summaryrefslogtreecommitdiff
path: root/src/intel_glamor.c
AgeCommit message (Collapse)Author
2012-02-21uxa/glamor/dri: Enable the pageflip support on glamor.Zhigang Gong
To support easy buffer exchange at glamor layer, glamor added a new API glamor_egl_exchange_buffers() to exchange two pixmaps' EGL image and fbos and textures without recreating any of them. But this simple method's requirement is that there are two pixmaps. A exceptional case is: If we are using triple buffer when do page flipping, we will have an extra back_buffer which doesn't have a pixmap attached to it. Then each time we set that buffer to a pixmap, we will have to call the create_egl_textured_pixmap to create the corresponding EGL image and fbo and texture for it. This is not efficient. To fix this issue, this commit introduces a new back_pixmap to intel structure to hold the back buffer and corresponding glamor resources. Then we will just need to do the light weight buffer exchanging at both DDX and glamor layer. As the new back pixmap is similar to the screen pixmap and need to be handled carefully when close screen. As the glamor data structure is a per screen data, and will be released at its close screen method. The glamor's close screen method must cleanup the screen pixmap and back pixmap's glamor resources. screen pixmap is easy to get, but there is no good way to store the back pixmap. So the glamor add a new API glamor_egl_create_textured_screen_ext function to pass the back pixmap's pointer to glamor layer. This commit make us depend on glamor commit: 4e58c4f. And we increased the required glamor version from 0.3.0 to 0.3.1 Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-08uxa/glamor: Use a macro to specify module name.Zhigang Gong
This depends upon glamor commit b5f8d, just after the 0.3.0 tag. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-08uxa/glamor: Refine CloseScreen and InitScreen process.Zhigang Gong
The previous version calls glamor_egl_close_screen and glamor_egl_free_screen manually which is not align with standard process. Now glamor change the way to follow standard method: glamor layer and glamor egl layer both have their internal CloseScreens. The correct sequence is after the I830CloseScreen is registered, then register glamor_egl_close_screen and the last one is glamor_close_screen. So we move out the intel_glamor_init from the intel_uxa_init to I830ScreenInit and just after the registration of I830CloseScreen. As the glamor interfaces changed, we need to check the glamor version when load the glamor egl module to make sure we are loading the right glamor module. If failed, it will switch back to UXA path. This depends upon glamor commit 1bc8bf tagged with version 0.3.0. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-16uxa/glamor: Create glamor pixmap by default.Zhigang Gong
When creating native glamor pixmaps we will get much better performance than using the textured-drm pixmap, this commit is to make that the default behaviour when configured to use glamor. Another advantage of this commit is that we reduce the risk of encountering the "incompatible region exists for this name" and the associated render corruption. And since we now never intentionally allocate a reusable pixmap we could just make all (intel_glamor) allocations non-reusable without incurring too great an overhead. A side effect is that those glamor pixmaps do not have a valid BO attached to them and thus it fails to get a DRI drawable. This commit also fixes that problem by adjusting the fixup_shadow mechanism to recreate a textured-drm pixmap from the native glamor pixmap. I tested this with mutter, and it works fine. The performance gain to apply this patch is about 10% to 20% with different workload. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-03uxa/glamor: Remove extraneous flushZhigang Gong
When glamor is enabled, a pixmap will not be accessed by UXA's accelerated functions. Only unaccelerated functions may access those pixmaps, and before each unaccelerated rendering, it calls uxa_prepare_access which will do a glFlush. Combined with a flush before sending to DRI clients, we no longer need to flush after every operation. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-03uxa/glamor: Remove dead code.Zhigang Gong
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-16uxa/glamor: Fallback to new glamor pixmap if failed to create textured pixmap.Zhigang Gong
If we failed to create textured pixmap from BO's handle, we turn to create a new glamor pixmap by call glamor_create_pixmap rather than fallback to in-memory pixmap. Have to introduce a new wrapper function intel_glamor_create_pixmap. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-12-14uxa/glamor: Silence a compiler warning for some unused codeChris Wilson
intel_glamor.c: In function 'intel_glamor_create_screen_image': intel_glamor.c:192:12: warning: variable 'pixmap' set but not used [-Wunused-but-set-variable] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-17glamor: Initial commit to introduce glamor acceleration.Zhigang Gong
Added one configuration option --enable-glamor to control whether use glamor. Added one new file intel_glamor.c to wrap glamor egl API for intel driver's usage. This commit doesn't really change the driver's control path. It just adds necessary files for glamor and change some configuration. Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com> Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>