Linux Framebuffer Layer development
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Javier Martinez Canillas <javierm@redhat.com>,
	deller@gmx.de, pjones@redhat.com
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/4] fbdev/efifb: Use screen_info pointer from device
Date: Fri, 1 Dec 2023 10:26:19 +0100	[thread overview]
Message-ID: <cf8d6ea2-e725-4794-a40c-206e53785a29@suse.de> (raw)
In-Reply-To: <87v89il2vj.fsf@minerva.mail-host-address-is-not-set>


[-- Attachment #1.1: Type: text/plain, Size: 1631 bytes --]

Hi Javier

Am 01.12.23 um 09:54 schrieb Javier Martinez Canillas:
> Thomas Zimmermann <tzimmermann@suse.de> writes:
> 
>> Use the screen_info instance from the device instead of dereferencing
>> the global screen_info state. Decouples the driver from per-architecture
>> code. Duplicated the screen_info data, so that efifb can modify it at
>> will.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
> 
> [...]
> 
>> +	si = dev_get_platdata(&dev->dev);
>> +	if (!si)
> 
> I would add a comment that this platform data is set when the device is
> registered by sysfb.
> 
>> +		return -ENODEV;
>> +	si = devm_kmemdup(&dev->dev, si, sizeof(*si), GFP_KERNEL);
>> +	if (!si)
>> +		return -ENOMEM;
>> +
> 
> Why a copy? In any case maybe the global screen_info should be duplicated
> when is set as the device platform data in sysfb_init() ?

We get our own copy of the global screen_info as platform-device data. 
Efifb modifies some of the values in our copy in efifb_setup(). If 
probing afterwards fails, the kernel might try a different driver, which 
would then operate on the values modified by efifb. Hence, there's this 
internal copy. The situation with vesafb is similar.

Best regards
Thomas

> 
> I agree with the direction of the patch though, so whatever you decide:
> 
> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2023-12-01  9:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 15:48 [PATCH 0/4] fbdev: Remove global screen_info in efifb/vesafb Thomas Zimmermann
2023-11-29 15:48 ` [PATCH 1/4] fbdev/efifb: Replace references to global screen_info by local pointer Thomas Zimmermann
2023-12-01  8:44   ` Javier Martinez Canillas
2023-11-29 15:48 ` [PATCH 2/4] fbdev/efifb: Use screen_info pointer from device Thomas Zimmermann
2023-12-01  8:54   ` Javier Martinez Canillas
2023-12-01  9:26     ` Thomas Zimmermann [this message]
2023-12-01  9:56       ` Javier Martinez Canillas
2023-11-29 15:48 ` [PATCH 3/4] fbdev/vesafb: Replace references to global screen_info by local pointer Thomas Zimmermann
2023-11-29 15:48 ` [PATCH 4/4] fbdev/vesafb: Use screen_info pointer from device Thomas Zimmermann
2023-12-01  8:55   ` Javier Martinez Canillas

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=cf8d6ea2-e725-4794-a40c-206e53785a29@suse.de \
    --to=tzimmermann@suse.de \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=pjones@redhat.com \
    /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