[PATCH] support for 30 bit depth in dummy driver
Antoine Martin
antoine at nagafix.co.uk
Sat Aug 5 11:10:25 UTC 2017
Ping. Please apply.
This patch has been used for almost a year now, and got tested more
thoroughly lately with a patch to VirtualGL. To test it with xpra 2.1:
xpra start --pixel-depth 30 --start=xterm --attach=yes
Thanks
Antoine
Here's an updated version with clean offsets against current HEAD:
diff --git a/src/dummy.h b/src/dummy.h
index c3fdd6e..0dd8906 100644
--- a/src/dummy.h
+++ b/src/dummy.h
@@ -68,7 +68,7 @@ typedef struct dummyRec
int overlay_offset;
int videoKey;
int interlace;
- dummy_colors colors[256];
+ dummy_colors colors[1024];
pointer* FBBase;
Bool (*CreateWindow)() ; /* wrapped CreateWindow */
Bool prop;
diff --git a/src/dummy_driver.c b/src/dummy_driver.c
index 2656602..c64c60f 100644
--- a/src/dummy_driver.c
+++ b/src/dummy_driver.c
@@ -307,6 +307,7 @@ DUMMYPreInit(ScrnInfoPtr pScrn, int flags)
case 15:
case 16:
case 24:
+ case 30:
break;
default:
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -321,8 +322,8 @@ DUMMYPreInit(ScrnInfoPtr pScrn, int flags)
pScrn->rgbBits = 8;
/* Get the depth24 pixmap format */
- if (pScrn->depth == 24 && pix24bpp == 0)
- pix24bpp = xf86GetBppFromDepth(pScrn, 24);
+ if (pScrn->depth >= 24 && pix24bpp == 0)
+ pix24bpp = xf86GetBppFromDepth(pScrn, pScrn->depth);
/*
* This must happen after pScrn->display has been set because
@@ -612,7 +613,7 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
if(!miCreateDefColormap(pScreen))
return FALSE;
- if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits,
+ if (!xf86HandleColormaps(pScreen, 1024, pScrn->rgbBits,
DUMMYLoadPalette, NULL,
CMAP_PALETTED_TRUECOLOR
| CMAP_RELOAD_ON_MODE_SWITCH))
On 20/09/16 22:45, Antoine Martin wrote:
> This patch makes it possible to start the server using the dummy
> driver with a 30 bit depth.
> The colormap size is changed from 256 to 1024 to prevent crashes.
>
> This updated patch adds the missing header file to the commit.
>
> Signed-off-by: Antoine Martin <antoine at nagafix.co.uk>
> ---
> src/dummy.h | 2 +-
> src/dummy_driver.c | 7 ++++---
> 2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/src/dummy.h b/src/dummy.h
> index c3fdd6e..0dd8906 100644
> --- a/src/dummy.h
> +++ b/src/dummy.h
> @@ -68,7 +68,7 @@ typedef struct dummyRec
> int overlay_offset;
> int videoKey;
> int interlace;
> - dummy_colors colors[256];
> + dummy_colors colors[1024];
> pointer* FBBase;
> Bool (*CreateWindow)() ; /* wrapped CreateWindow */
> Bool prop;
> diff --git a/src/dummy_driver.c b/src/dummy_driver.c
> index 737f11c..c84000f 100644
> --- a/src/dummy_driver.c
> +++ b/src/dummy_driver.c
> @@ -313,6 +313,7 @@ DUMMYPreInit(ScrnInfoPtr pScrn, int flags)
> case 15:
> case 16:
> case 24:
> + case 30:
> break;
> default:
> xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> @@ -327,8 +328,8 @@ DUMMYPreInit(ScrnInfoPtr pScrn, int flags)
> pScrn->rgbBits = 8;
>
> /* Get the depth24 pixmap format */
> - if (pScrn->depth == 24 && pix24bpp == 0)
> - pix24bpp = xf86GetBppFromDepth(pScrn, 24);
> + if (pScrn->depth >= 24 && pix24bpp == 0)
> + pix24bpp = xf86GetBppFromDepth(pScrn, pScrn->depth);
>
> /*
> * This must happen after pScrn->display has been set because
> @@ -637,7 +638,7 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
> if(!miCreateDefColormap(pScreen))
> return FALSE;
>
> - if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits,
> + if (!xf86HandleColormaps(pScreen, 1024, pScrn->rgbBits,
> DUMMYLoadPalette, NULL,
> CMAP_PALETTED_TRUECOLOR
> | CMAP_RELOAD_ON_MODE_SWITCH))
>
More information about the xorg-devel
mailing list