summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2015-06-11 10:16:15 +0100
committerRussell King <rmk@arm.linux.org.uk>2015-06-29 12:58:35 +0100
commite498aaa4759c12e02665507123d4c2ce1d15f848 (patch)
tree193c8453a0a504a44d489e991fa48d2fae8b5a99
parent105eb7355f43d5f7019cdb498250cfdf74321359 (diff)
src: provide option to switch to GPU bo allocation
Provide an xorg.conf option to switch pixmap allocations off Armada DRM onto the GPU instead. This is useful for Dove, where we would otherwise always use the Armada DRM allocator, and it allows the performance of the two allocators to be compared. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--src/armada_drm.c17
-rw-r--r--src/armada_drm.h1
2 files changed, 13 insertions, 5 deletions
diff --git a/src/armada_drm.c b/src/armada_drm.c
index 44eb359..c3084ac 100644
--- a/src/armada_drm.c
+++ b/src/armada_drm.c
@@ -41,6 +41,7 @@ const OptionInfoRec armada_drm_options[] = {
{ OPTION_XV_ACCEL, "XvAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_XV_PREFEROVL, "XvPreferOverlay", OPTV_BOOLEAN, {0}, TRUE },
{ OPTION_USE_GPU, "UseGPU", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_USE_KMS_BO, "UseKMSBo", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_ACCEL_MODULE, "AccelModule", OPTV_STRING, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -437,6 +438,7 @@ static Bool armada_drm_ScreenInit(SCREEN_INIT_ARGS_DECL)
struct common_drm_info *drm = GET_DRM_INFO(pScrn);
struct armada_drm_info *arm = GET_ARMADA_DRM_INFO(pScrn);
struct drm_armada_bo *bo;
+ Bool use_kms_bo;
Bool ret;
if (drmSetMaster(drm->fd)) {
@@ -472,14 +474,19 @@ static Bool armada_drm_ScreenInit(SCREEN_INIT_ARGS_DECL)
arm->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = armada_drm_CloseScreen;
+ /*
+ * Only pass the armada-drm bo manager if we are really
+ * driving armada-drm, other DRMs don't provide bo managers.
+ */
+ use_kms_bo = arm->version && strstr(arm->version->name, "armada");
+ if (use_kms_bo)
+ use_kms_bo = xf86ReturnOptValBool(arm->Options,
+ OPTION_USE_KMS_BO, TRUE);
+
if (arm->accel) {
struct drm_armada_bufmgr *mgr = arm->bufmgr;
- /*
- * Only pass the armada-drm bo manager if we are really
- * driving armada-drm, other DRMs don't provide bo managers.
- */
- if (!arm->version || !strstr(arm->version->name, "armada"))
+ if (!use_kms_bo)
mgr = NULL;
if (!arm->accel_ops->screen_init(pScreen, mgr)) {
diff --git a/src/armada_drm.h b/src/armada_drm.h
index dbb31ab..ec60e73 100644
--- a/src/armada_drm.h
+++ b/src/armada_drm.h
@@ -39,6 +39,7 @@ enum {
OPTION_XV_ACCEL,
OPTION_XV_PREFEROVL,
OPTION_USE_GPU,
+ OPTION_USE_KMS_BO,
OPTION_ACCEL_MODULE,
};