Lines Matching refs:video

52 #define has_hw_scaling(sna, video) ((sna)->kgem.gen < 071 || \
92 struct sna_video *video = port->devPriv.ptr;
94 xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(video->sna->scrn);
97 for (i = 0; i < video->sna->mode.num_real_crtc; i++) {
102 assert(pipe < ARRAY_SIZE(video->bo));
103 if (video->bo[pipe] == NULL)
107 s.plane_id = sna_crtc_to_sprite(crtc, video->idx);
108 if (drmIoctl(video->sna->kgem.fd, LOCAL_IOCTL_MODE_SETPLANE, &s))
109 xf86DrvMsg(video->sna->scrn->scrnIndex, X_ERROR,
112 if (video->bo[pipe])
113 kgem_bo_destroy(&video->sna->kgem, video->bo[pipe]);
114 video->bo[pipe] = NULL;
124 struct sna_video *video = port->devPriv.ptr;
127 video->color_key_changed = ~0;
128 video->color_key = value;
129 RegionEmpty(&video->clip);
132 video->colorspace_changed = ~0;
133 video->colorspace = value;
137 video->SyncToVblank, !!value));
138 video->SyncToVblank = !!value;
141 video->AlwaysOnTop, !!value));
142 video->color_key_changed = ~0;
143 video->AlwaysOnTop = !!value;
152 struct sna_video *video = port->devPriv.ptr;
155 *value = video->color_key;
157 *value = video->colorspace;
159 *value = video->AlwaysOnTop;
161 *value = video->SyncToVblank;
170 struct sna_video *video = port->devPriv.ptr;
171 struct sna *sna = video->sna;
173 if (!has_hw_scaling(sna, video) && !sna->render.video) {
245 struct sna_video *video)
251 r = g = b = video->color_key & 0xff;
253 r = ckey_value_chan(video->color_key, scrn->mask.red,
255 g = ckey_value_chan(video->color_key, scrn->mask.green,
257 b = ckey_value_chan(video->color_key, scrn->mask.blue,
281 struct sna_video *video,
289 /* XXX handle video spanning multiple CRTC */
292 s.plane_id = sna_crtc_to_sprite(crtc, video->idx);
298 if (video->color_key_changed & (1 << pipe) && video->has_color_key) {
308 __FUNCTION__, video->color_key));
311 set.min_value = ckey_value(sna, video);
315 if (!video->AlwaysOnTop)
322 s.plane_id = sna_crtc_to_sprite(crtc, video->idx);
325 if (drmIoctl(video->sna->kgem.fd, LOCAL_IOCTL_MODE_SETPLANE, &s))
326 xf86DrvMsg(video->sna->scrn->scrnIndex, X_ERROR,
332 video->has_color_key = false;
336 video->color_key_changed &= ~(1 << pipe);
339 if (video->colorspace_changed & (1 << pipe)) {
341 __FUNCTION__, video->colorspace));
343 sna_crtc_set_sprite_colorspace(crtc, video->idx,
344 video->colorspace);
346 video->colorspace_changed &= ~(1 << pipe);
432 X_ERROR, "failed to add fb, unable to update video\n");
465 if (video->bo[pipe]) {
466 kgem_bo_destroy(&sna->kgem, video->bo[pipe]);
467 video->bo[pipe] = NULL;
474 if (video->bo[pipe])
475 kgem_bo_destroy(&sna->kgem, video->bo[pipe]);
476 video->bo[pipe] = kgem_bo_reference(frame->bo);
491 struct sna_video *video = port->devPriv.ptr;
492 struct sna *sna = video->sna;
501 DBG(("%s: always_on_top=%d\n", __FUNCTION__, video->AlwaysOnTop));
502 if (!video->AlwaysOnTop) {
523 for (i = 0; i < video->sna->mode.num_real_crtc; i++) {
527 bool hw_scaling = has_hw_scaling(sna, video);
537 sna_video_frame_init(video, format->id, width, height, &frame);
544 assert(pipe < ARRAY_SIZE(video->bo));
545 if (video->bo[pipe]) {
548 s.plane_id = sna_crtc_to_sprite(crtc, video->idx);
549 if (drmIoctl(video->sna->kgem.fd, LOCAL_IOCTL_MODE_SETPLANE, &s))
550 xf86DrvMsg(video->sna->scrn->scrnIndex, X_ERROR,
552 video->bo[pipe] = NULL;
585 if (!sna_crtc_set_sprite_rotation(crtc, video->idx, crtc->rotation)) {
586 sna_crtc_set_sprite_rotation(crtc, video->idx, RR_Rotate_0);
589 sna_video_frame_set_rotation(video, &frame, rotation);
619 frame.bo = sna_video_buffer(video, &frame);
621 DBG(("%s: failed to allocate video bo\n", __FUNCTION__));
626 if (!sna_video_copy_data(video, &frame, buf)) {
627 DBG(("%s: failed to copy video data\n", __FUNCTION__));
635 if (!hw_scaling && sna->render.video &&
662 if (!sna->render.video(sna, video, &frame, &r, scaled)) {
669 sna_video_buffer_fini(video);
687 if (!sna_video_sprite_show(sna, video, &frame, crtc, &dst)) {
688 DBG(("%s: failed to show video frame\n", __FUNCTION__));
693 sna_video_buffer_fini(video);
707 sna_video_fill_colorkey(video, &clip);
723 struct sna_video *video = port->devPriv.ptr;
727 if (*w > video->sna->mode.max_crtc_width)
728 *w = video->sna->mode.max_crtc_width;
729 if (*h > video->sna->mode.max_crtc_height)
730 *h = video->sna->mode.max_crtc_height;
739 sna_video_frame_init(video, format->id, *w, *h, &frame);
740 sna_video_frame_set_rotation(video, &frame, RR_Rotate_0);
826 struct sna_video *video;
838 video = calloc(count, sizeof(*video));
840 if (video == NULL || port == NULL) {
841 free(video);
906 port->devPriv.ptr = video;
908 video->sna = sna;
909 video->idx = i;
910 video->alignment = 64;
911 video->color_key = sna_video_sprite_color_key(sna);
912 video->color_key_changed = ~0;
913 video->colorspace = 1; /* BT.709 */
914 video->colorspace_changed = ~0;
915 video->has_color_key = true;
916 video->brightness = -19; /* (255/219) * -16 */
917 video->contrast = 75; /* 255/219 * 64 */
918 video->saturation = 146; /* 128/112 * 128 */
919 video->desired_crtc = NULL;
920 video->gamma5 = 0xc0c0c0;
921 video->gamma4 = 0x808080;
922 video->gamma3 = 0x404040;
923 video->gamma2 = 0x202020;
924 video->gamma1 = 0x101010;
925 video->gamma0 = 0x080808;
926 RegionNull(&video->clip);
927 video->SyncToVblank = 1;
930 video++;