diff options
author | Giovanni Campagna <[email protected]> | 2014-07-23 19:28:52 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2014-07-30 16:43:41 +0100 |
commit | e57ad3d38cab091ef341838b651dbda16cee007b (patch) | |
tree | faa36d31ce343aeaa8a134c3bddfca8abecbcd52 /src/gallium/winsys | |
parent | 3b176c441b7ddc5f7d2f891da3f76cf3c1814ce1 (diff) |
dri: Add a new capabilities for drivers that can't share buffers
The kms-dri swrast driver cannot share buffers using the GEM,
so it must tell the loader to disable extensions relying on
that, without disabling the image DRI extension altogether
(which would prevent the loader from working at all).
This requires a new gallium capability (which is queried on
the pipe_screen and for swrast drivers it's forwarded to the
winsys), and requires a new version of the DRI image extension.
[Emil Velikov]
- Rebased on top of gallium-dri megadrivers.
- Drop PIPE_CAP_BUFFER_SHARE and sw_winsys::get_param hook.
The can_share_buffer cap is set at InitScreen. We use a different
InitScreen (and thus value for the cap) function for kms_dri, due to
deeper differences originating from dri megadrivers.
Signed-off-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c index e21c4c2627a..c9934bb07fa 100644 --- a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c +++ b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c @@ -231,6 +231,8 @@ kms_sw_displaytarget_from_handle(struct sw_winsys *ws, struct kms_sw_winsys *kms_sw = kms_sw_winsys(ws); struct kms_sw_displaytarget *kms_sw_dt; + assert(whandle->type == DRM_API_HANDLE_TYPE_KMS); + LIST_FOR_EACH_ENTRY(kms_sw_dt, &kms_sw->bo_list, link) { if (kms_sw_dt->handle == whandle->handle) { kms_sw_dt->ref_count++; @@ -253,9 +255,13 @@ kms_sw_displaytarget_get_handle(struct sw_winsys *winsys, { struct kms_sw_displaytarget *kms_sw_dt = kms_sw_displaytarget(dt); - assert(whandle->type == DRM_API_HANDLE_TYPE_SHARED); - whandle->handle = kms_sw_dt->handle; - whandle->stride = kms_sw_dt->stride; + if (whandle->type == DRM_API_HANDLE_TYPE_KMS) { + whandle->handle = kms_sw_dt->handle; + whandle->stride = kms_sw_dt->stride; + } else { + whandle->handle = 0; + whandle->stride = 0; + } return TRUE; } |