2018-07-26 09:37:32 +07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2013-06-17 02:01:02 +07:00
|
|
|
/*
|
|
|
|
* rcar_du_group.c -- R-Car Display Unit Planes and CRTCs Group
|
|
|
|
*
|
2014-02-07 00:13:52 +07:00
|
|
|
* Copyright (C) 2013-2014 Renesas Electronics Corporation
|
2013-06-17 02:01:02 +07:00
|
|
|
*
|
|
|
|
* Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __RCAR_DU_GROUP_H__
|
|
|
|
#define __RCAR_DU_GROUP_H__
|
|
|
|
|
2015-02-25 23:27:19 +07:00
|
|
|
#include <linux/mutex.h>
|
|
|
|
|
2013-06-17 02:01:02 +07:00
|
|
|
#include "rcar_du_plane.h"
|
|
|
|
|
|
|
|
struct rcar_du_device;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* struct rcar_du_group - CRTCs and planes group
|
|
|
|
* @dev: the DU device
|
|
|
|
* @mmio_offset: registers offset in the device memory map
|
|
|
|
* @index: group index
|
2018-04-28 05:21:53 +07:00
|
|
|
* @channels_mask: bitmask of populated DU channels in this group
|
2019-10-16 15:55:44 +07:00
|
|
|
* @cmms_mask: bitmask of available CMMs in this group
|
2015-04-28 21:36:33 +07:00
|
|
|
* @num_crtcs: number of CRTCs in this group (1 or 2)
|
2013-06-17 02:01:02 +07:00
|
|
|
* @use_count: number of users of the group (rcar_du_group_(get|put))
|
|
|
|
* @used_crtcs: number of CRTCs currently in use
|
2015-04-28 22:01:45 +07:00
|
|
|
* @lock: protects the dptsr_planes field and the DPTSR register
|
|
|
|
* @dptsr_planes: bitmask of planes driven by dot-clock and timing generator 1
|
2015-05-25 20:32:45 +07:00
|
|
|
* @num_planes: number of planes in the group
|
2013-06-17 02:01:02 +07:00
|
|
|
* @planes: planes handled by the group
|
2013-08-24 07:17:03 +07:00
|
|
|
* @need_restart: the group needs to be restarted due to a configuration change
|
2013-06-17 02:01:02 +07:00
|
|
|
*/
|
|
|
|
struct rcar_du_group {
|
|
|
|
struct rcar_du_device *dev;
|
|
|
|
unsigned int mmio_offset;
|
|
|
|
unsigned int index;
|
|
|
|
|
2018-04-28 05:21:53 +07:00
|
|
|
unsigned int channels_mask;
|
2019-10-16 15:55:44 +07:00
|
|
|
unsigned int cmms_mask;
|
2015-04-28 21:36:33 +07:00
|
|
|
unsigned int num_crtcs;
|
2013-06-17 02:01:02 +07:00
|
|
|
unsigned int use_count;
|
|
|
|
unsigned int used_crtcs;
|
|
|
|
|
2015-02-25 23:27:19 +07:00
|
|
|
struct mutex lock;
|
2015-04-28 22:01:45 +07:00
|
|
|
unsigned int dptsr_planes;
|
2015-02-25 23:27:19 +07:00
|
|
|
|
2015-05-25 20:32:45 +07:00
|
|
|
unsigned int num_planes;
|
2015-04-29 04:05:56 +07:00
|
|
|
struct rcar_du_plane planes[RCAR_DU_NUM_KMS_PLANES];
|
2013-08-24 07:17:03 +07:00
|
|
|
bool need_restart;
|
2013-06-17 02:01:02 +07:00
|
|
|
};
|
|
|
|
|
2013-06-17 05:29:25 +07:00
|
|
|
u32 rcar_du_group_read(struct rcar_du_group *rgrp, u32 reg);
|
|
|
|
void rcar_du_group_write(struct rcar_du_group *rgrp, u32 reg, u32 data);
|
|
|
|
|
2013-06-17 02:01:02 +07:00
|
|
|
int rcar_du_group_get(struct rcar_du_group *rgrp);
|
|
|
|
void rcar_du_group_put(struct rcar_du_group *rgrp);
|
|
|
|
void rcar_du_group_start_stop(struct rcar_du_group *rgrp, bool start);
|
|
|
|
void rcar_du_group_restart(struct rcar_du_group *rgrp);
|
2013-06-17 08:20:08 +07:00
|
|
|
int rcar_du_group_set_routing(struct rcar_du_group *rgrp);
|
2013-06-17 02:01:02 +07:00
|
|
|
|
2013-06-21 22:54:50 +07:00
|
|
|
int rcar_du_set_dpad0_vsp1_routing(struct rcar_du_device *rcdu);
|
|
|
|
|
2013-06-17 02:01:02 +07:00
|
|
|
#endif /* __RCAR_DU_GROUP_H__ */
|