diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-09-13 14:42:33 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-09-13 14:42:33 +0100 |
commit | 84a7c11a8134dfd040d2f90bb1e0670aa2c89962 (patch) | |
tree | 1f03bd9182da5d88451705d1a5f031e35ef8f7e4 | |
parent | a0d533ea8d098dbbd86af166de9c07ce67050c35 (diff) |
sna/video: Stop advertising unsupported Xv attributes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_video_textured.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/sna/sna_video_textured.c b/src/sna/sna_video_textured.c index 0e7a2914..3b59cf23 100644 --- a/src/sna/sna_video_textured.c +++ b/src/sna/sna_video_textured.c @@ -66,8 +66,9 @@ static XF86VideoFormatRec Formats[NUM_FORMATS] = { {15, TrueColor}, {16, TrueColor}, {24, TrueColor} }; -#define NUM_TEXTURED_ATTRIBUTES 3 -static XF86AttributeRec TexturedAttributes[NUM_TEXTURED_ATTRIBUTES] = { +//#define NUM_TEXTURED_ATTRIBUTES 3 +#define NUM_TEXTURED_ATTRIBUTES 0 +static XF86AttributeRec TexturedAttributes[] = { {XvSettable | XvGettable, -128, 127, "XV_BRIGHTNESS"}, {XvSettable | XvGettable, 0, 255, "XV_CONTRAST"}, {XvSettable | XvGettable, -1, 1, "XV_SYNC_TO_VBLANK"}, @@ -380,6 +381,7 @@ XF86VideoAdaptorPtr sna_video_textured_setup(struct sna *sna, adaptor = calloc(1, sizeof(XF86VideoAdaptorRec)); video = calloc(nports, sizeof(struct sna_video)); devUnions = calloc(nports, sizeof(DevUnion)); +#if NUM_TEXTURED_ATTRIBUTES attrs = calloc(NUM_TEXTURED_ATTRIBUTES, sizeof(XF86AttributeRec)); if (adaptor == NULL || video == NULL || @@ -391,6 +393,15 @@ XF86VideoAdaptorPtr sna_video_textured_setup(struct sna *sna, free(attrs); return NULL; } +#else + if (adaptor == NULL || video == NULL || devUnions == NULL) { + free(adaptor); + free(video); + free(devUnions); + return NULL; + } + attrs = NULL; +#endif adaptor->type = XvWindowMask | XvInputMask | XvImageMask; adaptor->flags = 0; |