diff options
author | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-07-03 09:50:15 +0200 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-07-07 07:51:19 +0200 |
commit | b82c1f8f78b4d273d1bcefe3e805eff61e879a68 (patch) | |
tree | d20bc6cab499daa98b5f59b1a755073f6ed2ffaa /include/drm/drm_writeback.h | |
parent | drm/writeback: Fix the "overview" section of the doc (diff) | |
download | linux-b82c1f8f78b4d273d1bcefe3e805eff61e879a68.tar.xz linux-b82c1f8f78b4d273d1bcefe3e805eff61e879a68.zip |
drm/atomic: Avoid connector to writeback_connector casts
Use container_of() instead of type casting so that it keeps working
even if base is moved inside the drm_writeback_connector struct.
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180703075022.15138-2-boris.brezillon@bootlin.com
Diffstat (limited to 'include/drm/drm_writeback.h')
-rw-r--r-- | include/drm/drm_writeback.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/drm/drm_writeback.h b/include/drm/drm_writeback.h index a10fe556dfd4..23df9d463003 100644 --- a/include/drm/drm_writeback.h +++ b/include/drm/drm_writeback.h @@ -110,6 +110,12 @@ struct drm_writeback_job { struct dma_fence *out_fence; }; +static inline struct drm_writeback_connector * +drm_connector_to_writeback(struct drm_connector *connector) +{ + return container_of(connector, struct drm_writeback_connector, base); +} + int drm_writeback_connector_init(struct drm_device *dev, struct drm_writeback_connector *wb_connector, const struct drm_connector_funcs *con_funcs, |