Mesa (main): etnaviv: fix renderonly check in etna_resource_alloc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 29 19:32:26 UTC 2021


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

Author: Simon Ser <contact at emersion.fr>
Date:   Tue Jul 27 08:52:45 2021 +0200

etnaviv: fix renderonly check in etna_resource_alloc

When the driver hasn't been initialized via renderonly, screen->ro
will be NULL. This fixes a crash when passing USE_SCANOUT to etnaviv
when it's missing renderonly.

Signed-off-by: Simon Ser <contact at emersion.fr>
Reviewed-by: Christian Gmeiner <christian.gmeiner at gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12074>

---

 src/gallium/drivers/etnaviv/etnaviv_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c
index ce37b0e779c..fa865f25093 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_resource.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c
@@ -272,7 +272,7 @@ etna_resource_alloc(struct pipe_screen *pscreen, unsigned layout,
 
    size = setup_miptree(rsc, paddingX, paddingY, msaa_xscale, msaa_yscale);
 
-   if (unlikely(templat->bind & PIPE_BIND_SCANOUT) && screen->ro->kms_fd >= 0) {
+   if (unlikely(templat->bind & PIPE_BIND_SCANOUT) && screen->ro) {
       struct pipe_resource scanout_templat = *templat;
       struct winsys_handle handle;
 



More information about the mesa-commit mailing list