aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Bornecrantz2010-01-22 19:41:49 -0600
committerJakob Bornecrantz2010-01-28 10:32:54 -0600
commit44a0e0a099eeeb6501359f08449dcaa5e9899398 (patch)
tree2bf83614ef44ed81cb16060e7601275c306969c1 /libkms/api.c
parentf2730574f2d204eee62d6f37aa56567bd2d94a26 (diff)
downloadexternal-libdrm-44a0e0a099eeeb6501359f08449dcaa5e9899398.tar.gz
external-libdrm-44a0e0a099eeeb6501359f08449dcaa5e9899398.tar.xz
external-libdrm-44a0e0a099eeeb6501359f08449dcaa5e9899398.zip
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
Diffstat (limited to 'libkms/api.c')
-rw-r--r--libkms/api.c17
1 files changed, 8 insertions, 9 deletions
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)
40int kms_get_prop(struct kms_driver *kms, unsigned key, unsigned *out) 40int kms_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
41{ 41{
42 switch (key) { 42 switch (key) {
43 case KMS_MAX_SCANOUT_WIDTH: 43 case KMS_BO_TYPE:
44 case KMS_MAX_SCANOUT_HEIGHT:
45 case KMS_MIN_SCANOUT_WIDTH:
46 case KMS_MIN_SCANOUT_HEIGHT:
47 case KMS_MAX_CURSOR_WIDTH:
48 case KMS_MAX_CURSOR_HEIGHT:
49 case KMS_MIN_CURSOR_WIDTH:
50 case KMS_MIN_CURSOR_HEIGHT:
51 break; 44 break;
52 default: 45 default:
53 return -EINVAL; 46 return -EINVAL;
@@ -69,7 +62,7 @@ int kms_bo_create(struct kms_driver *kms, const unsigned *attr, struct kms_bo **
69{ 62{
70 unsigned width = 0; 63 unsigned width = 0;
71 unsigned height = 0; 64 unsigned height = 0;
72 enum kms_bo_type type = KMS_BO_TYPE_SCANOUT; 65 enum kms_bo_type type = KMS_BO_TYPE_SCANOUT_X8R8G8B8;
73 int i; 66 int i;
74 67
75 for (i = 0; attr[i];) { 68 for (i = 0; attr[i];) {
@@ -94,6 +87,12 @@ int kms_bo_create(struct kms_driver *kms, const unsigned *attr, struct kms_bo **
94 if (width == 0 || height == 0) 87 if (width == 0 || height == 0)
95 return -EINVAL; 88 return -EINVAL;
96 89
90 /* XXX sanity check type */
91
92 if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8 &&
93 (width != 64 || height != 64))
94 return -EINVAL;
95
97 return kms->bo_create(kms, width, height, type, attr, out); 96 return kms->bo_create(kms, width, height, type, attr, out);
98} 97}
99 98