mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-03 15:10:37 +01:00
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 826f95778a)
This commit is contained in:
parent
c8812a86b2
commit
de052dfae4
2 changed files with 11 additions and 1 deletions
|
|
@ -274,7 +274,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
|
||||
},
|
||||
|
|
|
|||
|
|
@ -566,6 +566,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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue