All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Simon Glass <sjg@chromium.org>,
	Anatolij Gustschin <agust@denx.de>, Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de, maemo-leste@lists.dyne.org
Subject: [PATCH v2 1/2] video: Allow drivers to allocate the frame buffer themselves
Date: Wed,  9 Mar 2022 20:46:00 +0100	[thread overview]
Message-ID: <20220309194601.29238-1-pali@kernel.org> (raw)
In-Reply-To: <20220216204219.18539-1-pali@kernel.org>

When plat->base is set by driver then skip frame buffer reservation and allocation.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 drivers/video/video-uclass.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 7d499bcec51d..88797d4a21c2 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -33,7 +33,8 @@
  * information represents the requires size and alignment of the frame buffer
  * for the device. The values can be an over-estimate but cannot be too
  * small. The actual values will be suppled (in the same manner) by the bind()
- * method after relocation.
+ * method after relocation. Additionally driver can allocate frame buffer
+ * itself by setting plat->base.
  *
  * This information is then picked up by video_reserve() which works out how
  * much memory is needed for all devices. This is allocated between
@@ -78,6 +79,10 @@ static ulong alloc_fb(struct udevice *dev, ulong *addrp)
 	if (!plat->size)
 		return 0;
 
+	/* Allow drivers to allocate the frame buffer themselves */
+	if (plat->base)
+		return 0;
+
 	align = plat->align ? plat->align : 1 << 20;
 	base = *addrp - plat->size;
 	base &= ~(align - 1);
-- 
2.20.1


  parent reply	other threads:[~2022-03-09 19:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16 20:42 [PATCH] WIP: Nokia RX-51: Convert to CONFIG_DM_VIDEO Pali Rohár
2022-02-17  8:53 ` Anatolij Gustschin
2022-02-17 12:20   ` Pali Rohár
2022-03-06 11:51     ` Pali Rohár
2022-03-06 12:51       ` Simon Glass
2022-03-06 14:17         ` Pali Rohár
2022-03-06 14:42           ` Simon Glass
2022-03-06 15:25             ` Pali Rohár
2022-03-06 18:44               ` Simon Glass
2022-03-09 19:44                 ` Pali Rohár
2022-03-09 22:20                   ` Anatolij Gustschin
2022-03-11 18:58                     ` Pali Rohár
2022-03-12  5:02                       ` Simon Glass
2022-03-13 11:06                         ` Pali Rohár
2022-03-06 15:08 ` [PATCH] " Pali Rohár
2022-03-06 18:43   ` Simon Glass
2022-03-09 19:37     ` Pali Rohár
2022-03-09 19:46 ` Pali Rohár [this message]
2022-03-09 19:46   ` [PATCH v2 2/2] " Pali Rohár
2022-03-14 22:42     ` Anatolij Gustschin
2022-03-12  2:43   ` [PATCH v2 1/2] video: Allow drivers to allocate the frame buffer themselves Simon Glass
2022-03-14 22:41   ` Anatolij Gustschin

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=20220309194601.29238-1-pali@kernel.org \
    --to=pali@kernel.org \
    --cc=agust@denx.de \
    --cc=maemo-leste@lists.dyne.org \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.