summaryrefslogtreecommitdiff
path: root/glamor/glamor_xv.c
AgeCommit message (Collapse)AuthorFilesLines
2014-12-28glamor: Fix nlines in glamor_xv_put_image when src_y is oddKeith Packard1-1/+1
The number of lines of video to update in the texture needs to be computed from the height of the updated source, not the full height of the source. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-12-25glamor: Make sure Xvideo source image data is properly alignedMichel Dänzer1-13/+11
_glamor_upload_bits_to_pixmap_texture currently ignores the stride parameter, but __glamor_upload_pixmap_to_texture uses 4-byte alignment via glPixelStorei(GL_UNPACK_ALIGNMENT, 4). Also fix up the stride argument passed in though, in case it starts being used properly in the future. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87455 Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-08-17glamor: Free Xv put image data immediately after useKeith Packard1-3/+10
The Xv StopVideo callback is not invoked on textured video ports, so the temporary pixmaps allocated for the video planes are never freed. Freeing the storage immediately after use is a simple solution to this problem which doesn't appear to have any visible performance impact. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-07-28glamor: Eliminate diagonal tearing in xvKeith Packard1-5/+8
This uses a single large triangle and a scissor to draw the video instead of two triangles. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-17glamor: Remove always-true yInverted flag.Eric Anholt1-2/+2
All users of glamor had the same value set, and it complicated things for no reason. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-06-15glamor: Share code for put_image handling.Eric Anholt1-0/+104
The difference between the two is that XF86 has the clip helper that lets you upload less data when rendering video that's clipped. I don't think that's really worth the trouble, especially in a world of compositors, so I've dropped it to get to shared code. It turns out the clipping code was broken on xf86-video-intel anyway. To reproduce, run without a compositor, and use another window to clip the top half of your XV output on the glamor XV adaptor: the rendering got confused about which half of the window was being drawn to. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-06-15glamor: Split the XV code into XF86-dependent parts and generic.Eric Anholt1-269/+68
I want to expose this from Xephyr as well, both to be able to test XV changes rapidly, and beause the XV passthrough to the host's overlay really doesn't work out well when we glXSwapBuffers() over the colorkey. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-04-23glamor: Replace glamor_get/put_context() with just glamor_make_current().Eric Anholt1-5/+2
Now that we have the DIX global state for the current context, we don't need to track nesting to try to reduce MakeCurrent overhead. v2: Fix a mistaken replacement of a put_context with make_current in glamor_fill_spans_gl() (caught by keithp). Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (v1) Reviewed-by: Adam Jackson <ajax@redhat.com> (v1)
2014-04-03glamor: Initialize XV shaders from glamor_xv_init instead of glamor_initKeith Packard1-12/+2
The glamor_init calls to glamor_init_xv_shader were never getting run because GLAMOR_XV was never defined. Instead of trying to make that work, fix glamor_xv_init to make the call instead. Further, just get rid of the glamor_fini_xv_shader function entirely as the shader program will be destroyed when the context is destroyed at server reset time. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-17glamor: don't reset the GLSL programMarkus Wick1-1/+0
We don't use fixed function rendering, so there is no need to reset the program at all. This lets the driver avoid checking for state changes between draw calls when we rebind the same program. Improves xephyr x11perf -f8text performance by 6.03062% +/- 1.64928% (n=20) Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-17glamor: Apply debug labels to our shaders.Eric Anholt1-1/+1
This will help tools like fips, apitrace, or INTEL_DEBUG=shader_time provide useful information about the shaders in use. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-05xorg: Connect up the glamor XV code, xorg DDX-only for now.Eric Anholt1-12/+7
Porting this code to be non-xorg-dependent is going to take significant hacking, so just dump it in the glamoregl module for the moment, so I can hack on it while regression testing. v2: Fix compiler warnings by adding #include dix-config.h at the top, don't try to auto-init (I'll try to fix the xv ABI later). v3: Fix last minute breakage of having reintroduced xf86ScrnToScreen (one of the compat macros). Just use the drawable's pScreen instead. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-02-14glamor: Rename glamor_get/put_dispatch to glamor_get/put_context.Eric Anholt1-6/+6
It used to be the thing that returned your dispatch table and happeend to set up the context, but now it just sets up the context. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-02-14glamor: Convert to using libepoxy.Eric Anholt1-76/+64
Libepoxy hides all the GL versus GLES2 dispatch handling for us, with higher performance. v2: Squash in the later patch to drop the later of two repeated glamor_get_dispatch()es instead (caught by keithp) Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-01-27glamor: Convert use of the old "pointer" typedef to "void *".Eric Anholt1-6/+6
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-01-27glamor: Disable the XV code for now.Eric Anholt1-0/+2
We're going to want to make this DIX code instead of XF86 if at all possible, but for now just disable it so we can work on the rest of the build. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-01-27glamor: Fix some indent damage of putting a ' ' after the '*' for pointers.Eric Anholt1-1/+1
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-01-27glamor: Fix some mangling of shader strings by indent.Eric Anholt1-4/+10
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-01-27glamor: Apply x-indent.sh.Eric Anholt1-515/+499
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2013-12-18glamor: fix leak in xv code.Dave Airlie1-1/+1
This loop needed to go one higher, not sure if this fixes the leak MrCooper was seeing on irc, but it fixes a leak. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18glamor: remove unused variableFabio Pedretti1-1/+0
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18glamor: add initial Xv supportDave Airlie1-0/+646
This does YV12 and I420 for now, not sure if we can do packed without a GL extension. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>