linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Framebuffer mmap on PowerPC
@ 2023-08-31 14:41 Thomas Zimmermann
  2023-08-31 17:38 ` Christophe Leroy
  2023-09-01  1:44 ` Arnd Bergmann
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Zimmermann @ 2023-08-31 14:41 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin, Christophe Leroy,
	Arnd Bergmann, Helge Deller
  Cc: linuxppc-dev, Linux-Arch, Linux Fbdev development list, dri-devel


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

Hi,

there's a per-architecture function called fb_pgprotect() that sets 
VMA's vm_page_prot for mmaped framebuffers. Most architectures use a 
simple implementation based on pgprot_writecomine() [1] or 
pgprot_noncached(). [2]

On PPC this function uses phys_mem_access_prot() and therefore requires 
the mmap call's file struct. [3] Removing the file argument would help 
with simplifying the caller of fb_pgprotect(). [4]

Why is the file even required on PPC?

Is it possible to replace phys_mem_access_prot() with something simpler 
that does not use the file struct?

Best regards
Thomas


[1] 
https://elixir.bootlin.com/linux/v6.5/source/include/asm-generic/fb.h#L19
[2] 
https://elixir.bootlin.com/linux/v6.5/source/arch/mips/include/asm/fb.h#L11
[3] 
https://elixir.bootlin.com/linux/v6.5/source/arch/powerpc/include/asm/fb.h#L12
[4] 
https://elixir.bootlin.com/linux/v6.5/source/drivers/video/fbdev/core/fbmem.c#L1299


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-09-01  6:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-31 14:41 Framebuffer mmap on PowerPC Thomas Zimmermann
2023-08-31 17:38 ` Christophe Leroy
2023-08-31 17:41   ` Christophe Leroy
2023-09-01  6:45   ` Thomas Zimmermann
2023-09-01  1:44 ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).