summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Wei Huang <cwhuang@linux.org.tw>2013-06-04 22:38:15 +0800
committerChih-Wei Huang <cwhuang@linux.org.tw>2013-07-17 10:28:58 +0800
commit263f0c13e63e23d27209bdb66a239d870bf3eb6d (patch)
tree9eec92176f3af25ea72b59e97c996256824347ec
parent152d07cb6d5901f53f333d19bf2cb83acf8747fa (diff)
downloadexternal_drm_gralloc-263f0c13e63e23d27209bdb66a239d870bf3eb6d.zip
external_drm_gralloc-263f0c13e63e23d27209bdb66a239d870bf3eb6d.tar.gz
external_drm_gralloc-263f0c13e63e23d27209bdb66a239d870bf3eb6d.tar.bz2
gralloc_drm_intel: fix i915 issues: failed to exec batch
Old i915 doesn't have I915_EXEC_BLT bit. Only set the bit if it's available.
-rw-r--r--gralloc_drm_intel.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gralloc_drm_intel.c b/gralloc_drm_intel.c
index 645339b..3a020b4 100644
--- a/gralloc_drm_intel.c
+++ b/gralloc_drm_intel.c
@@ -62,6 +62,7 @@ struct intel_info {
drm_intel_bo *batch_ibo;
uint32_t *batch, *cur;
int capacity, size;
+ int exec_blt;
};
struct intel_buffer {
@@ -131,7 +132,7 @@ batch_flush(struct intel_info *info)
goto fail;
}
ret = drm_intel_bo_mrb_exec(info->batch_ibo, size,
- NULL, 0, 0, I915_EXEC_BLT);
+ NULL, 0, 0, info->exec_blt);
if (ret) {
ALOGE("failed to exec batch");
goto fail;
@@ -564,7 +565,7 @@ static void intel_init_kms_features(struct gralloc_drm_drv_t *drv,
{
struct intel_info *info = (struct intel_info *) drv;
struct drm_i915_getparam gp;
- int pageflipping, id;
+ int pageflipping, id, has_blt;
switch (drm->primary.fb_format) {
case HAL_PIXEL_FORMAT_BGRA_8888:
@@ -591,6 +592,13 @@ static void intel_init_kms_features(struct gralloc_drm_drv_t *drv,
if (drmCommandWriteRead(drm->fd, DRM_I915_GETPARAM, &gp, sizeof(gp)))
id = 0;
+ memset(&gp, 0, sizeof(gp));
+ gp.param = I915_PARAM_HAS_BLT;
+ gp.value = &has_blt;
+ if (drmCommandWriteRead(drm->fd, DRM_I915_GETPARAM, &gp, sizeof(gp)))
+ has_blt = 0;
+ info->exec_blt = has_blt ? I915_EXEC_BLT : 0;
+
/* GEN4, G4X, GEN5, GEN6, GEN7 */
if ((IS_9XX(id) || IS_G4X(id)) && !IS_GEN3(id)) {
if (IS_GEN7(id))