From 44a0e0a099eeeb6501359f08449dcaa5e9899398 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sat, 23 Jan 2010 01:41:49 +0000 Subject: libkms: Rework interface to not duplicate fields from kms and make formats explicit List of changes: Fixes the cursor size to 64x64, you still need ti supply width and height Explicitly make the cursor format A8R8G8B8 Explicitly make the scanout format X8R8G8B8 --- libkms/api.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'libkms/api.c') diff --git a/libkms/api.c b/libkms/api.c index 7696918a..4a05f3d7 100644 --- a/libkms/api.c +++ b/libkms/api.c @@ -40,14 +40,7 @@ int kms_create(int fd, struct kms_driver **out) int kms_get_prop(struct kms_driver *kms, unsigned key, unsigned *out) { switch (key) { - case KMS_MAX_SCANOUT_WIDTH: - case KMS_MAX_SCANOUT_HEIGHT: - case KMS_MIN_SCANOUT_WIDTH: - case KMS_MIN_SCANOUT_HEIGHT: - case KMS_MAX_CURSOR_WIDTH: - case KMS_MAX_CURSOR_HEIGHT: - case KMS_MIN_CURSOR_WIDTH: - case KMS_MIN_CURSOR_HEIGHT: + case KMS_BO_TYPE: break; default: return -EINVAL; @@ -69,7 +62,7 @@ int kms_bo_create(struct kms_driver *kms, const unsigned *attr, struct kms_bo ** { unsigned width = 0; unsigned height = 0; - enum kms_bo_type type = KMS_BO_TYPE_SCANOUT; + enum kms_bo_type type = KMS_BO_TYPE_SCANOUT_X8R8G8B8; int i; for (i = 0; attr[i];) { @@ -94,6 +87,12 @@ int kms_bo_create(struct kms_driver *kms, const unsigned *attr, struct kms_bo ** if (width == 0 || height == 0) return -EINVAL; + /* XXX sanity check type */ + + if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8 && + (width != 64 || height != 64)) + return -EINVAL; + return kms->bo_create(kms, width, height, type, attr, out); } -- cgit v1.2.3