1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright © 2006-2011 Intel Corporation
10 #ifndef _GMA_DISPLAY_H_
11 #define _GMA_DISPLAY_H_
13 #include <linux/pm_runtime.h>
40 struct gma_range_t dot, vco, n, m, m1, m2, p, p1;
42 bool (*find_pll)(const struct gma_limit_t *, struct drm_crtc *,
43 int target, int refclk,
44 struct gma_clock_t *best_clock);
47 struct gma_clock_funcs {
48 void (*clock)(int refclk, struct gma_clock_t *clock);
49 const struct gma_limit_t *(*limit)(struct drm_crtc *crtc, int refclk);
50 bool (*pll_is_valid)(struct drm_crtc *crtc,
51 const struct gma_limit_t *limit,
52 struct gma_clock_t *clock);
55 /* Common pipe related functions */
56 extern bool gma_pipe_has_type(struct drm_crtc *crtc, int type);
57 extern void gma_wait_for_vblank(struct drm_device *dev);
58 extern int gma_pipe_set_base(struct drm_crtc *crtc, int x, int y,
59 struct drm_framebuffer *old_fb);
60 extern int gma_crtc_cursor_set(struct drm_crtc *crtc,
61 struct drm_file *file_priv,
63 uint32_t width, uint32_t height);
64 extern int gma_crtc_cursor_move(struct drm_crtc *crtc, int x, int y);
65 extern void gma_crtc_load_lut(struct drm_crtc *crtc);
66 extern int gma_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
68 struct drm_modeset_acquire_ctx *ctx);
69 extern void gma_crtc_dpms(struct drm_crtc *crtc, int mode);
70 extern void gma_crtc_prepare(struct drm_crtc *crtc);
71 extern void gma_crtc_commit(struct drm_crtc *crtc);
72 extern void gma_crtc_disable(struct drm_crtc *crtc);
73 extern void gma_crtc_destroy(struct drm_crtc *crtc);
74 extern int gma_crtc_set_config(struct drm_mode_set *set,
75 struct drm_modeset_acquire_ctx *ctx);
77 extern void gma_crtc_save(struct drm_crtc *crtc);
78 extern void gma_crtc_restore(struct drm_crtc *crtc);
80 extern void gma_encoder_prepare(struct drm_encoder *encoder);
81 extern void gma_encoder_commit(struct drm_encoder *encoder);
82 extern void gma_encoder_destroy(struct drm_encoder *encoder);
84 /* Common clock related functions */
85 extern const struct gma_limit_t *gma_limit(struct drm_crtc *crtc, int refclk);
86 extern void gma_clock(int refclk, struct gma_clock_t *clock);
87 extern bool gma_pll_is_valid(struct drm_crtc *crtc,
88 const struct gma_limit_t *limit,
89 struct gma_clock_t *clock);
90 extern bool gma_find_best_pll(const struct gma_limit_t *limit,
91 struct drm_crtc *crtc, int target, int refclk,
92 struct gma_clock_t *best_clock);