Lines Matching refs:video
73 void sna_video_free_buffers(struct sna_video *video)
77 for (i = 0; i < ARRAY_SIZE(video->old_buf); i++) {
78 if (video->old_buf[i]) {
79 kgem_bo_destroy(&video->sna->kgem, video->old_buf[i]);
80 video->old_buf[i] = NULL;
84 if (video->buf) {
85 kgem_bo_destroy(&video->sna->kgem, video->buf);
86 video->buf = NULL;
91 sna_video_buffer(struct sna_video *video,
95 if (video->buf && __kgem_bo_size(video->buf) < frame->size)
96 sna_video_free_buffers(video);
98 if (video->buf && video->buf->scanout) {
99 if (frame->width != video->width ||
100 frame->height != video->height ||
101 frame->id != video->format)
102 sna_video_free_buffers(video);
105 if (video->buf == NULL) {
106 if (video->tiled) {
107 video->buf = kgem_create_2d(&video->sna->kgem,
111 video->buf = kgem_create_linear(&video->sna->kgem, frame->size,
116 video->width = frame->width;
117 video->height = frame->height;
118 video->format = frame->id;
120 return video->buf;
123 void sna_video_buffer_fini(struct sna_video *video)
127 bo = video->old_buf[1];
128 video->old_buf[1] = video->old_buf[0];
129 video->old_buf[0] = video->buf;
130 video->buf = bo;
134 sna_video_clip_helper(struct sna_video *video,
161 * For overlay video, compute the relevant CRTC and
162 * clip video to that
164 crtc = sna_covering_crtc(video->sna, dst, video->desired_crtc);
166 /* For textured video, we don't actually want to clip at all. */
167 if (crtc && !video->textured) {
199 sna_video_frame_init(struct sna_video *video,
204 __FUNCTION__, id, is_planar_fourcc(id), width, height, video->alignment));
215 sna_video_frame_set_rotation(struct sna_video *video,
226 align = video->alignment;
229 if (frame->id == FOURCC_XVMC && video->sna->kgem.gen < 040 && align < 1024)
300 static void sna_memcpy_plane(struct sna_video *video,
321 if (!video->textured)
366 sna_copy_planar_data(struct sna_video *video,
372 sna_memcpy_plane(video, dst, src, frame, 0);
379 sna_memcpy_plane(video, d, src, frame, 1);
386 sna_memcpy_plane(video, d, src, frame, 1);
390 sna_copy_packed_data(struct sna_video *video,
400 if (video->textured) {
487 sna_video_copy_data(struct sna_video *video,
496 frame->rotation, video->textured));
506 if (frame->rotation == RR_Rotate_0 && !video->tiled) {
516 if (!kgem_bo_write(&video->sna->kgem, frame->bo,
520 frame->bo = kgem_create_buffer(&video->sna->kgem, frame->size,
539 if (video->textured) {
554 if (!kgem_bo_write(&video->sna->kgem, frame->bo,
558 frame->bo = kgem_create_buffer(&video->sna->kgem, frame->size,
575 dst = kgem_bo_map__gtt(&video->sna->kgem, frame->bo);
579 frame->bo = kgem_create_buffer(&video->sna->kgem, frame->size,
587 sna_copy_planar_data(video, frame, buf, dst);
589 sna_copy_packed_data(video, frame, buf, dst);