mirror of https://gitee.com/openkylin/linux.git
drm: rcar-du: Replace dev_private with container_of
Now that drm_device is embedded in rcar_du_device, we can use container_of to get the rcar_du_device pointer from the drm_device, instead of using the drm_device.dev_private field. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
This commit is contained in:
parent
ea6aae1518
commit
a476f9e8c0
|
@ -585,8 +585,6 @@ static int rcar_du_probe(struct platform_device *pdev)
|
|||
return PTR_ERR(rcdu->mmio);
|
||||
|
||||
/* DRM/KMS objects */
|
||||
rcdu->ddev.dev_private = rcdu;
|
||||
|
||||
ret = rcar_du_modeset_init(rcdu);
|
||||
if (ret < 0) {
|
||||
if (ret != -EPROBE_DEFER)
|
||||
|
|
|
@ -99,6 +99,11 @@ struct rcar_du_device {
|
|||
unsigned int vspd1_sink;
|
||||
};
|
||||
|
||||
static inline struct rcar_du_device *to_rcar_du_device(struct drm_device *dev)
|
||||
{
|
||||
return container_of(dev, struct rcar_du_device, ddev);
|
||||
}
|
||||
|
||||
static inline bool rcar_du_has(struct rcar_du_device *rcdu,
|
||||
unsigned int feature)
|
||||
{
|
||||
|
|
|
@ -327,7 +327,7 @@ const struct rcar_du_format_info *rcar_du_format_info(u32 fourcc)
|
|||
int rcar_du_dumb_create(struct drm_file *file, struct drm_device *dev,
|
||||
struct drm_mode_create_dumb *args)
|
||||
{
|
||||
struct rcar_du_device *rcdu = dev->dev_private;
|
||||
struct rcar_du_device *rcdu = to_rcar_du_device(dev);
|
||||
unsigned int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
|
||||
unsigned int align;
|
||||
|
||||
|
@ -349,7 +349,7 @@ static struct drm_framebuffer *
|
|||
rcar_du_fb_create(struct drm_device *dev, struct drm_file *file_priv,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
struct rcar_du_device *rcdu = dev->dev_private;
|
||||
struct rcar_du_device *rcdu = to_rcar_du_device(dev);
|
||||
const struct rcar_du_format_info *format;
|
||||
unsigned int chroma_pitch;
|
||||
unsigned int max_pitch;
|
||||
|
@ -421,7 +421,7 @@ rcar_du_fb_create(struct drm_device *dev, struct drm_file *file_priv,
|
|||
static int rcar_du_atomic_check(struct drm_device *dev,
|
||||
struct drm_atomic_state *state)
|
||||
{
|
||||
struct rcar_du_device *rcdu = dev->dev_private;
|
||||
struct rcar_du_device *rcdu = to_rcar_du_device(dev);
|
||||
int ret;
|
||||
|
||||
ret = drm_atomic_helper_check(dev, state);
|
||||
|
@ -437,7 +437,7 @@ static int rcar_du_atomic_check(struct drm_device *dev,
|
|||
static void rcar_du_atomic_commit_tail(struct drm_atomic_state *old_state)
|
||||
{
|
||||
struct drm_device *dev = old_state->dev;
|
||||
struct rcar_du_device *rcdu = dev->dev_private;
|
||||
struct rcar_du_device *rcdu = to_rcar_du_device(dev);
|
||||
struct drm_crtc_state *crtc_state;
|
||||
struct drm_crtc *crtc;
|
||||
unsigned int i;
|
||||
|
|
|
@ -128,7 +128,7 @@ static int rcar_du_plane_hwalloc(struct rcar_du_plane *plane,
|
|||
int rcar_du_atomic_check_planes(struct drm_device *dev,
|
||||
struct drm_atomic_state *state)
|
||||
{
|
||||
struct rcar_du_device *rcdu = dev->dev_private;
|
||||
struct rcar_du_device *rcdu = to_rcar_du_device(dev);
|
||||
unsigned int group_freed_planes[RCAR_DU_MAX_GROUPS] = { 0, };
|
||||
unsigned int group_free_planes[RCAR_DU_MAX_GROUPS] = { 0, };
|
||||
bool needs_realloc = false;
|
||||
|
|
Loading…
Reference in New Issue