[RFC][PATCH 1/2] libkms: YUYV support
ville.syrjala at linux.intel.com
ville.syrjala at linux.intel.com
Fri May 25 01:07:27 PDT 2012
From: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
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
More information about the dri-devel
mailing list