[RFC][PATCH 1/2] libkms: YUYV support

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

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

---
 libkms/intel.c  |    6 +++++-
 libkms/libkms.h |    2 ++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/libkms/intel.c b/libkms/intel.c
index 8b8249b..8aeb6ae 100644
--- a/libkms/intel.c
+++ b/libkms/intel.c
@@ -52,7 +52,7 @@ intel_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
 {
 	switch (key) {
 	case KMS_BO_TYPE:
-		*out = KMS_BO_TYPE_SCANOUT_X8R8G8B8 | KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8;
+		*out = KMS_BO_TYPE_SCANOUT_X8R8G8B8 | KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8 | KMS_BO_TYPE_SCANOUT_YUYV;
 		break;
 	default:
 		return -EINVAL;
@@ -100,6 +100,10 @@ intel_bo_create(struct kms_driver *kms,
 		pitch = width * 4;
 		pitch = (pitch + 512 - 1) & ~(512 - 1);
 		size = pitch * ((height + 4 - 1) & ~(4 - 1));
+	} else if (type == KMS_BO_TYPE_SCANOUT_YUYV) {
+		pitch = width * 2;
+		pitch = (pitch + 64 - 1) & ~(64 - 1);
+		size = pitch * height;
 	} else {
 		return -EINVAL;
 	}
diff --git a/libkms/libkms.h b/libkms/libkms.h
index 4664442..8cf3489 100644
--- a/libkms/libkms.h
+++ b/libkms/libkms.h
@@ -59,6 +59,8 @@ enum kms_bo_type
 #define KMS_BO_TYPE_SCANOUT_X8R8G8B8 KMS_BO_TYPE_SCANOUT_X8R8G8B8
 	KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8 =  (1 << 1),
 #define KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8 KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8
+	KMS_BO_TYPE_SCANOUT_YUYV = (1 << 2),
+#define KMS_BO_TYPE_SCANOUT_YUYV KMS_BO_TYPE_SCANOUT_YUYV
 };
 
 int kms_create(int fd, struct kms_driver **out);
-- 
1.7.3.4

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux