kmsro: Add support for V3D.
authorEric Anholt <eric@anholt.net>
Wed, 3 Apr 2019 22:40:22 +0000 (15:40 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 26 Apr 2019 21:59:32 +0000 (14:59 -0700)
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 <robdclark@chromium.org>
meson.build
src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
src/gallium/winsys/kmsro/drm/meson.build

index 0e8aa25d336259d0c90db403540534234582e3f2..58d383749d391c9861b5402a3b35f8ed5c033ab2 100644 (file)
@@ -217,7 +217,7 @@ endif
 if with_dri_i915 and with_gallium_i915
   error('Only one i915 provider can be built')
 endif
-if with_gallium_kmsro and not (with_gallium_vc4 or with_gallium_etnaviv or with_gallium_freedreno or with_gallium_panfrost or with_gallium_lima)
+if with_gallium_kmsro and not (with_gallium_v3d or with_gallium_vc4 or with_gallium_etnaviv or with_gallium_freedreno or with_gallium_panfrost or with_gallium_lima)
   error('kmsro driver requires one or more renderonly drivers (vc4, etnaviv, freedreno, panfrost, lima)')
 endif
 if with_gallium_tegra and not with_gallium_nouveau
index 4869e6329f937b568d45d3a072ca74ce6d2074d1..3a452f91315916e6f6476f5c4c99e4ff46b44298 100644 (file)
@@ -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;
 }
index 02064025b4d03d7b158cc1d160d6d6f40041be18..13ed5a0ea4331e4fa6343e00ac6fbd3f306d5e9e 100644 (file)
@@ -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