sna/video: Stop advertising unsupported Xv attributes

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-09-13 14:42:33 +01:00
parent a0d533ea8d
commit 84a7c11a81
1 changed files with 13 additions and 2 deletions

View File

@ -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;