dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Eric Anholt <eric@anholt.net>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>,
	dri-devel@lists.freedesktop.org
Subject: [PATCH 1/6] drm/vc4: Make vc4_lbm_size() return 0 when vertical scaling is disabled
Date: Thu, 15 Nov 2018 11:37:16 +0100	[thread overview]
Message-ID: <20181115103721.25601-2-boris.brezillon@bootlin.com> (raw)
In-Reply-To: <20181115103721.25601-1-boris.brezillon@bootlin.com>

LBM is not needed when vertical scaling is disabled. Return 0 in this
case to avoid allocating LBM memory that will anyway be unused.

While at it, drop the test on ->is_unity which is now redundant.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
---
 drivers/gpu/drm/vc4/vc4_plane.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index c3ded0ba0441..f6e3e8d33115 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -395,10 +395,13 @@ static u32 vc4_lbm_size(struct drm_plane_state *state)
 	u32 pix_per_line = max(vc4_state->src_w[0], (u32)vc4_state->crtc_w);
 	u32 lbm;
 
+	/* LBM is not needed when there's no vertical scaling. */
+	if (vc4_state->y_scaling[0] == VC4_SCALING_NONE &&
+	    vc4_state->y_scaling[1] == VC4_SCALING_NONE)
+		return 0;
+
 	if (!vc4_state->is_yuv) {
-		if (vc4_state->is_unity)
-			return 0;
-		else if (vc4_state->y_scaling[0] == VC4_SCALING_TPZ)
+		if (vc4_state->y_scaling[0] == VC4_SCALING_TPZ)
 			lbm = pix_per_line * 8;
 		else {
 			/* In special cases, this multiplier might be 12. */
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-11-15 10:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-15 10:37 [PATCH 0/6] drm/vc4: Allow scaling on cursor planes Boris Brezillon
2018-11-15 10:37 ` Boris Brezillon [this message]
2018-11-15 20:39   ` [PATCH 1/6] drm/vc4: Make vc4_lbm_size() return 0 when vertical scaling is disabled Eric Anholt
2018-11-15 10:37 ` [PATCH 2/6] drm/vc4: Move LBM creation out of vc4_plane_mode_set() Boris Brezillon
2018-11-15 20:39   ` Eric Anholt
2018-11-15 21:10     ` Boris Brezillon
2018-11-20  4:41       ` Eric Anholt
2018-11-15 10:37 ` [PATCH 3/6] drm/vc4: Don't check plane state more than once Boris Brezillon
2018-11-15 20:41   ` Eric Anholt
2018-11-15 21:12     ` Boris Brezillon
2018-11-20  4:38       ` Eric Anholt
2018-11-15 10:37 ` [PATCH 4/6] drm/vc4: Rework the async update logic Boris Brezillon
2018-11-15 20:49   ` Eric Anholt
2018-11-15 21:21     ` Boris Brezillon
2018-11-20  4:44       ` Eric Anholt
2018-11-15 10:37 ` [PATCH 5/6] drm/vc4: Allow scaling on cursor plane Boris Brezillon
2018-11-15 20:50   ` Eric Anholt
2018-11-15 10:37 ` [PATCH 6/6] drm/vc4: Allow YUV formats on cursor planes Boris Brezillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181115103721.25601-2-boris.brezillon@bootlin.com \
    --to=boris.brezillon@bootlin.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox