drm/gma500: Add generic crtc save/restore funcs
[deliverable/linux.git] / drivers / gpu / drm / gma500 / gma_display.h
CommitLineData
5ea75e0f
PJ
1/*
2 * Copyright © 2006-2011 Intel Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
16 *
17 * Authors:
18 * Eric Anholt <eric@anholt.net>
19 * Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
20 */
21
22#ifndef _GMA_DISPLAY_H_
23#define _GMA_DISPLAY_H_
24
25struct gma_clock_t {
26 /* given values */
27 int n;
28 int m1, m2;
29 int p1, p2;
30 /* derived values */
31 int dot;
32 int vco;
33 int m;
34 int p;
35};
36
37struct gma_range_t {
38 int min, max;
39};
40
41struct gma_p2_t {
42 int dot_limit;
43 int p2_slow, p2_fast;
44};
45
46struct gma_limit_t {
47 struct gma_range_t dot, vco, n, m, m1, m2, p, p1;
48 struct gma_p2_t p2;
49 bool (*find_pll)(const struct gma_limit_t *, struct drm_crtc *,
50 int target, int refclk,
51 struct gma_clock_t *best_clock);
52};
53
54struct gma_clock_funcs {
55 void (*clock)(int refclk, struct gma_clock_t *clock);
56 const struct gma_limit_t *(*limit)(struct drm_crtc *crtc, int refclk);
57 bool (*pll_is_valid)(struct drm_crtc *crtc,
58 const struct gma_limit_t *limit,
59 struct gma_clock_t *clock);
60};
61
62/* Common pipe related functions */
63extern bool gma_pipe_has_type(struct drm_crtc *crtc, int type);
2eff0b33
PJ
64extern void gma_wait_for_vblank(struct drm_device *dev);
65extern int gma_pipe_set_base(struct drm_crtc *crtc, int x, int y,
66 struct drm_framebuffer *old_fb);
38945be6
PJ
67extern int gma_crtc_cursor_set(struct drm_crtc *crtc,
68 struct drm_file *file_priv,
69 uint32_t handle,
70 uint32_t width, uint32_t height);
71extern int gma_crtc_cursor_move(struct drm_crtc *crtc, int x, int y);
2eff0b33
PJ
72extern void gma_crtc_load_lut(struct drm_crtc *crtc);
73extern void gma_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
74 u16 *blue, u32 start, u32 size);
75extern void gma_crtc_dpms(struct drm_crtc *crtc, int mode);
76extern bool gma_crtc_mode_fixup(struct drm_crtc *crtc,
77 const struct drm_display_mode *mode,
78 struct drm_display_mode *adjusted_mode);
79extern void gma_crtc_prepare(struct drm_crtc *crtc);
80extern void gma_crtc_commit(struct drm_crtc *crtc);
81extern void gma_crtc_disable(struct drm_crtc *crtc);
82extern void gma_crtc_destroy(struct drm_crtc *crtc);
5ea75e0f 83
2e775700
PJ
84extern void gma_crtc_save(struct drm_crtc *crtc);
85extern void gma_crtc_restore(struct drm_crtc *crtc);
86
59345847
PJ
87extern void gma_encoder_prepare(struct drm_encoder *encoder);
88extern void gma_encoder_commit(struct drm_encoder *encoder);
89extern void gma_encoder_destroy(struct drm_encoder *encoder);
90
5ea75e0f
PJ
91/* Common clock related functions */
92extern const struct gma_limit_t *gma_limit(struct drm_crtc *crtc, int refclk);
93extern void gma_clock(int refclk, struct gma_clock_t *clock);
94extern bool gma_pll_is_valid(struct drm_crtc *crtc,
95 const struct gma_limit_t *limit,
96 struct gma_clock_t *clock);
97extern bool gma_find_best_pll(const struct gma_limit_t *limit,
98 struct drm_crtc *crtc, int target, int refclk,
99 struct gma_clock_t *best_clock);
7ea03f06
PJ
100
101/* Cedarview specific functions */
102extern void cdv_intel_disable_self_refresh(struct drm_device *dev);
103extern void cdv_intel_update_watermark(struct drm_device *dev,
104 struct drm_crtc *crtc);
5ea75e0f 105#endif
This page took 0.030811 seconds and 5 git commands to generate.