summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2020-01-15 12:07:44 +0100
committerEric Engestrom <eric@engestrom.ch>2021-08-10 22:40:23 +0100
commit85a95f8cc6f5c750ebc1ea28ca3bd4c140bcc501 (patch)
treedf76604aa7ac0d896abd50fd38cf8b803458d888
parent2afd95b8e614a38337291e185c32bcdb7ac2a0ce (diff)
etnaviv: always try to create KMS side handles for imported resources
By creating the KMS side handles we allow GBM to return the proper KMS side GEM handles for imported buffers. Always creating the KMS side handles adds a bit of overhead, as we don't need them on all imported resources, but seems like the most robust solution for now. Cc: mesa-stable Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Simon Ser <contact@emersion.fr> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12018> (cherry picked from commit 826f95778a4edf7ed912fb5f90a05febfbd3e037)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_resource.c10
2 files changed, 11 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 8a07e42ae74..ec79f1ec43f 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -355,7 +355,7 @@
"description": "etnaviv: always try to create KMS side handles for imported resources",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null
},
diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c
index 92db4b1365c..bac4b75614a 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_resource.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c
@@ -562,6 +562,16 @@ etna_resource_from_handle(struct pipe_screen *pscreen,
if (!rsc->pending_ctx)
goto fail;
+ if (screen->ro) {
+ struct pipe_resource *imp_prsc = prsc;
+ do {
+ etna_resource(imp_prsc)->scanout =
+ renderonly_create_gpu_import_for_resource(imp_prsc, screen->ro,
+ NULL);
+ /* failure is expected for scanout incompatible buffers */
+ } while ((imp_prsc = imp_prsc->next));
+ }
+
return prsc;
fail: