Commit a64b9c7e authored by Laurent Pinchart's avatar Laurent Pinchart

drm: rcar-du: Define macros for the max number of groups, CRTCs and LVDS

Let's avoid magic constants. Beside increasing code readability, it will
also ensure that no location will be forgotten when raising the maximum
number of groups, CRTCs or LVDS encoders
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
parent 931b7336
...@@ -64,6 +64,10 @@ struct rcar_du_device_info { ...@@ -64,6 +64,10 @@ struct rcar_du_device_info {
unsigned int num_lvds; unsigned int num_lvds;
}; };
#define RCAR_DU_MAX_CRTCS 3
#define RCAR_DU_MAX_GROUPS DIV_ROUND_UP(RCAR_DU_MAX_CRTCS, 2)
#define RCAR_DU_MAX_LVDS 2
struct rcar_du_device { struct rcar_du_device {
struct device *dev; struct device *dev;
const struct rcar_du_device_info *info; const struct rcar_du_device_info *info;
...@@ -73,13 +77,13 @@ struct rcar_du_device { ...@@ -73,13 +77,13 @@ struct rcar_du_device {
struct drm_device *ddev; struct drm_device *ddev;
struct drm_fbdev_cma *fbdev; struct drm_fbdev_cma *fbdev;
struct rcar_du_crtc crtcs[3]; struct rcar_du_crtc crtcs[RCAR_DU_MAX_CRTCS];
unsigned int num_crtcs; unsigned int num_crtcs;
struct rcar_du_group groups[2]; struct rcar_du_group groups[RCAR_DU_MAX_GROUPS];
unsigned int dpad0_source; unsigned int dpad0_source;
struct rcar_du_lvdsenc *lvds[2]; struct rcar_du_lvdsenc *lvds[RCAR_DU_MAX_LVDS];
}; };
static inline bool rcar_du_has(struct rcar_du_device *rcdu, static inline bool rcar_du_has(struct rcar_du_device *rcdu,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment