Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1464452
| From | Daniel Vetter <daniel@ffwll.ch> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3 1/3] drm: add SimpleDRM driver |
| Date | 2016-08-17 11:50 +0200 |
| Message-ID | <s75DX-7DZ-9@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <s66Vr-265-5@gated-at.bofh.it> <s6k2l-290-5@gated-at.bofh.it> <s6M8h-3cC-9@gated-at.bofh.it> <s6Ots-4M4-7@gated-at.bofh.it> <s6Sx4-7iI-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Aug 16, 2016 at 9:38 PM, Noralf Trønnes <noralf@tronnes.org> wrote: >> That's still a lot for what amounts to reimplementing mmap on shmem, but >> badly. What I mean with redirecting is pointing the entire ->mmap >> operation to the mmap implementation for the underlying mmap. Roughly: >> >> /* normal gem mmap checks first */ >> >> /* redirect to shmem mmap */ >> vma->vm_file = obj->filp; >> vma->vm_pgoff = 0; >> >> return obj->filp->f_op->mmap(obj->filp, vma); >> >> Much less code ;-) > > > obj->filp is NULL in my case. > > And looking at the docs, that's expected since I have driver specific > backing? > > /** > * @filp: > * > * SHMEM file node used as backing storage for swappable buffer objects. > * GEM also supports driver private objects with driver-specific backing > * storage (contiguous CMA memory, special reserved blocks). In this > * case @filp is NULL. > */ Hm, I totally misread the driver code. I assumed that we'd just allocate normal shmem gem objects, and then copy them on-demand onto the frontbuffer (in the dirty or plane update callbacks). Essentially treat the firmware fb area as a manual upload display, except that we don't use i2c or spi to do the upload, but normal mmio writes. I think that would greatly simplify the driver, and more important: It would also work like any other kms driver. Currently sdrm is violiting the spec a bit by aliasing all dumb buffers to the same underlying backing storage, and that's a bit evil. The other bit I noticed (and why I was confused): The prime import code reinvents a lot of wheels, and it digs into the backing storage directly. Instead it should just call dma_buf_vmap/dma_buf_vunmap and let the exporter figure out how it works. Sorry I was all confused here and didn't realize what's going on :( -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 0/3] drm: add SimpleDRM driver Noralf Trønnes <noralf@tronnes.org> - 2016-08-14 19:00 +0200
[PATCH v3 2/3] drm: simpledrm: add fbdev fallback support Noralf Trønnes <noralf@tronnes.org> - 2016-08-14 19:00 +0200
Re: [PATCH v3 2/3] drm: simpledrm: add fbdev fallback support Daniel Vetter <daniel@ffwll.ch> - 2016-08-15 08:50 +0200
Re: [PATCH v3 2/3] drm: simpledrm: add fbdev fallback support Noralf Trønnes <noralf@tronnes.org> - 2016-08-16 15:20 +0200
Re: [PATCH v3 2/3] drm: simpledrm: add fbdev fallback support Daniel Vetter <daniel@ffwll.ch> - 2016-08-16 17:40 +0200
[PATCH v3 3/3] drm: simpledrm: honour remove_conflicting_framebuffers() Noralf Trønnes <noralf@tronnes.org> - 2016-08-14 19:00 +0200
Re: [PATCH v3 3/3] drm: simpledrm: honour remove_conflicting_framebuffers() Daniel Vetter <daniel@ffwll.ch> - 2016-08-15 09:20 +0200
Re: [PATCH v3 0/3] drm: add SimpleDRM driver Daniel Vetter <daniel@ffwll.ch> - 2016-08-15 09:20 +0200
Re: [PATCH v3 1/3] drm: add SimpleDRM driver Noralf Trønnes <noralf@tronnes.org> - 2016-08-16 15:00 +0200
Re: [PATCH v3 1/3] drm: add SimpleDRM driver Daniel Vetter <daniel@ffwll.ch> - 2016-08-16 17:30 +0200
Re: [PATCH v3 1/3] drm: add SimpleDRM driver Noralf Trønnes <noralf@tronnes.org> - 2016-08-16 21:50 +0200
Re: [PATCH v3 1/3] drm: add SimpleDRM driver Daniel Vetter <daniel@ffwll.ch> - 2016-08-17 11:50 +0200
Re: [PATCH v3 1/3] drm: add SimpleDRM driver Noralf Trønnes <noralf@tronnes.org> - 2016-08-17 12:20 +0200
Re: [PATCH v3 1/3] drm: add SimpleDRM driver Daniel Vetter <daniel@ffwll.ch> - 2016-08-17 13:20 +0200
csiph-web