mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 05:00:09 +01:00
gbm: use driver check for dmabuf export
Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472>
This commit is contained in:
parent
9ec286b037
commit
ab08b79ef7
2 changed files with 4 additions and 1 deletions
|
|
@ -898,7 +898,7 @@ gbm_dri_bo_create(struct gbm_device *gbm,
|
||||||
|
|
||||||
format = gbm_core.v0.format_canonicalize(format);
|
format = gbm_core.v0.format_canonicalize(format);
|
||||||
|
|
||||||
if (usage & GBM_BO_USE_WRITE || dri->image == NULL)
|
if (usage & GBM_BO_USE_WRITE || !dri->has_dmabuf_export)
|
||||||
return create_dumb(gbm, width, height, format, usage);
|
return create_dumb(gbm, width, height, format, usage);
|
||||||
|
|
||||||
bo = calloc(1, sizeof *bo);
|
bo = calloc(1, sizeof *bo);
|
||||||
|
|
@ -1243,6 +1243,8 @@ dri_device_create(int fd, uint32_t gbm_backend_version)
|
||||||
#ifdef HAVE_DRI3
|
#ifdef HAVE_DRI3
|
||||||
if (pscreen->get_param(pscreen, PIPE_CAP_DMABUF) & DRM_PRIME_CAP_IMPORT)
|
if (pscreen->get_param(pscreen, PIPE_CAP_DMABUF) & DRM_PRIME_CAP_IMPORT)
|
||||||
dri->has_dmabuf_import = true;
|
dri->has_dmabuf_import = true;
|
||||||
|
if (pscreen->get_param(pscreen, PIPE_CAP_DMABUF) & DRM_PRIME_CAP_EXPORT)
|
||||||
|
dri->has_dmabuf_export = true;
|
||||||
#endif
|
#endif
|
||||||
dri->has_compression_modifiers = pscreen->query_compression_rates &&
|
dri->has_compression_modifiers = pscreen->query_compression_rates &&
|
||||||
pscreen->query_compression_modifiers;
|
pscreen->query_compression_modifiers;
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ struct gbm_dri_device {
|
||||||
bool software; /* A software driver was loaded */
|
bool software; /* A software driver was loaded */
|
||||||
bool swrast; /* this is swrast */
|
bool swrast; /* this is swrast */
|
||||||
bool has_dmabuf_import;
|
bool has_dmabuf_import;
|
||||||
|
bool has_dmabuf_export;
|
||||||
bool has_compression_modifiers;
|
bool has_compression_modifiers;
|
||||||
|
|
||||||
__DRIscreen *screen;
|
__DRIscreen *screen;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue