diff options
Diffstat (limited to 'src/drm-shim')
-rw-r--r-- | src/drm-shim/drm_shim.c | 9 | ||||
-rw-r--r-- | src/drm-shim/drm_shim.h | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/drm-shim/drm_shim.c b/src/drm-shim/drm_shim.c index 325a8a142e5..61a1cb2ae50 100644 --- a/src/drm-shim/drm_shim.c +++ b/src/drm-shim/drm_shim.c @@ -97,9 +97,11 @@ struct file_override { }; static struct file_override file_overrides[10]; static int file_overrides_count; +extern bool drm_shim_driver_prefers_first_render_node; -/* Come up with a filename for a render node that doesn't actually exist on - * the system. +/* Pick the minor and filename for our shimmed render node. This can be + * either a new one that didn't exist on the system, or if the driver wants, + * it can replace the first render node. */ static void get_dri_render_node_minor(void) @@ -110,7 +112,8 @@ get_dri_render_node_minor(void) asprintf(&render_node_path, "/dev/dri/%s", render_node_dirent_name); struct stat st; - if (stat(render_node_path, &st) == -1) { + if (drm_shim_driver_prefers_first_render_node || + stat(render_node_path, &st) == -1) { render_node_minor = minor; return; diff --git a/src/drm-shim/drm_shim.h b/src/drm-shim/drm_shim.h index 2d262fa35d4..4a151d49bbc 100644 --- a/src/drm-shim/drm_shim.h +++ b/src/drm-shim/drm_shim.h @@ -85,3 +85,4 @@ uint64_t drm_shim_bo_get_mmap_offset(struct shim_fd *shim_fd, /* driver-specific hooks. */ void drm_shim_driver_init(void); +extern bool drm_shim_driver_prefers_new_render_node; |