mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>,
	Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v1 1/4] video: simplefb-client: switch to dev_get_resource
Date: Wed, 30 Jul 2025 14:31:34 +0200	[thread overview]
Message-ID: <855b4098-9187-4ee6-95ff-9052c446f58a@pengutronix.de> (raw)
In-Reply-To: <334ffb15-1193-4f3f-a378-edcb04cd330d@gmail.com>

Hello Ivaylo,

On 7/30/25 13:28, Ivaylo Ivanov wrote:
> On 7/30/25 11:11, Ahmad Fatoum wrote:
>> Hi Ivaylo,
>>
>> thanks for your patch.
>>
>> On 7/29/25 22:36, Ivaylo Ivanov wrote:
>>> Since the framebuffer memory resource resides in ram, it has already
>>> been requested and mapped, so only get the resource to avoid
>>> requesting a busy resource. This is also the approach for linux.
>> even if it's regular RAM (as opposed to video memory) we aren't
>> guaranteed, it's mapped suitably.
> 
> In my case at least, the mainline device tree covers all of dram -
> (0x80000000 + n GB)
> 
>>
>> I think a remap of the region to writecombine is in order here. It
>> probably works right now, because we flush caches before shutting down
>> the MMU, but if you were to run fbtest, I'd expect that you will see
>> artifacts due to some pixels remaining in dirty cache line.
> 
> So you suggest remapping it, like ipufb for example?
> 
>     fbi->info.screen_base = dma_alloc_writecombine(DMA_DEVICE_BROKEN,
>                            info->line_length * info->yres,
>                            DMA_ADDRESS_BROKEN);

Except for dma_alloc_writecombine allocating a new buffer instead of
remapping an existing region. See the patch I just Cc'd you on.

>>> While at it, use IOMEM for mem->start and drop an unnecessary newline.
>>>
>>> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
>> Patch is correct, except for that aspect of the commit message:
> 
> I don't get it, do I have to change the commit message only, or
> code logic too?

Just correct the commit message: s/Since/If/.

The writecombine thing is a separate issue.

Cheers,
Ahmad

> 
> Thanks and best regards,
> Ivaylo
> 
>>
>> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
>>
>> Thanks,
>> Ahmad
>>
>>> ---
>>>  drivers/video/simplefb-client.c | 5 ++---
>>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/video/simplefb-client.c b/drivers/video/simplefb-client.c
>>> index dafec617..41ad8ffa 100644
>>> --- a/drivers/video/simplefb-client.c
>>> +++ b/drivers/video/simplefb-client.c
>>> @@ -96,7 +96,7 @@ static int simplefb_probe(struct device *dev)
>>>  	if (ret)
>>>  		return ret;
>>>  
>>> -	mem = dev_request_mem_resource(dev, 0);
>>> +	mem = dev_get_resource(dev, IORESOURCE_MEM, 0);
>>>  	if (IS_ERR(mem)) {
>>>  		dev_err(dev, "No memory resource\n");
>>>  		return PTR_ERR(mem);
>>> @@ -116,10 +116,9 @@ static int simplefb_probe(struct device *dev)
>>>  	info->blue = params.format->blue;
>>>  	info->transp = params.format->transp;
>>>  
>>> -	info->screen_base = (void *)mem->start;
>>> +	info->screen_base = IOMEM(mem->start);
>>>  	info->screen_size = resource_size(mem);
>>>  
>>> -
>>>  	info->fbops = &simplefb_ops;
>>>  
>>>  	info->dev.parent = dev;
> 
> 

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




  reply	other threads:[~2025-07-30 12:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-29 20:36 [PATCH v1 0/4] ARM: boards: add support for Samsung Galaxy S8 and S20 5G Ivaylo Ivanov
2025-07-29 20:36 ` [PATCH v1 1/4] video: simplefb-client: switch to dev_get_resource Ivaylo Ivanov
2025-07-30  8:11   ` Ahmad Fatoum
2025-07-30 11:28     ` Ivaylo Ivanov
2025-07-30 12:31       ` Ahmad Fatoum [this message]
2025-07-29 20:36 ` [PATCH v1 2/4] clocksource: arm_architected_timer: support clock-frequency Ivaylo Ivanov
2025-07-30  8:13   ` Ahmad Fatoum
2025-08-05  7:40   ` (subset) " Sascha Hauer
2025-07-29 20:36 ` [PATCH v1 3/4] ARM: boards: add support for Samsung Galaxy S8 (dreamlte) Ivaylo Ivanov
2025-07-30  8:31   ` Ahmad Fatoum
2025-07-30  9:09     ` Ivaylo Ivanov
2025-07-30  9:33       ` Ahmad Fatoum
2025-07-30 11:12         ` Ivaylo Ivanov
2025-07-29 20:36 ` [PATCH v1 4/4] ARM: boards: add support for Samsung Galaxy S20 5G (x1s) Ivaylo Ivanov
2025-07-30  8:48   ` Ahmad Fatoum
2025-07-30  9:16     ` Ivaylo Ivanov
2025-07-30  9:44       ` Ahmad Fatoum
2025-07-30 11:18         ` Ivaylo Ivanov
2025-07-30 12:50           ` Ahmad Fatoum
2025-07-30 13:12             ` Ivaylo Ivanov
2025-07-30 13:26               ` Ahmad Fatoum

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=855b4098-9187-4ee6-95ff-9052c446f58a@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=ivo.ivanov.ivanov1@gmail.com \
    --cc=s.hauer@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox