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

Author: Simon Ser <[email protected]>
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 <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
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;
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to