Lines Matching refs:video

84 void sna_video_free_buffers(struct sna_video *video)
88 for (i = 0; i < ARRAY_SIZE(video->old_buf); i++) {
89 if (video->old_buf[i]) {
90 kgem_bo_destroy(&video->sna->kgem, video->old_buf[i]);
91 video->old_buf[i] = NULL;
95 if (video->buf) {
96 kgem_bo_destroy(&video->sna->kgem, video->buf);
97 video->buf = NULL;
102 sna_video_buffer(struct sna_video *video,
106 if (video->buf && __kgem_bo_size(video->buf) < frame->size)
107 sna_video_free_buffers(video);
109 if (video->buf && video->buf->scanout) {
110 if (frame->width != video->width ||
111 frame->height != video->height ||
112 frame->id != video->format)
113 sna_video_free_buffers(video);
116 if (video->buf == NULL) {
117 if (video->tiled) {
118 video->buf = kgem_create_2d(&video->sna->kgem,
122 video->buf = kgem_create_linear(&video->sna->kgem, frame->size,
127 video->width = frame->width;
128 video->height = frame->height;
129 video->format = frame->id;
131 return video->buf;
134 void sna_video_buffer_fini(struct sna_video *video)
138 bo = video->old_buf[1];
139 video->old_buf[1] = video->old_buf[0];
140 video->old_buf[0] = video->buf;
141 video->buf = bo;
145 sna_video_clip_helper(struct sna_video *video,
172 * For overlay video, compute the relevant CRTC and
173 * clip video to that
175 crtc = sna_covering_crtc(video->sna, dst, video->desired_crtc);
177 /* For textured video, we don't actually want to clip at all. */
178 if (crtc && !video->textured) {
210 sna_video_frame_init(struct sna_video *video,
215 __FUNCTION__, id, is_planar_fourcc(id), width, height, video->alignment));
226 sna_video_frame_set_rotation(struct sna_video *video,
237 align = video->alignment;
240 if (frame->id == FOURCC_XVMC && video->sna->kgem.gen < 040 && align < 1024)
348 static void sna_memcpy_cbcr_plane(struct sna_video *video,
362 if (!video->textured)
406 static void sna_memcpy_plane(struct sna_video *video,
423 if (!video->textured)
468 sna_copy_nv12_data(struct sna_video *video,
472 sna_memcpy_plane(video, dst, src, frame, 0);
475 sna_memcpy_cbcr_plane(video, (void*)dst, (void*)src, frame);
479 sna_copy_planar_data(struct sna_video *video,
485 sna_memcpy_plane(video, dst, src, frame, 0);
492 sna_memcpy_plane(video, d, src, frame, 1);
499 sna_memcpy_plane(video, d, src, frame, 1);
503 sna_copy_packed_data(struct sna_video *video,
513 if (video->textured) {
600 sna_copy_ayuv_data(struct sna_video *video,
612 if (video->textured) {
666 sna_video_copy_data(struct sna_video *video,
675 frame->rotation, video->textured));
685 if (frame->rotation == RR_Rotate_0 && !video->tiled && !is_ayuv_fourcc(frame->id)) {
695 if (!kgem_bo_write(&video->sna->kgem, frame->bo,
699 frame->bo = kgem_create_buffer(&video->sna->kgem, frame->size,
716 if (!kgem_bo_write(&video->sna->kgem, frame->bo,
720 frame->bo = kgem_create_buffer(&video->sna->kgem, frame->size,
739 if (video->textured) {
754 if (!kgem_bo_write(&video->sna->kgem, frame->bo,
758 frame->bo = kgem_create_buffer(&video->sna->kgem, frame->size,
775 dst = kgem_bo_map__gtt(&video->sna->kgem, frame->bo);
779 frame->bo = kgem_create_buffer(&video->sna->kgem, frame->size,
787 sna_copy_nv12_data(video, frame, buf, dst);
789 sna_copy_planar_data(video, frame, buf, dst);
791 sna_copy_ayuv_data(video, frame, buf, dst);
793 sna_copy_packed_data(video, frame, buf, dst);
798 void sna_video_fill_colorkey(struct sna_video *video,
801 struct sna *sna = video->sna;
807 if (video->AlwaysOnTop || RegionEqual(&video->clip, (RegionPtr)clip))
814 video->color_key,
817 RegionCopy(&video->clip, (RegionPtr)clip);
831 memcpy(tmp, &video->color_key, w);
858 RegionCopy(&video->clip, (RegionPtr)clip);