From 31401d3de9c83b356d616ce07eac7435aeb293f5 Mon Sep 17 00:00:00 2001 From: Alan Kwong Date: Tue, 27 Sep 2016 07:41:56 -0400 Subject: drm/msm/sde: use const alpha for wb if pipe alpha not supported Writeback can source alpha from upper pipe or from constant alpha. When pipe alpha is not supported, use constant alpha to supply alpha value for writeback. Change-Id: I4381aeb35bc1ef4c18e70174880b223a61e89024 Signed-off-by: Alan Kwong --- drivers/gpu/drm/msm/sde/sde_hw_catalog.h | 2 ++ drivers/gpu/drm/msm/sde/sde_hw_wb.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/sde/sde_hw_catalog.h b/drivers/gpu/drm/msm/sde/sde_hw_catalog.h index 85aa6b671258..91e7b90cbc76 100644 --- a/drivers/gpu/drm/msm/sde/sde_hw_catalog.h +++ b/drivers/gpu/drm/msm/sde/sde_hw_catalog.h @@ -174,6 +174,7 @@ enum { * support * @SDE_WB_WBWC_1_5 UBWC 1.5 support * @SDE_WB_YUV_CONFIG Writeback supports output of YUV colorspace + * @SDE_WB_PIPE_ALPHA Writeback supports pipe alpha * @SDE_WB_MAX maximum value */ enum { @@ -187,6 +188,7 @@ enum { SDE_WB_TRAFFIC_SHAPER, SDE_WB_UBWC_1_0, SDE_WB_YUV_CONFIG, + SDE_WB_PIPE_ALPHA, SDE_WB_MAX }; diff --git a/drivers/gpu/drm/msm/sde/sde_hw_wb.c b/drivers/gpu/drm/msm/sde/sde_hw_wb.c index a776d5538d83..60141dcf9be5 100644 --- a/drivers/gpu/drm/msm/sde/sde_hw_wb.c +++ b/drivers/gpu/drm/msm/sde/sde_hw_wb.c @@ -96,7 +96,8 @@ static void sde_hw_wb_setup_format(struct sde_hw_wb *ctx, if (fmt->bits[C3_ALPHA] || fmt->alpha_enable) { dst_format |= BIT(8); /* DSTC3_EN */ - if (!fmt->alpha_enable) + if (!fmt->alpha_enable || + !(ctx->caps->features & BIT(SDE_WB_PIPE_ALPHA))) dst_format |= BIT(14); /* DST_ALPHA_X */ } -- cgit v1.2.3