mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 10:00:14 +01:00
kms-dri-sw: Report linear modifiers in get_handle()
Dumb-buffers or imported dmabufs are always linear - otherwise they couldn't be used by llvmpipe/lavapipe. So far, however, they have been implicitly reported as DRM_FORMAT_MOD_INVALID when queried through e.g. `gbm_bo_get_modifier()`. That is a problem for lavapipe, which requires explicit modifiers. Thus report modifiers as linear, fixing clients like Westons Vulkan backend on CI (vkms+lavapipe). Signed-off-by: Robert Mader <robert.mader@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37374>
This commit is contained in:
parent
b0528bcab1
commit
45dc8b4d97
1 changed files with 3 additions and 0 deletions
|
|
@ -42,6 +42,7 @@
|
|||
#include <fcntl.h>
|
||||
#include <xf86drm.h>
|
||||
|
||||
#include "drm-uapi/drm_fourcc.h"
|
||||
#include "util/compiler.h"
|
||||
#include "util/format/u_formats.h"
|
||||
#include "pipe/p_state.h"
|
||||
|
|
@ -514,12 +515,14 @@ kms_sw_displaytarget_get_handle(struct sw_winsys *winsys,
|
|||
whandle->handle = kms_sw_dt->handle;
|
||||
whandle->stride = plane->stride;
|
||||
whandle->offset = plane->offset;
|
||||
whandle->modifier = DRM_FORMAT_MOD_LINEAR;
|
||||
return true;
|
||||
case WINSYS_HANDLE_TYPE_FD:
|
||||
if (!drmPrimeHandleToFD(kms_sw->fd, kms_sw_dt->handle,
|
||||
DRM_CLOEXEC | DRM_RDWR, (int*)&whandle->handle)) {
|
||||
whandle->stride = plane->stride;
|
||||
whandle->offset = plane->offset;
|
||||
whandle->modifier = DRM_FORMAT_MOD_LINEAR;
|
||||
return true;
|
||||
}
|
||||
FALLTHROUGH;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue