[Spice-devel] Compute totalPixmapSize using the same logic as in dix/pixmap.c, rather than hard coding 100.

Submitted by Jeremy White on June 13, 2012, 10:04 p.m.

Details

Message ID 4FD90E5C.4090806@codeweavers.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Jeremy White June 13, 2012, 10:04 p.m.
This was found while building with a modified X server; one with a PixmapRec size of 224, not 64 :-/.
---
 src/qxl_driver.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 5519f57..135c269 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -1077,8 +1077,6 @@  qxl_screen_init(SCREEN_INIT_ARGS_DECL)
     ErrorF ("allocated %d x %d  %p\n", pScrn->virtualX, pScrn->virtualY, qxl->fb);
 #endif
     
-    pScreen->totalPixmapSize = 100;
-
     pScrn->virtualX = pScrn->currentMode->HDisplay;
     pScrn->virtualY = pScrn->currentMode->VDisplay;
 
@@ -1137,6 +1135,10 @@  qxl_screen_init(SCREEN_INIT_ARGS_DECL)
 
     DamageSetup(pScreen);
     
+    /* We need to set totalPixmapSize after setup_uxa and Damage,
+	as the privatessize is not computed correctly until then */
+    pScreen->totalPixmapSize = BitmapBytePad((sizeof(PixmapRec) + dixPrivatesSize(PRIVATE_PIXMAP) ) * 8);
+
     miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
     if (!miCreateDefColormap(pScreen))
       goto out;

Comments

On Wed, Jun 13, 2012 at 05:04:12PM -0500, Jeremy White wrote:

Looks good to me.

> This was found while building with a modified X server; one with a PixmapRec size of 224, not 64 :-/.
> ---
>  src/qxl_driver.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qxl_driver.c b/src/qxl_driver.c
> index 5519f57..135c269 100644
> --- a/src/qxl_driver.c
> +++ b/src/qxl_driver.c
> @@ -1077,8 +1077,6 @@ qxl_screen_init(SCREEN_INIT_ARGS_DECL)
>      ErrorF ("allocated %d x %d  %p\n", pScrn->virtualX, pScrn->virtualY, qxl->fb);
>  #endif
>      
> -    pScreen->totalPixmapSize = 100;
> -
>      pScrn->virtualX = pScrn->currentMode->HDisplay;
>      pScrn->virtualY = pScrn->currentMode->VDisplay;
>  
> @@ -1137,6 +1135,10 @@ qxl_screen_init(SCREEN_INIT_ARGS_DECL)
>  
>      DamageSetup(pScreen);
>      
> +    /* We need to set totalPixmapSize after setup_uxa and Damage,
> +	as the privatessize is not computed correctly until then */
> +    pScreen->totalPixmapSize = BitmapBytePad((sizeof(PixmapRec) + dixPrivatesSize(PRIVATE_PIXMAP) ) * 8);
> +
>      miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
>      if (!miCreateDefColormap(pScreen))
>        goto out;
> -- 
> 1.7.10
> 
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
On Wed, Jun 13, 2012 at 05:04:12PM -0500, Jeremy White wrote:
> This was found while building with a modified X server; one with a PixmapRec size of 224, not 64 :-/.

pushed, thanks.

> ---
>  src/qxl_driver.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qxl_driver.c b/src/qxl_driver.c
> index 5519f57..135c269 100644
> --- a/src/qxl_driver.c
> +++ b/src/qxl_driver.c
> @@ -1077,8 +1077,6 @@ qxl_screen_init(SCREEN_INIT_ARGS_DECL)
>      ErrorF ("allocated %d x %d  %p\n", pScrn->virtualX, pScrn->virtualY, qxl->fb);
>  #endif
>      
> -    pScreen->totalPixmapSize = 100;
> -
>      pScrn->virtualX = pScrn->currentMode->HDisplay;
>      pScrn->virtualY = pScrn->currentMode->VDisplay;
>  
> @@ -1137,6 +1135,10 @@ qxl_screen_init(SCREEN_INIT_ARGS_DECL)
>  
>      DamageSetup(pScreen);
>      
> +    /* We need to set totalPixmapSize after setup_uxa and Damage,
> +	as the privatessize is not computed correctly until then */
> +    pScreen->totalPixmapSize = BitmapBytePad((sizeof(PixmapRec) + dixPrivatesSize(PRIVATE_PIXMAP) ) * 8);
> +
>      miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
>      if (!miCreateDefColormap(pScreen))
>        goto out;
> -- 
> 1.7.10
> 
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel