Lines Matching refs:p_surf
60 vlVdpSurface *p_surf; in vlVdpVideoSurfaceCreate() local
68 p_surf = CALLOC(1, sizeof(vlVdpSurface)); in vlVdpVideoSurfaceCreate()
69 if (!p_surf) { in vlVdpVideoSurfaceCreate()
80 DeviceReference(&p_surf->device, dev); 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()
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()
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()
106 vlVdpVideoSurfaceClear(p_surf); in vlVdpVideoSurfaceCreate()
109 *surface = vlAddDataHTAB(p_surf); in vlVdpVideoSurfaceCreate()
118 p_surf->video_buffer->destroy(p_surf->video_buffer); in vlVdpVideoSurfaceCreate()
121 DeviceReference(&p_surf->device, NULL); in vlVdpVideoSurfaceCreate()
122 FREE(p_surf); in vlVdpVideoSurfaceCreate()
135 vlVdpSurface *p_surf; in vlVdpVideoSurfaceDestroy() local
137 p_surf = (vlVdpSurface *)vlGetDataHTAB((vlHandle)surface); in vlVdpVideoSurfaceDestroy()
138 if (!p_surf) in vlVdpVideoSurfaceDestroy()
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()
148 FREE(p_surf); in vlVdpVideoSurfaceDestroy()
164 vlVdpSurface *p_surf = vlGetDataHTAB(surface); in vlVdpVideoSurfaceGetParameters() local
165 if (!p_surf) in vlVdpVideoSurfaceGetParameters()
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()
182 vlVdpVideoSurfaceSize(vlVdpSurface *p_surf, int component, in vlVdpVideoSurfaceSize() argument
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()
313 vlVdpSurface *p_surf = vlGetDataHTAB(surface); in vlVdpVideoSurfacePutBitsYCbCr() local
314 if (!p_surf) in vlVdpVideoSurfacePutBitsYCbCr()
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()
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()
364 vlVdpVideoSurfaceClear(p_surf); 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()
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()
391 vlVdpVideoSurfaceSize(p_surf, i, &width, &height); in vlVdpVideoSurfacePutBitsYCbCr()
406 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfacePutBitsYCbCr()
429 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfacePutBitsYCbCr()
468 vlVdpSurface *p_surf = vlGetDataHTAB(surface); in vlVdpVideoSurfaceGallium() local
469 if (!p_surf) in vlVdpVideoSurfaceGallium()
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()
488 vlVdpSurface *p_surf = vlGetDataHTAB(surface); in vlVdpVideoSurfaceDMABuf() local
495 if (!p_surf) 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()
533 if (!pscreen->resource_get_handle(pscreen, p_surf->device->context, in vlVdpVideoSurfaceDMABuf()
536 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfaceDMABuf()
540 mtx_unlock(&p_surf->device->mutex); in vlVdpVideoSurfaceDMABuf()