summaryrefslogtreecommitdiff
path: root/include/drm/drm_writeback.h
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@bootlin.com>2018-07-03 09:50:15 +0200
committerBoris Brezillon <boris.brezillon@bootlin.com>2018-07-07 07:51:19 +0200
commitb82c1f8f78b4d273d1bcefe3e805eff61e879a68 (patch)
treed20bc6cab499daa98b5f59b1a755073f6ed2ffaa /include/drm/drm_writeback.h
parent73915b2b1f2581cbce5a511550c2cac2e2b42595 (diff)
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.h6
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,