From e6c84b8a00f15b1e90fe379e22f94b8865eb9b82 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Wed, 5 Apr 2023 17:28:24 +0100 Subject: [PATCH] panfrost: assign the correct create_for_resource from the start Signed-off-by: Eric Engestrom Part-of: --- src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c | 2 +- src/gallium/winsys/panfrost/drm/panfrost_drm_public.h | 6 ++++++ src/gallium/winsys/panfrost/drm/panfrost_drm_winsys.c | 3 +-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c index a39a495..16a79d4 100644 --- a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c +++ b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c @@ -108,7 +108,7 @@ struct pipe_screen *kmsro_drm_screen_create(int fd, { .name = "panfrost", .create_screen = panfrost_drm_screen_create_renderonly, - .create_for_resource = renderonly_create_kms_dumb_buffer_for_resource, + .create_for_resource = panfrost_create_kms_dumb_buffer_for_resource, }, #endif diff --git a/src/gallium/winsys/panfrost/drm/panfrost_drm_public.h b/src/gallium/winsys/panfrost/drm/panfrost_drm_public.h index 67749b5..fe28f64 100644 --- a/src/gallium/winsys/panfrost/drm/panfrost_drm_public.h +++ b/src/gallium/winsys/panfrost/drm/panfrost_drm_public.h @@ -27,13 +27,19 @@ #include +struct pipe_resource; struct pipe_screen; struct pipe_screen_config; struct renderonly; +struct renderonly_scanout; +struct winsys_handle; struct pipe_screen *panfrost_drm_screen_create(int drmFD); struct pipe_screen *panfrost_drm_screen_create_renderonly(int fd, struct renderonly *ro, const struct pipe_screen_config *config); +struct renderonly_scanout *panfrost_create_kms_dumb_buffer_for_resource(struct pipe_resource *rsc, + struct renderonly *ro, + struct winsys_handle *out_handle); #endif /* __PAN_DRM_PUBLIC_H__ */ diff --git a/src/gallium/winsys/panfrost/drm/panfrost_drm_winsys.c b/src/gallium/winsys/panfrost/drm/panfrost_drm_winsys.c index fbe1cd4..c2e348f 100644 --- a/src/gallium/winsys/panfrost/drm/panfrost_drm_winsys.c +++ b/src/gallium/winsys/panfrost/drm/panfrost_drm_winsys.c @@ -38,7 +38,7 @@ #include "panfrost/pan_public.h" #include "xf86drm.h" -static struct renderonly_scanout * +struct renderonly_scanout * panfrost_create_kms_dumb_buffer_for_resource(struct pipe_resource *rsc, struct renderonly *ro, struct winsys_handle *out_handle) @@ -123,7 +123,6 @@ panfrost_drm_screen_create_renderonly(int fd, struct renderonly *ro, const struct pipe_screen_config *config) { - ro->create_for_resource = panfrost_create_kms_dumb_buffer_for_resource; return u_pipe_screen_lookup_or_create(os_dupfd_cloexec(fd), config, ro, panfrost_create_screen); } -- 2.7.4