mm: hugetlb: fix hugepage memory leak caused by wrong reserve count
[linux/fpc-iii.git] / drivers / gpu / drm / armada / armada_drm.h
blob4df6f2af2b21056854e961f703c6f524aeab0c4b
1 /*
2 * Copyright (C) 2012 Russell King
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8 #ifndef ARMADA_DRM_H
9 #define ARMADA_DRM_H
11 #include <linux/kfifo.h>
12 #include <linux/io.h>
13 #include <linux/workqueue.h>
14 #include <drm/drmP.h>
16 struct armada_crtc;
17 struct armada_gem_object;
18 struct clk;
19 struct drm_fb_helper;
21 static inline void
22 armada_updatel(uint32_t val, uint32_t mask, void __iomem *ptr)
24 uint32_t ov, v;
26 ov = v = readl_relaxed(ptr);
27 v = (v & ~mask) | val;
28 if (ov != v)
29 writel_relaxed(v, ptr);
32 static inline uint32_t armada_pitch(uint32_t width, uint32_t bpp)
34 uint32_t pitch = bpp != 4 ? width * ((bpp + 7) / 8) : width / 2;
36 /* 88AP510 spec recommends pitch be a multiple of 128 */
37 return ALIGN(pitch, 128);
41 struct armada_private;
43 struct armada_variant {
44 bool has_spu_adv_reg;
45 uint32_t spu_adv_reg;
46 int (*init)(struct armada_crtc *, struct device *);
47 int (*compute_clock)(struct armada_crtc *,
48 const struct drm_display_mode *,
49 uint32_t *);
52 /* Variant ops */
53 extern const struct armada_variant armada510_ops;
55 struct armada_private {
56 struct work_struct fb_unref_work;
57 DECLARE_KFIFO(fb_unref, struct drm_framebuffer *, 8);
58 struct drm_fb_helper *fbdev;
59 struct armada_crtc *dcrtc[2];
60 struct drm_mm linear;
61 struct drm_property *csc_yuv_prop;
62 struct drm_property *csc_rgb_prop;
63 struct drm_property *colorkey_prop;
64 struct drm_property *colorkey_min_prop;
65 struct drm_property *colorkey_max_prop;
66 struct drm_property *colorkey_val_prop;
67 struct drm_property *colorkey_alpha_prop;
68 struct drm_property *colorkey_mode_prop;
69 struct drm_property *brightness_prop;
70 struct drm_property *contrast_prop;
71 struct drm_property *saturation_prop;
72 #ifdef CONFIG_DEBUG_FS
73 struct dentry *de;
74 #endif
77 void __armada_drm_queue_unref_work(struct drm_device *,
78 struct drm_framebuffer *);
79 void armada_drm_queue_unref_work(struct drm_device *,
80 struct drm_framebuffer *);
82 extern const struct drm_mode_config_funcs armada_drm_mode_config_funcs;
84 int armada_fbdev_init(struct drm_device *);
85 void armada_fbdev_lastclose(struct drm_device *);
86 void armada_fbdev_fini(struct drm_device *);
88 int armada_overlay_plane_create(struct drm_device *, unsigned long);
90 int armada_drm_debugfs_init(struct drm_minor *);
91 void armada_drm_debugfs_cleanup(struct drm_minor *);
93 #endif