summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-04-03 15:40:22 -0700
committerEric Anholt <[email protected]>2019-04-26 14:59:32 -0700
commit7e069832a05ebd5948d3ef95d3b5028156c829b3 (patch)
tree97a5313b588e12bec4af70f07757594780a8c1ff /src
parenta8a0e5c03cab8dc0e73d761fdf44874f7f45be55 (diff)
kmsro: Add support for V3D.
Like vc4, we expect to have SOCs with various displays that have a single V3D instance for rendering. v2: Add v3d to the list of drivers that make enabling kmsro valid. Acked-by: Rob Clark <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c13
-rw-r--r--src/gallium/winsys/kmsro/drm/meson.build3
2 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
index 4869e6329f9..3a452f91315 100644
--- a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
+++ b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
@@ -26,6 +26,7 @@
#include <unistd.h>
#include "kmsro_drm_public.h"
+#include "v3d/drm/v3d_drm_public.h"
#include "vc4/drm/vc4_drm_public.h"
#include "etnaviv/drm/etnaviv_drm_public.h"
#include "freedreno/drm/freedreno_drm_public.h"
@@ -109,5 +110,17 @@ struct pipe_screen *kmsro_drm_screen_create(int fd)
}
#endif
+#if defined(GALLIUM_V3D)
+ ro.gpu_fd = drmOpenWithType("v3d", NULL, DRM_NODE_RENDER);
+ if (ro.gpu_fd >= 0) {
+ ro.create_for_resource = renderonly_create_kms_dumb_buffer_for_resource,
+ screen = v3d_drm_screen_create_renderonly(&ro);
+ if (!screen)
+ close(ro.gpu_fd);
+
+ return screen;
+ }
+#endif
+
return screen;
}
diff --git a/src/gallium/winsys/kmsro/drm/meson.build b/src/gallium/winsys/kmsro/drm/meson.build
index 02064025b4d..13ed5a0ea43 100644
--- a/src/gallium/winsys/kmsro/drm/meson.build
+++ b/src/gallium/winsys/kmsro/drm/meson.build
@@ -25,6 +25,9 @@ endif
if with_gallium_lima
kmsro_c_args += '-DGALLIUM_LIMA'
endif
+if with_gallium_v3d
+ kmsro_c_args += '-DGALLIUM_V3D'
+endif
if with_gallium_vc4
kmsro_c_args += '-DGALLIUM_VC4'
endif