* Depth 30 enablement for ati-ddx + exa. Rev 2
@ 2017-12-23 6:07 Mario Kleiner
[not found] ` <20171223060737.12271-1-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Mario Kleiner @ 2017-12-23 6:07 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w
Ok, applied Michel's and Fredrik's suggestions,
tacked Fredrik's signed off to his patch, retested
on HD-5770.
-mario
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/3] Skip xf86HandleColormaps() at color depth 30.
[not found] ` <20171223060737.12271-1-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-12-23 6:07 ` Mario Kleiner
[not found] ` <20171223060737.12271-2-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-23 6:07 ` [PATCH 2/3] exa: Accelerate ARGB2101010 pictures (v2) Mario Kleiner
2017-12-23 6:07 ` [PATCH 3/3] Support exa screen color depth 30 on Linux 3.16 and later. (v2) Mario Kleiner
2 siblings, 1 reply; 9+ messages in thread
From: Mario Kleiner @ 2017-12-23 6:07 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w
The hardware gamma luts get bypassed at color
depth 30 anyway, so skip their setup.
Also skip drmmode_crtc_gamma_set() for a screen
with depth 30.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
---
src/drmmode_display.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 7ad3235..e5f9dbe 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1275,6 +1275,10 @@ drmmode_crtc_gamma_set(xf86CrtcPtr crtc, uint16_t *red, uint16_t *green,
RADEONInfoPtr info = RADEONPTR(scrn);
int i;
+ /* Hw gamma lut's are bypassed at color depth 30 */
+ if (scrn->depth == 30)
+ return;
+
drmmode_crtc_gamma_do_set(crtc, red, green, blue, size);
/* Compute index of this CRTC into xf86_config->crtc */
@@ -2730,8 +2734,10 @@ 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,
+
+ /* All radeons support 10 bit CLUTs. They get bypassed at depth 30. */
+ if (pScrn->depth != 30 &&
+ !xf86HandleColormaps(pScreen, 256, 10,
NULL, NULL,
CMAP_PALETTED_TRUECOLOR
#if 0 /* This option messes up text mode! (eich@suse.de) */
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/3] exa: Accelerate ARGB2101010 pictures (v2)
[not found] ` <20171223060737.12271-1-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-23 6:07 ` [PATCH 1/3] Skip xf86HandleColormaps() at color depth 30 Mario Kleiner
@ 2017-12-23 6:07 ` Mario Kleiner
[not found] ` <20171223060737.12271-3-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-23 6:07 ` [PATCH 3/3] Support exa screen color depth 30 on Linux 3.16 and later. (v2) Mario Kleiner
2 siblings, 1 reply; 9+ messages in thread
From: Mario Kleiner @ 2017-12-23 6:07 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w, Fredrik Höglund
From: Fredrik Höglund <fredrik@kde.org>
Tested by Mario on a Radeon HD 4000 series for the r600
exa path, and on Radeon HD 5770 for the evergreen exa
path.
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-and-Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
v2: Add format handling in XXXSetSolidConsts() as well,
as suggested by Fredrik.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
---
src/evergreen_exa.c | 22 ++++++++++++++++++++++
src/r600_exa.c | 22 ++++++++++++++++++++++
2 files changed, 44 insertions(+)
diff --git a/src/evergreen_exa.c b/src/evergreen_exa.c
index 90c9b6d..eed2ae5 100644
--- a/src/evergreen_exa.c
+++ b/src/evergreen_exa.c
@@ -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:
@@ -1153,18 +1167,21 @@ static void EVERGREENSetSolidConsts(ScrnInfoPtr pScrn, float *buf, int format, u
switch (format) {
case PICT_a1r5g5b5:
case PICT_a8r8g8b8:
+ case PICT_a2r10g10b10:
pix_r = zf; /* R */
pix_g = yf; /* G */
pix_b = xf; /* B */
pix_a = wf; /* A */
break;
case PICT_a8b8g8r8:
+ case PICT_a2b10g10r10:
pix_r = xf; /* R */
pix_g = yf; /* G */
pix_b = zf; /* B */
pix_a = wf; /* A */
break;
case PICT_x8b8g8r8:
+ case PICT_x2b10g10r10:
pix_r = xf; /* R */
pix_g = yf; /* G */
pix_b = zf; /* B */
@@ -1184,6 +1201,7 @@ static void EVERGREENSetSolidConsts(ScrnInfoPtr pScrn, float *buf, int format, u
break;
case PICT_x1r5g5b5:
case PICT_x8r8g8b8:
+ case PICT_x2r10g10b10:
case PICT_r5g6b5:
pix_r = zf; /* R */
pix_g = yf; /* G */
@@ -1425,6 +1443,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 +1452,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 */
diff --git a/src/r600_exa.c b/src/r600_exa.c
index 22d4b31..6572951 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -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:
@@ -1197,18 +1211,21 @@ static void R600SetSolidConsts(ScrnInfoPtr pScrn, float *buf, int format, uint32
switch (format) {
case PICT_a1r5g5b5:
case PICT_a8r8g8b8:
+ case PICT_a2r10g10b10:
pix_r = zf; /* R */
pix_g = yf; /* G */
pix_b = xf; /* B */
pix_a = wf; /* A */
break;
case PICT_a8b8g8r8:
+ case PICT_a2b10g10r10:
pix_r = xf; /* R */
pix_g = yf; /* G */
pix_b = zf; /* B */
pix_a = wf; /* A */
break;
case PICT_x8b8g8r8:
+ case PICT_x2b10g10r10:
pix_r = xf; /* R */
pix_g = yf; /* G */
pix_b = zf; /* B */
@@ -1228,6 +1245,7 @@ static void R600SetSolidConsts(ScrnInfoPtr pScrn, float *buf, int format, uint32
break;
case PICT_x1r5g5b5:
case PICT_x8r8g8b8:
+ case PICT_x2r10g10b10:
case PICT_r5g6b5:
pix_r = zf; /* R */
pix_g = yf; /* G */
@@ -1464,6 +1482,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 +1491,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 */
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/3] Support exa screen color depth 30 on Linux 3.16 and later. (v2)
[not found] ` <20171223060737.12271-1-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-23 6:07 ` [PATCH 1/3] Skip xf86HandleColormaps() at color depth 30 Mario Kleiner
2017-12-23 6:07 ` [PATCH 2/3] exa: Accelerate ARGB2101010 pictures (v2) Mario Kleiner
@ 2017-12-23 6:07 ` Mario Kleiner
[not found] ` <20171223060737.12271-4-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2 siblings, 1 reply; 9+ messages in thread
From: Mario Kleiner @ 2017-12-23 6:07 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w
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.
v2: Style fixes, check for glamor first, as suggested
by Michel.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
---
man/radeon.man | 3 ++-
src/radeon_kms.c | 17 +++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/man/radeon.man b/man/radeon.man
index f4441c4..889355b 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -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;
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index a9300d4..07a490a 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -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 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;
+ }
+
+ /* 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;
+ }
+
radeon_drm_queue_init();
info->allowColorTiling2D = FALSE;
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] Skip xf86HandleColormaps() at color depth 30.
[not found] ` <20171223060737.12271-2-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-12-27 11:56 ` Michel Dänzer
[not found] ` <f15625f4-c8fa-38b2-6a35-05bdbcaa9a1e-otUistvHUpPR7s880joybQ@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Michel Dänzer @ 2017-12-27 11:56 UTC (permalink / raw)
To: Mario Kleiner; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 2017-12-23 07:07 AM, Mario Kleiner wrote:
> The hardware gamma luts get bypassed at color
> depth 30 anyway, so skip their setup.
>
> Also skip drmmode_crtc_gamma_set() for a screen
> with depth 30.
>
> Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
> ---
> src/drmmode_display.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 7ad3235..e5f9dbe 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -1275,6 +1275,10 @@ drmmode_crtc_gamma_set(xf86CrtcPtr crtc, uint16_t *red, uint16_t *green,
> RADEONInfoPtr info = RADEONPTR(scrn);
> int i;
>
> + /* Hw gamma lut's are bypassed at color depth 30 */
> + if (scrn->depth == 30)
> + return;
It's better to set xf86CrtcFuncsRec::gamma_set = NULL in this case, to
prevent the X server from wasting work calculating gamma tables that
will never be used.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] exa: Accelerate ARGB2101010 pictures (v2)
[not found] ` <20171223060737.12271-3-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-12-27 14:57 ` Michel Dänzer
0 siblings, 0 replies; 9+ messages in thread
From: Michel Dänzer @ 2017-12-27 14:57 UTC (permalink / raw)
To: Mario Kleiner
Cc: Fredrik Höglund, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 2017-12-23 07:07 AM, Mario Kleiner wrote:
> From: Fredrik Höglund <fredrik@kde.org>
>
> Tested by Mario on a Radeon HD 4000 series for the r600
> exa path, and on Radeon HD 5770 for the evergreen exa
> path.
>
> Signed-off-by: Fredrik Höglund <fredrik@kde.org>
> Reviewed-and-Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
>
> v2: Add format handling in XXXSetSolidConsts() as well,
> as suggested by Fredrik.
As Fredrik mentioned, this isn't necessary, because solid pictures
currently always have format a8r8g8b8 (see CreateSolidPicture =>
createSourcePicture in xserver/render/picture.c).
I'll just take v1 of this patch with Fredrik's Signed-off-by (thanks).
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] Support exa screen color depth 30 on Linux 3.16 and later. (v2)
[not found] ` <20171223060737.12271-4-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-12-27 15:04 ` Michel Dänzer
0 siblings, 0 replies; 9+ messages in thread
From: Michel Dänzer @ 2017-12-27 15:04 UTC (permalink / raw)
To: Mario Kleiner; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 2017-12-23 07:07 AM, Mario Kleiner wrote:
> 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.
>
> v2: Style fixes, check for glamor first, as suggested
> by Michel.
>
> Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] Skip xf86HandleColormaps() at color depth 30.
[not found] ` <f15625f4-c8fa-38b2-6a35-05bdbcaa9a1e-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2017-12-27 20:49 ` Mario Kleiner
[not found] ` <bae0a477-fa06-5ddd-6202-ebb29576e432-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Mario Kleiner @ 2017-12-27 20:49 UTC (permalink / raw)
To: Michel Dänzer; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 12/27/2017 12:56 PM, Michel Dänzer wrote:
> On 2017-12-23 07:07 AM, Mario Kleiner wrote:
>> The hardware gamma luts get bypassed at color
>> depth 30 anyway, so skip their setup.
>>
>> Also skip drmmode_crtc_gamma_set() for a screen
>> with depth 30.
>>
>> Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
>> ---
>> src/drmmode_display.c | 10 ++++++++--
>> 1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
>> index 7ad3235..e5f9dbe 100644
>> --- a/src/drmmode_display.c
>> +++ b/src/drmmode_display.c
>> @@ -1275,6 +1275,10 @@ drmmode_crtc_gamma_set(xf86CrtcPtr crtc, uint16_t *red, uint16_t *green,
>> RADEONInfoPtr info = RADEONPTR(scrn);
>> int i;
>>
>> + /* Hw gamma lut's are bypassed at color depth 30 */
>> + if (scrn->depth == 30)
>> + return;
>
> It's better to set xf86CrtcFuncsRec::gamma_set = NULL in this case, to
> prevent the X server from wasting work calculating gamma tables that
> will never be used.
I looked at that, but as far as i understand, wouldn't NULL'ing that
entry affect all active X-Screens, not only the depth 30 ones, as each
screen only references the same shared static struct with function
pointers in the driver? At least for the use cases of many of "my"
users, two separate x-screens, with ZaphodHeads and different color
depth wouldn't be an unexpected setup.
Or maybe i just overlook something (not with my code/test-machine atm.)?
-mario
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] Skip xf86HandleColormaps() at color depth 30.
[not found] ` <bae0a477-fa06-5ddd-6202-ebb29576e432-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-12-28 14:47 ` Michel Dänzer
0 siblings, 0 replies; 9+ messages in thread
From: Michel Dänzer @ 2017-12-28 14:47 UTC (permalink / raw)
To: Mario Kleiner; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 2017-12-27 09:49 PM, Mario Kleiner wrote:
> On 12/27/2017 12:56 PM, Michel Dänzer wrote:
>> On 2017-12-23 07:07 AM, Mario Kleiner wrote:
>>> The hardware gamma luts get bypassed at color
>>> depth 30 anyway, so skip their setup.
>>>
>>> Also skip drmmode_crtc_gamma_set() for a screen
>>> with depth 30.
>>>
>>> Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
>>> ---
>>> src/drmmode_display.c | 10 ++++++++--
>>> 1 file changed, 8 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
>>> index 7ad3235..e5f9dbe 100644
>>> --- a/src/drmmode_display.c
>>> +++ b/src/drmmode_display.c
>>> @@ -1275,6 +1275,10 @@ drmmode_crtc_gamma_set(xf86CrtcPtr crtc,
>>> uint16_t *red, uint16_t *green,
>>> RADEONInfoPtr info = RADEONPTR(scrn);
>>> int i;
>>> + /* Hw gamma lut's are bypassed at color depth 30 */
>>> + if (scrn->depth == 30)
>>> + return;
>>
>> It's better to set xf86CrtcFuncsRec::gamma_set = NULL in this case, to
>> prevent the X server from wasting work calculating gamma tables that
>> will never be used.
>
> I looked at that, but as far as i understand, wouldn't NULL'ing that
> entry affect all active X-Screens, not only the depth 30 ones, as each
> screen only references the same shared static struct with function
> pointers in the driver?
That's right.
> At least for the use cases of many of "my" users, two separate
> x-screens, with ZaphodHeads and different color depth wouldn't be an
> unexpected setup.
Then we'll need to use a different xf86CrtcFuncsRec instance per screen
instead of a single one for all screens.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-12-28 14:47 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-23 6:07 Depth 30 enablement for ati-ddx + exa. Rev 2 Mario Kleiner
[not found] ` <20171223060737.12271-1-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-23 6:07 ` [PATCH 1/3] Skip xf86HandleColormaps() at color depth 30 Mario Kleiner
[not found] ` <20171223060737.12271-2-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-27 11:56 ` Michel Dänzer
[not found] ` <f15625f4-c8fa-38b2-6a35-05bdbcaa9a1e-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-12-27 20:49 ` Mario Kleiner
[not found] ` <bae0a477-fa06-5ddd-6202-ebb29576e432-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-28 14:47 ` Michel Dänzer
2017-12-23 6:07 ` [PATCH 2/3] exa: Accelerate ARGB2101010 pictures (v2) Mario Kleiner
[not found] ` <20171223060737.12271-3-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-27 14:57 ` Michel Dänzer
2017-12-23 6:07 ` [PATCH 3/3] Support exa screen color depth 30 on Linux 3.16 and later. (v2) Mario Kleiner
[not found] ` <20171223060737.12271-4-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-27 15:04 ` Michel Dänzer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox