dri_interface: add put shm image2 (v2)
This adds a new interface to the swrast interface to fix an shm put image bug. The current code adds the x,y src offsets into the offset parameters, however if the x offset is > 0, and the put image copies up to the height of the image, this can trigger an X server validation check to fail and the renderering to get BadMatch. This patch fixes it to pass the x offset coord in as a src x. We cannot pass the Y coordinate due to the horrible code mangling the image w/h vs stride in swrastXPutImage. v2: drop srcx,y from api Cc: <mesa-stable@lists.freedesktop.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
@@ -589,7 +589,7 @@ struct __DRIdamageExtensionRec {
|
|||||||
* SWRast Loader extension.
|
* SWRast Loader extension.
|
||||||
*/
|
*/
|
||||||
#define __DRI_SWRAST_LOADER "DRI_SWRastLoader"
|
#define __DRI_SWRAST_LOADER "DRI_SWRastLoader"
|
||||||
#define __DRI_SWRAST_LOADER_VERSION 4
|
#define __DRI_SWRAST_LOADER_VERSION 5
|
||||||
struct __DRIswrastLoaderExtensionRec {
|
struct __DRIswrastLoaderExtensionRec {
|
||||||
__DRIextension base;
|
__DRIextension base;
|
||||||
|
|
||||||
@@ -649,6 +649,23 @@ struct __DRIswrastLoaderExtensionRec {
|
|||||||
void (*getImageShm)(__DRIdrawable *readable,
|
void (*getImageShm)(__DRIdrawable *readable,
|
||||||
int x, int y, int width, int height,
|
int x, int y, int width, int height,
|
||||||
int shmid, void *loaderPrivate);
|
int shmid, void *loaderPrivate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Put shm image to drawable (v2)
|
||||||
|
*
|
||||||
|
* The original version fixes srcx/y to 0, and expected
|
||||||
|
* the offset to be adjusted. This version allows src x,y
|
||||||
|
* to not be included in the offset. This is needed to
|
||||||
|
* avoid certain overflow checks in the X server, that
|
||||||
|
* result in lost rendering.
|
||||||
|
*
|
||||||
|
* \since 5
|
||||||
|
*/
|
||||||
|
void (*putImageShm2)(__DRIdrawable *drawable, int op,
|
||||||
|
int x, int y,
|
||||||
|
int width, int height, int stride,
|
||||||
|
int shmid, char *shmaddr, unsigned offset,
|
||||||
|
void *loaderPrivate);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user