Skip to contentSkip to conversation

Depth 30 enablement for ati-ddx + exa.

PATCH In review Mario Kleiner 3 participants 10 messages Dec 18, 2017 – Dec 22, 2017 6 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,

this is the patch series for ati-ddx to enable depth 30 color display under exa, which i used for testing the corresponding mesa 30 bit rendering patches. Works well, and photometer measurements confirmed we get 10 bpc per color channel.

1/3 fixes a server crash if x-screen depth 30 is selected.

2/3 is actually Fredrik Hoeglunds work, which he sent out many years ago to the mailing list. I've tested it without problems on HD 5770 for the evergreen exa path, and on some HD 4000 series (rv630 iirc) for the r600 exa path, and it seems to work nicely.

It also has a r-b by me as in "looks good to me", but i'm not familiar enough with exa to really judge if it is complete or if something for some more unusual case might be missing.

I guess it also might need a signed off by Fredrik?

3/3 switches depth 30 on for exa + Linux 3.16 and later, when depth 30 scanout was added to radeon-kms.

Thanks,
-mario

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20171218223645.25142-1-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw

PATCH 1/3 Fix xf86HandleColormaps() crash at color depth 30.

The size of the X-Server pScreenPriv->PreAllocIndices array allocated within xf86HandleColormaps() is given by the given maxColors argument, but the range of indices by which the PreAllocIndices array is indexed in routines like CMapReinstallMap() seems to be up to 1023 on a 10 bpc / depth 30 screen, leading to an out-of-bounds access and server crash.

Raising maxColors to 1024 fixes the crash at server startup with X-Screen color depth 30.

---
 src/drmmode_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
src/drmmode_display.c +2 -1
index 7ad3235..67db86e 100644
@@ -2730,8 +2730,9 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
 		       "Initializing kms color map\n");
 	if (!miCreateDefColormap(pScreen))
 	    return FALSE;
+
 	/* all radeons support 10 bit CLUTs */
-	if (!xf86HandleColormaps(pScreen, 256, 10,
+	if (!xf86HandleColormaps(pScreen, 1024, 10,
 				 NULL, NULL,
 				 CMAP_PALETTED_TRUECOLOR
 #if 0 /* This option messes up text mode! ([email protected]) */
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20171218223645.25142-2-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#4 lore raw

Re: [PATCH 1/3] Fix xf86HandleColormaps() crash at color depth 30.

Quoted 22 lines · Mario Kleiner

The size of the X-Server pScreenPriv->PreAllocIndices array allocated within xf86HandleColormaps() is given by the given maxColors argument, but the range of indices by which the PreAllocIndices array is indexed in routines like CMapReinstallMap() seems to be up to 1023 on a 10 bpc / depth 30 screen, leading to an out-of-bounds access and server crash.

Raising maxColors to 1024 fixes the crash at server startup with X-Screen color depth 30.

---
 src/drmmode_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
src/drmmode_display.c +0 -0
index 7ad3235..67db86e 100644

src/drmmode_display.c Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn) · line 2738

Quoted 10 lines
src/drmmode_display.c +2 -1
@@ -2730,8 +2730,9 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
 		       "Initializing kms color map\n");
 	if (!miCreateDefColormap(pScreen))
 	    return FALSE;
+
 	/* all radeons support 10 bit CLUTs */
-	if (!xf86HandleColormaps(pScreen, 256, 10,
+	if (!xf86HandleColormaps(pScreen, 1024, 10,
 				 NULL, NULL,
 				 CMAP_PALETTED_TRUECOLOR
 #if 0 /* This option messes up text mode! ([email protected]) */

The hardware CLUT isn't actually used at depth 30, so a better solution would be to skip the xf86HandleColormaps call (and probably also set xf86CrtcFuncsRec::gamma_set = NULL) for pScrn->depth == 30.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 3e792109-b517-4f4c-26eb-033b903bfba8-otUistvHUpPR7s880joybQ@public.gmane.org

#6 lore raw

Re: [PATCH 1/3] Fix xf86HandleColormaps() crash at color depth 30.

Quoted 29 lines · Michel Dänzer
Quoted 28 lines · Mario Kleiner

The size of the X-Server pScreenPriv->PreAllocIndices array allocated within xf86HandleColormaps() is given by the given maxColors argument, but the range of indices by which the PreAllocIndices array is indexed in routines like CMapReinstallMap() seems to be up to 1023 on a 10 bpc / depth 30 screen, leading to an out-of-bounds access and server crash.

Raising maxColors to 1024 fixes the crash at server startup with X-Screen color depth 30.

---
  src/drmmode_display.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
src/drmmode_display.c +2 -1
index 7ad3235..67db86e 100644
@@ -2730,8 +2730,9 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
  		       "Initializing kms color map\n");
  	if (!miCreateDefColormap(pScreen))
  	    return FALSE;
+
  	/* all radeons support 10 bit CLUTs */
-	if (!xf86HandleColormaps(pScreen, 256, 10,
+	if (!xf86HandleColormaps(pScreen, 1024, 10,
Quoted 9 lines

src/drmmode_display.c Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn) · line 2738

Quoted 4 lines
src/drmmode_display.c +0 -0
  				 NULL, NULL,
  				 CMAP_PALETTED_TRUECOLOR
  #if 0 /* This option messes up text mode! ([email protected]) */

The hardware CLUT isn't actually used at depth 30, so a better solution would be to skip the xf86HandleColormaps call (and probably also set xf86CrtcFuncsRec::gamma_set = NULL) for pScrn->depth == 30.

I know. Skipping the xf86HandleColormaps() function was the solution i first used, but then i thought we might want to keep it as future-proofing in case we'd implement hw gamma tables in the kms drivers for depth > 24 by switching to the piecewise linear hw gamma tables. Haven't looked yet what DC uses in amdgpu-kms, and what therefore makes sense for the amdgpu-ddx?

But no strong opinion, so whatever you prefer?

thanks,
-mario
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): bd1746c1-63ed-eed4-5dae-c79e6a88c9e3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#8 lore raw

Re: [PATCH 1/3] Fix xf86HandleColormaps() crash at color depth 30.

Quoted 41 lines · Mario Kleiner
Quoted 30 lines · Michel Dänzer
Quoted 29 lines · Mario Kleiner

The size of the X-Server pScreenPriv->PreAllocIndices array allocated within xf86HandleColormaps() is given by the given maxColors argument, but the range of indices by which the PreAllocIndices array is indexed in routines like CMapReinstallMap() seems to be up to 1023 on a 10 bpc / depth 30 screen, leading to an out-of-bounds access and server crash.

Raising maxColors to 1024 fixes the crash at server startup with X-Screen color depth 30.

---
  src/drmmode_display.c | 3 ++-

  1 file changed, 2 insertions(+), 1 deletion(-)
src/drmmode_display.c +2 -1
index 7ad3235..67db86e 100644
@@ -2730,8 +2730,9 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen,
 ScrnInfoPtr pScrn)
                  "Initializing kms color map\n");
       if (!miCreateDefColormap(pScreen))
           return FALSE;
+
       /* all radeons support 10 bit CLUTs */
-    if (!xf86HandleColormaps(pScreen, 256, 10,
+    if (!xf86HandleColormaps(pScreen, 1024, 10,
Quoted 9 lines
Quoted 4 lines
src/drmmode_display.c +0 -0
                    NULL, NULL,

                   CMAP_PALETTED_TRUECOLOR
  #if 0 /* This option messes up text mode! ([email protected]) */

The hardware CLUT isn't actually used at depth 30, so a better solution would be to skip the xf86HandleColormaps call (and probably also set xf86CrtcFuncsRec::gamma_set = NULL) for pScrn->depth == 30.

Quoted 5 lines

I know. Skipping the xf86HandleColormaps() function was the solution i first used, but then i thought we might want to keep it as future-proofing in case we'd implement hw gamma tables in the kms drivers for depth > 24 by switching to the piecewise linear hw gamma tables.

We can cross that bridge when we get there.

Quoted 2 lines

Haven't looked yet what DC uses in amdgpu-kms, and what therefore makes sense for the amdgpu-ddx?

The legacy/non-atomic KMS gamma ramp has no effect at depth 30 with DC as well, so the plan for xf86-video-amdgpu is what I described above. Let's not diverge on this without good reason.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#9 lore raw

PATCH 2/3 exa: Accelerate ARGB2101010 pictures

In reply to a message not in the archive

From: Fredrik Höglund <[email protected]>

Tested by Mario on a Radeon HD 4000 series for the r600 exa path, and on Radeon HD 5770 for the evergreen exa path.

Reviewed-and-Tested-by Mario Kleiner <[email protected]>
Cc Fredrik Höglund <[email protected]>
---
 src/evergreen_exa.c | 18 ++++++++++++++++++
 src/r600_exa.c      | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)
src/evergreen_exa.c +18 -0
index 90c9b6d..8584813 100644
@@ -668,6 +668,10 @@ struct formatinfo {
 };
 
 static struct formatinfo EVERGREENTexFormats[] = {
+    {PICT_a2r10g10b10,	FMT_2_10_10_10},
+    {PICT_x2r10g10b10,	FMT_2_10_10_10},
+    {PICT_a2b10g10r10,	FMT_2_10_10_10},
+    {PICT_x2b10g10r10,	FMT_2_10_10_10},
     {PICT_a8r8g8b8,	FMT_8_8_8_8},
     {PICT_x8r8g8b8,	FMT_8_8_8_8},
     {PICT_a8b8g8r8,	FMT_8_8_8_8},
@@ -723,6 +727,12 @@ static uint32_t EVERGREENGetBlendCntl(int op, PicturePtr pMask, uint32_t dst_for
 static Bool EVERGREENGetDestFormat(PicturePtr pDstPicture, uint32_t *dst_format)
 {
     switch (pDstPicture->format) {
+    case PICT_a2r10g10b10:
+    case PICT_x2r10g10b10:
+    case PICT_a2b10g10r10:
+    case PICT_x2b10g10r10:
+	*dst_format = COLOR_2_10_10_10;
+	break;
     case PICT_a8r8g8b8:
     case PICT_x8r8g8b8:
     case PICT_a8b8g8r8:
@@ -891,6 +901,7 @@ static Bool EVERGREENTextureSetup(PicturePtr pPict, PixmapPtr pPix,
 
     /* component swizzles */
     switch (pPict->format) {
+    case PICT_a2r10g10b10:
     case PICT_a1r5g5b5:
     case PICT_a8r8g8b8:
 	pix_r = SQ_SEL_Z; /* R */
@@ -898,12 +909,14 @@ static Bool EVERGREENTextureSetup(PicturePtr pPict, PixmapPtr pPix,
 	pix_b = SQ_SEL_X; /* B */
 	pix_a = SQ_SEL_W; /* A */
 	break;
+    case PICT_a2b10g10r10:
     case PICT_a8b8g8r8:
 	pix_r = SQ_SEL_X; /* R */
 	pix_g = SQ_SEL_Y; /* G */
 	pix_b = SQ_SEL_Z; /* B */
 	pix_a = SQ_SEL_W; /* A */
 	break;
+    case PICT_x2b10g10r10:
     case PICT_x8b8g8r8:
 	pix_r = SQ_SEL_X; /* R */
 	pix_g = SQ_SEL_Y; /* G */
@@ -922,6 +935,7 @@ static Bool EVERGREENTextureSetup(PicturePtr pPict, PixmapPtr pPix,
 	pix_b = SQ_SEL_W; /* B */
 	pix_a = SQ_SEL_1; /* A */
 	break;
+    case PICT_x2r10g10b10:
     case PICT_x1r5g5b5:
     case PICT_x8r8g8b8:
     case PICT_r5g6b5:
@@ -1425,6 +1439,8 @@ static Bool EVERGREENPrepareComposite(int op, PicturePtr pSrcPicture,
     cb_conf.surface = accel_state->dst_obj.surface;
 
     switch (pDstPicture->format) {
+    case PICT_a2r10g10b10:
+    case PICT_x2r10g10b10:
     case PICT_a8r8g8b8:
     case PICT_x8r8g8b8:
     case PICT_a1r5g5b5:
@@ -1432,6 +1448,8 @@ static Bool EVERGREENPrepareComposite(int op, PicturePtr pSrcPicture,
     default:
 	cb_conf.comp_swap = 1; /* ARGB */
 	break;
+    case PICT_a2b10g10r10:
+    case PICT_x2b10g10r10:
     case PICT_a8b8g8r8:
     case PICT_x8b8g8r8:
 	cb_conf.comp_swap = 0; /* ABGR */
src/r600_exa.c +18 -0
index 22d4b31..c69b8fc 100644
@@ -727,6 +727,10 @@ struct formatinfo {
 };
 
 static struct formatinfo R600TexFormats[] = {
+    {PICT_a2r10g10b10,	FMT_2_10_10_10},
+    {PICT_x2r10g10b10,	FMT_2_10_10_10},
+    {PICT_a2b10g10r10,	FMT_2_10_10_10},
+    {PICT_x2b10g10r10,	FMT_2_10_10_10},
     {PICT_a8r8g8b8,	FMT_8_8_8_8},
     {PICT_x8r8g8b8,	FMT_8_8_8_8},
     {PICT_a8b8g8r8,	FMT_8_8_8_8},
@@ -782,6 +786,12 @@ static uint32_t R600GetBlendCntl(int op, PicturePtr pMask, uint32_t dst_format)
 static Bool R600GetDestFormat(PicturePtr pDstPicture, uint32_t *dst_format)
 {
     switch (pDstPicture->format) {
+    case PICT_a2r10g10b10:
+    case PICT_x2r10g10b10:
+    case PICT_a2b10g10r10:
+    case PICT_x2b10g10r10:
+	*dst_format = COLOR_2_10_10_10;
+	break;
     case PICT_a8r8g8b8:
     case PICT_x8r8g8b8:
     case PICT_a8b8g8r8:
@@ -906,6 +916,7 @@ static Bool R600TextureSetup(PicturePtr pPict, PixmapPtr pPix,
 
     /* component swizzles */
     switch (pPict->format) {
+    case PICT_a2r10g10b10:
     case PICT_a1r5g5b5:
     case PICT_a8r8g8b8:
 	pix_r = SQ_SEL_Z; /* R */
@@ -913,12 +924,14 @@ static Bool R600TextureSetup(PicturePtr pPict, PixmapPtr pPix,
 	pix_b = SQ_SEL_X; /* B */
 	pix_a = SQ_SEL_W; /* A */
 	break;
+    case PICT_a2b10g10r10:
     case PICT_a8b8g8r8:
 	pix_r = SQ_SEL_X; /* R */
 	pix_g = SQ_SEL_Y; /* G */
 	pix_b = SQ_SEL_Z; /* B */
 	pix_a = SQ_SEL_W; /* A */
 	break;
+    case PICT_x2b10g10r10:
     case PICT_x8b8g8r8:
 	pix_r = SQ_SEL_X; /* R */
 	pix_g = SQ_SEL_Y; /* G */
@@ -937,6 +950,7 @@ static Bool R600TextureSetup(PicturePtr pPict, PixmapPtr pPix,
 	pix_b = SQ_SEL_W; /* B */
 	pix_a = SQ_SEL_1; /* A */
 	break;
+    case PICT_x2r10g10b10:
     case PICT_x1r5g5b5:
     case PICT_x8r8g8b8:
     case PICT_r5g6b5:
@@ -1464,6 +1478,8 @@ static Bool R600PrepareComposite(int op, PicturePtr pSrcPicture,
     cb_conf.surface = accel_state->dst_obj.surface;
 
     switch (pDstPicture->format) {
+    case PICT_a2r10g10b10:
+    case PICT_x2r10g10b10:
     case PICT_a8r8g8b8:
     case PICT_x8r8g8b8:
     case PICT_a1r5g5b5:
@@ -1471,6 +1487,8 @@ static Bool R600PrepareComposite(int op, PicturePtr pSrcPicture,
     default:
 	cb_conf.comp_swap = 1; /* ARGB */
 	break;
+    case PICT_a2b10g10r10:
+    case PICT_x2b10g10r10:
     case PICT_a8b8g8r8:
     case PICT_x8b8g8r8:
 	cb_conf.comp_swap = 0; /* ABGR */
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20171218223645.25142-3-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#11 lore raw

Re: [PATCH 2/3] exa: Accelerate ARGB2101010 pictures

Quoted 8 lines · Mario Kleiner

From: Fredrik Höglund <[email protected]>

Tested by Mario on a Radeon HD 4000 series for the r600 exa path, and on Radeon HD 5770 for the evergreen exa path.

Reviewed-and-Tested-by Mario Kleiner <[email protected]>
Cc Fredrik Höglund <[email protected]>

I think the only question is whether SetSolidConsts() should support 2101010 formats. I believe solid pictures are always a8r8g8b8, so it shouldn't matter in practice. But that function already supports all other formats, so maybe the 2101010 ones should be added for the sake of consistency.

But either way:

Quoted 152 lines
---
 src/evergreen_exa.c | 18 ++++++++++++++++++
 src/r600_exa.c      | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)
src/evergreen_exa.c +18 -0
index 90c9b6d..8584813 100644
@@ -668,6 +668,10 @@ struct formatinfo {
 };
 
 static struct formatinfo EVERGREENTexFormats[] = {
+    {PICT_a2r10g10b10,	FMT_2_10_10_10},
+    {PICT_x2r10g10b10,	FMT_2_10_10_10},
+    {PICT_a2b10g10r10,	FMT_2_10_10_10},
+    {PICT_x2b10g10r10,	FMT_2_10_10_10},
     {PICT_a8r8g8b8,	FMT_8_8_8_8},
     {PICT_x8r8g8b8,	FMT_8_8_8_8},
     {PICT_a8b8g8r8,	FMT_8_8_8_8},
@@ -723,6 +727,12 @@ static uint32_t EVERGREENGetBlendCntl(int op, PicturePtr pMask, uint32_t dst_for
 static Bool EVERGREENGetDestFormat(PicturePtr pDstPicture, uint32_t *dst_format)
 {
     switch (pDstPicture->format) {
+    case PICT_a2r10g10b10:
+    case PICT_x2r10g10b10:
+    case PICT_a2b10g10r10:
+    case PICT_x2b10g10r10:
+	*dst_format = COLOR_2_10_10_10;
+	break;
     case PICT_a8r8g8b8:
     case PICT_x8r8g8b8:
     case PICT_a8b8g8r8:
@@ -891,6 +901,7 @@ static Bool EVERGREENTextureSetup(PicturePtr pPict, PixmapPtr pPix,
 
     /* component swizzles */
     switch (pPict->format) {
+    case PICT_a2r10g10b10:
     case PICT_a1r5g5b5:
     case PICT_a8r8g8b8:
 	pix_r = SQ_SEL_Z; /* R */
@@ -898,12 +909,14 @@ static Bool EVERGREENTextureSetup(PicturePtr pPict, PixmapPtr pPix,
 	pix_b = SQ_SEL_X; /* B */
 	pix_a = SQ_SEL_W; /* A */
 	break;
+    case PICT_a2b10g10r10:
     case PICT_a8b8g8r8:
 	pix_r = SQ_SEL_X; /* R */
 	pix_g = SQ_SEL_Y; /* G */
 	pix_b = SQ_SEL_Z; /* B */
 	pix_a = SQ_SEL_W; /* A */
 	break;
+    case PICT_x2b10g10r10:
     case PICT_x8b8g8r8:
 	pix_r = SQ_SEL_X; /* R */
 	pix_g = SQ_SEL_Y; /* G */
@@ -922,6 +935,7 @@ static Bool EVERGREENTextureSetup(PicturePtr pPict, PixmapPtr pPix,
 	pix_b = SQ_SEL_W; /* B */
 	pix_a = SQ_SEL_1; /* A */
 	break;
+    case PICT_x2r10g10b10:
     case PICT_x1r5g5b5:
     case PICT_x8r8g8b8:
     case PICT_r5g6b5:
@@ -1425,6 +1439,8 @@ static Bool EVERGREENPrepareComposite(int op, PicturePtr pSrcPicture,
     cb_conf.surface = accel_state->dst_obj.surface;
 
     switch (pDstPicture->format) {
+    case PICT_a2r10g10b10:
+    case PICT_x2r10g10b10:
     case PICT_a8r8g8b8:
     case PICT_x8r8g8b8:
     case PICT_a1r5g5b5:
@@ -1432,6 +1448,8 @@ static Bool EVERGREENPrepareComposite(int op, PicturePtr pSrcPicture,
     default:
 	cb_conf.comp_swap = 1; /* ARGB */
 	break;
+    case PICT_a2b10g10r10:
+    case PICT_x2b10g10r10:
     case PICT_a8b8g8r8:
     case PICT_x8b8g8r8:
 	cb_conf.comp_swap = 0; /* ABGR */
src/r600_exa.c +16 -0
index 22d4b31..c69b8fc 100644
@@ -727,6 +727,10 @@ struct formatinfo {
 };
 
 static struct formatinfo R600TexFormats[] = {
+    {PICT_a2r10g10b10,	FMT_2_10_10_10},
+    {PICT_x2r10g10b10,	FMT_2_10_10_10},
+    {PICT_a2b10g10r10,	FMT_2_10_10_10},
+    {PICT_x2b10g10r10,	FMT_2_10_10_10},
     {PICT_a8r8g8b8,	FMT_8_8_8_8},
     {PICT_x8r8g8b8,	FMT_8_8_8_8},
     {PICT_a8b8g8r8,	FMT_8_8_8_8},
@@ -782,6 +786,12 @@ static uint32_t R600GetBlendCntl(int op, PicturePtr pMask, uint32_t dst_format)
 static Bool R600GetDestFormat(PicturePtr pDstPicture, uint32_t *dst_format)
 {
     switch (pDstPicture->format) {
+    case PICT_a2r10g10b10:
+    case PICT_x2r10g10b10:
+    case PICT_a2b10g10r10:
+    case PICT_x2b10g10r10:
+	*dst_format = COLOR_2_10_10_10;
+	break;
     case PICT_a8r8g8b8:
     case PICT_x8r8g8b8:
     case PICT_a8b8g8r8:
@@ -906,6 +916,7 @@ static Bool R600TextureSetup(PicturePtr pPict, PixmapPtr pPix,
 
     /* component swizzles */
     switch (pPict->format) {
+    case PICT_a2r10g10b10:
     case PICT_a1r5g5b5:
     case PICT_a8r8g8b8:
 	pix_r = SQ_SEL_Z; /* R */
@@ -913,12 +924,14 @@ static Bool R600TextureSetup(PicturePtr pPict, PixmapPtr pPix,
 	pix_b = SQ_SEL_X; /* B */
 	pix_a = SQ_SEL_W; /* A */
 	break;
+    case PICT_a2b10g10r10:
     case PICT_a8b8g8r8:
 	pix_r = SQ_SEL_X; /* R */
 	pix_g = SQ_SEL_Y; /* G */
 	pix_b = SQ_SEL_Z; /* B */
 	pix_a = SQ_SEL_W; /* A */
 	break;
+    case PICT_x2b10g10r10:
     case PICT_x8b8g8r8:
 	pix_r = SQ_SEL_X; /* R */
 	pix_g = SQ_SEL_Y; /* G */
@@ -937,6 +950,7 @@ static Bool R600TextureSetup(PicturePtr pPict, PixmapPtr pPix,
 	pix_b = SQ_SEL_W; /* B */
 	pix_a = SQ_SEL_1; /* A */
 	break;
+    case PICT_x2r10g10b10:
     case PICT_x1r5g5b5:
     case PICT_x8r8g8b8:
     case PICT_r5g6b5:
@@ -1464,6 +1478,8 @@ static Bool R600PrepareComposite(int op, PicturePtr pSrcPicture,
     cb_conf.surface = accel_state->dst_obj.surface;
 
     switch (pDstPicture->format) {
+    case PICT_a2r10g10b10:
+    case PICT_x2r10g10b10:
     case PICT_a8r8g8b8:
     case PICT_x8r8g8b8:
     case PICT_a1r5g5b5:

src/r600_exa.c static Bool R600PrepareComposite(int op, PicturePtr pSrcPicture, · line 1494

Quoted 8 lines
src/r600_exa.c +2 -0
@@ -1471,6 +1487,8 @@ static Bool R600PrepareComposite(int op, PicturePtr pSrcPicture,
     default:
 	cb_conf.comp_swap = 1; /* ARGB */
 	break;
+    case PICT_a2b10g10r10:
+    case PICT_x2b10g10r10:
     case PICT_a8b8g8r8:
     case PICT_x8b8g8r8:
 	cb_conf.comp_swap = 0; /* ABGR */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#12 lore raw

PATCH 3/3 Support exa screen color depth 30 on Linux 3.16 and later.

In reply to a message not in the archive

Linux 3.16's radeon-kms introduced 10 bpc fb support. Currently, as of X-Server 1.19, this works with exa accel, but not yet when using glamor acceleration.

---
 man/radeon.man   |  3 ++-
 src/radeon_kms.c | 17 +++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)
man/radeon.man +2 -1
index f4441c4..d888ac0 100644
@@ -18,7 +18,8 @@ following features:
 .PD 0
 .TP 2
 \(bu
-Full support for 8-, 15-, 16- and 24-bit pixel depths;
+Full support for 8-, 15-, 16- and 24-bit pixel depths, and for 30-bit depth on Linux 3.16
+and later with exa acceleration;
 .TP
 \(bu
 RandR 1.2 and RandR 1.3 support;
src/radeon_kms.c +17 -0
index a9300d4..296bc6c 100644
@@ -1248,6 +1248,7 @@ static Bool RADEONPreInitVisual(ScrnInfoPtr pScrn)
     case 15:
     case 16:
     case 24:
+    case 30:
 	break;
 
     default:
@@ -1763,6 +1764,22 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
 
     if (!RADEONPreInitAccel_KMS(pScrn))              goto fail;
 
+    /* Depth 30 only supported since Linux 3.16 / kms driver minor version 39 */
+    if ((pScrn->depth == 30) && (info->dri2.pKernelDRMVersion->version_minor < 39)) {
+	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		   "Given depth (%d) is not supported. Kernel too old. Needs Linux 3.16+\n",
+		   pScrn->depth);
+	goto fail;
+    }
+
+    /* Depth 30 not yet supported under glamor. */
+    if ((pScrn->depth == 30) && info->use_glamor) {
+	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		   "Given depth (%d) is not supported under glamor accel. Select exa.\n",
+		   pScrn->depth);
+	goto fail;
+    }
+
     radeon_drm_queue_init();
 
     info->allowColorTiling2D = FALSE;
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20171218223645.25142-4-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#14 lore raw

Re: [PATCH 3/3] Support exa screen color depth 30 on Linux 3.16 and later.

Quoted 15 lines · Mario Kleiner

Linux 3.16's radeon-kms introduced 10 bpc fb support. Currently, as of X-Server 1.19, this works with exa accel, but not yet when using glamor acceleration.

---
 man/radeon.man   |  3 ++-
 src/radeon_kms.c | 17 +++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)
man/radeon.man +0 -0
index f4441c4..d888ac0 100644

man/radeon.man following features: · line 22

Quoted 6 lines
man/radeon.man +2 -1
@@ -18,7 +18,8 @@ following features:
 .PD 0
 .TP 2
 \(bu
-Full support for 8-, 15-, 16- and 24-bit pixel depths;
+Full support for 8-, 15-, 16- and 24-bit pixel depths, and for 30-bit depth on Linux 3.16
+and later with exa acceleration;

"EXA" (acronyms should be spelled with capital letters)

Quoted 4 lines
man/radeon.man +0 -0
@@ -1763,6 +1764,22 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
 
     if (!RADEONPreInitAccel_KMS(pScrn))              goto fail;
 

man/radeon.man Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags) · line 1776

Quoted 10 lines
man/radeon.man +10 -0
+    /* Depth 30 only supported since Linux 3.16 / kms driver minor version 39 */
+    if ((pScrn->depth == 30) && (info->dri2.pKernelDRMVersion->version_minor < 39)) {
+	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		   "Given depth (%d) is not supported. Kernel too old. Needs Linux 3.16+\n",
+		   pScrn->depth);
+	goto fail;
+    }
+
+    /* Depth 30 not yet supported under glamor. */
+    if ((pScrn->depth == 30) && info->use_glamor) {

There's no need for the nested parentheses in the tests.

man/radeon.man Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags) · line 1781

Quoted 5 lines
man/radeon.man +5 -0
+	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		   "Given depth (%d) is not supported under glamor accel. Select exa.\n",
+		   pScrn->depth);
+	goto fail;
+    }

I'd check for glamor first, so that users with GCN cards don't upgrade their kernel just to find out that it doesn't work with glamor anyway.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#15 lore raw
In reply to a message not in the archive
Quoted 11 lines · Mario Kleiner

2/3 is actually Fredrik Hoeglunds work, which he sent out many years ago to the mailing list. I've tested it without problems on HD 5770 for the evergreen exa path, and on some HD 4000 series (rv630 iirc) for the r600 exa path, and it seems to work nicely.

It also has a r-b by me as in "looks good to me", but i'm not familiar enough with exa to really judge if it is complete or if something for some more unusual case might be missing.

I guess it also might need a signed off by Fredrik?

Yes, that would be good.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx