diff options
author | Rob Clark <robdclark@gmail.com> | 2014-05-04 13:13:38 -0400 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2014-05-04 19:55:40 -0400 |
commit | 6e6e0ebcc3fc000577ac7d1c6ea1e6bcdc9671ad (patch) | |
tree | 8459404164cb54e96e64f1a7a3b5a209c83c1c7b | |
parent | 8b38461c8ab4cabba63be2f572fa024d6d8241a5 (diff) |
option to enable/disable individual EXA functions
Mostly for debug.
Signed-off-by: Rob Clark <robdclark@gmail.com>
-rw-r--r-- | man/freedreno.man | 6 | ||||
-rw-r--r-- | src/msm-driver.c | 18 | ||||
-rw-r--r-- | src/msm-exa-xa.c | 4 | ||||
-rw-r--r-- | src/msm-exa.c | 6 | ||||
-rw-r--r-- | src/msm.h | 12 |
5 files changed, 42 insertions, 4 deletions
diff --git a/man/freedreno.man b/man/freedreno.man index a70c810..4586c43 100644 --- a/man/freedreno.man +++ b/man/freedreno.man @@ -47,6 +47,12 @@ Enable SW Refresher. Only applicable for fbdev/kgsl, unused for drm/msm. .IP Default: Enabled .TP +.BI "Option \*qexamask\*q \*q" integer \*q +Bitmask of enabled EXA functions: 1-Solid, 2-Copy, 4-Composite. +Mostly intended for debugging. +.IP +Default: 7 +.TP .BI "Option \*qfb\*q \*q" string \*q Path to fbdev device file. Required to use fbdev/kgsl, unused for drm/msm. .IP diff --git a/src/msm-driver.c b/src/msm-driver.c index 440da52..c2b5123 100644 --- a/src/msm-driver.c +++ b/src/msm-driver.c @@ -77,6 +77,7 @@ static const OptionInfoRec MSMOptions[] = { {OPTION_FB, "fb", OPTV_STRING, {0}, FALSE}, {OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_SWCURSOR, "SWCursor", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_EXAMASK, "examask", OPTV_INTEGER, {0}, FALSE}, {OPTION_SWREFRESHER, "SWRefresher", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_VSYNC, "DefaultVsync", OPTV_INTEGER, {0}, FALSE}, {OPTION_DEBUG, "Debug", OPTV_BOOLEAN, {0}, FALSE}, @@ -166,6 +167,7 @@ MSMPreInit(ScrnInfoPtr pScrn, int flags) MSMPtr pMsm; rgb defaultWeight = { 0, 0, 0 }; Gamma zeros = { 0.0, 0.0, 0.0 }; + unsigned long val; DEBUG_MSG("pre-init"); @@ -253,6 +255,22 @@ MSMPreInit(ScrnInfoPtr pScrn, int flags) /* SWRefresher - default TRUE */ pMsm->SWRefresher = xf86ReturnOptValBool(pMsm->options, OPTION_SWREFRESHER, TRUE); + if (xf86GetOptValULong(pMsm->options, OPTION_EXAMASK, &val)) + pMsm->examask = val; + else + pMsm->examask = ACCEL_DEFAULT; + + INFO_MSG("Option Summary:"); + INFO_MSG(" NoAccel: %d", pMsm->NoAccel); + INFO_MSG(" HWCursor: %d", pMsm->HWCursor); + INFO_MSG(" examask: %d", pMsm->examask); + if (pMsm->NoKMS) { + const char *fb = xf86GetOptValString(pMsm->options, OPTION_FB); + INFO_MSG(" fb: %s", fb); + INFO_MSG(" SWRefresher: %d", pMsm->SWRefresher); + } + INFO_MSG(" Debug: %d", msmDebug); + xf86PrintModes(pScrn); /* FIXME: We will probably need to be more exact when setting diff --git a/src/msm-exa-xa.c b/src/msm-exa-xa.c index 5cd4b7e..03e9f72 100644 --- a/src/msm-exa-xa.c +++ b/src/msm-exa-xa.c @@ -84,6 +84,7 @@ XAPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg) { MSM_LOCALS(pPixmap); struct xa_surface *dst = msm_get_pixmap_surf(pPixmap); + EXA_FAIL_IF(!(pMsm->examask & ACCEL_SOLID)); if (!dst) return FALSE; return xa_solid_prepare(exa->ctx, dst, fg) == XA_ERR_NONE; @@ -172,6 +173,7 @@ XAPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int dx, int dy, MSM_LOCALS(pDstPixmap); struct xa_surface *src = msm_get_pixmap_surf(pSrcPixmap); struct xa_surface *dst = msm_get_pixmap_surf(pDstPixmap); + EXA_FAIL_IF(!(pMsm->examask & ACCEL_COPY)); if (!(src && dst)) return FALSE; return xa_copy_prepare(exa->ctx, dst, src) == XA_ERR_NONE; @@ -461,6 +463,7 @@ XACheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture) { MSM_LOCALS(pDstPicture->pDrawable); + EXA_FAIL_IF(!(pMsm->examask & ACCEL_COMPOSITE)); if (!xa_setup_composite(exa, op, pSrcPicture, pMaskPicture, pDstPicture)) return FALSE; EXA_FAIL_IF(xa_composite_check_accelerated(&exa->comp) != XA_ERR_NONE); @@ -528,6 +531,7 @@ XAPrepareComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst) { MSM_LOCALS(pDst); + EXA_FAIL_IF(!(pMsm->examask & ACCEL_COMPOSITE)); if (!xa_update_composite(&exa->comp, pSrc, pMask, pDst)) return FALSE; EXA_FAIL_IF(xa_composite_prepare(exa->ctx, &exa->comp) != XA_ERR_NONE); diff --git a/src/msm-exa.c b/src/msm-exa.c index 5c04ef5..e1b24e8 100644 --- a/src/msm-exa.c +++ b/src/msm-exa.c @@ -231,6 +231,7 @@ MSMPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg) { MSM_LOCALS(pPixmap); + EXA_FAIL_IF(!(pMsm->examask & ACCEL_SOLID)); EXA_FAIL_IF(planemask != FB_ALLONES); EXA_FAIL_IF(alu != GXcopy); @@ -350,6 +351,7 @@ MSMPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int dx, int dy, { MSM_LOCALS(pDstPixmap); + EXA_FAIL_IF(!(pMsm->examask & ACCEL_COPY)); EXA_FAIL_IF(planemask != FB_ALLONES); EXA_FAIL_IF(alu != GXcopy); @@ -482,6 +484,8 @@ MSMCheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, MSM_LOCALS(pDstPicture->pDrawable); int idx = 0; + EXA_FAIL_IF(!(pMsm->examask & ACCEL_COMPOSITE)); + // TODO proper handling for RGB vs BGR! EXA_FAIL_IF((pDstPicture->format != PICT_a8r8g8b8) && @@ -591,6 +595,8 @@ MSMPrepareComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, { MSM_LOCALS(pDst); + EXA_FAIL_IF(!(pMsm->examask & ACCEL_COMPOSITE)); + // TODO, maybe we can support this.. pSrcPicture could be telling // us to do solid, which we could probably support EXA_FAIL_IF(!pSrc); @@ -55,6 +55,7 @@ typedef enum OPTION_NOACCEL, OPTION_SWCURSOR, OPTION_SWREFRESHER, + OPTION_EXAMASK, OPTION_VSYNC, OPTION_DEBUG, } MSMOpts; @@ -77,6 +78,13 @@ typedef struct _MSMRec Bool HWCursor; Bool SWRefresher; + enum { + ACCEL_SOLID = 0x1, + ACCEL_COPY = 0x2, + ACCEL_COMPOSITE = 0x4, + ACCEL_DEFAULT = ACCEL_SOLID | ACCEL_COPY | ACCEL_COMPOSITE, + } examask; + int drmFD; int pending_page_flips; @@ -84,10 +92,6 @@ typedef struct _MSMRec struct fd_device *dev; char *deviceName; - /* for now just a single ringbuffer.. not sure if we need more.. - * probably would like more until context restore works in a sane - * way.. - */ struct { int idx; struct fd_ringbuffer *rings[8]; |