xf86-video-ati: Branch 'master' - 4 commits
Michel Dänzer
daenzer at kemper.freedesktop.org
Wed Jan 24 11:33:46 UTC 2018
man/radeon.man | 3 ++-
src/drmmode_display.c | 26 ++++++++++++++++++++------
src/evergreen_exa.c | 18 ++++++++++++++++++
src/r600_exa.c | 18 ++++++++++++++++++
src/radeon.h | 2 ++
src/radeon_kms.c | 17 +++++++++++++++++
6 files changed, 77 insertions(+), 7 deletions(-)
New commits:
commit 574bfab4bf1fcd95163a8f33cea2889189429d30
Author: Mario Kleiner <mario.kleiner.de at gmail.com>
Date: Mon Jan 22 03:14:37 2018 +0100
Support exa screen color depth 30 on Linux 3.16 and later. (v2)
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 at gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
diff --git a/man/radeon.man b/man/radeon.man
index f4441c4b..889355bb 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 c1f885eb..bac98cb6 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -1250,6 +1250,7 @@ static Bool RADEONPreInitVisual(ScrnInfoPtr pScrn)
case 15:
case 16:
case 24:
+ case 30:
break;
default:
@@ -1765,6 +1766,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;
commit ee7e6c25989e4faf1adfa4754b7edd5a9a4722ce
Author: Fredrik Höglund <fredrik at kde.org>
Date: Mon Jan 22 03:14:36 2018 +0100
exa: Accelerate ARGB2101010 pictures
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 at kde.org>
Reviewed-and-Tested-by: Mario Kleiner <mario.kleiner.de at gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
diff --git a/src/evergreen_exa.c b/src/evergreen_exa.c
index 90c9b6d9..85848133 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:
@@ -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 */
diff --git a/src/r600_exa.c b/src/r600_exa.c
index 22d4b316..c69b8fce 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:
@@ -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 */
commit 1f1d4b1fa7d4b22dd8553f7e71251bf17ca7a7b1
Author: Mario Kleiner <mario.kleiner.de at gmail.com>
Date: Mon Jan 22 03:14:35 2018 +0100
Skip xf86HandleColormaps() at color depth 30. (v2)
The hardware gamma luts get bypassed at color
depth 30 anyway, so skip their setup.
v2: Also don't hook up drmmode_crtc_gamma_set()
to .gamma_set for a screen with depth 30,
so the server can spare itself the effort of
updating and setting unused cluts.
Suggested by Michel.
Signed-off-by: Mario Kleiner <mario.kleiner.de at gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index b1c874c7..21cc3c90 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2544,6 +2544,12 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
info->drmmode_crtc_funcs.shadow_destroy = NULL;
}
+ /* Hw gamma lut's are currently bypassed by the hw at color depth 30,
+ * so spare the server the effort to compute and update the cluts.
+ */
+ if (pScrn->depth == 30)
+ info->drmmode_crtc_funcs.gamma_set = NULL;
+
drmmode->count_crtcs = mode_res->count_crtcs;
xf86CrtcSetSizeRange(pScrn, 320, 200, mode_res->max_width, mode_res->max_height);
@@ -2787,8 +2793,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 at suse.de) */
commit 21f6753462464acfd3c452393328c977a375ce26
Author: Mario Kleiner <mario.kleiner.de at gmail.com>
Date: Mon Jan 22 03:14:34 2018 +0100
Define per x-screen individual drmmode_crtc_funcs
This allows to en-/disable some functions depending on individual screen
settings.
Prep work for more efficient depth 30 support.
Suggested-by: Michel Dänzer <michel.daenzer at amd.com>
Signed-off-by: Mario Kleiner <mario.kleiner.de at gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index f55677f6..b1c874c7 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1395,8 +1395,9 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res
xf86CrtcPtr crtc;
drmmode_crtc_private_ptr drmmode_crtc;
RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
+ RADEONInfoPtr info = RADEONPTR(pScrn);
- crtc = xf86CrtcCreate(pScrn, &drmmode_crtc_funcs);
+ crtc = xf86CrtcCreate(pScrn, &info->drmmode_crtc_funcs);
if (crtc == NULL)
return 0;
@@ -2531,11 +2532,16 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"%d crtcs needed for screen.\n", crtcs_needed);
+ /* Need per-screen drmmode_crtc_funcs, based on our global template,
+ * so we can disable some functions, depending on screen settings.
+ */
+ info->drmmode_crtc_funcs = drmmode_crtc_funcs;
+
if (info->r600_shadow_fb) {
/* Rotation requires hardware acceleration */
- drmmode_crtc_funcs.shadow_allocate = NULL;
- drmmode_crtc_funcs.shadow_create = NULL;
- drmmode_crtc_funcs.shadow_destroy = NULL;
+ info->drmmode_crtc_funcs.shadow_allocate = NULL;
+ info->drmmode_crtc_funcs.shadow_create = NULL;
+ info->drmmode_crtc_funcs.shadow_destroy = NULL;
}
drmmode->count_crtcs = mode_res->count_crtcs;
diff --git a/src/radeon.h b/src/radeon.h
index 9658e029..5b717364 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -635,6 +635,8 @@ typedef struct {
SetSharedPixmapBackingProcPtr SavedSetSharedPixmapBacking;
} glamor;
#endif /* USE_GLAMOR */
+
+ xf86CrtcFuncsRec drmmode_crtc_funcs;
} RADEONInfoRec, *RADEONInfoPtr;
/* radeon_accel.c */
More information about the xorg-commit
mailing list