diff options
author | Keith Packard <keithp@keithp.com> | 2014-08-03 15:15:31 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-08-06 22:10:10 -0700 |
commit | edbd7cd41a8a4e1091d8b44526b8628485292360 (patch) | |
tree | fdd7f163fc4a221a6a042fdc50047fba3efbfe67 | |
parent | 584a5c2d52888075e828a0bb8db4aa2b2fafc9d5 (diff) |
xfree86/glamor: use glamor hooks to init/cleanup portsglamor-xv-cleanup
Uses glamor_xv_init_port instead of open-coding that function at
server init time.
Uses the new ddFreePort hook to ensure that glamor resources are
freed at server reset time.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | hw/xfree86/glamor_egl/glamor_xf86_xv.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/hw/xfree86/glamor_egl/glamor_xf86_xv.c b/hw/xfree86/glamor_egl/glamor_xf86_xv.c index 8535fa0c9..d3a3aab7a 100644 --- a/hw/xfree86/glamor_egl/glamor_xf86_xv.c +++ b/hw/xfree86/glamor_egl/glamor_xf86_xv.c @@ -114,6 +114,13 @@ glamor_xf86_xv_put_image(ScrnInfoPtr pScrn, id, buf, width, height, sync, clipBoxes); } +static void +glamor_xf86_xv_free_port(ScrnInfoPtr scrn, + void *data) +{ + glamor_xv_fini_port(data); +} + static XF86VideoEncodingRec DummyEncodingGLAMOR[1] = { { 0, @@ -166,20 +173,14 @@ glamor_xv_init(ScreenPtr screen, int num_texture_ports) adapt->PutImage = glamor_xf86_xv_put_image; adapt->ReputImage = NULL; adapt->QueryImageAttributes = glamor_xf86_xv_query_image_attributes; + adapt->FreePort = glamor_xf86_xv_free_port; for (i = 0; i < num_texture_ports; i++) { glamor_port_private *pPriv = &port_priv[i]; - pPriv->brightness = 0; - pPriv->contrast = 0; - pPriv->saturation = 0; - pPriv->hue = 0; - pPriv->gamma = 1000; - pPriv->transform_index = 0; - - REGION_NULL(pScreen, &pPriv->clip); + glamor_xv_init_port(pPriv); - adapt->pPortPrivates[i].ptr = (void *) (pPriv); + adapt->pPortPrivates[i].ptr = pPriv; } return adapt; } |