summaryrefslogtreecommitdiff
path: root/glamor
AgeCommit message (Collapse)AuthorFilesLines
2015-06-02glamor: don't do render ops with matching source/dest (v3)Dave Airlie2-1/+17
XRender defines this, GL really doesn't like it. kwin 4.x and qt 4.x seem to make this happen for the gradient in the titlebar, and on radeonsi/r600 hw this draws all kinds of wrong. v2: bump this up a level, and check it earlier. (I assume the XXXX was for this case.) v3: add same code to largepixmap paths (Keith) Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-05-14glamor: Replace CompositeGlyphs code [v2]Keith Packard9-1978/+589
New composite glyphs code uses the updated glamor program infrastructure to create efficient shaders for drawing render text. Glyphs are cached in two atlases (one 8-bit, one 32-bit) in a simple linear fashion. When the atlas fills, it is discarded and a new one constructed. v2: Eric Anholt changed the non-GLSL 130 path to use quads instead of two triangles for a significant performance improvement on hardware with quads. Someone can fix the GLES quads emulation if they want to make it faster there. v3: Eric found more dead code to delete Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-05-14glamor: Adapt glamor_program API to handle render accelerationKeith Packard8-30/+347
This extends the existing API to support options needed for render accleration, including an additional fragment, 'combine', (which provides a place to perform the source IN mask operation before the final OP dest state) and an additional 'defines' parameter which provides a way to add target-dependent values without using a uniform. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-05-14glamor: Compute GLSL version from GL_SHADING_LANGUAGE_VERSION (v3)Keith Packard1-9/+39
Use code from Piglit project to compute GLSL version for either GL or GLES. The Piglit code was originally written by Chad Versace. v2: bail if the parse fails (requested by Eric Anholt) v3: Use version 1.20 for GLES until we fix our programs (Eric Anholt) Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-05-14glamor: Remove destination drawable argument from glamor_set_textureKeith Packard2-8/+4
This argument wasn't used at all. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-05-14glamor: Pass depth to glamor_pm_is_solid and glamor_set_planemaskKeith Packard7-17/+16
Instead of passing the destination drawable, just pass the depth, as the underlying functions need only that to check whether the planemask is going to work. This API change will allow higher level functions to not need the destination pixmap. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-05-12glamor: fix build when DRI3 is not definedJonathan Gray1-1/+5
Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-12glamor: remove const from the return type of glamor_get_drawable_location()Jonathan Gray2-2/+2
Fixes a build error with gcc 4.2.1 on OpenBSD due to -Werror=return-type from xorg-macros. error: type qualifiers ignored on function return type Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-04-21Convert glamor & glx to new *allocarray functionsAlan Coopersmith6-11/+11
v2: fixup whitespace Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-03-24glamor: * 1/size is faster than / size in VSKeith Packard4-17/+17
Pass the inverse of the texture size to glamor vertex shaders so that we multiply by that instead of dividing by the size as multiplication is generally faster than division. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-24glamor: Fix up indentationAdam Jackson1-7/+7
Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-24glamor: Perform texture2D() separately from swizzle.Matt Turner1-12/+14
The texture2D() happens in each branch, so we may as well do it as early as possible and hide some of its latency in the branching instructions. Moving it outside the (uniform) control flow reduces the number of instructions in the fs_source shader from 64 to 46 and in the set_alpha_source shader from 69 to 47 on Haswell. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: Add a helper function for the common GL_QUADS fallback pattern.Eric Anholt4-23/+20
We should do better than this with an index buffer, but for now at least make it so that we don't have to copy the same code to new places. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2015-03-24glamor: Don't optimize out scissor updates in CopyArea.Eric Anholt1-11/+6
This possibly is a minor hit for immediate mode renderers (no difference on copypixin100 on my hsw, n=12), but it gives important information about drawing bounds to a deferred renderer (3.1x improvement in copypixwin100 on vc4). Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2015-03-24glamor: Just set the logic op to what we want at the start of all rendering.Eric Anholt13-49/+25
By dropping the unconditional logic op disable at the end of rendering, this fixes GL errors being thrown in GLES2 contexts (which don't have logic ops). On desktop, this also means a little less overhead per draw call from taking one less trip through the glEnable/glDisable switch statement of doom in Mesa. The exchange here is that we end up taking a trip through it in the XV, Render, and gradient-generation paths. If the glEnable() is actually costly, we should probably cache our logic op state in our screen, since there's no way the GL could make that switch statement as cheap as the caller caching it would be. v2: Don't forget to set the logic op in Xephyr's drawing. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2015-03-24glamor: Fix build when configured --enable-glamor --disable-xshmfenceJon TURNEY1-0/+2
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: check max native ALU instructionsOlivier Fourdan2-0/+34
When using glamor (either in Xephyr or Xwayland) on hardware with too low instructions limit, glamor fallbacks to sw due to large shaders. This makes glamor unbearably slow on such hardware. Check reported value for GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB and fail in glamor_init() if the limit is lower than 128. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=88316 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: Eliminate GLAMOR_TEXTURE_LARGE pixmap typeKeith Packard4-49/+35
Initialize full pixmap private for all pixmaps, including block dimensions and counts so that no checks are needed when walking the fbos. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: Create inline tests for small/large pixmapsKeith Packard9-96/+103
This will let us eliminate the pixmap types shortly Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: Eliminate separate 'large' pixmap private structureKeith Packard15-196/+176
Just embed the large elements in the regular pixmap private and collapse the union to a single struct. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: Remove unused glamor_pixmap_private_atlas_tKeith Packard1-12/+0
Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: Remove screen private and pixmap ptrs from pixmap private and fboKeith Packard11-297/+345
There's no reason to waste memory storing redundant copies of the same pointer all over the system; just pass in pointers as necessary to each function. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: Remove remaining support for FBOs not matching pixmap sizeKeith Packard5-122/+15
The core rendering code already requires that FBOs be allocated at exactly the pixmap size so that tiling and stippling work correctly. Remove the allocation support for that, along with the render code. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: Eliminate GLAMOR_TEXTURE_PACK pixmap typeKeith Packard1-2/+1
This is not used anywhere Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: Eliminate GLAMOR_SEPARATE_TEXTURE pixmap typeKeith Packard2-11/+0
This was only used to signal when we couldn't ask the DDX to draw to a pixmap; now that we have no DDX-based fallbacks, we don't need to have this type. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: Remove ddx fallback check functionsKeith Packard1-34/+0
With no DDX-based fallback support, we can remove these functions as they are no longer called. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: Remove _nf rendering functionsKeith Packard18-581/+29
These were used by the non-standard glamor implementation in the intel driver. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: Eliminate GLAMOR_USE_SCREEN and GLAMOR_USE_PICTURE_SCREENKeith Packard2-86/+52
Remove these defines as we start to remove support for non-standard glamor layering as used by the intel driver. v2: Rebase on the blockhandler change and the Xephyr init failure change (by anholt), fix stray NO_DRI3 addition to xwayland. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: Eliminate GLAMOR_CREATE_PIXMAP_MAP and GLAMOR_MEMORY_MAPKeith Packard3-18/+1
GLAMOR_MEMORY_MAP was only used with GLAMOR_CREATE_PIXMAP_MAP, and GLAMOR_CREATE_PIXMAP_MAP doesn't appear to be used anywhere, so just remove both of them. v2: Fix a stray whitespace bug that was introduced (change by anholt). Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: GL_TEXTURE_MAX_LEVEL is not available on GLES2Maarten Lankhorst3-3/+0
Remove the calls to GL_TEXTURE_MAX_LEVEL. Setting the filtering is a sufficient hint to the driver about texture mipmap allocation. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2015-03-24glamor: Use GL_FRAMEBUFFER instead of GL_READ_FRAMEBUFFERMaarten Lankhorst2-2/+2
The latter might not be available on GLES2. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: do not check for gl errors in glamor_build_programMaarten Lankhorst1-3/+0
According to Eric Anholt the check for glGetError is not needed here. Because a opengl error might be set before this function is called keeping the check could result in glamor_build_program returning failure when building the shader succeeded. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: only use (un)pack_subimage when availableMaarten Lankhorst3-19/+46
Check for GL_EXT_unpack_subimage and GL_NV_pack_subimage to check if GL_(UN)PACK_ROW_LENGTH is available. Set the offsets manually to prevent calls to GL_(UN)PACK_SKIP_*. v2: Check support for GL_NV_pack_subimage as suggested by Matt Turner. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-01-23glamor: use screen blockhandler rather than dix one (v3)Dave Airlie2-12/+12
This adds glamor into the block handler call chain in the correct place. This should fix interactions between glamor and drivers requiring damage from glamor. v2: okay don't consolidate, just leave things wierd for now remove blcokhandler in screen close. v3: block handler wrapping the right way. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
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-12-25glamor: Make glamor_purge_fbo staticMichel Dänzer2-2/+1
Only called from glamor_fbo.c now. 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-12-25glamor: Call glamor_pixmap_destroy_fbo from glamor_set_pixmap_privateMichel Dänzer1-6/+1
Calling glamor_purge_fbo directly was incorrect for large pixmaps. Fixes use-after free with large pixmaps: ==2029== Invalid write of size 8 ~ ==2029== at 0x85F93AD: __xorg_list_del (list.h:184) ==2029== by 0x85F93AD: xorg_list_del (list.h:204) ==2029== by 0x85F93AD: glamor_fbo_expire (glamor_fbo.c:280) ==2029== by 0x85F95CA: glamor_pixmap_fbo_cache_put (glamor_fbo.c:159) ==2029== by 0x85D7AB5: glamor_destroy_textured_pixmap (glamor.c:228) ==2029== by 0xC1BDDC4: radeon_glamor_destroy_pixmap (radeon_glamor.c:272) ==2029== by 0x519D00: damageDestroyPixmap (damage.c:1473) ==2029== by 0x4DD307: XvDestroyPixmap (xvmain.c:370) ==2029== by 0x4DB975: ShmDestroyPixmap (shm.c:258) ==2029== by 0x5098F6: FreePicture (picture.c:1425) ==2029== by 0x85E678E: glamor_composite_clipped_region (glamor_render.c:1558) ==2029== by 0x85F763A: glamor_composite_largepixmap_region (glamor_largepixmap.c:1347) ==2029== by 0x85E7964: _glamor_composite (glamor_render.c:1679) ==2029== by 0x85E7A38: glamor_composite (glamor_render.c:1758) ==2029== Address 0x1141d3c0 is 0 bytes inside a block of size 64 free'd ==2029== at 0x4C29E90: free (vg_replace_malloc.c:473) ==2029== by 0x85D7167: glamor_set_pixmap_private (glamor.c:570) ==2029== by 0xC1BDDC4: radeon_glamor_destroy_pixmap (radeon_glamor.c:272) ==2029== by 0x519D00: damageDestroyPixmap (damage.c:1473) ==2029== by 0x4DD307: XvDestroyPixmap (xvmain.c:370) ==2029== by 0x4DB975: ShmDestroyPixmap (shm.c:258) ==2029== by 0x45B246: doFreeResource (resource.c:875) ==2029== by 0x45BD5E: FreeResource (resource.c:905) ==2029== by 0x43444B: ProcFreePixmap (dispatch.c:1422) ==2029== by 0x43856E: Dispatch (dispatch.c:432) ==2029== by 0x43C96F: dix_main (main.c:298) ==2029== by 0x6CFAB44: (below main) (libc-start.c:287) 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-12-11glamor: Make sure glamor_egl_close_screen wraps glamor_close_screenMichel Dänzer1-3/+3
The other way around fails to destroy the screen pixmap EGL image: ==1782== 80 (32 direct, 48 indirect) bytes in 1 blocks are definitely lost in loss record 981 of 2,171 ==1782== at 0x4C28C20: malloc (vg_replace_malloc.c:296) ==1782== by 0xF9D4BD2: dri2_create_image_from_dri (egl_dri2.c:1264) ==1782== by 0xF9D4BD2: dri2_create_image_dma_buf (egl_dri2.c:1764) ==1782== by 0xF9D4BD2: dri2_create_image_khr (egl_dri2.c:1798) ==1782== by 0xF9C7937: eglCreateImageKHR (eglapi.c:1494) ==1782== by 0x85D5655: _glamor_egl_create_image (glamor_egl.c:134) ==1782== by 0x85D5655: glamor_egl_create_textured_pixmap (glamor_egl.c:302) ==1782== by 0x85D579B: glamor_egl_create_textured_screen (glamor_egl.c:225) ==1782== by 0xC1BE05D: radeon_glamor_create_screen_resources (radeon_glamor.c:67) ==1782== by 0xC1B6153: RADEONCreateScreenResources_KMS (radeon_kms.c:258) ==1782== by 0x4B2105: xf86CrtcCreateScreenResources (xf86Crtc.c:709) ==1782== by 0x43C823: dix_main (main.c:223) ==1782== by 0x6CFAB44: (below main) (libc-start.c:287) 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-12-11glamor: Make glamor_destroy_textured_pixmap idempotentMichel Dänzer2-2/+1
For robustness against drivers which may call both glamor_(egl_)destroy_textured_pixmap and glamor_destroy_pixmap. 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-12-11glamor: Make glamor_set_pixmap_private not crash if the pixmap has no fboMichel Dänzer1-2/+5
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-12-11glamor: Fix use-after-free in glamor_destroy_textured_pixmapMichel Dänzer1-3/+4
==25551== Invalid read of size 8 ==25551== at 0x85D5F2C: glamor_egl_destroy_pixmap_image (glamor_egl.c:527) ==25551== by 0x85D7750: glamor_destroy_pixmap (glamor.c:235) ==25551== by 0xC1BDD9B: radeon_glamor_destroy_pixmap (radeon_glamor.c:278) ==25551== by 0x5098F6: FreePicture (picture.c:1425) ==25551== by 0x85DD7A9: glamor_unrealize_glyph_caches (glamor_glyphs.c:257) ==25551== by 0x85D7B50: glamor_close_screen (glamor.c:586) ==25551== by 0x4B1A82: xf86CrtcCloseScreen (xf86Crtc.c:734) ==25551== by 0x4CFFC7: CursorCloseScreen (cursor.c:187) ==25551== by 0x513A44: AnimCurCloseScreen (animcur.c:106) ==25551== by 0x51529B: present_close_screen (present_screen.c:64) ==25551== by 0x43CA83: dix_main (main.c:351) ==25551== by 0x6CFAB44: (below main) (libc-start.c:287) ==25551== Address 0x83dafa0 is 96 bytes inside a block of size 152 free'd ==25551== at 0x4C29E90: free (vg_replace_malloc.c:473) ==25551== by 0x85D76B4: glamor_destroy_textured_pixmap (glamor.c:225) ==25551== by 0x85D7750: glamor_destroy_pixmap (glamor.c:235) ==25551== by 0xC1BDD9B: radeon_glamor_destroy_pixmap (radeon_glamor.c:278) ==25551== by 0x5098F6: FreePicture (picture.c:1425) ==25551== by 0x85DD7A9: glamor_unrealize_glyph_caches (glamor_glyphs.c:257) ==25551== by 0x85D7B50: glamor_close_screen (glamor.c:586) ==25551== by 0x4B1A82: xf86CrtcCloseScreen (xf86Crtc.c:734) ==25551== by 0x4CFFC7: CursorCloseScreen (cursor.c:187) ==25551== by 0x513A44: AnimCurCloseScreen (animcur.c:106) ==25551== by 0x51529B: present_close_screen (present_screen.c:64) ==25551== by 0x43CA83: dix_main (main.c:351) 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-12-11glamor: Add an accessor for the GBM device.Dave Airlie2-0/+14
(Originally written by Dave Airlie; split into a separate patch by Kenneth Graunke.) Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Tested-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-12-10glamor: Reinstate glamor_(egl_)destroy_textured_pixmapMichel Dänzer3-2/+15
They are part of the ABI. 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-12-09glamor: Free existing EGL image when assigning new oneKeith Packard1-7/+21
When reallocating the framebuffer on screen resize, the old EGL image was getting leaked. Check for an existing EGL image and free it in this case. Signed-off-by: Keith Packard <keithp@keithp.com> Revewied-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-12-09glamor: Remove redundant reference to screen pixmap EGL imageKeith Packard1-12/+1
There's no reason to store this in the egl screen private as the screen pixmap will always hold a reference to it anyways. Signed-off-by: Keith Packard <keithp@keithp.com> Revewied-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-12-09glamor: Always destroy EGL image associated with destroyed pixmapKeith Packard5-56/+18
There were three paths that called eglDestroyImageKHR: * The front buffer * The intel driver's flip buffer * pixmaps under DRI3 This patch unifies the second two by having glamor_destroy_pixmap always destroy any associaged EGL image. This allows us to stop storing the back_pixmap pointer in glamor as that was only used to make sure that buffer was freed at server reset time. v2: check for valid pixmap_priv before using it in glamor_egl_destroy_pixmap_image Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-11-24Merge remote-tracking branch 'whot/for-keith'Keith Packard1-1/+1
2014-11-20glamor: Don't insert fbos from external objects into fbo cacheKeith Packard3-1/+5
Mark fbos created from external buffers so that when the associated pixmap is destroyed, they aren't put into the fbo cache for later re-use and are instead freed immediately. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-11-12Drop trailing whitespacesPeter Hutterer1-1/+1
sed -i "s/[ ]\+$//g" **/*.(c|h) happy reviewing... git diff -w is an empty diff. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>