Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Mesa
mesa
Commits
935a70ba
Commit
935a70ba
authored
Jan 22, 2021
by
Lionel Landwerlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
anv: implement VK_EXT_physical_device_drm
Signed-off-by:
Lionel Landwerlin
<
lionel.g.landwerlin@intel.com
>
parent
b2034d6a
Pipeline
#259966
waiting for manual action with stages
in 9 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-0
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_device.c
+36
-0
src/intel/vulkan/anv_extensions.py
src/intel/vulkan/anv_extensions.py
+1
-0
src/intel/vulkan/anv_private.h
src/intel/vulkan/anv_private.h
+7
-0
No files found.
src/intel/vulkan/anv_device.c
View file @
935a70ba
...
...
@@ -24,7 +24,9 @@
#include <assert.h>
#include <stdbool.h>
#include <string.h>
#include <sys/sysmacros.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include "drm-uapi/drm_fourcc.h"
...
...
@@ -550,6 +552,24 @@ anv_physical_device_try_create(struct anv_instance *instance,
}
device
->
master_fd
=
master_fd
;
struct
stat
st
;
if
(
stat
(
path
,
&
st
)
!=
0
)
{
result
=
vk_errorfi
(
instance
,
NULL
,
VK_ERROR_INITIALIZATION_FAILED
,
"failed to stat DRM node %s"
,
path
);
goto
fail_disk_cache
;
}
device
->
local_node
[
0
]
=
(
int64_t
)
major
(
st
.
st_rdev
);
device
->
local_node
[
1
]
=
(
int64_t
)
minor
(
st
.
st_rdev
);
if
(
master_fd
!=
-
1
)
{
if
(
stat
(
primary_path
,
&
st
)
!=
0
)
{
result
=
vk_errorfi
(
instance
,
NULL
,
VK_ERROR_INITIALIZATION_FAILED
,
"failed to stat DRM node %s"
,
primary_path
);
goto
fail_disk_cache
;
}
device
->
master_node
[
0
]
=
(
int64_t
)
major
(
st
.
st_rdev
);
device
->
master_node
[
1
]
=
(
int64_t
)
minor
(
st
.
st_rdev
);
}
result
=
anv_init_wsi
(
device
);
if
(
result
!=
VK_SUCCESS
)
goto
fail_disk_cache
;
...
...
@@ -1899,6 +1919,22 @@ void anv_GetPhysicalDeviceProperties2(
break
;
}
case
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT
:
{
VkPhysicalDeviceDrmPropertiesEXT
*
props
=
(
VkPhysicalDeviceDrmPropertiesEXT
*
)
ext
;
if
(
pdevice
->
master_fd
!=
-
1
)
{
props
->
hasPrimary
=
true
;
props
->
primaryMajor
=
pdevice
->
master_node
[
0
];
props
->
primaryMinor
=
pdevice
->
master_node
[
1
];
}
else
{
props
->
hasPrimary
=
false
;
}
props
->
hasRender
=
true
;
props
->
renderMajor
=
pdevice
->
local_node
[
0
];
props
->
renderMinor
=
pdevice
->
local_node
[
1
];
break
;
}
case
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT
:
{
VkPhysicalDeviceExternalMemoryHostPropertiesEXT
*
props
=
(
VkPhysicalDeviceExternalMemoryHostPropertiesEXT
*
)
ext
;
...
...
src/intel/vulkan/anv_extensions.py
View file @
935a70ba
...
...
@@ -148,6 +148,7 @@ EXTENSIONS = [
Extension
(
'VK_EXT_line_rasterization'
,
1
,
True
),
Extension
(
'VK_EXT_memory_budget'
,
1
,
'device->has_mem_available'
),
Extension
(
'VK_EXT_pci_bus_info'
,
2
,
True
),
Extension
(
'VK_EXT_physical_device_drm'
,
1
,
True
),
Extension
(
'VK_EXT_pipeline_creation_cache_control'
,
3
,
True
),
Extension
(
'VK_EXT_pipeline_creation_feedback'
,
1
,
True
),
Extension
(
'VK_EXT_post_depth_coverage'
,
1
,
'device->info.gen >= 9'
),
...
...
src/intel/vulkan/anv_private.h
View file @
935a70ba
...
...
@@ -30,6 +30,7 @@
#include <pthread.h>
#include <assert.h>
#include <stdint.h>
#include "drm-uapi/i915_drm.h"
#ifdef HAVE_VALGRIND
...
...
@@ -1145,6 +1146,12 @@ struct anv_physical_device {
struct
wsi_device
wsi_device
;
int
local_fd
;
int
master_fd
;
/**
* Major & minor DRM numbers.
*/
int64_t
local_node
[
2
];
int64_t
master_node
[
2
];
};
struct
anv_app_info
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment