Module: Mesa
Branch: main
Commit: e6c84b8a00f15b1e90fe379e22f94b8865eb9b82
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e6c84b8a00f15b1e90fe379e22f94b8865eb9b82

Author: Eric Engestrom <[email protected]>
Date:   Wed Apr  5 17:28:24 2023 +0100

panfrost: assign the correct create_for_resource from the start

Signed-off-by: Eric Engestrom <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22322>

---

 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 a39a495eee4..16a79d4757a 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 67749b5582a..fe28f6437ab 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 <stdbool.h>
 
+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 fbe1cd40f88..c2e348fed41 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);
 }

Reply via email to