diff options
author | Christian König <[email protected]> | 2012-02-15 17:20:50 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2012-02-25 12:14:14 +0100 |
commit | 1448e829e86981e6144410ba6a3d0f16357fb2b3 (patch) | |
tree | 18a95fc6ebab9afd59837d419f2e5ab96130624b /src/gallium/state_trackers/vdpau | |
parent | b34c35a5243e0f4a23721891dbbccff8863b7d4c (diff) |
vl: rework winsys interface
Throw out all the old and now unneeded stuff.
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/vdpau')
-rw-r--r-- | src/gallium/state_trackers/vdpau/decode.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/vdpau/device.c | 10 | ||||
-rw-r--r-- | src/gallium/state_trackers/vdpau/mixer.c | 8 | ||||
-rw-r--r-- | src/gallium/state_trackers/vdpau/output.c | 6 | ||||
-rw-r--r-- | src/gallium/state_trackers/vdpau/presentation.c | 41 | ||||
-rw-r--r-- | src/gallium/state_trackers/vdpau/surface.c | 4 | ||||
-rw-r--r-- | src/gallium/state_trackers/vdpau/vdpau_private.h | 2 |
7 files changed, 39 insertions, 34 deletions
diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c index c45abb81799..64349a8bbce 100644 --- a/src/gallium/state_trackers/vdpau/decode.c +++ b/src/gallium/state_trackers/vdpau/decode.c @@ -65,7 +65,7 @@ vlVdpDecoderCreate(VdpDevice device, if (!dev) return VDP_STATUS_INVALID_HANDLE; - pipe = dev->context->pipe; + pipe = dev->context; screen = dev->vscreen->pscreen; supported = screen->get_video_param ( diff --git a/src/gallium/state_trackers/vdpau/device.c b/src/gallium/state_trackers/vdpau/device.c index 7b23863d120..f4a3dc04bfb 100644 --- a/src/gallium/state_trackers/vdpau/device.c +++ b/src/gallium/state_trackers/vdpau/device.c @@ -41,8 +41,9 @@ PUBLIC VdpStatus vdp_imp_device_create_x11(Display *display, int screen, VdpDevice *device, VdpGetProcAddress **get_proc_address) { - VdpStatus ret; + struct pipe_screen *pscreen; vlVdpDevice *dev = NULL; + VdpStatus ret; if (!(display && device && get_proc_address)) return VDP_STATUS_INVALID_POINTER; @@ -64,7 +65,8 @@ vdp_imp_device_create_x11(Display *display, int screen, VdpDevice *device, goto no_vscreen; } - dev->context = vl_video_create(dev->vscreen); + pscreen = dev->vscreen->pscreen; + dev->context = pscreen->context_create(pscreen, dev->vscreen); if (!dev->context) { ret = VDP_STATUS_RESOURCES; goto no_context; @@ -76,7 +78,7 @@ vdp_imp_device_create_x11(Display *display, int screen, VdpDevice *device, goto no_handle; } - vl_compositor_init(&dev->compositor, dev->context->pipe); + vl_compositor_init(&dev->compositor, dev->context); *get_proc_address = &vlVdpGetProcAddress; @@ -160,7 +162,7 @@ vlVdpDeviceDestroy(VdpDevice device) return VDP_STATUS_INVALID_HANDLE; vl_compositor_cleanup(&dev->compositor); - vl_video_destroy(dev->context); + dev->context->destroy(dev->context); vl_screen_destroy(dev->vscreen); FREE(dev); diff --git a/src/gallium/state_trackers/vdpau/mixer.c b/src/gallium/state_trackers/vdpau/mixer.c index df6750d5698..082860888af 100644 --- a/src/gallium/state_trackers/vdpau/mixer.c +++ b/src/gallium/state_trackers/vdpau/mixer.c @@ -62,7 +62,7 @@ vlVdpVideoMixerCreate(VdpDevice device, return VDP_STATUS_RESOURCES; vmixer->device = dev; - vl_compositor_init(&vmixer->compositor, dev->context->pipe); + vl_compositor_init(&vmixer->compositor, dev->context); vl_csc_get_matrix(VL_CSC_COLOR_STANDARD_BT_601, NULL, true, vmixer->csc); if (!debug_get_bool_option("G3DVL_NO_CSC", FALSE)) @@ -300,8 +300,7 @@ vlVdpVideoMixerUpdateNoiseReductionFilter(vlVdpVideoMixer *vmixer) /* and create a new filter as needed */ if (vmixer->noise_reduction. enabled && vmixer->noise_reduction.level > 0) { vmixer->noise_reduction.filter = MALLOC(sizeof(struct vl_median_filter)); - vl_median_filter_init(vmixer->noise_reduction.filter, - vmixer->device->context->pipe, + vl_median_filter_init(vmixer->noise_reduction.filter, vmixer->device->context, vmixer->video_width, vmixer->video_height, vmixer->noise_reduction.level + 1, VL_MEDIAN_FILTER_CROSS); @@ -347,8 +346,7 @@ vlVdpVideoMixerUpdateSharpnessFilter(vlVdpVideoMixer *vmixer) } vmixer->sharpness.filter = MALLOC(sizeof(struct vl_matrix_filter)); - vl_matrix_filter_init(vmixer->sharpness.filter, - vmixer->device->context->pipe, + vl_matrix_filter_init(vmixer->sharpness.filter, vmixer->device->context, vmixer->video_width, vmixer->video_height, 3, 3, matrix); } diff --git a/src/gallium/state_trackers/vdpau/output.c b/src/gallium/state_trackers/vdpau/output.c index 17ce0373dba..5ccb153fabd 100644 --- a/src/gallium/state_trackers/vdpau/output.c +++ b/src/gallium/state_trackers/vdpau/output.c @@ -58,7 +58,7 @@ vlVdpOutputSurfaceCreate(VdpDevice device, if (!dev) return VDP_STATUS_INVALID_HANDLE; - pipe = dev->context->pipe; + pipe = dev->context; if (!pipe) return VDP_STATUS_INVALID_HANDLE; @@ -217,7 +217,7 @@ vlVdpOutputSurfacePutBitsIndexed(VdpOutputSurface surface, if (!vlsurface) return VDP_STATUS_INVALID_HANDLE; - context = vlsurface->device->context->pipe; + context = vlsurface->device->context; compositor = &vlsurface->device->compositor; index_format = FormatIndexedToPipe(source_indexed_format); @@ -459,7 +459,7 @@ vlVdpOutputSurfaceRenderOutputSurface(VdpOutputSurface destination_surface, if (dst_vlsurface->device != src_vlsurface->device) return VDP_STATUS_HANDLE_DEVICE_MISMATCH; - context = dst_vlsurface->device->context->pipe; + context = dst_vlsurface->device->context; compositor = &dst_vlsurface->device->compositor; blend = BlenderToPipe(context, blend_state); diff --git a/src/gallium/state_trackers/vdpau/presentation.c b/src/gallium/state_trackers/vdpau/presentation.c index 13025d21156..e3ad03a2a51 100644 --- a/src/gallium/state_trackers/vdpau/presentation.c +++ b/src/gallium/state_trackers/vdpau/presentation.c @@ -68,7 +68,7 @@ vlVdpPresentationQueueCreate(VdpDevice device, pq->device = dev; pq->drawable = pqt->drawable; - if (!vl_compositor_init(&pq->compositor, dev->context->pipe)) { + if (!vl_compositor_init(&pq->compositor, dev->context)) { ret = VDP_STATUS_ERROR; goto no_compositor; } @@ -202,17 +202,25 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue, vlVdpOutputSurface *surf; struct pipe_context *pipe; - struct pipe_surface *drawable_surface; + struct pipe_resource *tex; + struct pipe_surface surf_templ, *surf_draw; struct pipe_video_rect src_rect, dst_clip; pq = vlGetDataHTAB(presentation_queue); if (!pq) return VDP_STATUS_INVALID_HANDLE; - drawable_surface = vl_drawable_surface_get(pq->device->context, pq->drawable); - if (!drawable_surface) + pipe = pq->device->context; + + tex = vl_screen_texture_from_drawable(pq->device->vscreen, pq->drawable); + if (!tex) return VDP_STATUS_INVALID_HANDLE; + memset(&surf_templ, 0, sizeof(surf_templ)); + surf_templ.format = tex->format; + surf_templ.usage = PIPE_BIND_RENDER_TARGET; + surf_draw = pipe->create_surface(pipe, tex, &surf_templ); + surf = vlGetDataHTAB(surface); if (!surf) return VDP_STATUS_INVALID_HANDLE; @@ -221,26 +229,22 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue, src_rect.x = 0; src_rect.y = 0; - src_rect.w = drawable_surface->width; - src_rect.h = drawable_surface->height; + src_rect.w = surf_draw->width; + src_rect.h = surf_draw->height; dst_clip.x = 0; dst_clip.y = 0; - dst_clip.w = clip_width ? clip_width : drawable_surface->width; - dst_clip.h = clip_height ? clip_height : drawable_surface->height; + dst_clip.w = clip_width ? clip_width : surf_draw->width; + dst_clip.h = clip_height ? clip_height : surf_draw->height; vl_compositor_clear_layers(&pq->compositor); vl_compositor_set_rgba_layer(&pq->compositor, 0, surf->sampler_view, &src_rect, NULL); - vl_compositor_render(&pq->compositor, drawable_surface, NULL, &dst_clip, &pq->dirty_area); - - pipe = pq->device->context->pipe; + vl_compositor_render(&pq->compositor, surf_draw, NULL, &dst_clip, &pq->dirty_area); pipe->screen->flush_frontbuffer ( - pipe->screen, - drawable_surface->texture, - 0, 0, - vl_contextprivate_get(pq->device->context, drawable_surface) + pipe->screen, tex, 0, 0, + vl_screen_get_private(pq->device->vscreen) ); pipe->screen->fence_reference(pipe->screen, &surf->fence, NULL); @@ -259,7 +263,8 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue, VDPAU_MSG(VDPAU_ERR, "[VDPAU] Dumping surface %d failed.\n", surface); } - pipe_surface_reference(&drawable_surface, NULL); + pipe_resource_reference(&tex, NULL); + pipe_surface_reference(&surf_draw, NULL); return VDP_STATUS_OK; } @@ -288,7 +293,7 @@ vlVdpPresentationQueueBlockUntilSurfaceIdle(VdpPresentationQueue presentation_qu return VDP_STATUS_INVALID_HANDLE; if (surf->fence) { - screen = pq->device->context->pipe->screen; + screen = pq->device->vscreen->pscreen; screen->fence_finish(screen, surf->fence, 0); } @@ -327,7 +332,7 @@ vlVdpPresentationQueueQuerySurfaceStatus(VdpPresentationQueue presentation_queue if (!surf->fence) { *status = VDP_PRESENTATION_QUEUE_STATUS_IDLE; } else { - screen = pq->device->context->pipe->screen; + screen = pq->device->vscreen->pscreen; if (screen->fence_signalled(screen, surf->fence)) { screen->fence_reference(screen, &surf->fence, NULL); *status = VDP_PRESENTATION_QUEUE_STATUS_VISIBLE; diff --git a/src/gallium/state_trackers/vdpau/surface.c b/src/gallium/state_trackers/vdpau/surface.c index a0ebe001aa8..04832426a10 100644 --- a/src/gallium/state_trackers/vdpau/surface.c +++ b/src/gallium/state_trackers/vdpau/surface.c @@ -71,7 +71,7 @@ vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type, } p_surf->device = dev; - pipe = dev->context->pipe; + pipe = dev->context; memset(&p_surf->templat, 0, sizeof(p_surf->templat)); p_surf->templat.buffer_format = pipe->screen->get_video_param @@ -204,7 +204,7 @@ vlVdpVideoSurfacePutBitsYCbCr(VdpVideoSurface surface, if (!p_surf) return VDP_STATUS_INVALID_HANDLE; - pipe = p_surf->device->context->pipe; + pipe = p_surf->device->context; if (!pipe) return VDP_STATUS_INVALID_HANDLE; diff --git a/src/gallium/state_trackers/vdpau/vdpau_private.h b/src/gallium/state_trackers/vdpau/vdpau_private.h index 35f0dc0d58a..e02744ffd41 100644 --- a/src/gallium/state_trackers/vdpau/vdpau_private.h +++ b/src/gallium/state_trackers/vdpau/vdpau_private.h @@ -286,7 +286,7 @@ RectToPipe(const VdpRect *src, struct pipe_video_rect *dst) typedef struct { struct vl_screen *vscreen; - struct vl_context *context; + struct pipe_context *context; struct vl_compositor compositor; } vlVdpDevice; |