pipe_mutex_lock(vlsurface->device->mutex);
- vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);
-
dst_box = RectToPipeBox(destination_rect, vlsurface->sampler_view->texture);
pipe->texture_subdata(pipe, vlsurface->sampler_view->texture, 0,
PIPE_TRANSFER_WRITE, &dst_box, *source_data,
if (desc->swizzle[3] == PIPE_SWIZZLE_0)
templ->swizzle_a = PIPE_SWIZZLE_1;
}
-
-void
-vlVdpResolveDelayedRendering(vlVdpDevice *dev, struct pipe_surface *surface, struct u_rect *dirty_area)
-{
- struct vl_compositor_state *cstate;
- vlVdpOutputSurface *vlsurface;
-
- assert(dev);
-
- cstate = dev->delayed_rendering.cstate;
- if (!cstate)
- return;
-
- vlsurface = vlGetDataHTAB(dev->delayed_rendering.surface);
- if (!vlsurface)
- return;
-
- if (!surface) {
- surface = vlsurface->surface;
- dirty_area = &vlsurface->dirty_area;
- }
-
- vl_compositor_render(cstate, &dev->compositor, surface, dirty_area, true);
-
- dev->delayed_rendering.surface = VDP_INVALID_HANDLE;
- dev->delayed_rendering.cstate = NULL;
-
- /* test if we need to create a new sampler for the just filled texture */
- if (surface->texture != vlsurface->sampler_view->texture) {
- struct pipe_resource *res = surface->texture;
- struct pipe_sampler_view sv_templ;
-
- vlVdpDefaultSamplerViewTemplate(&sv_templ, res);
- pipe_sampler_view_reference(&vlsurface->sampler_view, NULL);
- vlsurface->sampler_view = dev->context->create_sampler_view(dev->context, res, &sv_templ);
- }
-
- return;
-}
-
-void
-vlVdpSave4DelayedRendering(vlVdpDevice *dev, VdpOutputSurface surface, struct vl_compositor_state *cstate)
-{
- assert(dev);
-
- vlVdpResolveDelayedRendering(dev, NULL, NULL);
-
- dev->delayed_rendering.surface = surface;
- dev->delayed_rendering.cstate = cstate;
-}
pipe_mutex_lock(vmixer->device->mutex);
- vlVdpResolveDelayedRendering(vmixer->device, NULL, NULL);
-
vlRemoveDataHTAB(mixer);
vl_compositor_cleanup_state(&vmixer->cstate);
}
pipe_mutex_lock(vmixer->device->mutex);
- vlVdpResolveDelayedRendering(vmixer->device, NULL, NULL);
vl_compositor_clear_layers(&vmixer->cstate);
++layers;
}
- if (!vmixer->noise_reduction.filter && !vmixer->sharpness.filter && !vmixer->bicubic.filter)
- vlVdpSave4DelayedRendering(vmixer->device, destination_surface, &vmixer->cstate);
- else {
- vl_compositor_render(&vmixer->cstate, compositor, surface, &dirty_area, true);
-
- if (vmixer->noise_reduction.filter) {
- if (!vmixer->sharpness.filter && !vmixer->bicubic.filter) {
- vl_median_filter_render(vmixer->noise_reduction.filter,
- sampler_view, dst->surface);
- } else {
- res = pipe->screen->resource_create(pipe->screen, &res_tmpl);
- struct pipe_sampler_view *sampler_view_temp = pipe->create_sampler_view(pipe, res, &sv_templ);
- struct pipe_surface *surface_temp = pipe->create_surface(pipe, res, &surf_templ);
- pipe_resource_reference(&res, NULL);
-
- vl_median_filter_render(vmixer->noise_reduction.filter,
- sampler_view, surface_temp);
-
- pipe_sampler_view_reference(&sampler_view, NULL);
- pipe_surface_reference(&surface, NULL);
-
- sampler_view = sampler_view_temp;
- surface = surface_temp;
- }
- }
+ vl_compositor_render(&vmixer->cstate, compositor, surface, &dirty_area, true);
- if (vmixer->sharpness.filter) {
- if (!vmixer->bicubic.filter) {
- vl_matrix_filter_render(vmixer->sharpness.filter,
- sampler_view, dst->surface);
- } else {
- res = pipe->screen->resource_create(pipe->screen, &res_tmpl);
- struct pipe_sampler_view *sampler_view_temp = pipe->create_sampler_view(pipe, res, &sv_templ);
- struct pipe_surface *surface_temp = pipe->create_surface(pipe, res, &surf_templ);
- pipe_resource_reference(&res, NULL);
+ if (vmixer->noise_reduction.filter) {
+ if (!vmixer->sharpness.filter && !vmixer->bicubic.filter) {
+ vl_median_filter_render(vmixer->noise_reduction.filter,
+ sampler_view, dst->surface);
+ } else {
+ res = pipe->screen->resource_create(pipe->screen, &res_tmpl);
+ struct pipe_sampler_view *sampler_view_temp = pipe->create_sampler_view(pipe, res, &sv_templ);
+ struct pipe_surface *surface_temp = pipe->create_surface(pipe, res, &surf_templ);
+ pipe_resource_reference(&res, NULL);
- vl_matrix_filter_render(vmixer->sharpness.filter,
- sampler_view, surface_temp);
+ vl_median_filter_render(vmixer->noise_reduction.filter,
+ sampler_view, surface_temp);
- pipe_sampler_view_reference(&sampler_view, NULL);
- pipe_surface_reference(&surface, NULL);
+ pipe_sampler_view_reference(&sampler_view, NULL);
+ pipe_surface_reference(&surface, NULL);
- sampler_view = sampler_view_temp;
- surface = surface_temp;
- }
+ sampler_view = sampler_view_temp;
+ surface = surface_temp;
}
+ }
- if (vmixer->bicubic.filter)
- vl_bicubic_filter_render(vmixer->bicubic.filter,
- sampler_view, dst->surface,
- RectToPipe(destination_video_rect, &rect),
- RectToPipe(destination_rect, &clip));
+ if (vmixer->sharpness.filter) {
+ if (!vmixer->bicubic.filter) {
+ vl_matrix_filter_render(vmixer->sharpness.filter,
+ sampler_view, dst->surface);
+ } else {
+ res = pipe->screen->resource_create(pipe->screen, &res_tmpl);
+ struct pipe_sampler_view *sampler_view_temp = pipe->create_sampler_view(pipe, res, &sv_templ);
+ struct pipe_surface *surface_temp = pipe->create_surface(pipe, res, &surf_templ);
+ pipe_resource_reference(&res, NULL);
+
+ vl_matrix_filter_render(vmixer->sharpness.filter,
+ sampler_view, surface_temp);
- if(surface != dst->surface) {
pipe_sampler_view_reference(&sampler_view, NULL);
pipe_surface_reference(&surface, NULL);
+
+ sampler_view = sampler_view_temp;
+ surface = surface_temp;
}
}
+
+ if (vmixer->bicubic.filter)
+ vl_bicubic_filter_render(vmixer->bicubic.filter,
+ sampler_view, dst->surface,
+ RectToPipe(destination_video_rect, &rect),
+ RectToPipe(destination_rect, &clip));
+
+ if(surface != dst->surface) {
+ pipe_sampler_view_reference(&sampler_view, NULL);
+ pipe_surface_reference(&surface, NULL);
+ }
pipe_mutex_unlock(vmixer->device->mutex);
return VDP_STATUS_OK;
pipe = vlsurface->device->context;
pipe_mutex_lock(vlsurface->device->mutex);
- vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);
pipe_surface_reference(&vlsurface->surface, NULL);
pipe_sampler_view_reference(&vlsurface->sampler_view, NULL);
return VDP_STATUS_INVALID_POINTER;
pipe_mutex_lock(vlsurface->device->mutex);
- vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);
res = vlsurface->sampler_view->texture;
box = RectToPipeBox(source_rect, res);
return VDP_STATUS_INVALID_POINTER;
pipe_mutex_lock(vlsurface->device->mutex);
- vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);
dst_box = RectToPipeBox(destination_rect, vlsurface->sampler_view->texture);
pipe->texture_subdata(pipe, vlsurface->sampler_view->texture, 0,
res_tmpl.bind = PIPE_BIND_SAMPLER_VIEW;
pipe_mutex_lock(vlsurface->device->mutex);
- vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);
if (!CheckSurfaceParams(context->screen, &res_tmpl))
goto error_resource;
return VDP_STATUS_INVALID_POINTER;
pipe_mutex_lock(vlsurface->device->mutex);
- vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);
memset(&vtmpl, 0, sizeof(vtmpl));
vtmpl.buffer_format = format;
vtmpl.chroma_format = FormatYCBCRToPipeChroma(source_ycbcr_format);
}
pipe_mutex_lock(dst_vlsurface->device->mutex);
- vlVdpResolveDelayedRendering(dst_vlsurface->device, NULL, NULL);
context = dst_vlsurface->device->context;
compositor = &dst_vlsurface->device->compositor;
cstate = &dst_vlsurface->cstate;
pipe_mutex_lock(dst_vlsurface->device->mutex);
- vlVdpResolveDelayedRendering(dst_vlsurface->device, NULL, NULL);
blend = BlenderToPipe(context, blend_state);
return NULL;
pipe_mutex_lock(vlsurface->device->mutex);
- vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);
vlsurface->device->context->flush(vlsurface->device->context, NULL, 0);
pipe_mutex_unlock(vlsurface->device->mutex);
return VDP_STATUS_INVALID_HANDLE;
pipe_mutex_lock(vlsurface->device->mutex);
- vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);
vlsurface->device->context->flush(vlsurface->device->context, NULL, 0);
memset(&whandle, 0, sizeof(struct winsys_handle));
dst_clip.x1 = clip_width ? clip_width : surf_draw->width;
dst_clip.y1 = clip_height ? clip_height : surf_draw->height;
- if (pq->device->delayed_rendering.surface == surface &&
- dst_clip.x1 == surf_draw->width && dst_clip.y1 == surf_draw->height) {
-
- // TODO: we correctly support the clipping here, but not the pq background color in the clipped area....
- cstate = pq->device->delayed_rendering.cstate;
- vl_compositor_set_dst_clip(cstate, &dst_clip);
- vlVdpResolveDelayedRendering(pq->device, surf_draw, dirty_area);
-
- } else {
- vlVdpResolveDelayedRendering(pq->device, NULL, NULL);
-
- src_rect.x0 = 0;
- src_rect.y0 = 0;
- src_rect.x1 = surf_draw->width;
- src_rect.y1 = surf_draw->height;
-
- vl_compositor_clear_layers(cstate);
- vl_compositor_set_rgba_layer(cstate, compositor, 0, surf->sampler_view, &src_rect, NULL, NULL);
- vl_compositor_set_dst_clip(cstate, &dst_clip);
- vl_compositor_render(cstate, compositor, surf_draw, dirty_area, true);
- }
+ src_rect.x0 = 0;
+ src_rect.y0 = 0;
+ src_rect.x1 = surf_draw->width;
+ src_rect.y1 = surf_draw->height;
+
+ vl_compositor_clear_layers(cstate);
+ vl_compositor_set_rgba_layer(cstate, compositor, 0, surf->sampler_view, &src_rect, NULL, NULL);
+ vl_compositor_set_dst_clip(cstate, &dst_clip);
+ vl_compositor_render(cstate, compositor, surf_draw, dirty_area, true);
}
vscreen->set_next_timestamp(vscreen, earliest_presentation_time);
struct vl_compositor compositor;
struct pipe_sampler_view *dummy_sv;
pipe_mutex mutex;
-
- struct {
- struct vl_compositor_state *cstate;
- VdpOutputSurface surface;
- } delayed_rendering;
} vlVdpDevice;
typedef struct
void vlVdpDefaultSamplerViewTemplate(struct pipe_sampler_view *templ, struct pipe_resource *res);
-/* Delayed rendering funtionality */
-void vlVdpResolveDelayedRendering(vlVdpDevice *dev, struct pipe_surface *surface, struct u_rect *dirty_area);
-void vlVdpSave4DelayedRendering(vlVdpDevice *dev, VdpOutputSurface surface, struct vl_compositor_state *cstate);
-
/* Internal function pointers */
VdpGetErrorString vlVdpGetErrorString;
VdpDeviceDestroy vlVdpDeviceDestroy;