Thread (1 message) read the whole thread 1 message, 1 author, 2021-01-13

Re: [Intel-gfx] [PATCH] drm-buf: Add debug option

From: Daniel Vetter <hidden>
Date: 2021-01-13 20:51:09
Also in: dri-devel, intel-gfx

On Wed, Jan 13, 2021 at 4:43 PM Chris Wilson [off-list ref] wrote:
Quoting Daniel Vetter (2021-01-13 14:06:04)
quoted
We have too many people abusing the struct page they can get at but
really shouldn't in importers. Aside from that the backing page might
simply not exist (for dynamic p2p mappings) looking at it and using it
e.g. for mmap can also wreak the page handling of the exporter
completely. Importers really must go through the proper interface like
dma_buf_mmap for everything.
If the exporter doesn't want to expose the struct page, why are they
setting it in the exported sg_table?
You need to store it somewhere, otherwise the dma-api doesn't work.
Essentially this achieves clearing/resetting the struct page pointer,
without additional allocations somewhere, or tons of driver changes
(since presumably the driver does keep track of the struct page
somewhere too).

Also as long as we have random importers looking at struct page we
can't just remove it, or crashes everywhere. So it has to be some
debug option you can disable.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help