diff options
author | Rob Herring <[email protected]> | 2019-01-25 10:39:40 -0600 |
---|---|---|
committer | Qiang Yu <[email protected]> | 2019-04-11 09:57:53 +0800 |
commit | b1da1946c75bdf5d6bd27bfcec3354028808aacb (patch) | |
tree | 8a54278488f3bf01c35e27f0467fce1b2f79071b /src/gallium/winsys | |
parent | 92d7ca4b1cdfe1ffc80748fa7eedf927f3c664f0 (diff) |
kmsro: Add lima renderonly support
Enable using lima for KMS renderonly. This still needs KMS driver
name mapping to kmsro to be used automatically.
Reviewed-by: Eric Anholt <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
Signed-off-by: Qiang Yu <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c | 11 | ||||
-rw-r--r-- | src/gallium/winsys/kmsro/drm/meson.build | 3 |
2 files changed, 14 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 59f2c28a2eb..4869e6329f9 100644 --- a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c +++ b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c @@ -30,6 +30,7 @@ #include "etnaviv/drm/etnaviv_drm_public.h" #include "freedreno/drm/freedreno_drm_public.h" #include "panfrost/drm/panfrost_drm_public.h" +#include "lima/drm/lima_drm_public.h" #include "xf86drm.h" #include "pipe/p_screen.h" @@ -96,7 +97,17 @@ struct pipe_screen *kmsro_drm_screen_create(int fd) } #endif +#if defined(GALLIUM_LIMA) + ro.gpu_fd = drmOpenWithType("lima", NULL, DRM_NODE_RENDER); + if (ro.gpu_fd >= 0) { + ro.create_for_resource = renderonly_create_kms_dumb_buffer_for_resource, + screen = lima_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 51246b68e34..02064025b4d 100644 --- a/src/gallium/winsys/kmsro/drm/meson.build +++ b/src/gallium/winsys/kmsro/drm/meson.build @@ -22,6 +22,9 @@ kmsro_c_args = [] if with_gallium_etnaviv kmsro_c_args += '-DGALLIUM_ETNAVIV' endif +if with_gallium_lima + kmsro_c_args += '-DGALLIUM_LIMA' +endif if with_gallium_vc4 kmsro_c_args += '-DGALLIUM_VC4' endif |