• Home
  • Raw
  • Download

Lines Matching +full:enum +full:- +full:conversion

21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
44 enum getbits_conversion {
80 DeviceReference(&p_surf->device, dev); in vlVdpVideoSurfaceCreate()
81 pipe = dev->context; in vlVdpVideoSurfaceCreate()
83 mtx_lock(&dev->mutex); in vlVdpVideoSurfaceCreate()
84 memset(&p_surf->templat, 0, sizeof(p_surf->templat)); in vlVdpVideoSurfaceCreate()
86 p_surf->templat.buffer_format = pipe->screen->get_video_param in vlVdpVideoSurfaceCreate()
88 pipe->screen, in vlVdpVideoSurfaceCreate()
93 p_surf->templat.width = width; in vlVdpVideoSurfaceCreate()
94 p_surf->templat.height = height; in vlVdpVideoSurfaceCreate()
95 p_surf->templat.interlaced = pipe->screen->get_video_param in vlVdpVideoSurfaceCreate()
97 pipe->screen, in vlVdpVideoSurfaceCreate()
102 if (p_surf->templat.buffer_format != PIPE_FORMAT_NONE) in vlVdpVideoSurfaceCreate()
103 p_surf->video_buffer = pipe->create_video_buffer(pipe, &p_surf->templat); in vlVdpVideoSurfaceCreate()
107 mtx_unlock(&dev->mutex); in vlVdpVideoSurfaceCreate()
118 p_surf->video_buffer->destroy(p_surf->video_buffer); in vlVdpVideoSurfaceCreate()
121 DeviceReference(&p_surf->device, NULL); in vlVdpVideoSurfaceCreate()
141 mtx_lock(&p_surf->device->mutex); in vlVdpVideoSurfaceDestroy()
142 if (p_surf->video_buffer) in vlVdpVideoSurfaceDestroy()
143 p_surf->video_buffer->destroy(p_surf->video_buffer); in vlVdpVideoSurfaceDestroy()
144 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfaceDestroy()
147 DeviceReference(&p_surf->device, NULL); in vlVdpVideoSurfaceDestroy()
168 if (p_surf->video_buffer) { in vlVdpVideoSurfaceGetParameters()
169 *width = p_surf->video_buffer->width; in vlVdpVideoSurfaceGetParameters()
170 *height = p_surf->video_buffer->height; in vlVdpVideoSurfaceGetParameters()
171 … *chroma_type = PipeToChroma(pipe_format_to_chroma_format(p_surf->video_buffer->buffer_format)); in vlVdpVideoSurfaceGetParameters()
173 *width = p_surf->templat.width; in vlVdpVideoSurfaceGetParameters()
174 *height = p_surf->templat.height; in vlVdpVideoSurfaceGetParameters()
175 *chroma_type = PipeToChroma(pipe_format_to_chroma_format(p_surf->templat.buffer_format)); in vlVdpVideoSurfaceGetParameters()
185 *width = p_surf->templat.width; in vlVdpVideoSurfaceSize()
186 *height = p_surf->templat.height; in vlVdpVideoSurfaceSize()
189 pipe_format_to_chroma_format(p_surf->templat.buffer_format), in vlVdpVideoSurfaceSize()
190 p_surf->templat.interlaced); in vlVdpVideoSurfaceSize()
205 enum pipe_format format, buffer_format; in vlVdpVideoSurfaceGetBitsYCbCr()
207 enum getbits_conversion conversion = CONVERSION_NONE; in vlVdpVideoSurfaceGetBitsYCbCr() local
214 pipe = vlsurface->device->context; in vlVdpVideoSurfaceGetBitsYCbCr()
225 if (vlsurface->video_buffer == NULL) in vlVdpVideoSurfaceGetBitsYCbCr()
228 buffer_format = vlsurface->video_buffer->buffer_format; in vlVdpVideoSurfaceGetBitsYCbCr()
231 conversion = CONVERSION_NV12_TO_YV12; in vlVdpVideoSurfaceGetBitsYCbCr()
233 conversion = CONVERSION_YV12_TO_NV12; in vlVdpVideoSurfaceGetBitsYCbCr()
236 conversion = CONVERSION_SWAP_YUYV_UYVY; in vlVdpVideoSurfaceGetBitsYCbCr()
241 mtx_lock(&vlsurface->device->mutex); in vlVdpVideoSurfaceGetBitsYCbCr()
242 sampler_views = vlsurface->video_buffer->get_sampler_view_planes(vlsurface->video_buffer); in vlVdpVideoSurfaceGetBitsYCbCr()
244 mtx_unlock(&vlsurface->device->mutex); in vlVdpVideoSurfaceGetBitsYCbCr()
255 for (j = 0; j < sv->texture->array_size; ++j) { in vlVdpVideoSurfaceGetBitsYCbCr()
263 map = pipe->texture_map(pipe, sv->texture, 0, in vlVdpVideoSurfaceGetBitsYCbCr()
266 mtx_unlock(&vlsurface->device->mutex); in vlVdpVideoSurfaceGetBitsYCbCr()
270 if (conversion == CONVERSION_NV12_TO_YV12 && i == 1) { in vlVdpVideoSurfaceGetBitsYCbCr()
272 i, j, transfer->stride, sv->texture->array_size, in vlVdpVideoSurfaceGetBitsYCbCr()
274 } else if (conversion == CONVERSION_YV12_TO_NV12 && i > 0) { in vlVdpVideoSurfaceGetBitsYCbCr()
276 i, j, transfer->stride, sv->texture->array_size, in vlVdpVideoSurfaceGetBitsYCbCr()
278 } else if (conversion == CONVERSION_SWAP_YUYV_UYVY) { in vlVdpVideoSurfaceGetBitsYCbCr()
280 i, j, transfer->stride, sv->texture->array_size, in vlVdpVideoSurfaceGetBitsYCbCr()
283 util_copy_rect(destination_data[i] + destination_pitches[i] * j, sv->texture->format, in vlVdpVideoSurfaceGetBitsYCbCr()
284 destination_pitches[i] * sv->texture->array_size, 0, 0, in vlVdpVideoSurfaceGetBitsYCbCr()
285 box.width, box.height, map, transfer->stride, 0, 0); in vlVdpVideoSurfaceGetBitsYCbCr()
291 mtx_unlock(&vlsurface->device->mutex); in vlVdpVideoSurfaceGetBitsYCbCr()
306 enum pipe_format pformat = FormatYCBCRToPipe(source_ycbcr_format); in vlVdpVideoSurfacePutBitsYCbCr()
307 enum getbits_conversion conversion = CONVERSION_NONE; in vlVdpVideoSurfacePutBitsYCbCr() local
317 pipe = p_surf->device->context; in vlVdpVideoSurfacePutBitsYCbCr()
324 mtx_lock(&p_surf->device->mutex); in vlVdpVideoSurfacePutBitsYCbCr()
326 if (p_surf->video_buffer == NULL || in vlVdpVideoSurfacePutBitsYCbCr()
327 ((pformat != p_surf->video_buffer->buffer_format))) { in vlVdpVideoSurfacePutBitsYCbCr()
328 enum pipe_format nformat = pformat; in vlVdpVideoSurfacePutBitsYCbCr()
329 struct pipe_screen *screen = pipe->screen; in vlVdpVideoSurfacePutBitsYCbCr()
332 if (!screen->is_video_format_supported(screen, nformat, in vlVdpVideoSurfacePutBitsYCbCr()
335 nformat = screen->get_video_param(screen, in vlVdpVideoSurfacePutBitsYCbCr()
340 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfacePutBitsYCbCr()
345 if (p_surf->video_buffer == NULL || in vlVdpVideoSurfacePutBitsYCbCr()
346 nformat != p_surf->video_buffer->buffer_format) { in vlVdpVideoSurfacePutBitsYCbCr()
348 if (p_surf->video_buffer) in vlVdpVideoSurfacePutBitsYCbCr()
349 p_surf->video_buffer->destroy(p_surf->video_buffer); in vlVdpVideoSurfacePutBitsYCbCr()
352 p_surf->templat.buffer_format = nformat; in vlVdpVideoSurfacePutBitsYCbCr()
354 p_surf->templat.interlaced = false; in vlVdpVideoSurfacePutBitsYCbCr()
357 p_surf->video_buffer = pipe->create_video_buffer(pipe, &p_surf->templat); in vlVdpVideoSurfacePutBitsYCbCr()
360 if (!p_surf->video_buffer) { in vlVdpVideoSurfacePutBitsYCbCr()
361 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfacePutBitsYCbCr()
368 if (pformat != p_surf->video_buffer->buffer_format) { in vlVdpVideoSurfacePutBitsYCbCr()
370 p_surf->video_buffer->buffer_format == PIPE_FORMAT_NV12) in vlVdpVideoSurfacePutBitsYCbCr()
371 conversion = CONVERSION_YV12_TO_NV12; in vlVdpVideoSurfacePutBitsYCbCr()
373 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfacePutBitsYCbCr()
378 sampler_views = p_surf->video_buffer->get_sampler_view_planes(p_surf->video_buffer); in vlVdpVideoSurfacePutBitsYCbCr()
380 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfacePutBitsYCbCr()
390 tex = sv->texture; in vlVdpVideoSurfacePutBitsYCbCr()
393 for (j = 0; j < tex->array_size; ++j) { in vlVdpVideoSurfacePutBitsYCbCr()
399 if (conversion == CONVERSION_YV12_TO_NV12 && i == 1) { in vlVdpVideoSurfacePutBitsYCbCr()
403 map = pipe->texture_map(pipe, tex, 0, usage, in vlVdpVideoSurfacePutBitsYCbCr()
406 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfacePutBitsYCbCr()
411 i, j, transfer->stride, tex->array_size, in vlVdpVideoSurfacePutBitsYCbCr()
416 pipe->texture_subdata(pipe, tex, 0, in vlVdpVideoSurfacePutBitsYCbCr()
419 source_pitches[i] * tex->array_size, in vlVdpVideoSurfacePutBitsYCbCr()
429 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfacePutBitsYCbCr()
435 * Helper function to initially clear the VideoSurface after (re-)creation
440 struct pipe_context *pipe = vlsurf->device->context; in vlVdpVideoSurfaceClear()
444 if (!vlsurf->video_buffer) in vlVdpVideoSurfaceClear()
447 surfaces = vlsurf->video_buffer->get_surfaces(vlsurf->video_buffer); in vlVdpVideoSurfaceClear()
454 if (i > !!vlsurf->templat.interlaced) in vlVdpVideoSurfaceClear()
457 pipe->clear_render_target(pipe, surfaces[i], &c, 0, 0, in vlVdpVideoSurfaceClear()
458 surfaces[i]->width, surfaces[i]->height, false); in vlVdpVideoSurfaceClear()
460 pipe->flush(pipe, NULL, 0); in vlVdpVideoSurfaceClear()
472 mtx_lock(&p_surf->device->mutex); in vlVdpVideoSurfaceGallium()
473 if (p_surf->video_buffer == NULL) { in vlVdpVideoSurfaceGallium()
474 struct pipe_context *pipe = p_surf->device->context; in vlVdpVideoSurfaceGallium()
477 p_surf->video_buffer = pipe->create_video_buffer(pipe, &p_surf->templat); in vlVdpVideoSurfaceGallium()
479 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfaceGallium()
481 return p_surf->video_buffer; in vlVdpVideoSurfaceGallium()
505 result->handle = -1; in vlVdpVideoSurfaceDMABuf()
507 mtx_lock(&p_surf->device->mutex); in vlVdpVideoSurfaceDMABuf()
508 if (p_surf->video_buffer == NULL) { in vlVdpVideoSurfaceDMABuf()
509 struct pipe_context *pipe = p_surf->device->context; in vlVdpVideoSurfaceDMABuf()
512 p_surf->video_buffer = pipe->create_video_buffer(pipe, &p_surf->templat); in vlVdpVideoSurfaceDMABuf()
516 if (p_surf->video_buffer == NULL || !p_surf->video_buffer->interlaced || in vlVdpVideoSurfaceDMABuf()
517 p_surf->video_buffer->buffer_format != PIPE_FORMAT_NV12) { in vlVdpVideoSurfaceDMABuf()
518 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfaceDMABuf()
522 surf = p_surf->video_buffer->get_surfaces(p_surf->video_buffer)[plane]; in vlVdpVideoSurfaceDMABuf()
524 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfaceDMABuf()
530 whandle.layer = surf->u.tex.first_layer; in vlVdpVideoSurfaceDMABuf()
532 pscreen = surf->texture->screen; in vlVdpVideoSurfaceDMABuf()
533 if (!pscreen->resource_get_handle(pscreen, p_surf->device->context, in vlVdpVideoSurfaceDMABuf()
534 surf->texture, &whandle, in vlVdpVideoSurfaceDMABuf()
536 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfaceDMABuf()
540 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfaceDMABuf()
542 result->handle = whandle.handle; in vlVdpVideoSurfaceDMABuf()
543 result->width = surf->width; in vlVdpVideoSurfaceDMABuf()
544 result->height = surf->height; in vlVdpVideoSurfaceDMABuf()
545 result->offset = whandle.offset; in vlVdpVideoSurfaceDMABuf()
546 result->stride = whandle.stride; in vlVdpVideoSurfaceDMABuf()
548 if (surf->format == PIPE_FORMAT_R8_UNORM) in vlVdpVideoSurfaceDMABuf()
549 result->format = VDP_RGBA_FORMAT_R8; in vlVdpVideoSurfaceDMABuf()
551 result->format = VDP_RGBA_FORMAT_R8G8; in vlVdpVideoSurfaceDMABuf()