diff options
author | Dave Airlie <[email protected]> | 2013-11-28 11:08:11 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2013-12-13 14:37:01 +1000 |
commit | ba00f2f6f54cbc5ffdb0f0b94bcd672d147cdc36 (patch) | |
tree | 93cec2b58156f3fb87cbc425a7680253bb1fe82f /src/gallium/winsys | |
parent | 40070e72d4f27797d03986a68b1540339eb2b496 (diff) |
swrast* (gallium, classic): add MESA_copy_sub_buffer support (v3)
This patches add MESA_copy_sub_buffer support to the dri sw loader and
then to gallium state tracker, llvmpipe, softpipe and other bits.
It reuses the dri1 driver extension interface, and it updates the swrast
loader interface for a new putimage which can take a stride.
I've tested this with gnome-shell with a cogl hacked to reenable sub copies
for llvmpipe and the one piglit test.
I could probably split this patch up as well.
v2: pass a pipe_box, to reduce the entrypoints, as per Jose's review,
add to p_screen doc comments.
v3: finish off winsys interfaces, add swrast classic support as well.
Reviewed-by: Jose Fonseca <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
swrast: add support for copy_sub_buffer
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/sw/android/android_sw_winsys.cpp | 3 | ||||
-rw-r--r-- | src/gallium/winsys/sw/dri/dri_sw_winsys.c | 16 | ||||
-rw-r--r-- | src/gallium/winsys/sw/fbdev/fbdev_sw_winsys.c | 3 | ||||
-rw-r--r-- | src/gallium/winsys/sw/gdi/gdi_sw_winsys.c | 3 | ||||
-rw-r--r-- | src/gallium/winsys/sw/hgl/hgl_sw_winsys.c | 3 | ||||
-rw-r--r-- | src/gallium/winsys/sw/null/null_sw_winsys.c | 3 | ||||
-rw-r--r-- | src/gallium/winsys/sw/wayland/wayland_sw_winsys.c | 3 | ||||
-rw-r--r-- | src/gallium/winsys/sw/xlib/xlib_sw_winsys.c | 3 |
8 files changed, 26 insertions, 11 deletions
diff --git a/src/gallium/winsys/sw/android/android_sw_winsys.cpp b/src/gallium/winsys/sw/android/android_sw_winsys.cpp index cb91aade0a8..4b1040cb6ee 100644 --- a/src/gallium/winsys/sw/android/android_sw_winsys.cpp +++ b/src/gallium/winsys/sw/android/android_sw_winsys.cpp @@ -74,7 +74,8 @@ namespace android { static void android_displaytarget_display(struct sw_winsys *ws, struct sw_displaytarget *dt, - void *context_private) + void *context_private, + struct pipe_box *box) { } diff --git a/src/gallium/winsys/sw/dri/dri_sw_winsys.c b/src/gallium/winsys/sw/dri/dri_sw_winsys.c index edb3a381a74..6fed22bbd7c 100644 --- a/src/gallium/winsys/sw/dri/dri_sw_winsys.c +++ b/src/gallium/winsys/sw/dri/dri_sw_winsys.c @@ -166,25 +166,33 @@ dri_sw_displaytarget_get_handle(struct sw_winsys *winsys, static void dri_sw_displaytarget_display(struct sw_winsys *ws, struct sw_displaytarget *dt, - void *context_private) + void *context_private, + struct pipe_box *box) { struct dri_sw_winsys *dri_sw_ws = dri_sw_winsys(ws); struct dri_sw_displaytarget *dri_sw_dt = dri_sw_displaytarget(dt); struct dri_drawable *dri_drawable = (struct dri_drawable *)context_private; unsigned width, height; + unsigned blsize = util_format_get_blocksize(dri_sw_dt->format); /* Set the width to 'stride / cpp'. * * PutImage correctly clips to the width of the dst drawable. */ - width = dri_sw_dt->stride / util_format_get_blocksize(dri_sw_dt->format); + width = dri_sw_dt->stride / blsize; height = dri_sw_dt->height; - dri_sw_ws->lf->put_image(dri_drawable, dri_sw_dt->data, width, height); + if (box) { + void *data; + data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize; + dri_sw_ws->lf->put_image2(dri_drawable, data, + box->x, box->y, box->width, box->height, dri_sw_dt->stride); + } else { + dri_sw_ws->lf->put_image(dri_drawable, dri_sw_dt->data, width, height); + } } - static void dri_destroy_sw_winsys(struct sw_winsys *winsys) { diff --git a/src/gallium/winsys/sw/fbdev/fbdev_sw_winsys.c b/src/gallium/winsys/sw/fbdev/fbdev_sw_winsys.c index a2809854710..cc3ce1a78d2 100644 --- a/src/gallium/winsys/sw/fbdev/fbdev_sw_winsys.c +++ b/src/gallium/winsys/sw/fbdev/fbdev_sw_winsys.c @@ -74,7 +74,8 @@ fbdev_sw_winsys(struct sw_winsys *ws) static void fbdev_displaytarget_display(struct sw_winsys *ws, struct sw_displaytarget *dt, - void *winsys_private) + void *winsys_private, + struct pipe_box *box) { struct fbdev_sw_winsys *fbdev = fbdev_sw_winsys(ws); struct fbdev_sw_displaytarget *src = fbdev_sw_displaytarget(dt); diff --git a/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c b/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c index 2e12f6e6cc8..aae3ec55a25 100644 --- a/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c +++ b/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c @@ -207,7 +207,8 @@ gdi_sw_display( struct sw_winsys *winsys, static void gdi_sw_displaytarget_display(struct sw_winsys *winsys, struct sw_displaytarget *dt, - void *context_private) + void *context_private, + struct pipe_box *box) { /* nasty: */ diff --git a/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c b/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c index b09584c39a4..27eca2ba280 100644 --- a/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c +++ b/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c @@ -160,7 +160,8 @@ hgl_winsys_displaytarget_unmap(struct sw_winsys* winsys, static void hgl_winsys_displaytarget_display(struct sw_winsys* winsys, - struct sw_displaytarget* displayTarget, void* contextPrivate) + struct sw_displaytarget* displayTarget, void* contextPrivate, + struct pipe_box *box) { assert(contextPrivate); diff --git a/src/gallium/winsys/sw/null/null_sw_winsys.c b/src/gallium/winsys/sw/null/null_sw_winsys.c index 44849da1403..9c8b3ec4396 100644 --- a/src/gallium/winsys/sw/null/null_sw_winsys.c +++ b/src/gallium/winsys/sw/null/null_sw_winsys.c @@ -114,7 +114,8 @@ null_sw_displaytarget_get_handle(struct sw_winsys *winsys, static void null_sw_displaytarget_display(struct sw_winsys *winsys, struct sw_displaytarget *dt, - void *context_private) + void *context_private, + struct pipe_box *box) { assert(0); } diff --git a/src/gallium/winsys/sw/wayland/wayland_sw_winsys.c b/src/gallium/winsys/sw/wayland/wayland_sw_winsys.c index f432de98fef..e4286136fe4 100644 --- a/src/gallium/winsys/sw/wayland/wayland_sw_winsys.c +++ b/src/gallium/winsys/sw/wayland/wayland_sw_winsys.c @@ -75,7 +75,8 @@ wayland_sw_winsys(struct sw_winsys *ws) static void wayland_displaytarget_display(struct sw_winsys *ws, struct sw_displaytarget *dt, - void *context_private) + void *context_private, + struct pipe_box *box) { } diff --git a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c index 6e71530e635..99da2ae991c 100644 --- a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c +++ b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c @@ -376,7 +376,8 @@ xlib_sw_display(struct xlib_drawable *xlib_drawable, static void xlib_displaytarget_display(struct sw_winsys *ws, struct sw_displaytarget *dt, - void *context_private) + void *context_private, + struct pipe_box *box) { struct xlib_drawable *xlib_drawable = (struct xlib_drawable *)context_private; xlib_sw_display(xlib_drawable, dt); |