tech-x11 archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: DRM Stuff
Taylor R Campbell <campbell+netbsd-tech-x11%mumble.net@localhost> wrote:
>> Date: Mon, 26 Sep 2022 09:40:15 +0100
>> From: Robert Swindells <rjs%fdy2.co.uk@localhost>
>>
>> Taylor R Campbell <campbell+netbsd-tech-x11%mumble.net@localhost> wrote:
>> > Date: Sun, 25 Sep 2022 22:10:15 +0100
>> > From: Robert Swindells <rjs%fdy2.co.uk@localhost>
>> >
>> >> I think that the usage from linux_sgt.c needs to be able to keep the
>> >> segments setup when converting between Linux and NetBSD memory pages so
>> >> that they can be used in calls to bus_dmamap_sync(). To be able to
>> >> use bus_dmamap_sync() I think would also need to change from using
>> >> bus_dmamap_load_raw() to bus_dmamap_load().
>> >
>> >Why do you think that? The arm bus_dmamap_sync treats them the same
>> >as far as I can tell.
>>
>> On arm, bus_dmamap_sync crashes if you have used bus_dmamap_load_raw.
>
>How does it crash? Sounds like a bug.
It tries to flush VA 0.
>> >Using bus_dmamap_load would require that we map every graphics buffer
>> >into KVA before using it, which shouldn't be necessary for anything.
>>
>> Ok, suggest some other way of doing a cache sync.
>
>If you need to try this as a hack, you can just map the same pages in
>with kmap or something and issue the CPU flush instructions you
>suspect are necessary -- not fit for committing permanently but enough
>to test a hypothesis.
I would prefer to find a long-term solution.
The ARM cache flush instructions operate on a virtual address, they are
not barrier ones like on X86.
The logical place to flush the buffer seems to me to be in userspace.
I agree that needing to map every buffer into the kernel is a waste, the
lima and panfrost drivers don't touch them.
The RPi3 DRM driver does need to map every buffer as it does some
checking of them before handing them to the GPU.
> What does Linux do in the place where you think we need
> bus_dmamap_sync?
It doesn't do anything.
Are we setting different page cache properties on buffers to Linux?
Home |
Main Index |
Thread Index |
Old Index