aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_drv.h
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2011-12-13 16:19:38 -0500
committerKeith Packard <keithp@keithp.com>2012-01-03 12:31:09 -0500
commitb840d907fcf6d5d5ef91af4518b3dab3a5da0f75 (patch)
treeaea5477428533760383870a39e7768bd8f59567d /drivers/gpu/drm/i915/intel_drv.h
parentc7dffff7cc8de748edf0e9f6571cdabecb198705 (diff)
drm/i915: add SNB and IVB video sprite support v6
The video sprites support various video surface formats natively and can handle scaling as well. So add support for them using the new DRM core sprite support functions. v2: use drm specific fourcc header and defines v3: address Daniel's comments: - don't take struct mutex around register access (only needed for regs in the GT power well) - don't hold struct mutex across vblank waits - fix up update_plane API (pass obj instead of GTT offset) - add interlaced defines for sprite regs - drop unnecessary 'reg' variables - comment double buffered reg flushing Also fix w/h confusion when writing the scaling reg. v4: more fixes, address more comments from Daniel, and include Hai's fix - prevent divide by zero in scaling calculation (Hai Lan) - update to Ville's new DRM_FORMAT_* types - fix sprite watermark handling (calc based on CRTC size, separate from normal display wm) - remove private refcounts now that the fb cleanups handles things v5: add linear surface support v6: remove color key clearing & setting from update_plane For this version, I tested DPMS since it came up in the last review; DPMS off/on works ok when a video player is working under X, but for power saving we'll probably want to do something smarter. I'll leave that for a separate patch on top. Likewise with the refcounting/fb layer handling, which are really separate cleanups. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_drv.h')
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 82a459bfccbc..a6e2f0d865b1 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -177,10 +177,27 @@ struct intel_crtc {
177 bool use_pll_a; 177 bool use_pll_a;
178}; 178};
179 179
180struct intel_plane {
181 struct drm_plane base;
182 enum pipe pipe;
183 struct drm_i915_gem_object *obj;
184 int max_downscale;
185 u32 lut_r[1024], lut_g[1024], lut_b[1024];
186 void (*update_plane)(struct drm_plane *plane,
187 struct drm_framebuffer *fb,
188 struct drm_i915_gem_object *obj,
189 int crtc_x, int crtc_y,
190 unsigned int crtc_w, unsigned int crtc_h,
191 uint32_t x, uint32_t y,
192 uint32_t src_w, uint32_t src_h);
193 void (*disable_plane)(struct drm_plane *plane);
194};
195
180#define to_intel_crtc(x) container_of(x, struct intel_crtc, base) 196#define to_intel_crtc(x) container_of(x, struct intel_crtc, base)
181#define to_intel_connector(x) container_of(x, struct intel_connector, base) 197#define to_intel_connector(x) container_of(x, struct intel_connector, base)
182#define to_intel_encoder(x) container_of(x, struct intel_encoder, base) 198#define to_intel_encoder(x) container_of(x, struct intel_encoder, base)
183#define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base) 199#define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base)
200#define to_intel_plane(x) container_of(x, struct intel_plane, base)
184 201
185#define DIP_HEADER_SIZE 5 202#define DIP_HEADER_SIZE 5
186 203
@@ -290,6 +307,7 @@ intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
290extern bool intel_dpd_is_edp(struct drm_device *dev); 307extern bool intel_dpd_is_edp(struct drm_device *dev);
291extern void intel_edp_link_config(struct intel_encoder *, int *, int *); 308extern void intel_edp_link_config(struct intel_encoder *, int *, int *);
292extern bool intel_encoder_is_pch_edp(struct drm_encoder *encoder); 309extern bool intel_encoder_is_pch_edp(struct drm_encoder *encoder);
310extern int intel_plane_init(struct drm_device *dev, enum pipe pipe);
293 311
294/* intel_panel.c */ 312/* intel_panel.c */
295extern void intel_fixed_panel_mode(struct drm_display_mode *fixed_mode, 313extern void intel_fixed_panel_mode(struct drm_display_mode *fixed_mode,
@@ -380,9 +398,19 @@ extern int intel_overlay_attrs(struct drm_device *dev, void *data,
380extern void intel_fb_output_poll_changed(struct drm_device *dev); 398extern void intel_fb_output_poll_changed(struct drm_device *dev);
381extern void intel_fb_restore_mode(struct drm_device *dev); 399extern void intel_fb_restore_mode(struct drm_device *dev);
382 400
401extern void assert_pipe(struct drm_i915_private *dev_priv, enum pipe pipe,
402 bool state);
403#define assert_pipe_enabled(d, p) assert_pipe(d, p, true)
404#define assert_pipe_disabled(d, p) assert_pipe(d, p, false)
405
383extern void intel_init_clock_gating(struct drm_device *dev); 406extern void intel_init_clock_gating(struct drm_device *dev);
384extern void intel_write_eld(struct drm_encoder *encoder, 407extern void intel_write_eld(struct drm_encoder *encoder,
385 struct drm_display_mode *mode); 408 struct drm_display_mode *mode);
386extern void intel_cpt_verify_modeset(struct drm_device *dev, int pipe); 409extern void intel_cpt_verify_modeset(struct drm_device *dev, int pipe);
387 410
411/* For use by IVB LP watermark workaround in intel_sprite.c */
412extern void sandybridge_update_wm(struct drm_device *dev);
413extern void intel_update_sprite_watermarks(struct drm_device *dev, int pipe,
414 uint32_t sprite_width,
415 int pixel_size);
388#endif /* __INTEL_DRV_H__ */ 416#endif /* __INTEL_DRV_H__ */