Re: [PATCH 09/15] worker: don't process drawable if it can't be allocated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/04/2015 05:48 PM, Frediano Ziglio wrote:
This patch does the same of former one.

Hi,

Does this patch just throws away the draw command ?

Why is that good ?

Regards,
    Uri.




[PATCH] worker: don't process drawable if it can't be allocated

---
  server/red_worker.c | 10 ++++++----
  1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/server/red_worker.c b/server/red_worker.c
index 5b1ece8..5005e7c 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -3211,14 +3211,14 @@ static inline int red_handle_self_bitmap(RedWorker *worker, Drawable *drawable)
      return TRUE;
  }

-static void free_one_drawable(RedWorker *worker, int force_glz_free)
+static bool free_one_drawable(RedWorker *worker, int force_glz_free)
  {
      RingItem *ring_item = ring_get_tail(&worker->current_list);
      Drawable *drawable;
      Container *container;

      if (!ring_item) {
-        return;
+        return FALSE;
      }
      drawable = SPICE_CONTAINEROF(ring_item, Drawable, list_link);
      if (force_glz_free) {
@@ -3233,6 +3233,8 @@ static void free_one_drawable(RedWorker *worker, int force_glz_free)

      current_remove_drawable(worker, drawable);
      container_cleanup(worker, container);
+
+    return TRUE;
  }

  static Drawable *get_drawable(RedWorker *worker, uint8_t effect, RedDrawable *red_drawable,
@@ -3253,7 +3255,8 @@ static Drawable *get_drawable(RedWorker *worker, uint8_t effect, RedDrawable *re
      }

      while (!(drawable = alloc_drawable(worker))) {
-        free_one_drawable(worker, FALSE);
+        if (!free_one_drawable(worker, FALSE))
+            return NULL;
      }
      worker->drawable_count++;
      memset(drawable, 0, sizeof(Drawable));
@@ -3356,7 +3359,6 @@ static inline void red_process_draw(RedWorker *worker, RedDrawable *red_drawable
      Drawable *drawable = get_drawable(worker, red_drawable->effect, red_drawable, group_id);

      if (!drawable) {
-        rendering_incorrect("failed to get_drawable");
          return;
      }



_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]