diff options
author | Jonathan Marek <[email protected]> | 2019-01-27 21:05:33 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2019-01-28 18:25:27 -0500 |
commit | f6292c32cc7ace408cb9016806ebf1d9a387bcf8 (patch) | |
tree | 5437aace67f5bee5387bdfeed8948b5b373a97ee /src/gallium | |
parent | 7d458c0c69ad80e3d01c0ba79e57ed3981764823 (diff) |
kmsro: Add freedreno renderonly support
Signed-off-by: Jonathan Marek <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/winsys/kmsro/drm/Makefile.am | 4 | ||||
-rw-r--r-- | src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c | 13 | ||||
-rw-r--r-- | src/gallium/winsys/kmsro/drm/meson.build | 3 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/winsys/kmsro/drm/Makefile.am b/src/gallium/winsys/kmsro/drm/Makefile.am index 0092206539c..8c51839b064 100644 --- a/src/gallium/winsys/kmsro/drm/Makefile.am +++ b/src/gallium/winsys/kmsro/drm/Makefile.am @@ -37,6 +37,10 @@ if HAVE_GALLIUM_VC4 AM_CFLAGS += -DGALLIUM_VC4 endif +if HAVE_GALLIUM_FREEDRENO +AM_CFLAGS += -DGALLIUM_FREEDRENO +endif + noinst_LTLIBRARIES = libkmsrodrm.la libkmsrodrm_la_SOURCES = $(C_SOURCES) diff --git a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c index e086c0858f0..36d4e412486 100644 --- a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c +++ b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c @@ -28,6 +28,7 @@ #include "kmsro_drm_public.h" #include "vc4/drm/vc4_drm_public.h" #include "etnaviv/drm/etnaviv_drm_public.h" +#include "freedreno/drm/freedreno_drm_public.h" #include "xf86drm.h" #include "pipe/p_screen.h" @@ -69,5 +70,17 @@ struct pipe_screen *kmsro_drm_screen_create(int fd) } #endif +#if defined(GALLIUM_FREEDRENO) + ro.gpu_fd = drmOpenWithType("msm", NULL, DRM_NODE_RENDER); + if (ro.gpu_fd >= 0) { + ro.create_for_resource = renderonly_create_kms_dumb_buffer_for_resource, + screen = fd_drm_screen_create(ro.gpu_fd, &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 e8c350e081b..5ea53dd44bf 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_vc4 kmsro_c_args += '-DGALLIUM_VC4' endif +if with_gallium_freedreno + kmsro_c_args += '-DGALLIUM_FREEDRENO' +endif libkmsrowinsys = static_library( 'kmsrowinsys', |