drm/rcar-du: Fix buffer pitch alignment for R8A7790 DU
[deliverable/linux.git] / drivers / gpu / drm / rcar-du / rcar_du_drv.h
CommitLineData
4bf8e196
LP
1/*
2 * rcar_du_drv.h -- R-Car Display Unit DRM driver
3 *
4 * Copyright (C) 2013 Renesas Corporation
5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13
14#ifndef __RCAR_DU_DRV_H__
15#define __RCAR_DU_DRV_H__
16
17#include <linux/kernel.h>
4bf8e196
LP
18#include <linux/platform_data/rcar-du.h>
19
20#include "rcar_du_crtc.h"
cb2025d2 21#include "rcar_du_group.h"
4bf8e196
LP
22
23struct clk;
24struct device;
25struct drm_device;
cb2025d2 26struct rcar_du_device;
4bf8e196 27
f66ee304 28#define RCAR_DU_FEATURE_CRTC_IRQ_CLOCK (1 << 0) /* Per-CRTC IRQ and clock */
9e2d2de9 29#define RCAR_DU_FEATURE_ALIGN_128B (1 << 1) /* Align pitches to 128 bytes */
f66ee304 30
481d342e
LP
31/*
32 * struct rcar_du_device_info - DU model-specific information
33 * @features: device features (RCAR_DU_FEATURE_*)
34 */
35struct rcar_du_device_info {
36 unsigned int features;
37};
38
4bf8e196
LP
39struct rcar_du_device {
40 struct device *dev;
41 const struct rcar_du_platform_data *pdata;
481d342e 42 const struct rcar_du_device_info *info;
4bf8e196
LP
43
44 void __iomem *mmio;
4bf8e196
LP
45
46 struct drm_device *ddev;
47
48 struct rcar_du_crtc crtcs[2];
4bf8e196
LP
49 unsigned int num_crtcs;
50
cb2025d2 51 struct rcar_du_group group;
4bf8e196
LP
52};
53
481d342e
LP
54static inline bool rcar_du_has(struct rcar_du_device *rcdu,
55 unsigned int feature)
56{
57 return rcdu->info->features & feature;
58}
59
4bf8e196
LP
60static inline u32 rcar_du_read(struct rcar_du_device *rcdu, u32 reg)
61{
62 return ioread32(rcdu->mmio + reg);
63}
64
65static inline void rcar_du_write(struct rcar_du_device *rcdu, u32 reg, u32 data)
66{
67 iowrite32(data, rcdu->mmio + reg);
68}
69
70#endif /* __RCAR_DU_DRV_H__ */
This page took 0.046048 seconds and 5 git commands to generate.