Skip to content

Commit

Permalink
drm/i915: Move FBC stuff to intel_fbc.c
Browse files Browse the repository at this point in the history
No functional changes. This is just the begin of a FBC rework.

v2 (Paulo):
  - Revert intel_fbc_init() changed parameter.
  - Revert set_no_fbc_reason() rename.
  - Rebase.

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Rodrigo Vivi authored and Daniel Vetter committed Dec 10, 2014
1 parent 15a17aa commit 7ff0ebc
Show file tree
Hide file tree
Showing 8 changed files with 698 additions and 669 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ i915-y += intel_renderstate_gen6.o \
i915-y += intel_audio.o \
intel_bios.o \
intel_display.o \
intel_fbc.o \
intel_fifo_underrun.o \
intel_frontbuffer.o \
intel_modes.o \
Expand Down
3 changes: 0 additions & 3 deletions drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -2963,9 +2963,6 @@ extern void intel_modeset_setup_hw_state(struct drm_device *dev,
bool force_restore);
extern void i915_redisable_vga(struct drm_device *dev);
extern void i915_redisable_vga_power_on(struct drm_device *dev);
extern bool intel_fbc_enabled(struct drm_device *dev);
extern void bdw_fbc_sw_flush(struct drm_device *dev, u32 value);
extern void intel_disable_fbc(struct drm_device *dev);
extern bool ironlake_set_drps(struct drm_device *dev, u8 val);
extern void intel_init_pch_refclk(struct drm_device *dev);
extern void gen6_set_rps(struct drm_device *dev, u8 val);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/i915_suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static void i915_restore_display(struct drm_device *dev)
}

/* only restore FBC info on the platform that supports FBC*/
intel_disable_fbc(dev);
intel_fbc_disable(dev);

/* restore FBC interval */
if (HAS_FBC(dev) && INTEL_INFO(dev)->gen <= 4 && !IS_G4X(dev))
Expand Down
22 changes: 11 additions & 11 deletions drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -4201,7 +4201,7 @@ static void intel_crtc_enable_planes(struct drm_crtc *crtc)
hsw_enable_ips(intel_crtc);

mutex_lock(&dev->struct_mutex);
intel_update_fbc(dev);
intel_fbc_update(dev);
mutex_unlock(&dev->struct_mutex);

/*
Expand All @@ -4223,7 +4223,7 @@ static void intel_crtc_disable_planes(struct drm_crtc *crtc)
intel_crtc_wait_for_pending_flips(crtc);

if (dev_priv->fbc.plane == plane)
intel_disable_fbc(dev);
intel_fbc_disable(dev);

hsw_disable_ips(intel_crtc);

Expand Down Expand Up @@ -4527,7 +4527,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
intel_update_watermarks(crtc);

mutex_lock(&dev->struct_mutex);
intel_update_fbc(dev);
intel_fbc_update(dev);
mutex_unlock(&dev->struct_mutex);
}

Expand Down Expand Up @@ -4584,7 +4584,7 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
intel_update_watermarks(crtc);

mutex_lock(&dev->struct_mutex);
intel_update_fbc(dev);
intel_fbc_update(dev);
mutex_unlock(&dev->struct_mutex);

if (intel_crtc_to_shared_dpll(intel_crtc))
Expand Down Expand Up @@ -5189,7 +5189,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
intel_update_watermarks(crtc);

mutex_lock(&dev->struct_mutex);
intel_update_fbc(dev);
intel_fbc_update(dev);
mutex_unlock(&dev->struct_mutex);
}

Expand Down Expand Up @@ -8950,7 +8950,7 @@ static void intel_unpin_work_fn(struct work_struct *__work)
drm_gem_object_unreference(&work->pending_flip_obj->base);
drm_gem_object_unreference(&work->old_fb_obj->base);

intel_update_fbc(dev);
intel_fbc_update(dev);

if (work->flip_queued_req)
i915_gem_request_assign(&work->flip_queued_req, NULL);
Expand Down Expand Up @@ -9747,7 +9747,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
i915_gem_track_fb(work->old_fb_obj, obj,
INTEL_FRONTBUFFER_PRIMARY(pipe));

intel_disable_fbc(dev);
intel_fbc_disable(dev);
intel_frontbuffer_flip_prepare(dev, INTEL_FRONTBUFFER_PRIMARY(pipe));
mutex_unlock(&dev->struct_mutex);

Expand Down Expand Up @@ -11816,7 +11816,7 @@ intel_commit_primary_plane(struct drm_plane *plane,
INTEL_INFO(dev)->gen <= 4 && !IS_G4X(dev) &&
dev_priv->fbc.plane == intel_crtc->plane &&
intel_plane->rotation != BIT(DRM_ROTATE_0)) {
intel_disable_fbc(dev);
intel_fbc_disable(dev);
}

if (state->visible) {
Expand Down Expand Up @@ -11851,7 +11851,7 @@ intel_commit_primary_plane(struct drm_plane *plane,
intel_frontbuffer_flip(dev, INTEL_FRONTBUFFER_PRIMARY(pipe));

mutex_lock(&dev->struct_mutex);
intel_update_fbc(dev);
intel_fbc_update(dev);
mutex_unlock(&dev->struct_mutex);
}
}
Expand Down Expand Up @@ -13050,7 +13050,7 @@ void intel_modeset_init(struct drm_device *dev)
intel_setup_outputs(dev);

/* Just in case the BIOS is doing something questionable. */
intel_disable_fbc(dev);
intel_fbc_disable(dev);

drm_modeset_lock_all(dev);
intel_modeset_setup_hw_state(dev, false);
Expand Down Expand Up @@ -13567,7 +13567,7 @@ void intel_modeset_cleanup(struct drm_device *dev)

intel_unregister_dsm_handler();

intel_disable_fbc(dev);
intel_fbc_disable(dev);

ironlake_teardown_rc6(dev);

Expand Down
9 changes: 7 additions & 2 deletions drivers/gpu/drm/i915/intel_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,13 @@ static inline void intel_fbdev_restore_mode(struct drm_device *dev)
}
#endif

/* intel_fbc.c */
bool intel_fbc_enabled(struct drm_device *dev);
void intel_fbc_update(struct drm_device *dev);
void intel_fbc_init(struct drm_i915_private *dev_priv);
void intel_fbc_disable(struct drm_device *dev);
void bdw_fbc_sw_flush(struct drm_device *dev, u32 value);

/* intel_hdmi.c */
void intel_hdmi_init(struct drm_device *dev, int hdmi_reg, enum port port);
void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
Expand Down Expand Up @@ -1169,8 +1176,6 @@ void intel_update_sprite_watermarks(struct drm_plane *plane,
bool enabled, bool scaled);
void intel_init_pm(struct drm_device *dev);
void intel_pm_setup(struct drm_device *dev);
bool intel_fbc_enabled(struct drm_device *dev);
void intel_update_fbc(struct drm_device *dev);
void intel_gpu_ips_init(struct drm_i915_private *dev_priv);
void intel_gpu_ips_teardown(void);
void intel_init_gt_powersave(struct drm_device *dev);
Expand Down
Loading

0 comments on commit 7ff0ebc

Please sign in to comment.