[PATCH xf86-video-amdgpu 3/4] Add 30bit RGB color format support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Hawking Zhang <Hawking.Zhang@xxxxxxx>

Signed-off-by: Hawking Zhang <Hawking.Zhang at amd.com>

[ Michel Dänzer:
* Require Xorg >= 1.19.99.1 for depth 30, otherwise it can't work with glamor
* Update manpage, per radeon commit
  574bfab4bf1fcd95163a8f33cea2889189429d30 ]

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 man/amdgpu.man         | 2 +-
 src/amdgpu_bo_helper.c | 2 ++
 src/amdgpu_dri2.c      | 1 +
 src/amdgpu_kms.c       | 8 ++++++++
 4 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/man/amdgpu.man b/man/amdgpu.man
index 0d9dd93d9..390f4837b 100644
--- a/man/amdgpu.man
+++ b/man/amdgpu.man
@@ -18,7 +18,7 @@ following features:
 .PD 0
 .TP 2
 \(bu
-Support for 24-bit pixel depth;
+Support for 24- and 30-bit pixel depths;
 .TP
 \(bu
 RandR support up to version 1.4;
diff --git a/src/amdgpu_bo_helper.c b/src/amdgpu_bo_helper.c
index ba2212228..34880ff12 100644
--- a/src/amdgpu_bo_helper.c
+++ b/src/amdgpu_bo_helper.c
@@ -42,6 +42,8 @@ amdgpu_get_gbm_format(int depth, int bitsPerPixel)
 		return GBM_FORMAT_RGB565;
 	case 32:
 		return GBM_FORMAT_ARGB8888;
+	case 30:
+		return GBM_FORMAT_XRGB2101010;
 	case 24:
 		if (bitsPerPixel == 32)
 			return GBM_FORMAT_XRGB8888;
diff --git a/src/amdgpu_dri2.c b/src/amdgpu_dri2.c
index 4ffa34676..4a0f8bf24 100644
--- a/src/amdgpu_dri2.c
+++ b/src/amdgpu_dri2.c
@@ -120,6 +120,7 @@ amdgpu_dri2_create_buffer2(ScreenPtr pScreen,
 			cpp = 2;
 			break;
 		case 24:
+		case 30:
 			cpp = 4;
 			break;
 		default:
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 49044f514..7dc9e22a9 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -1085,6 +1085,14 @@ static Bool AMDGPUPreInitVisual(ScrnInfoPtr pScrn)
 	case 24:
 		break;
 
+	case 30:
+		if (xorgGetVersion() < XORG_VERSION_NUMERIC(1,19,99,1,0)) {
+			xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+				   "Depth 30 requires Xorg >= 1.19.99.1\n");
+			return FALSE;
+		}
+		break;
+
 	default:
 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 			   "Given depth (%d) is not supported by %s driver\n",
-- 
2.16.1



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux