summaryrefslogtreecommitdiff
path: root/src/intel_driver.c
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2011-11-16 15:04:36 +0800
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-17 01:10:21 +0000
commitfbabe60f48006ee664c983082498a863e8beec71 (patch)
treee0b76a3ee86fcb9b746565a7971ff52c979a0e24 /src/intel_driver.c
parentc4c2eb1fae2518578a56a278afeaec66d544439d (diff)
glamor: Initial commit to introduce glamor acceleration.
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>
Diffstat (limited to 'src/intel_driver.c')
-rw-r--r--src/intel_driver.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 188c5125..451bebd9 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -76,6 +76,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i915_drm.h"
#include <xf86drmMode.h>
+#include "intel_glamor.h"
+
/* *INDENT-OFF* */
/*
* Note: "ColorKey" is provided for compatibility with the i810 driver.
@@ -713,6 +715,13 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags)
return FALSE;
}
+ if (!intel_glamor_pre_init(scrn)) {
+ PreInitCleanup(scrn);
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+ "Failed to pre init glamor display.\n");
+ return FALSE;
+ }
+
/* Load the dri2 module if requested. */
if (intel->directRenderingType != DRI_DISABLED)
xf86LoadSubModule(scrn, "dri2");
@@ -814,8 +823,10 @@ intel_flush_callback(CallbackListPtr *list,
pointer user_data, pointer call_data)
{
ScrnInfoPtr scrn = user_data;
- if (scrn->vtSema)
+ if (scrn->vtSema) {
intel_batch_submit(scrn);
+ intel_glamor_flush(intel_get_screen_private(scrn));
+ }
}
#if HAVE_UDEV
@@ -1111,6 +1122,8 @@ static void I830FreeScreen(int scrnIndex, int flags)
ScrnInfoPtr scrn = xf86Screens[scrnIndex];
intel_screen_private *intel = intel_get_screen_private(scrn);
+ intel_glamor_free_screen(scrnIndex, flags);
+
if (intel) {
intel_mode_fini(intel);
intel_close_drm_master(intel);
@@ -1187,6 +1200,8 @@ static Bool I830CloseScreen(int scrnIndex, ScreenPtr screen)
DeleteCallback(&FlushCallback, intel_flush_callback, scrn);
+ intel_glamor_close_screen(screen);
+
if (intel->uxa_driver) {
uxa_driver_fini(screen);
free(intel->uxa_driver);