diff options
author | Jakob Bornecrantz <jakob@vmware.com> | 2012-02-09 10:56:44 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-02-13 07:01:34 -0500 |
commit | bd49ae46f8a24c088dbca12064a846399e2da631 (patch) | |
tree | 27871163a4466e3769ba84b864d190779da79fca /drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | |
parent | bb1bd2f43ee15386a1c3f96cbcbb9302a9994443 (diff) |
vmwgfx: Pipe fence out of screen object dirty functions
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_kms.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 12619c33953b..24efcae3e2f5 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | |||
@@ -422,7 +422,8 @@ static int do_surface_dirty_sou(struct vmw_private *dev_priv, | |||
422 | struct vmw_framebuffer *framebuffer, | 422 | struct vmw_framebuffer *framebuffer, |
423 | unsigned flags, unsigned color, | 423 | unsigned flags, unsigned color, |
424 | struct drm_clip_rect *clips, | 424 | struct drm_clip_rect *clips, |
425 | unsigned num_clips, int inc) | 425 | unsigned num_clips, int inc, |
426 | struct vmw_fence_obj **out_fence) | ||
426 | { | 427 | { |
427 | struct vmw_display_unit *units[VMWGFX_NUM_DISPLAY_UNITS]; | 428 | struct vmw_display_unit *units[VMWGFX_NUM_DISPLAY_UNITS]; |
428 | struct drm_clip_rect *clips_ptr; | 429 | struct drm_clip_rect *clips_ptr; |
@@ -542,12 +543,15 @@ static int do_surface_dirty_sou(struct vmw_private *dev_priv, | |||
542 | if (num == 0) | 543 | if (num == 0) |
543 | continue; | 544 | continue; |
544 | 545 | ||
546 | /* only return the last fence */ | ||
547 | if (out_fence && *out_fence) | ||
548 | vmw_fence_obj_unreference(out_fence); | ||
545 | 549 | ||
546 | /* recalculate package length */ | 550 | /* recalculate package length */ |
547 | fifo_size = sizeof(*cmd) + sizeof(SVGASignedRect) * num; | 551 | fifo_size = sizeof(*cmd) + sizeof(SVGASignedRect) * num; |
548 | cmd->header.size = cpu_to_le32(fifo_size - sizeof(cmd->header)); | 552 | cmd->header.size = cpu_to_le32(fifo_size - sizeof(cmd->header)); |
549 | ret = vmw_execbuf_process(file_priv, dev_priv, NULL, cmd, | 553 | ret = vmw_execbuf_process(file_priv, dev_priv, NULL, cmd, |
550 | fifo_size, 0, NULL, NULL); | 554 | fifo_size, 0, NULL, out_fence); |
551 | 555 | ||
552 | if (unlikely(ret != 0)) | 556 | if (unlikely(ret != 0)) |
553 | break; | 557 | break; |
@@ -598,7 +602,7 @@ int vmw_framebuffer_surface_dirty(struct drm_framebuffer *framebuffer, | |||
598 | 602 | ||
599 | ret = do_surface_dirty_sou(dev_priv, file_priv, &vfbs->base, | 603 | ret = do_surface_dirty_sou(dev_priv, file_priv, &vfbs->base, |
600 | flags, color, | 604 | flags, color, |
601 | clips, num_clips, inc); | 605 | clips, num_clips, inc, NULL); |
602 | 606 | ||
603 | ttm_read_unlock(&vmaster->lock); | 607 | ttm_read_unlock(&vmaster->lock); |
604 | return 0; | 608 | return 0; |
@@ -821,7 +825,8 @@ static int do_dmabuf_dirty_sou(struct drm_file *file_priv, | |||
821 | struct vmw_framebuffer *framebuffer, | 825 | struct vmw_framebuffer *framebuffer, |
822 | unsigned flags, unsigned color, | 826 | unsigned flags, unsigned color, |
823 | struct drm_clip_rect *clips, | 827 | struct drm_clip_rect *clips, |
824 | unsigned num_clips, int increment) | 828 | unsigned num_clips, int increment, |
829 | struct vmw_fence_obj **out_fence) | ||
825 | { | 830 | { |
826 | struct vmw_display_unit *units[VMWGFX_NUM_DISPLAY_UNITS]; | 831 | struct vmw_display_unit *units[VMWGFX_NUM_DISPLAY_UNITS]; |
827 | struct drm_clip_rect *clips_ptr; | 832 | struct drm_clip_rect *clips_ptr; |
@@ -894,9 +899,13 @@ static int do_dmabuf_dirty_sou(struct drm_file *file_priv, | |||
894 | if (hit_num == 0) | 899 | if (hit_num == 0) |
895 | continue; | 900 | continue; |
896 | 901 | ||
902 | /* only return the last fence */ | ||
903 | if (out_fence && *out_fence) | ||
904 | vmw_fence_obj_unreference(out_fence); | ||
905 | |||
897 | fifo_size = sizeof(*blits) * hit_num; | 906 | fifo_size = sizeof(*blits) * hit_num; |
898 | ret = vmw_execbuf_process(file_priv, dev_priv, NULL, blits, | 907 | ret = vmw_execbuf_process(file_priv, dev_priv, NULL, blits, |
899 | fifo_size, 0, NULL, NULL); | 908 | fifo_size, 0, NULL, out_fence); |
900 | 909 | ||
901 | if (unlikely(ret != 0)) | 910 | if (unlikely(ret != 0)) |
902 | break; | 911 | break; |
@@ -942,7 +951,7 @@ int vmw_framebuffer_dmabuf_dirty(struct drm_framebuffer *framebuffer, | |||
942 | } else { | 951 | } else { |
943 | ret = do_dmabuf_dirty_sou(file_priv, dev_priv, &vfbd->base, | 952 | ret = do_dmabuf_dirty_sou(file_priv, dev_priv, &vfbd->base, |
944 | flags, color, | 953 | flags, color, |
945 | clips, num_clips, increment); | 954 | clips, num_clips, increment, NULL); |
946 | } | 955 | } |
947 | 956 | ||
948 | ttm_read_unlock(&vmaster->lock); | 957 | ttm_read_unlock(&vmaster->lock); |