diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-01-29 05:46:07 +0000 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-02-05 01:19:30 +0000 |
commit | 61d3ae6e0bde93c5601278d1a60c44be655a7cb5 (patch) | |
tree | c0c23980f21110a1459db40e18b06edb92d87ded /src/gallium/winsys/kmsro | |
parent | 742d6cdb42e5570a3a74005f18bb89208069d01f (diff) |
panfrost: Initial stub for Panfrost driver
This patch adds an initial stub for the Gallium driver, containing
simple screen functions and the majority of the driver headers but no
actual functionality. It further adds the winsys glue for linking in
this stub driver via kmsro on Rockchip/Amlogic boards.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Acked-by: Jason Ekstrand <[email protected]>
Acked-by: Rob Clark <[email protected]>
Acked-by: Eric Anholt <[email protected]>
Acked-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/winsys/kmsro')
-rw-r--r-- | src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c | 25 | ||||
-rw-r--r-- | src/gallium/winsys/kmsro/drm/meson.build | 3 |
2 files changed, 28 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 36d4e412486..7752474f8aa 100644 --- a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c +++ b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c @@ -29,6 +29,7 @@ #include "vc4/drm/vc4_drm_public.h" #include "etnaviv/drm/etnaviv_drm_public.h" #include "freedreno/drm/freedreno_drm_public.h" +#include "panfrost/drm/panfrost_drm_public.h" #include "xf86drm.h" #include "pipe/p_screen.h" @@ -82,5 +83,29 @@ struct pipe_screen *kmsro_drm_screen_create(int fd) } #endif +#if defined(GALLIUM_PANFROST) + ro.gpu_fd = drmOpenWithType("panfrost", NULL, DRM_NODE_RENDER); + + bool is_drm = true; + if (ro.gpu_fd < 0) { + /* For compatibility with legacy kernels, fallback on the non-DRM + * interface */ + + ro.gpu_fd = open("/dev/mali0", O_RDWR | O_CLOEXEC); + is_drm = false; + } + + if (ro.gpu_fd >= 0) { + ro.create_for_resource = renderonly_create_kms_dumb_buffer_for_resource, + screen = panfrost_drm_screen_create_renderonly(&ro, is_drm); + 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 5ea53dd44bf..51246b68e34 100644 --- a/src/gallium/winsys/kmsro/drm/meson.build +++ b/src/gallium/winsys/kmsro/drm/meson.build @@ -28,6 +28,9 @@ endif if with_gallium_freedreno kmsro_c_args += '-DGALLIUM_FREEDRENO' endif +if with_gallium_panfrost + kmsro_c_args += '-DGALLIUM_PANFROST' +endif libkmsrowinsys = static_library( 'kmsrowinsys', |