[PATCH 1/2] drm/fb_cma_helper: Add drm_fb_cma_setup_fence() helper
Daniel Vetter
daniel at ffwll.ch
Mon Oct 3 13:54:54 UTC 2016
On Sun, Oct 2, 2016 at 7:19 PM, Marek Vasut <marex at denx.de> wrote:
>>> /**
>>> * drm_fb_cma_extract_and_attach_fence() - Extract fence from plane and
>>> attach to planestate
>>> * @plane: Which plane
>>> * @state: Plane state attach fence to
>>> *
>>> * If the plane fb has an dma-buf attached, fish out the exclusive
>>> * fence and attach it to plane state for the atomic helper to wait
>>> * on.
>>> */
>>
>> That choice of color is ok with me too, but then you need to have a
>> pile of text to explain where it should be used (i.e. directly as the
>> prepare_fb hook).
>
> There can be more stuff in the prepare_fb hook though.
There's 3 things prepare/cleanup_fb should do:
- pin/upin the backing storage. CMA memory is always pinned, so nothing to do.
- setup/tear down iommu mappings: Already done when allocating CMA
memory, again nothing to do.
- grab fences in prepare.
So for plain cma drivers this hook is indeed the complete
implementation they need for prepare_fb. I guess you could mention in
the kernel-doc that cma based drivers don't need a cleanup_fb, hence
why there is none.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
More information about the dri-devel
mailing list