[v2,7/8] firmware/sysfb: Update screen_info for relocated EFI framebuffers

Thomas Zimmermann tzimmermann at suse.de
Tue Feb 6 16:45:15 UTC 2024


Hi

Am 02.02.24 um 19:00 schrieb Sui Jingfeng:
> Hi,
>
>
> On 2024/2/2 19:58, Thomas Zimmermann wrote:
>> +static inline void __screen_info_set_lfb_base(struct screen_info 
>> *si, u64 lfb_base)
>> +{
>> +    si->lfb_base = lfb_base & GENMASK_ULL(31, 0);
>> +    si->ext_lfb_base = (lfb_base & GENMASK_ULL(63, 32)) >> 32;
>
>
> I want to ask a trivial question: why not simply write it like below?
>
> si->lfb_base = (u32)lfb_base;
>
> si->ext_lfb_base = lfb_base >> 32;
>
> I'm asking because I feel it is a little bit complicated.

Admittedly it's a bit verbose. I've written it like this so that it's 
clear which bits go where.

Best regards
Thomas

>
>> +    if (si->ext_lfb_base)
>> +        si->capabilities |= VIDEO_CAPABILITY_64BIT_BASE;
>> +    else
>> +        si->capabilities &= ~VIDEO_CAPABILITY_64BIT_BASE;
>> +}
>> +

-- 
--
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)



More information about the dri-devel mailing list