diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-05-15 23:00:53 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-05-16 10:02:16 +0100 |
commit | e73d51247be5018fe53346f991e2f178c917cb13 (patch) | |
tree | 5e97d41d8dc68b6e446a0ab91fbb98c14150f5ba /src/sna/sna_video_textured.c | |
parent | 10c18b1a4631ebab5508f4308c73129f2111e964 (diff) |
sna/video: Only migrate the destination window
By using move-area-to-gpu and specifying that we overwrite the target
area, we can optimize away any needless damage migration.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_video_textured.c')
-rw-r--r-- | src/sna/sna_video_textured.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/sna/sna_video_textured.c b/src/sna/sna_video_textured.c index c2a37bf1..335769c6 100644 --- a/src/sna/sna_video_textured.c +++ b/src/sna/sna_video_textured.c @@ -170,6 +170,7 @@ sna_video_textured_put_image(ClientPtr client, struct sna *sna = video->sna; struct sna_video_frame frame; PixmapPtr pixmap = get_drawable_pixmap(draw); + unsigned int flags; BoxRec dstBox; RegionRec clip; xf86CrtcPtr crtc; @@ -197,12 +198,6 @@ sna_video_textured_put_image(ClientPtr client, clip.extents.x1, clip.extents.y1, clip.extents.x2, clip.extents.y2)); - if (!sna_pixmap_move_to_gpu(pixmap, MOVE_READ | MOVE_WRITE)) { - DBG(("%s: attempting to render to a non-GPU pixmap\n", - __FUNCTION__)); - return BadAlloc; - } - sna_video_frame_init(video, format->id, width, height, &frame); if (!sna_video_clip_helper(video, &frame, &crtc, &dstBox, @@ -211,6 +206,16 @@ sna_video_textured_put_image(ClientPtr client, &clip)) return Success; + flags = MOVE_WRITE | __MOVE_FORCE; + if (clip.data) + flags |= MOVE_READ; + + if (!sna_pixmap_move_area_to_gpu(pixmap, &clip.extents, flags)) { + DBG(("%s: attempting to render to a non-GPU pixmap\n", + __FUNCTION__)); + return BadAlloc; + } + sna_video_frame_set_rotation(video, &frame, RR_Rotate_0); if (xvmc_passthrough(format->id)) { |