[Spice-devel,1/3] server/red_worker: red_process_drawable: have single point of exit

Submitted by Alon Levy on May 14, 2012, 12:32 p.m.

Details

Message ID 1336998749-11201-1-git-send-email-alevy@redhat.com
State Accepted
Commit c8cefd4a8f28bde14b70a72272c0ccb80c77af04
Headers show

Not browsing as part of any series.

Commit Message

Alon Levy May 14, 2012, 12:32 p.m.
---
 server/red_worker.c |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/server/red_worker.c b/server/red_worker.c
index 60f30d3..4304f29 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -3905,23 +3905,19 @@  static inline void red_process_drawable(RedWorker *worker, RedDrawable *drawable
     red_inc_surfaces_drawable_dependencies(worker, item);
 
     if (region_is_empty(&item->tree_item.base.rgn)) {
-        release_drawable(worker, item);
-        return;
+        goto cleanup;
     }
 
     if (!red_handle_self_bitmap(worker, item)) {
-        release_drawable(worker, item);
-        return;
+        goto cleanup;
     }
 
     if (!red_handle_depends_on_target_surface(worker, surface_id)) {
-        release_drawable(worker, item);
-        return;
+        goto cleanup;
     }
 
     if (!red_handle_surfaces_dependencies(worker, item)) {
-        release_drawable(worker, item);
-        return;
+        goto cleanup;
     }
 
     if (red_current_add_qxl(worker, &worker->surfaces[surface_id].current, item,
@@ -3934,6 +3930,7 @@  static inline void red_process_drawable(RedWorker *worker, RedDrawable *drawable
         red_draw_qxl_drawable(worker, item);
 #endif
     }
+cleanup:
     release_drawable(worker, item);
 }
 

Comments

v2:
 self_bitmap renamed self_bitmap_image and moved to RedDrawable (Yonit)
  - the first two patches are identical to the previous ones.

Alon Levy (6):
  server/red_worker: red_process_drawable: have single point of exit
  server/red_worker/red_process_commands: rename drawable to
    red_drawable (later add a local drawable)
  server/red_worker: rename SpiceImage *self_bitmap to
    self_bitmap_image
  server/red_worker/red_handle_self_bitmap: add red_drawable local, one
    extra whitespace line removed
  server/red_worker/put_red_drawable: s/drawable/red_drawable/
  server: move self_bitmap_image to RedDrawable

Yonit Halperin (1):
  server/red_worker: don't release self_bitmap unless refcount is 0

 server/red_parse_qxl.c |    3 +++
 server/red_parse_qxl.h |    1 +
 server/red_worker.c    |   69 ++++++++++++++++++++----------------------------
 3 files changed, 33 insertions(+), 40 deletions(-)
Looks good. Ack series.

Thanks,
Yonit.
On 05/15/2012 01:58 PM, Alon Levy wrote:
> v2:
>   self_bitmap renamed self_bitmap_image and moved to RedDrawable (Yonit)
>    - the first two patches are identical to the previous ones.
>
> Alon Levy (6):
>    server/red_worker: red_process_drawable: have single point of exit
>    server/red_worker/red_process_commands: rename drawable to
>      red_drawable (later add a local drawable)
>    server/red_worker: rename SpiceImage *self_bitmap to
>      self_bitmap_image
>    server/red_worker/red_handle_self_bitmap: add red_drawable local, one
>      extra whitespace line removed
>    server/red_worker/put_red_drawable: s/drawable/red_drawable/
>    server: move self_bitmap_image to RedDrawable
>
> Yonit Halperin (1):
>    server/red_worker: don't release self_bitmap unless refcount is 0
>
>   server/red_parse_qxl.c |    3 +++
>   server/red_parse_qxl.h |    1 +
>   server/red_worker.c    |   69 ++++++++++++++++++++----------------------------
>   3 files changed, 33 insertions(+), 40 deletions(-)
>