Lines Matching refs:video
49 /* Limits for the overlay/textured video source sizes. The documented hardware
50 * limits are 2048x2048 or better for overlay and both of our textured video
101 static bool sna_video_overlay_update_attrs(struct sna_video *video)
108 attrs.brightness = video->brightness;
109 attrs.contrast = video->contrast;
110 attrs.saturation = video->saturation;
111 attrs.color_key = video->color_key;
112 attrs.gamma0 = video->gamma0;
113 attrs.gamma1 = video->gamma1;
114 attrs.gamma2 = video->gamma2;
115 attrs.gamma3 = video->gamma3;
116 attrs.gamma4 = video->gamma4;
117 attrs.gamma5 = video->gamma5;
119 if (video->AlwaysOnTop)
122 return drmIoctl(video->sna->kgem.fd, DRM_IOCTL_I915_OVERLAY_ATTRS, &attrs) == 0;
127 struct sna_video *video = port->devPriv.ptr;
128 struct sna *sna = video->sna;
133 REGION_EMPTY(scrn->pScreen, &video->clip);
140 if (video->bo[0])
141 kgem_bo_destroy(&sna->kgem, video->bo[0]);
142 video->bo[0] = NULL;
144 sna_video_free_buffers(video);
152 struct sna_video *video = port->devPriv.ptr;
153 struct sna *sna = video->sna;
160 video->contrast, (int)value));
161 video->brightness = value;
166 video->contrast, (int)value));
167 video->contrast = value;
172 video->saturation, (int)value));
173 video->saturation = value;
179 video->desired_crtc = NULL;
181 video->desired_crtc = xf86_config->crtc[value];
184 video->AlwaysOnTop, !!value));
185 video->AlwaysOnTop = !!value;
187 video->gamma0 = value;
189 video->gamma1 = value;
191 video->gamma2 = value;
193 video->gamma3 = value;
195 video->gamma4 = value;
197 video->gamma5 = value;
199 video->color_key = value;
200 RegionEmpty(&video->clip);
214 if (!sna_video_overlay_update_attrs(video))
223 struct sna_video *video = port->devPriv.ptr;
224 struct sna *sna = video->sna;
227 *value = video->brightness;
229 *value = video->contrast;
231 *value = video->saturation;
236 if (xf86_config->crtc[c] == video->desired_crtc)
242 *value = video->AlwaysOnTop;
244 *value = video->gamma0;
246 *value = video->gamma1;
248 *value = video->gamma2;
250 *value = video->gamma3;
252 *value = video->gamma4;
254 *value = video->gamma5;
256 *value = video->color_key;
266 struct sna_video *video = port->devPriv.ptr;
267 struct sna *sna = video->sna;
347 struct sna_video *video,
443 if (video->bo[0] != frame->bo) {
444 if (video->bo[0])
445 kgem_bo_destroy(&sna->kgem, video->bo[0]);
446 video->bo[0] = kgem_bo_reference(frame->bo);
455 struct sna_video *video = port->devPriv.ptr;
456 struct sna *sna = video->sna;
483 DBG(("%s: always_on_top=%d\n", __FUNCTION__, video->AlwaysOnTop));
484 if (!video->AlwaysOnTop)
500 sna_video_frame_init(video, format->id, width, height, &frame);
502 if (!sna_video_clip_helper(video, &frame, &crtc, &dstBox,
512 sna_video_frame_set_rotation(video, &frame, crtc->rotation);
539 frame.bo = sna_video_buffer(video, &frame);
541 DBG(("%s: failed to allocate video bo\n", __FUNCTION__));
545 if (!sna_video_copy_data(video, &frame, buf)) {
546 DBG(("%s: failed to copy video data\n", __FUNCTION__));
553 (sna, video, &frame, crtc, &dstBox, src_w, src_h, drw_w, drw_h)) {
554 //xf86XVFillKeyHelperDrawable(draw, video->color_key, &clip);
555 if (!video->AlwaysOnTop && !RegionEqual(&video->clip, &clip) &&
559 video->color_key,
562 RegionCopy(&video->clip, &clip);
565 DBG(("%s: failed to show video frame\n", __FUNCTION__));
573 sna_video_buffer_fini(video);
579 * If the video isn't visible on any CRTC, turn it off
592 struct sna_video *video = port->devPriv.ptr;
594 struct sna *sna = video->sna;
618 sna_video_frame_init(video, format->id, *w, *h, &frame);
619 sna_video_frame_set_rotation(video, &frame, RR_Rotate_0);
702 struct sna_video *video;
717 video = calloc(1, sizeof(*video));
719 if (video == NULL || port == NULL) {
720 free(video);
773 port->devPriv.ptr = video;
775 video->sna = sna;
780 video->alignment = 512;
785 video->alignment = 256;
787 video->alignment = 64;
788 video->color_key = sna_video_overlay_color_key(sna);
789 video->brightness = -19; /* (255/219) * -16 */
790 video->contrast = 75; /* 255/219 * 64 */
791 video->saturation = 146; /* 128/112 * 128 */
792 video->desired_crtc = NULL;
793 video->gamma5 = 0xc0c0c0;
794 video->gamma4 = 0x808080;
795 video->gamma3 = 0x404040;
796 video->gamma2 = 0x202020;
797 video->gamma1 = 0x101010;
798 video->gamma0 = 0x080808;
799 RegionNull(&video->clip);
819 sna_video_overlay_update_attrs(video);