[Spice-devel] [PATCH 1/3] qxl: disable image cache for KMS

Dave Airlie airlied at gmail.com
Thu Jul 4 21:49:22 PDT 2013


From: Dave Airlie <airlied at redhat.com>

Currently this code can't work with KMS, need to work out how
the image cache could be effectively used with KMS enabled.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/qxl_image.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/qxl_image.c b/src/qxl_image.c
index 40798b3..6c39214 100644
--- a/src/qxl_image.c
+++ b/src/qxl_image.c
@@ -50,7 +50,7 @@ static unsigned int
 hash_and_copy (const uint8_t *src, int src_stride,
 	       uint8_t *dest, int dest_stride,
 	       int bytes_per_pixel, int width, int height,
-	       uint32_t hash)
+	       uint32_t hash, Bool do_hashing)
 {
     int i;
   
@@ -63,7 +63,8 @@ hash_and_copy (const uint8_t *src, int src_stride,
 	if (dest)
 	    memcpy (dest_line, src_line, n_bytes);
 
-	MurmurHash3_x86_32 (src_line, n_bytes, hash, &hash);
+	if (do_hashing)
+	    MurmurHash3_x86_32 (src_line, n_bytes, hash, &hash);
     }
 
     return hash;
@@ -165,7 +166,7 @@ qxl_image_create (qxl_screen_t *qxl, const uint8_t *data,
 	    chunk->data_size = n_lines * dest_stride;
 	    hash = hash_and_copy (data, stride,
 				  chunk->data, dest_stride,
-				  Bpp, width, n_lines, hash);
+				  Bpp, width, n_lines, hash, !qxl->kms_enabled);
 	    
 	    if (tail_bo)
 	    {
@@ -230,8 +231,9 @@ qxl_image_create (qxl_screen_t *qxl, const uint8_t *data,
 
 	qxl->bo_funcs->bo_decref(qxl, head_bo);
 	/* Add to hash table if caching is enabled */
-	if ((fallback && qxl->enable_fallback_cache)	||
-	    (!fallback && qxl->enable_image_cache))
+	if (!qxl->kms_enabled &&
+	    ((fallback && qxl->enable_fallback_cache)	||
+	     (!fallback && qxl->enable_image_cache)))
 	{
 	    if ((info = insert_image_info (hash)))
 	    {
-- 
1.8.3.1



More information about the Spice-devel mailing list