Commit f71635e8 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/gma500: Replace references to dev_private with helper function

Replace most references to struct drm_device.dev_private with the new
helper function to_drm_psb_private(). The only references left are in
assignments and the helper itself.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210920141051.30988-2-tzimmermann@suse.de
parent c6dc899e
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
static void do_gma_backlight_set(struct drm_device *dev) static void do_gma_backlight_set(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
backlight_update_status(dev_priv->backlight_device); backlight_update_status(dev_priv->backlight_device);
} }
#endif #endif
...@@ -24,7 +24,7 @@ static void do_gma_backlight_set(struct drm_device *dev) ...@@ -24,7 +24,7 @@ static void do_gma_backlight_set(struct drm_device *dev)
void gma_backlight_enable(struct drm_device *dev) void gma_backlight_enable(struct drm_device *dev)
{ {
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
dev_priv->backlight_enabled = true; dev_priv->backlight_enabled = true;
if (dev_priv->backlight_device) { if (dev_priv->backlight_device) {
dev_priv->backlight_device->props.brightness = dev_priv->backlight_level; dev_priv->backlight_device->props.brightness = dev_priv->backlight_level;
...@@ -36,7 +36,7 @@ void gma_backlight_enable(struct drm_device *dev) ...@@ -36,7 +36,7 @@ void gma_backlight_enable(struct drm_device *dev)
void gma_backlight_disable(struct drm_device *dev) void gma_backlight_disable(struct drm_device *dev)
{ {
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
dev_priv->backlight_enabled = false; dev_priv->backlight_enabled = false;
if (dev_priv->backlight_device) { if (dev_priv->backlight_device) {
dev_priv->backlight_device->props.brightness = 0; dev_priv->backlight_device->props.brightness = 0;
...@@ -48,7 +48,7 @@ void gma_backlight_disable(struct drm_device *dev) ...@@ -48,7 +48,7 @@ void gma_backlight_disable(struct drm_device *dev)
void gma_backlight_set(struct drm_device *dev, int v) void gma_backlight_set(struct drm_device *dev, int v)
{ {
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
dev_priv->backlight_level = v; dev_priv->backlight_level = v;
if (dev_priv->backlight_device && dev_priv->backlight_enabled) { if (dev_priv->backlight_device && dev_priv->backlight_enabled) {
dev_priv->backlight_device->props.brightness = v; dev_priv->backlight_device->props.brightness = v;
...@@ -60,7 +60,7 @@ void gma_backlight_set(struct drm_device *dev, int v) ...@@ -60,7 +60,7 @@ void gma_backlight_set(struct drm_device *dev, int v)
int gma_backlight_init(struct drm_device *dev) int gma_backlight_init(struct drm_device *dev)
{ {
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
dev_priv->backlight_enabled = true; dev_priv->backlight_enabled = true;
return dev_priv->ops->backlight_init(dev); return dev_priv->ops->backlight_init(dev);
#else #else
...@@ -71,7 +71,7 @@ int gma_backlight_init(struct drm_device *dev) ...@@ -71,7 +71,7 @@ int gma_backlight_init(struct drm_device *dev)
void gma_backlight_exit(struct drm_device *dev) void gma_backlight_exit(struct drm_device *dev)
{ {
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
if (dev_priv->backlight_device) { if (dev_priv->backlight_device) {
dev_priv->backlight_device->props.brightness = 0; dev_priv->backlight_device->props.brightness = 0;
backlight_update_status(dev_priv->backlight_device); backlight_update_status(dev_priv->backlight_device);
......
...@@ -38,7 +38,7 @@ static void cdv_disable_vga(struct drm_device *dev) ...@@ -38,7 +38,7 @@ static void cdv_disable_vga(struct drm_device *dev)
static int cdv_output_init(struct drm_device *dev) static int cdv_output_init(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
drm_mode_create_scaling_mode_property(dev); drm_mode_create_scaling_mode_property(dev);
...@@ -146,7 +146,7 @@ static const struct backlight_ops cdv_ops = { ...@@ -146,7 +146,7 @@ static const struct backlight_ops cdv_ops = {
static int cdv_backlight_init(struct drm_device *dev) static int cdv_backlight_init(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct backlight_properties props; struct backlight_properties props;
memset(&props, 0, sizeof(struct backlight_properties)); memset(&props, 0, sizeof(struct backlight_properties));
...@@ -206,7 +206,7 @@ static inline void CDV_MSG_WRITE32(int domain, uint port, uint offset, ...@@ -206,7 +206,7 @@ static inline void CDV_MSG_WRITE32(int domain, uint port, uint offset,
static void cdv_init_pm(struct drm_device *dev) static void cdv_init_pm(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
u32 pwr_cnt; u32 pwr_cnt;
int domain = pci_domain_nr(pdev->bus); int domain = pci_domain_nr(pdev->bus);
...@@ -259,7 +259,7 @@ static void cdv_errata(struct drm_device *dev) ...@@ -259,7 +259,7 @@ static void cdv_errata(struct drm_device *dev)
*/ */
static int cdv_save_display_registers(struct drm_device *dev) static int cdv_save_display_registers(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
struct psb_save_area *regs = &dev_priv->regs; struct psb_save_area *regs = &dev_priv->regs;
struct drm_connector *connector; struct drm_connector *connector;
...@@ -314,7 +314,7 @@ static int cdv_save_display_registers(struct drm_device *dev) ...@@ -314,7 +314,7 @@ static int cdv_save_display_registers(struct drm_device *dev)
*/ */
static int cdv_restore_display_registers(struct drm_device *dev) static int cdv_restore_display_registers(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
struct psb_save_area *regs = &dev_priv->regs; struct psb_save_area *regs = &dev_priv->regs;
struct drm_connector *connector; struct drm_connector *connector;
...@@ -383,7 +383,7 @@ static int cdv_restore_display_registers(struct drm_device *dev) ...@@ -383,7 +383,7 @@ static int cdv_restore_display_registers(struct drm_device *dev)
static int cdv_power_down(struct drm_device *dev) static int cdv_power_down(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 pwr_cnt, pwr_mask, pwr_sts; u32 pwr_cnt, pwr_mask, pwr_sts;
int tries = 5; int tries = 5;
...@@ -405,7 +405,7 @@ static int cdv_power_down(struct drm_device *dev) ...@@ -405,7 +405,7 @@ static int cdv_power_down(struct drm_device *dev)
static int cdv_power_up(struct drm_device *dev) static int cdv_power_up(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 pwr_cnt, pwr_mask, pwr_sts; u32 pwr_cnt, pwr_mask, pwr_sts;
int tries = 5; int tries = 5;
...@@ -440,7 +440,7 @@ static void cdv_hotplug_work_func(struct work_struct *work) ...@@ -440,7 +440,7 @@ static void cdv_hotplug_work_func(struct work_struct *work)
static int cdv_hotplug_event(struct drm_device *dev) static int cdv_hotplug_event(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
schedule_work(&dev_priv->hotplug_work); schedule_work(&dev_priv->hotplug_work);
REG_WRITE(PORT_HOTPLUG_STAT, REG_READ(PORT_HOTPLUG_STAT)); REG_WRITE(PORT_HOTPLUG_STAT, REG_READ(PORT_HOTPLUG_STAT));
return 1; return 1;
...@@ -468,7 +468,7 @@ static const char *force_audio_names[] = { ...@@ -468,7 +468,7 @@ static const char *force_audio_names[] = {
void cdv_intel_attach_force_audio_property(struct drm_connector *connector) void cdv_intel_attach_force_audio_property(struct drm_connector *connector)
{ {
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct drm_property *prop; struct drm_property *prop;
int i; int i;
...@@ -497,7 +497,7 @@ static const char *broadcast_rgb_names[] = { ...@@ -497,7 +497,7 @@ static const char *broadcast_rgb_names[] = {
void cdv_intel_attach_broadcast_rgb_property(struct drm_connector *connector) void cdv_intel_attach_broadcast_rgb_property(struct drm_connector *connector)
{ {
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct drm_property *prop; struct drm_property *prop;
int i; int i;
...@@ -574,7 +574,7 @@ static const struct psb_offset cdv_regmap[2] = { ...@@ -574,7 +574,7 @@ static const struct psb_offset cdv_regmap[2] = {
static int cdv_chip_setup(struct drm_device *dev) static int cdv_chip_setup(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
INIT_WORK(&dev_priv->hotplug_work, cdv_hotplug_work_func); INIT_WORK(&dev_priv->hotplug_work, cdv_hotplug_work_func);
......
...@@ -455,7 +455,7 @@ static bool cdv_intel_find_dp_pll(const struct gma_limit_t *limit, ...@@ -455,7 +455,7 @@ static bool cdv_intel_find_dp_pll(const struct gma_limit_t *limit,
static bool cdv_intel_pipe_enabled(struct drm_device *dev, int pipe) static bool cdv_intel_pipe_enabled(struct drm_device *dev, int pipe)
{ {
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_crtc *gma_crtc = NULL; struct gma_crtc *gma_crtc = NULL;
crtc = dev_priv->pipe_to_crtc_mapping[pipe]; crtc = dev_priv->pipe_to_crtc_mapping[pipe];
...@@ -489,7 +489,7 @@ void cdv_disable_sr(struct drm_device *dev) ...@@ -489,7 +489,7 @@ void cdv_disable_sr(struct drm_device *dev)
void cdv_update_wm(struct drm_device *dev, struct drm_crtc *crtc) void cdv_update_wm(struct drm_device *dev, struct drm_crtc *crtc)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
/* Is only one pipe enabled? */ /* Is only one pipe enabled? */
...@@ -574,7 +574,7 @@ static int cdv_intel_crtc_mode_set(struct drm_crtc *crtc, ...@@ -574,7 +574,7 @@ static int cdv_intel_crtc_mode_set(struct drm_crtc *crtc,
struct drm_framebuffer *old_fb) struct drm_framebuffer *old_fb)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
int pipe = gma_crtc->pipe; int pipe = gma_crtc->pipe;
const struct psb_offset *map = &dev_priv->regmap[pipe]; const struct psb_offset *map = &dev_priv->regmap[pipe];
...@@ -829,7 +829,7 @@ static void i8xx_clock(int refclk, struct gma_clock_t *clock) ...@@ -829,7 +829,7 @@ static void i8xx_clock(int refclk, struct gma_clock_t *clock)
static int cdv_intel_crtc_clock_get(struct drm_device *dev, static int cdv_intel_crtc_clock_get(struct drm_device *dev,
struct drm_crtc *crtc) struct drm_crtc *crtc)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
int pipe = gma_crtc->pipe; int pipe = gma_crtc->pipe;
const struct psb_offset *map = &dev_priv->regmap[pipe]; const struct psb_offset *map = &dev_priv->regmap[pipe];
...@@ -910,7 +910,7 @@ struct drm_display_mode *cdv_intel_crtc_mode_get(struct drm_device *dev, ...@@ -910,7 +910,7 @@ struct drm_display_mode *cdv_intel_crtc_mode_get(struct drm_device *dev,
{ {
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
int pipe = gma_crtc->pipe; int pipe = gma_crtc->pipe;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_pipe *p = &dev_priv->regs.pipe[pipe]; struct psb_pipe *p = &dev_priv->regs.pipe[pipe];
const struct psb_offset *map = &dev_priv->regmap[pipe]; const struct psb_offset *map = &dev_priv->regmap[pipe];
struct drm_display_mode *mode; struct drm_display_mode *mode;
......
...@@ -515,7 +515,7 @@ cdv_intel_dp_mode_valid(struct drm_connector *connector, ...@@ -515,7 +515,7 @@ cdv_intel_dp_mode_valid(struct drm_connector *connector,
struct cdv_intel_dp *intel_dp = encoder->dev_priv; struct cdv_intel_dp *intel_dp = encoder->dev_priv;
int max_link_clock = cdv_intel_dp_link_clock(cdv_intel_dp_max_link_bw(encoder)); int max_link_clock = cdv_intel_dp_link_clock(cdv_intel_dp_max_link_bw(encoder));
int max_lanes = cdv_intel_dp_max_lane_count(encoder); int max_lanes = cdv_intel_dp_max_lane_count(encoder);
struct drm_psb_private *dev_priv = connector->dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev);
if (is_edp(encoder) && intel_dp->panel_fixed_mode) { if (is_edp(encoder) && intel_dp->panel_fixed_mode) {
if (mode->hdisplay > intel_dp->panel_fixed_mode->hdisplay) if (mode->hdisplay > intel_dp->panel_fixed_mode->hdisplay)
...@@ -896,7 +896,7 @@ static bool ...@@ -896,7 +896,7 @@ static bool
cdv_intel_dp_mode_fixup(struct drm_encoder *encoder, const struct drm_display_mode *mode, cdv_intel_dp_mode_fixup(struct drm_encoder *encoder, const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode) struct drm_display_mode *adjusted_mode)
{ {
struct drm_psb_private *dev_priv = encoder->dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(encoder->dev);
struct gma_encoder *intel_encoder = to_gma_encoder(encoder); struct gma_encoder *intel_encoder = to_gma_encoder(encoder);
struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv;
int lane_count, clock; int lane_count, clock;
...@@ -988,7 +988,7 @@ cdv_intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, ...@@ -988,7 +988,7 @@ cdv_intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode) struct drm_display_mode *adjusted_mode)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct drm_mode_config *mode_config = &dev->mode_config; struct drm_mode_config *mode_config = &dev->mode_config;
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
...@@ -1744,7 +1744,7 @@ static int cdv_intel_dp_get_modes(struct drm_connector *connector) ...@@ -1744,7 +1744,7 @@ static int cdv_intel_dp_get_modes(struct drm_connector *connector)
if (is_edp(intel_encoder)) { if (is_edp(intel_encoder)) {
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
cdv_intel_edp_panel_vdd_off(intel_encoder); cdv_intel_edp_panel_vdd_off(intel_encoder);
if (ret) { if (ret) {
...@@ -1809,7 +1809,7 @@ cdv_intel_dp_set_property(struct drm_connector *connector, ...@@ -1809,7 +1809,7 @@ cdv_intel_dp_set_property(struct drm_connector *connector,
struct drm_property *property, struct drm_property *property,
uint64_t val) uint64_t val)
{ {
struct drm_psb_private *dev_priv = connector->dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev);
struct gma_encoder *encoder = gma_attached_encoder(connector); struct gma_encoder *encoder = gma_attached_encoder(connector);
struct cdv_intel_dp *intel_dp = encoder->dev_priv; struct cdv_intel_dp *intel_dp = encoder->dev_priv;
int ret; int ret;
...@@ -1908,7 +1908,7 @@ static void cdv_intel_dp_add_properties(struct drm_connector *connector) ...@@ -1908,7 +1908,7 @@ static void cdv_intel_dp_add_properties(struct drm_connector *connector)
/* check the VBT to see whether the eDP is on DP-D port */ /* check the VBT to see whether the eDP is on DP-D port */
static bool cdv_intel_dpc_is_edp(struct drm_device *dev) static bool cdv_intel_dpc_is_edp(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct child_device_config *p_child; struct child_device_config *p_child;
int i; int i;
......
...@@ -57,7 +57,7 @@ struct cdv_intel_lvds_priv { ...@@ -57,7 +57,7 @@ struct cdv_intel_lvds_priv {
*/ */
static u32 cdv_intel_lvds_get_max_backlight(struct drm_device *dev) static u32 cdv_intel_lvds_get_max_backlight(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 retval; u32 retval;
if (gma_power_begin(dev, false)) { if (gma_power_begin(dev, false)) {
...@@ -81,7 +81,7 @@ static u32 cdv_intel_lvds_get_max_backlight(struct drm_device *dev) ...@@ -81,7 +81,7 @@ static u32 cdv_intel_lvds_get_max_backlight(struct drm_device *dev)
*/ */
static void cdv_intel_lvds_set_backlight(struct drm_device *dev, int level) static void cdv_intel_lvds_set_backlight(struct drm_device *dev, int level)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 blc_pwm_ctl; u32 blc_pwm_ctl;
if (gma_power_begin(dev, false)) { if (gma_power_begin(dev, false)) {
...@@ -105,7 +105,7 @@ static void cdv_intel_lvds_set_backlight(struct drm_device *dev, int level) ...@@ -105,7 +105,7 @@ static void cdv_intel_lvds_set_backlight(struct drm_device *dev, int level)
static void cdv_intel_lvds_set_power(struct drm_device *dev, static void cdv_intel_lvds_set_power(struct drm_device *dev,
struct drm_encoder *encoder, bool on) struct drm_encoder *encoder, bool on)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 pp_status; u32 pp_status;
if (!gma_power_begin(dev, true)) if (!gma_power_begin(dev, true))
...@@ -154,7 +154,7 @@ static enum drm_mode_status cdv_intel_lvds_mode_valid(struct drm_connector *conn ...@@ -154,7 +154,7 @@ static enum drm_mode_status cdv_intel_lvds_mode_valid(struct drm_connector *conn
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct drm_display_mode *fixed_mode = struct drm_display_mode *fixed_mode =
dev_priv->mode_dev.panel_fixed_mode; dev_priv->mode_dev.panel_fixed_mode;
...@@ -180,7 +180,7 @@ static bool cdv_intel_lvds_mode_fixup(struct drm_encoder *encoder, ...@@ -180,7 +180,7 @@ static bool cdv_intel_lvds_mode_fixup(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode) struct drm_display_mode *adjusted_mode)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
struct drm_encoder *tmp_encoder; struct drm_encoder *tmp_encoder;
struct drm_display_mode *panel_fixed_mode = mode_dev->panel_fixed_mode; struct drm_display_mode *panel_fixed_mode = mode_dev->panel_fixed_mode;
...@@ -227,7 +227,7 @@ static bool cdv_intel_lvds_mode_fixup(struct drm_encoder *encoder, ...@@ -227,7 +227,7 @@ static bool cdv_intel_lvds_mode_fixup(struct drm_encoder *encoder,
static void cdv_intel_lvds_prepare(struct drm_encoder *encoder) static void cdv_intel_lvds_prepare(struct drm_encoder *encoder)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
if (!gma_power_begin(dev, true)) if (!gma_power_begin(dev, true))
...@@ -245,7 +245,7 @@ static void cdv_intel_lvds_prepare(struct drm_encoder *encoder) ...@@ -245,7 +245,7 @@ static void cdv_intel_lvds_prepare(struct drm_encoder *encoder)
static void cdv_intel_lvds_commit(struct drm_encoder *encoder) static void cdv_intel_lvds_commit(struct drm_encoder *encoder)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
if (mode_dev->backlight_duty_cycle == 0) if (mode_dev->backlight_duty_cycle == 0)
...@@ -260,7 +260,7 @@ static void cdv_intel_lvds_mode_set(struct drm_encoder *encoder, ...@@ -260,7 +260,7 @@ static void cdv_intel_lvds_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode) struct drm_display_mode *adjusted_mode)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_crtc *gma_crtc = to_gma_crtc(encoder->crtc); struct gma_crtc *gma_crtc = to_gma_crtc(encoder->crtc);
u32 pfit_control; u32 pfit_control;
...@@ -297,7 +297,7 @@ static void cdv_intel_lvds_mode_set(struct drm_encoder *encoder, ...@@ -297,7 +297,7 @@ static void cdv_intel_lvds_mode_set(struct drm_encoder *encoder,
static int cdv_intel_lvds_get_modes(struct drm_connector *connector) static int cdv_intel_lvds_get_modes(struct drm_connector *connector)
{ {
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_encoder *gma_encoder = gma_attached_encoder(connector); struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
int ret; int ret;
...@@ -428,7 +428,7 @@ static const struct drm_connector_funcs cdv_intel_lvds_connector_funcs = { ...@@ -428,7 +428,7 @@ static const struct drm_connector_funcs cdv_intel_lvds_connector_funcs = {
static bool lvds_is_present_in_vbt(struct drm_device *dev, static bool lvds_is_present_in_vbt(struct drm_device *dev,
u8 *i2c_pin) u8 *i2c_pin)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
int i; int i;
if (!dev_priv->child_dev_num) if (!dev_priv->child_dev_num)
...@@ -486,7 +486,7 @@ void cdv_intel_lvds_init(struct drm_device *dev, ...@@ -486,7 +486,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct drm_display_mode *scan; struct drm_display_mode *scan;
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 lvds; u32 lvds;
int pipe; int pipe;
u8 pin; u8 pin;
......
...@@ -81,7 +81,7 @@ static vm_fault_t psbfb_vm_fault(struct vm_fault *vmf) ...@@ -81,7 +81,7 @@ static vm_fault_t psbfb_vm_fault(struct vm_fault *vmf)
struct vm_area_struct *vma = vmf->vma; struct vm_area_struct *vma = vmf->vma;
struct drm_framebuffer *fb = vma->vm_private_data; struct drm_framebuffer *fb = vma->vm_private_data;
struct drm_device *dev = fb->dev; struct drm_device *dev = fb->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gtt_range *gtt = to_gtt_range(fb->obj[0]); struct gtt_range *gtt = to_gtt_range(fb->obj[0]);
int page_num; int page_num;
int i; int i;
...@@ -261,7 +261,7 @@ static int psbfb_create(struct drm_fb_helper *fb_helper, ...@@ -261,7 +261,7 @@ static int psbfb_create(struct drm_fb_helper *fb_helper,
struct drm_fb_helper_surface_size *sizes) struct drm_fb_helper_surface_size *sizes)
{ {
struct drm_device *dev = fb_helper->dev; struct drm_device *dev = fb_helper->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
struct fb_info *info; struct fb_info *info;
struct drm_framebuffer *fb; struct drm_framebuffer *fb;
...@@ -374,7 +374,7 @@ static int psbfb_probe(struct drm_fb_helper *fb_helper, ...@@ -374,7 +374,7 @@ static int psbfb_probe(struct drm_fb_helper *fb_helper,
struct drm_fb_helper_surface_size *sizes) struct drm_fb_helper_surface_size *sizes)
{ {
struct drm_device *dev = fb_helper->dev; struct drm_device *dev = fb_helper->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
unsigned int fb_size; unsigned int fb_size;
int bytespp; int bytespp;
...@@ -422,7 +422,7 @@ static int psb_fbdev_destroy(struct drm_device *dev, ...@@ -422,7 +422,7 @@ static int psb_fbdev_destroy(struct drm_device *dev,
int psb_fbdev_init(struct drm_device *dev) int psb_fbdev_init(struct drm_device *dev)
{ {
struct drm_fb_helper *fb_helper; struct drm_fb_helper *fb_helper;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
int ret; int ret;
fb_helper = kzalloc(sizeof(*fb_helper), GFP_KERNEL); fb_helper = kzalloc(sizeof(*fb_helper), GFP_KERNEL);
...@@ -457,7 +457,7 @@ int psb_fbdev_init(struct drm_device *dev) ...@@ -457,7 +457,7 @@ int psb_fbdev_init(struct drm_device *dev)
static void psb_fbdev_fini(struct drm_device *dev) static void psb_fbdev_fini(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
if (!dev_priv->fb_helper) if (!dev_priv->fb_helper)
return; return;
...@@ -474,7 +474,7 @@ static const struct drm_mode_config_funcs psb_mode_funcs = { ...@@ -474,7 +474,7 @@ static const struct drm_mode_config_funcs psb_mode_funcs = {
static void psb_setup_outputs(struct drm_device *dev) static void psb_setup_outputs(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct drm_connector *connector; struct drm_connector *connector;
drm_mode_create_scaling_mode_property(dev); drm_mode_create_scaling_mode_property(dev);
...@@ -533,7 +533,7 @@ static void psb_setup_outputs(struct drm_device *dev) ...@@ -533,7 +533,7 @@ static void psb_setup_outputs(struct drm_device *dev)
void psb_modeset_init(struct drm_device *dev) void psb_modeset_init(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
int i; int i;
...@@ -566,7 +566,7 @@ void psb_modeset_init(struct drm_device *dev) ...@@ -566,7 +566,7 @@ void psb_modeset_init(struct drm_device *dev)
void psb_modeset_cleanup(struct drm_device *dev) void psb_modeset_cleanup(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
if (dev_priv->modeset) { if (dev_priv->modeset) {
drm_kms_helper_poll_fini(dev); drm_kms_helper_poll_fini(dev);
psb_fbdev_fini(dev); psb_fbdev_fini(dev);
......
...@@ -147,7 +147,7 @@ static vm_fault_t psb_gem_fault(struct vm_fault *vmf) ...@@ -147,7 +147,7 @@ static vm_fault_t psb_gem_fault(struct vm_fault *vmf)
obj = vma->vm_private_data; /* GEM object */ obj = vma->vm_private_data; /* GEM object */
dev = obj->dev; dev = obj->dev;
dev_priv = dev->dev_private; dev_priv = to_drm_psb_private(dev);
r = container_of(obj, struct gtt_range, gem); /* Get the gtt range */ r = container_of(obj, struct gtt_range, gem); /* Get the gtt range */
......
...@@ -15,7 +15,7 @@ void gma_get_core_freq(struct drm_device *dev) ...@@ -15,7 +15,7 @@ void gma_get_core_freq(struct drm_device *dev)
struct pci_dev *pci_root = struct pci_dev *pci_root =
pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus), pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
0, 0); 0, 0);
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
/*pci_write_config_dword(pci_root, 0xD4, 0x00C32004);*/ /*pci_write_config_dword(pci_root, 0xD4, 0x00C32004);*/
/*pci_write_config_dword(pci_root, 0xD0, 0xE0033000);*/ /*pci_write_config_dword(pci_root, 0xD0, 0xE0033000);*/
......
...@@ -51,7 +51,7 @@ int gma_pipe_set_base(struct drm_crtc *crtc, int x, int y, ...@@ -51,7 +51,7 @@ int gma_pipe_set_base(struct drm_crtc *crtc, int x, int y,
struct drm_framebuffer *old_fb) struct drm_framebuffer *old_fb)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
struct drm_framebuffer *fb = crtc->primary->fb; struct drm_framebuffer *fb = crtc->primary->fb;
struct gtt_range *gtt; struct gtt_range *gtt;
...@@ -136,7 +136,7 @@ int gma_pipe_set_base(struct drm_crtc *crtc, int x, int y, ...@@ -136,7 +136,7 @@ int gma_pipe_set_base(struct drm_crtc *crtc, int x, int y,
void gma_crtc_load_lut(struct drm_crtc *crtc) void gma_crtc_load_lut(struct drm_crtc *crtc)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
const struct psb_offset *map = &dev_priv->regmap[gma_crtc->pipe]; const struct psb_offset *map = &dev_priv->regmap[gma_crtc->pipe];
int palreg = map->palette; int palreg = map->palette;
...@@ -189,7 +189,7 @@ int gma_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, u16 *blue, ...@@ -189,7 +189,7 @@ int gma_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, u16 *blue,
void gma_crtc_dpms(struct drm_crtc *crtc, int mode) void gma_crtc_dpms(struct drm_crtc *crtc, int mode)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
int pipe = gma_crtc->pipe; int pipe = gma_crtc->pipe;
const struct psb_offset *map = &dev_priv->regmap[pipe]; const struct psb_offset *map = &dev_priv->regmap[pipe];
...@@ -324,7 +324,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, ...@@ -324,7 +324,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc,
uint32_t width, uint32_t height) uint32_t width, uint32_t height)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
int pipe = gma_crtc->pipe; int pipe = gma_crtc->pipe;
uint32_t control = (pipe == 0) ? CURACNTR : CURBCNTR; uint32_t control = (pipe == 0) ? CURACNTR : CURBCNTR;
...@@ -553,7 +553,7 @@ int gma_crtc_set_config(struct drm_mode_set *set, ...@@ -553,7 +553,7 @@ int gma_crtc_set_config(struct drm_mode_set *set,
struct drm_modeset_acquire_ctx *ctx) struct drm_modeset_acquire_ctx *ctx)
{ {
struct drm_device *dev = set->crtc->dev; struct drm_device *dev = set->crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
int ret; int ret;
if (!dev_priv->rpm_enabled) if (!dev_priv->rpm_enabled)
...@@ -572,7 +572,7 @@ int gma_crtc_set_config(struct drm_mode_set *set, ...@@ -572,7 +572,7 @@ int gma_crtc_set_config(struct drm_mode_set *set,
void gma_crtc_save(struct drm_crtc *crtc) void gma_crtc_save(struct drm_crtc *crtc)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
struct psb_intel_crtc_state *crtc_state = gma_crtc->crtc_state; struct psb_intel_crtc_state *crtc_state = gma_crtc->crtc_state;
const struct psb_offset *map = &dev_priv->regmap[gma_crtc->pipe]; const struct psb_offset *map = &dev_priv->regmap[gma_crtc->pipe];
...@@ -615,7 +615,7 @@ void gma_crtc_save(struct drm_crtc *crtc) ...@@ -615,7 +615,7 @@ void gma_crtc_save(struct drm_crtc *crtc)
void gma_crtc_restore(struct drm_crtc *crtc) void gma_crtc_restore(struct drm_crtc *crtc)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
struct psb_intel_crtc_state *crtc_state = gma_crtc->crtc_state; struct psb_intel_crtc_state *crtc_state = gma_crtc->crtc_state;
const struct psb_offset *map = &dev_priv->regmap[gma_crtc->pipe]; const struct psb_offset *map = &dev_priv->regmap[gma_crtc->pipe];
......
...@@ -53,7 +53,7 @@ static inline uint32_t psb_gtt_mask_pte(uint32_t pfn, int type) ...@@ -53,7 +53,7 @@ static inline uint32_t psb_gtt_mask_pte(uint32_t pfn, int type)
*/ */
static u32 __iomem *psb_gtt_entry(struct drm_device *dev, struct gtt_range *r) static u32 __iomem *psb_gtt_entry(struct drm_device *dev, struct gtt_range *r)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
unsigned long offset; unsigned long offset;
offset = r->resource.start - dev_priv->gtt_mem->start; offset = r->resource.start - dev_priv->gtt_mem->start;
...@@ -118,7 +118,7 @@ static int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r, ...@@ -118,7 +118,7 @@ static int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r,
*/ */
static void psb_gtt_remove(struct drm_device *dev, struct gtt_range *r) static void psb_gtt_remove(struct drm_device *dev, struct gtt_range *r)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 __iomem *gtt_slot; u32 __iomem *gtt_slot;
u32 pte; u32 pte;
int i; int i;
...@@ -188,7 +188,7 @@ int psb_gtt_pin(struct gtt_range *gt) ...@@ -188,7 +188,7 @@ int psb_gtt_pin(struct gtt_range *gt)
{ {
int ret = 0; int ret = 0;
struct drm_device *dev = gt->gem.dev; struct drm_device *dev = gt->gem.dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 gpu_base = dev_priv->gtt.gatt_start; u32 gpu_base = dev_priv->gtt.gatt_start;
mutex_lock(&dev_priv->gtt_mutex); mutex_lock(&dev_priv->gtt_mutex);
...@@ -226,7 +226,7 @@ int psb_gtt_pin(struct gtt_range *gt) ...@@ -226,7 +226,7 @@ int psb_gtt_pin(struct gtt_range *gt)
void psb_gtt_unpin(struct gtt_range *gt) void psb_gtt_unpin(struct gtt_range *gt)
{ {
struct drm_device *dev = gt->gem.dev; struct drm_device *dev = gt->gem.dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 gpu_base = dev_priv->gtt.gatt_start; u32 gpu_base = dev_priv->gtt.gatt_start;
mutex_lock(&dev_priv->gtt_mutex); mutex_lock(&dev_priv->gtt_mutex);
...@@ -266,7 +266,7 @@ void psb_gtt_unpin(struct gtt_range *gt) ...@@ -266,7 +266,7 @@ void psb_gtt_unpin(struct gtt_range *gt)
struct gtt_range *psb_gtt_alloc_range(struct drm_device *dev, int len, struct gtt_range *psb_gtt_alloc_range(struct drm_device *dev, int len,
const char *name, int backed, u32 align) const char *name, int backed, u32 align)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gtt_range *gt; struct gtt_range *gt;
struct resource *r = dev_priv->gtt_mem; struct resource *r = dev_priv->gtt_mem;
int ret; int ret;
...@@ -322,13 +322,13 @@ void psb_gtt_free_range(struct drm_device *dev, struct gtt_range *gt) ...@@ -322,13 +322,13 @@ void psb_gtt_free_range(struct drm_device *dev, struct gtt_range *gt)
static void psb_gtt_alloc(struct drm_device *dev) static void psb_gtt_alloc(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
init_rwsem(&dev_priv->gtt.sem); init_rwsem(&dev_priv->gtt.sem);
} }
void psb_gtt_takedown(struct drm_device *dev) void psb_gtt_takedown(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
if (dev_priv->gtt_map) { if (dev_priv->gtt_map) {
...@@ -347,7 +347,7 @@ void psb_gtt_takedown(struct drm_device *dev) ...@@ -347,7 +347,7 @@ void psb_gtt_takedown(struct drm_device *dev)
int psb_gtt_init(struct drm_device *dev, int resume) int psb_gtt_init(struct drm_device *dev, int resume)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
unsigned gtt_pages; unsigned gtt_pages;
unsigned long stolen_size, vram_stolen_size; unsigned long stolen_size, vram_stolen_size;
...@@ -496,7 +496,7 @@ int psb_gtt_init(struct drm_device *dev, int resume) ...@@ -496,7 +496,7 @@ int psb_gtt_init(struct drm_device *dev, int resume)
int psb_gtt_restore(struct drm_device *dev) int psb_gtt_restore(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct resource *r = dev_priv->gtt_mem->child; struct resource *r = dev_priv->gtt_mem->child;
struct gtt_range *range; struct gtt_range *range;
unsigned int restored = 0, total = 0, size = 0; unsigned int restored = 0, total = 0, size = 0;
......
...@@ -515,7 +515,7 @@ parse_device_mapping(struct drm_psb_private *dev_priv, ...@@ -515,7 +515,7 @@ parse_device_mapping(struct drm_psb_private *dev_priv,
*/ */
int psb_intel_init_bios(struct drm_device *dev) int psb_intel_init_bios(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
struct vbt_header *vbt = NULL; struct vbt_header *vbt = NULL;
struct bdb_header *bdb = NULL; struct bdb_header *bdb = NULL;
...@@ -579,7 +579,7 @@ int psb_intel_init_bios(struct drm_device *dev) ...@@ -579,7 +579,7 @@ int psb_intel_init_bios(struct drm_device *dev)
*/ */
void psb_intel_destroy_bios(struct drm_device *dev) void psb_intel_destroy_bios(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
kfree(dev_priv->sdvo_lvds_vbt_mode); kfree(dev_priv->sdvo_lvds_vbt_mode);
kfree(dev_priv->lfp_lvds_vbt_mode); kfree(dev_priv->lfp_lvds_vbt_mode);
......
...@@ -75,7 +75,7 @@ struct intel_gpio { ...@@ -75,7 +75,7 @@ struct intel_gpio {
void void
gma_intel_i2c_reset(struct drm_device *dev) gma_intel_i2c_reset(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
GMBUS_REG_WRITE(GMBUS0, 0); GMBUS_REG_WRITE(GMBUS0, 0);
} }
...@@ -394,7 +394,7 @@ int gma_intel_setup_gmbus(struct drm_device *dev) ...@@ -394,7 +394,7 @@ int gma_intel_setup_gmbus(struct drm_device *dev)
"reserved", "reserved",
"dpd", "dpd",
}; };
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
int ret, i; int ret, i;
dev_priv->gmbus = kcalloc(GMBUS_NUM_PORTS, sizeof(struct intel_gmbus), dev_priv->gmbus = kcalloc(GMBUS_NUM_PORTS, sizeof(struct intel_gmbus),
...@@ -480,7 +480,7 @@ void gma_intel_gmbus_force_bit(struct i2c_adapter *adapter, bool force_bit) ...@@ -480,7 +480,7 @@ void gma_intel_gmbus_force_bit(struct i2c_adapter *adapter, bool force_bit)
void gma_intel_teardown_gmbus(struct drm_device *dev) void gma_intel_teardown_gmbus(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
int i; int i;
if (dev_priv->gmbus == NULL) if (dev_priv->gmbus == NULL)
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
static void mid_get_fuse_settings(struct drm_device *dev) static void mid_get_fuse_settings(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
struct pci_dev *pci_root = struct pci_dev *pci_root =
pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus), pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
...@@ -325,7 +325,7 @@ static void mid_get_vbt_data(struct drm_psb_private *dev_priv) ...@@ -325,7 +325,7 @@ static void mid_get_vbt_data(struct drm_psb_private *dev_priv)
int mid_chip_setup(struct drm_device *dev) int mid_chip_setup(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
mid_get_fuse_settings(dev); mid_get_fuse_settings(dev);
mid_get_vbt_data(dev_priv); mid_get_vbt_data(dev_priv);
mid_get_pci_revID(dev_priv); mid_get_pci_revID(dev_priv);
......
...@@ -66,7 +66,7 @@ static inline void psb_mmu_clflush(struct psb_mmu_driver *driver, void *addr) ...@@ -66,7 +66,7 @@ static inline void psb_mmu_clflush(struct psb_mmu_driver *driver, void *addr)
static void psb_mmu_flush_pd_locked(struct psb_mmu_driver *driver, int force) static void psb_mmu_flush_pd_locked(struct psb_mmu_driver *driver, int force)
{ {
struct drm_device *dev = driver->dev; struct drm_device *dev = driver->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
if (atomic_read(&driver->needs_tlbflush) || force) { if (atomic_read(&driver->needs_tlbflush) || force) {
uint32_t val = PSB_RSGX32(PSB_CR_BIF_CTRL); uint32_t val = PSB_RSGX32(PSB_CR_BIF_CTRL);
...@@ -94,7 +94,7 @@ static void psb_mmu_flush_pd(struct psb_mmu_driver *driver, int force) ...@@ -94,7 +94,7 @@ static void psb_mmu_flush_pd(struct psb_mmu_driver *driver, int force)
void psb_mmu_flush(struct psb_mmu_driver *driver) void psb_mmu_flush(struct psb_mmu_driver *driver)
{ {
struct drm_device *dev = driver->dev; struct drm_device *dev = driver->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
uint32_t val; uint32_t val;
down_write(&driver->sem); down_write(&driver->sem);
...@@ -120,7 +120,7 @@ void psb_mmu_flush(struct psb_mmu_driver *driver) ...@@ -120,7 +120,7 @@ void psb_mmu_flush(struct psb_mmu_driver *driver)
void psb_mmu_set_pd_context(struct psb_mmu_pd *pd, int hw_context) void psb_mmu_set_pd_context(struct psb_mmu_pd *pd, int hw_context)
{ {
struct drm_device *dev = pd->driver->dev; struct drm_device *dev = pd->driver->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
uint32_t offset = (hw_context == 0) ? PSB_CR_BIF_DIR_LIST_BASE0 : uint32_t offset = (hw_context == 0) ? PSB_CR_BIF_DIR_LIST_BASE0 :
PSB_CR_BIF_DIR_LIST_BASE1 + hw_context * 4; PSB_CR_BIF_DIR_LIST_BASE1 + hw_context * 4;
...@@ -230,7 +230,7 @@ void psb_mmu_free_pagedir(struct psb_mmu_pd *pd) ...@@ -230,7 +230,7 @@ void psb_mmu_free_pagedir(struct psb_mmu_pd *pd)
{ {
struct psb_mmu_driver *driver = pd->driver; struct psb_mmu_driver *driver = pd->driver;
struct drm_device *dev = driver->dev; struct drm_device *dev = driver->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_mmu_pt *pt; struct psb_mmu_pt *pt;
int i; int i;
...@@ -409,7 +409,7 @@ struct psb_mmu_pd *psb_mmu_get_default_pd(struct psb_mmu_driver *driver) ...@@ -409,7 +409,7 @@ struct psb_mmu_pd *psb_mmu_get_default_pd(struct psb_mmu_driver *driver)
void psb_mmu_driver_takedown(struct psb_mmu_driver *driver) void psb_mmu_driver_takedown(struct psb_mmu_driver *driver)
{ {
struct drm_device *dev = driver->dev; struct drm_device *dev = driver->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
PSB_WSGX32(driver->bif_ctrl, PSB_CR_BIF_CTRL); PSB_WSGX32(driver->bif_ctrl, PSB_CR_BIF_CTRL);
psb_mmu_free_pagedir(driver->default_pd); psb_mmu_free_pagedir(driver->default_pd);
...@@ -422,7 +422,7 @@ struct psb_mmu_driver *psb_mmu_driver_init(struct drm_device *dev, ...@@ -422,7 +422,7 @@ struct psb_mmu_driver *psb_mmu_driver_init(struct drm_device *dev,
atomic_t *msvdx_mmu_invaldc) atomic_t *msvdx_mmu_invaldc)
{ {
struct psb_mmu_driver *driver; struct psb_mmu_driver *driver;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
driver = kmalloc(sizeof(*driver), GFP_KERNEL); driver = kmalloc(sizeof(*driver), GFP_KERNEL);
......
...@@ -82,7 +82,7 @@ static const struct gma_limit_t *mrst_limit(struct drm_crtc *crtc, ...@@ -82,7 +82,7 @@ static const struct gma_limit_t *mrst_limit(struct drm_crtc *crtc,
{ {
const struct gma_limit_t *limit = NULL; const struct gma_limit_t *limit = NULL;
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
if (gma_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) if (gma_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)
|| gma_pipe_has_type(crtc, INTEL_OUTPUT_MIPI)) { || gma_pipe_has_type(crtc, INTEL_OUTPUT_MIPI)) {
...@@ -214,7 +214,7 @@ static bool mrst_lvds_find_best_pll(const struct gma_limit_t *limit, ...@@ -214,7 +214,7 @@ static bool mrst_lvds_find_best_pll(const struct gma_limit_t *limit,
static void oaktrail_crtc_dpms(struct drm_crtc *crtc, int mode) static void oaktrail_crtc_dpms(struct drm_crtc *crtc, int mode)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
int pipe = gma_crtc->pipe; int pipe = gma_crtc->pipe;
const struct psb_offset *map = &dev_priv->regmap[pipe]; const struct psb_offset *map = &dev_priv->regmap[pipe];
...@@ -361,7 +361,7 @@ static int oaktrail_crtc_mode_set(struct drm_crtc *crtc, ...@@ -361,7 +361,7 @@ static int oaktrail_crtc_mode_set(struct drm_crtc *crtc,
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
int pipe = gma_crtc->pipe; int pipe = gma_crtc->pipe;
const struct psb_offset *map = &dev_priv->regmap[pipe]; const struct psb_offset *map = &dev_priv->regmap[pipe];
int refclk = 0; int refclk = 0;
...@@ -589,7 +589,7 @@ static int oaktrail_pipe_set_base(struct drm_crtc *crtc, ...@@ -589,7 +589,7 @@ static int oaktrail_pipe_set_base(struct drm_crtc *crtc,
int x, int y, struct drm_framebuffer *old_fb) int x, int y, struct drm_framebuffer *old_fb)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
struct drm_framebuffer *fb = crtc->primary->fb; struct drm_framebuffer *fb = crtc->primary->fb;
int pipe = gma_crtc->pipe; int pipe = gma_crtc->pipe;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
static int oaktrail_output_init(struct drm_device *dev) static int oaktrail_output_init(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
if (dev_priv->iLVDS_enable) if (dev_priv->iLVDS_enable)
oaktrail_lvds_init(dev, &dev_priv->mode_dev); oaktrail_lvds_init(dev, &dev_priv->mode_dev);
else else
...@@ -51,7 +51,7 @@ static int oaktrail_brightness; ...@@ -51,7 +51,7 @@ static int oaktrail_brightness;
static int oaktrail_set_brightness(struct backlight_device *bd) static int oaktrail_set_brightness(struct backlight_device *bd)
{ {
struct drm_device *dev = bl_get_data(oaktrail_backlight_device); struct drm_device *dev = bl_get_data(oaktrail_backlight_device);
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
int level = bd->props.brightness; int level = bd->props.brightness;
u32 blc_pwm_ctl; u32 blc_pwm_ctl;
u32 max_pwm_blc; u32 max_pwm_blc;
...@@ -96,7 +96,7 @@ static int oaktrail_get_brightness(struct backlight_device *bd) ...@@ -96,7 +96,7 @@ static int oaktrail_get_brightness(struct backlight_device *bd)
static int device_backlight_init(struct drm_device *dev) static int device_backlight_init(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
unsigned long core_clock; unsigned long core_clock;
u16 bl_max_freq; u16 bl_max_freq;
uint32_t value; uint32_t value;
...@@ -133,7 +133,7 @@ static const struct backlight_ops oaktrail_ops = { ...@@ -133,7 +133,7 @@ static const struct backlight_ops oaktrail_ops = {
static int oaktrail_backlight_init(struct drm_device *dev) static int oaktrail_backlight_init(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
int ret; int ret;
struct backlight_properties props; struct backlight_properties props;
...@@ -175,7 +175,7 @@ static int oaktrail_backlight_init(struct drm_device *dev) ...@@ -175,7 +175,7 @@ static int oaktrail_backlight_init(struct drm_device *dev)
*/ */
static int oaktrail_save_display_registers(struct drm_device *dev) static int oaktrail_save_display_registers(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_save_area *regs = &dev_priv->regs; struct psb_save_area *regs = &dev_priv->regs;
struct psb_pipe *p = &regs->pipe[0]; struct psb_pipe *p = &regs->pipe[0];
int i; int i;
...@@ -289,7 +289,7 @@ static int oaktrail_save_display_registers(struct drm_device *dev) ...@@ -289,7 +289,7 @@ static int oaktrail_save_display_registers(struct drm_device *dev)
*/ */
static int oaktrail_restore_display_registers(struct drm_device *dev) static int oaktrail_restore_display_registers(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_save_area *regs = &dev_priv->regs; struct psb_save_area *regs = &dev_priv->regs;
struct psb_pipe *p = &regs->pipe[0]; struct psb_pipe *p = &regs->pipe[0];
u32 pp_stat; u32 pp_stat;
...@@ -404,7 +404,7 @@ static int oaktrail_restore_display_registers(struct drm_device *dev) ...@@ -404,7 +404,7 @@ static int oaktrail_restore_display_registers(struct drm_device *dev)
*/ */
static int oaktrail_power_down(struct drm_device *dev) static int oaktrail_power_down(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 pwr_mask ; u32 pwr_mask ;
u32 pwr_sts; u32 pwr_sts;
...@@ -428,7 +428,7 @@ static int oaktrail_power_down(struct drm_device *dev) ...@@ -428,7 +428,7 @@ static int oaktrail_power_down(struct drm_device *dev)
*/ */
static int oaktrail_power_up(struct drm_device *dev) static int oaktrail_power_up(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 pwr_mask = PSB_PWRGT_DISPLAY_MASK; u32 pwr_mask = PSB_PWRGT_DISPLAY_MASK;
u32 pwr_sts, pwr_cnt; u32 pwr_sts, pwr_cnt;
...@@ -500,7 +500,7 @@ static const struct psb_offset oaktrail_regmap[2] = { ...@@ -500,7 +500,7 @@ static const struct psb_offset oaktrail_regmap[2] = {
static int oaktrail_chip_setup(struct drm_device *dev) static int oaktrail_chip_setup(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
int ret; int ret;
...@@ -524,7 +524,7 @@ static int oaktrail_chip_setup(struct drm_device *dev) ...@@ -524,7 +524,7 @@ static int oaktrail_chip_setup(struct drm_device *dev)
static void oaktrail_teardown(struct drm_device *dev) static void oaktrail_teardown(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
gma_intel_teardown_gmbus(dev); gma_intel_teardown_gmbus(dev);
oaktrail_hdmi_teardown(dev); oaktrail_hdmi_teardown(dev);
......
...@@ -130,7 +130,7 @@ static const struct oaktrail_hdmi_limit oaktrail_hdmi_limit = { ...@@ -130,7 +130,7 @@ static const struct oaktrail_hdmi_limit oaktrail_hdmi_limit = {
static void oaktrail_hdmi_audio_enable(struct drm_device *dev) static void oaktrail_hdmi_audio_enable(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv;
HDMI_WRITE(HDMI_HCR, 0x67); HDMI_WRITE(HDMI_HCR, 0x67);
...@@ -145,7 +145,7 @@ static void oaktrail_hdmi_audio_enable(struct drm_device *dev) ...@@ -145,7 +145,7 @@ static void oaktrail_hdmi_audio_enable(struct drm_device *dev)
static void oaktrail_hdmi_audio_disable(struct drm_device *dev) static void oaktrail_hdmi_audio_disable(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv;
HDMI_WRITE(0x51a8, 0x0); HDMI_WRITE(0x51a8, 0x0);
...@@ -264,7 +264,7 @@ int oaktrail_crtc_hdmi_mode_set(struct drm_crtc *crtc, ...@@ -264,7 +264,7 @@ int oaktrail_crtc_hdmi_mode_set(struct drm_crtc *crtc,
struct drm_framebuffer *old_fb) struct drm_framebuffer *old_fb)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv;
int pipe = 1; int pipe = 1;
int htot_reg = (pipe == 0) ? HTOTAL_A : HTOTAL_B; int htot_reg = (pipe == 0) ? HTOTAL_A : HTOTAL_B;
...@@ -494,7 +494,7 @@ static void oaktrail_hdmi_dpms(struct drm_encoder *encoder, int mode) ...@@ -494,7 +494,7 @@ static void oaktrail_hdmi_dpms(struct drm_encoder *encoder, int mode)
static int dpms_mode = -1; static int dpms_mode = -1;
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv;
u32 temp; u32 temp;
...@@ -529,7 +529,7 @@ oaktrail_hdmi_detect(struct drm_connector *connector, bool force) ...@@ -529,7 +529,7 @@ oaktrail_hdmi_detect(struct drm_connector *connector, bool force)
{ {
enum drm_connector_status status; enum drm_connector_status status;
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv;
u32 temp; u32 temp;
...@@ -665,7 +665,7 @@ void oaktrail_hdmi_init(struct drm_device *dev, ...@@ -665,7 +665,7 @@ void oaktrail_hdmi_init(struct drm_device *dev,
void oaktrail_hdmi_setup(struct drm_device *dev) void oaktrail_hdmi_setup(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev; struct pci_dev *pdev;
struct oaktrail_hdmi_dev *hdmi_dev; struct oaktrail_hdmi_dev *hdmi_dev;
int ret; int ret;
...@@ -718,7 +718,7 @@ void oaktrail_hdmi_setup(struct drm_device *dev) ...@@ -718,7 +718,7 @@ void oaktrail_hdmi_setup(struct drm_device *dev)
void oaktrail_hdmi_teardown(struct drm_device *dev) void oaktrail_hdmi_teardown(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv;
struct pci_dev *pdev; struct pci_dev *pdev;
...@@ -735,7 +735,7 @@ void oaktrail_hdmi_teardown(struct drm_device *dev) ...@@ -735,7 +735,7 @@ void oaktrail_hdmi_teardown(struct drm_device *dev)
/* save HDMI register state */ /* save HDMI register state */
void oaktrail_hdmi_save(struct drm_device *dev) void oaktrail_hdmi_save(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv;
struct psb_state *regs = &dev_priv->regs.psb; struct psb_state *regs = &dev_priv->regs.psb;
struct psb_pipe *pipeb = &dev_priv->regs.pipe[1]; struct psb_pipe *pipeb = &dev_priv->regs.pipe[1];
...@@ -788,7 +788,7 @@ void oaktrail_hdmi_save(struct drm_device *dev) ...@@ -788,7 +788,7 @@ void oaktrail_hdmi_save(struct drm_device *dev)
/* restore HDMI register state */ /* restore HDMI register state */
void oaktrail_hdmi_restore(struct drm_device *dev) void oaktrail_hdmi_restore(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv;
struct psb_state *regs = &dev_priv->regs.psb; struct psb_state *regs = &dev_priv->regs.psb;
struct psb_pipe *pipeb = &dev_priv->regs.pipe[1]; struct psb_pipe *pipeb = &dev_priv->regs.pipe[1];
......
...@@ -37,7 +37,7 @@ static void oaktrail_lvds_set_power(struct drm_device *dev, ...@@ -37,7 +37,7 @@ static void oaktrail_lvds_set_power(struct drm_device *dev,
bool on) bool on)
{ {
u32 pp_status; u32 pp_status;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
if (!gma_power_begin(dev, true)) if (!gma_power_begin(dev, true))
return; return;
...@@ -83,7 +83,7 @@ static void oaktrail_lvds_mode_set(struct drm_encoder *encoder, ...@@ -83,7 +83,7 @@ static void oaktrail_lvds_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode) struct drm_display_mode *adjusted_mode)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
struct drm_mode_config *mode_config = &dev->mode_config; struct drm_mode_config *mode_config = &dev->mode_config;
struct drm_connector *connector = NULL; struct drm_connector *connector = NULL;
...@@ -155,7 +155,7 @@ static void oaktrail_lvds_mode_set(struct drm_encoder *encoder, ...@@ -155,7 +155,7 @@ static void oaktrail_lvds_mode_set(struct drm_encoder *encoder,
static void oaktrail_lvds_prepare(struct drm_encoder *encoder) static void oaktrail_lvds_prepare(struct drm_encoder *encoder)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_encoder *gma_encoder = to_gma_encoder(encoder); struct gma_encoder *gma_encoder = to_gma_encoder(encoder);
struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
...@@ -171,7 +171,7 @@ static void oaktrail_lvds_prepare(struct drm_encoder *encoder) ...@@ -171,7 +171,7 @@ static void oaktrail_lvds_prepare(struct drm_encoder *encoder)
static u32 oaktrail_lvds_get_max_backlight(struct drm_device *dev) static u32 oaktrail_lvds_get_max_backlight(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 ret; u32 ret;
if (gma_power_begin(dev, false)) { if (gma_power_begin(dev, false)) {
...@@ -191,7 +191,7 @@ static u32 oaktrail_lvds_get_max_backlight(struct drm_device *dev) ...@@ -191,7 +191,7 @@ static u32 oaktrail_lvds_get_max_backlight(struct drm_device *dev)
static void oaktrail_lvds_commit(struct drm_encoder *encoder) static void oaktrail_lvds_commit(struct drm_encoder *encoder)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_encoder *gma_encoder = to_gma_encoder(encoder); struct gma_encoder *gma_encoder = to_gma_encoder(encoder);
struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
...@@ -215,7 +215,7 @@ static void oaktrail_lvds_get_configuration_mode(struct drm_device *dev, ...@@ -215,7 +215,7 @@ static void oaktrail_lvds_get_configuration_mode(struct drm_device *dev,
struct psb_intel_mode_device *mode_dev) struct psb_intel_mode_device *mode_dev)
{ {
struct drm_display_mode *mode = NULL; struct drm_display_mode *mode = NULL;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct oaktrail_timing_info *ti = &dev_priv->gct_data.DTD; struct oaktrail_timing_info *ti = &dev_priv->gct_data.DTD;
mode_dev->panel_fixed_mode = NULL; mode_dev->panel_fixed_mode = NULL;
...@@ -294,7 +294,7 @@ void oaktrail_lvds_init(struct drm_device *dev, ...@@ -294,7 +294,7 @@ void oaktrail_lvds_init(struct drm_device *dev,
struct gma_connector *gma_connector; struct gma_connector *gma_connector;
struct drm_connector *connector; struct drm_connector *connector;
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct edid *edid; struct edid *edid;
struct i2c_adapter *i2c_adap; struct i2c_adapter *i2c_adap;
struct drm_display_mode *scan; /* *modes, *bios_mode; */ struct drm_display_mode *scan; /* *modes, *bios_mode; */
......
...@@ -133,7 +133,7 @@ void oaktrail_lvds_i2c_init(struct drm_encoder *encoder) ...@@ -133,7 +133,7 @@ void oaktrail_lvds_i2c_init(struct drm_encoder *encoder)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct gma_encoder *gma_encoder = to_gma_encoder(encoder); struct gma_encoder *gma_encoder = to_gma_encoder(encoder);
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_intel_i2c_chan *chan; struct psb_intel_i2c_chan *chan;
chan = kzalloc(sizeof(struct psb_intel_i2c_chan), GFP_KERNEL); chan = kzalloc(sizeof(struct psb_intel_i2c_chan), GFP_KERNEL);
......
...@@ -147,7 +147,7 @@ static struct psb_intel_opregion *system_opregion; ...@@ -147,7 +147,7 @@ static struct psb_intel_opregion *system_opregion;
static u32 asle_set_backlight(struct drm_device *dev, u32 bclp) static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct opregion_asle *asle = dev_priv->opregion.asle; struct opregion_asle *asle = dev_priv->opregion.asle;
struct backlight_device *bd = dev_priv->backlight_device; struct backlight_device *bd = dev_priv->backlight_device;
...@@ -198,7 +198,7 @@ static void psb_intel_opregion_asle_work(struct work_struct *work) ...@@ -198,7 +198,7 @@ static void psb_intel_opregion_asle_work(struct work_struct *work)
void psb_intel_opregion_asle_intr(struct drm_device *dev) void psb_intel_opregion_asle_intr(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
if (dev_priv->opregion.asle) if (dev_priv->opregion.asle)
schedule_work(&dev_priv->opregion.asle_work); schedule_work(&dev_priv->opregion.asle_work);
...@@ -211,7 +211,7 @@ void psb_intel_opregion_asle_intr(struct drm_device *dev) ...@@ -211,7 +211,7 @@ void psb_intel_opregion_asle_intr(struct drm_device *dev)
void psb_intel_opregion_enable_asle(struct drm_device *dev) void psb_intel_opregion_enable_asle(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct opregion_asle *asle = dev_priv->opregion.asle; struct opregion_asle *asle = dev_priv->opregion.asle;
if (asle && system_opregion ) { if (asle && system_opregion ) {
...@@ -258,7 +258,7 @@ static struct notifier_block psb_intel_opregion_notifier = { ...@@ -258,7 +258,7 @@ static struct notifier_block psb_intel_opregion_notifier = {
void psb_intel_opregion_init(struct drm_device *dev) void psb_intel_opregion_init(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_intel_opregion *opregion = &dev_priv->opregion; struct psb_intel_opregion *opregion = &dev_priv->opregion;
if (!opregion->header) if (!opregion->header)
...@@ -278,7 +278,7 @@ void psb_intel_opregion_init(struct drm_device *dev) ...@@ -278,7 +278,7 @@ void psb_intel_opregion_init(struct drm_device *dev)
void psb_intel_opregion_fini(struct drm_device *dev) void psb_intel_opregion_fini(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_intel_opregion *opregion = &dev_priv->opregion; struct psb_intel_opregion *opregion = &dev_priv->opregion;
if (!opregion->header) if (!opregion->header)
...@@ -304,7 +304,7 @@ void psb_intel_opregion_fini(struct drm_device *dev) ...@@ -304,7 +304,7 @@ void psb_intel_opregion_fini(struct drm_device *dev)
int psb_intel_opregion_setup(struct drm_device *dev) int psb_intel_opregion_setup(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
struct psb_intel_opregion *opregion = &dev_priv->opregion; struct psb_intel_opregion *opregion = &dev_priv->opregion;
u32 opregion_phy, mboxes; u32 opregion_phy, mboxes;
......
...@@ -47,7 +47,7 @@ static DEFINE_SPINLOCK(power_ctrl_lock); /* Serialize power claim */ ...@@ -47,7 +47,7 @@ static DEFINE_SPINLOCK(power_ctrl_lock); /* Serialize power claim */
*/ */
void gma_power_init(struct drm_device *dev) void gma_power_init(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
/* FIXME: Move APM/OSPM base into relevant device code */ /* FIXME: Move APM/OSPM base into relevant device code */
dev_priv->apm_base = dev_priv->apm_reg & 0xffff; dev_priv->apm_base = dev_priv->apm_reg & 0xffff;
...@@ -82,7 +82,7 @@ void gma_power_uninit(struct drm_device *dev) ...@@ -82,7 +82,7 @@ void gma_power_uninit(struct drm_device *dev)
*/ */
static void gma_suspend_display(struct drm_device *dev) static void gma_suspend_display(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
if (dev_priv->suspended) if (dev_priv->suspended)
return; return;
...@@ -101,7 +101,7 @@ static void gma_suspend_display(struct drm_device *dev) ...@@ -101,7 +101,7 @@ static void gma_suspend_display(struct drm_device *dev)
static void gma_resume_display(struct pci_dev *pdev) static void gma_resume_display(struct pci_dev *pdev)
{ {
struct drm_device *dev = pci_get_drvdata(pdev); struct drm_device *dev = pci_get_drvdata(pdev);
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
/* turn on the display power island */ /* turn on the display power island */
dev_priv->ops->power_up(dev); dev_priv->ops->power_up(dev);
...@@ -125,7 +125,7 @@ static void gma_resume_display(struct pci_dev *pdev) ...@@ -125,7 +125,7 @@ static void gma_resume_display(struct pci_dev *pdev)
static void gma_suspend_pci(struct pci_dev *pdev) static void gma_suspend_pci(struct pci_dev *pdev)
{ {
struct drm_device *dev = pci_get_drvdata(pdev); struct drm_device *dev = pci_get_drvdata(pdev);
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
int bsm, vbt; int bsm, vbt;
if (dev_priv->suspended) if (dev_priv->suspended)
...@@ -155,7 +155,7 @@ static void gma_suspend_pci(struct pci_dev *pdev) ...@@ -155,7 +155,7 @@ static void gma_suspend_pci(struct pci_dev *pdev)
static bool gma_resume_pci(struct pci_dev *pdev) static bool gma_resume_pci(struct pci_dev *pdev)
{ {
struct drm_device *dev = pci_get_drvdata(pdev); struct drm_device *dev = pci_get_drvdata(pdev);
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
int ret; int ret;
if (!dev_priv->suspended) if (!dev_priv->suspended)
...@@ -189,7 +189,7 @@ int gma_power_suspend(struct device *_dev) ...@@ -189,7 +189,7 @@ int gma_power_suspend(struct device *_dev)
{ {
struct pci_dev *pdev = to_pci_dev(_dev); struct pci_dev *pdev = to_pci_dev(_dev);
struct drm_device *dev = pci_get_drvdata(pdev); struct drm_device *dev = pci_get_drvdata(pdev);
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
mutex_lock(&power_mutex); mutex_lock(&power_mutex);
if (!dev_priv->suspended) { if (!dev_priv->suspended) {
...@@ -234,7 +234,7 @@ int gma_power_resume(struct device *_dev) ...@@ -234,7 +234,7 @@ int gma_power_resume(struct device *_dev)
*/ */
bool gma_power_is_on(struct drm_device *dev) bool gma_power_is_on(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
return dev_priv->display_power; return dev_priv->display_power;
} }
...@@ -248,7 +248,7 @@ bool gma_power_is_on(struct drm_device *dev) ...@@ -248,7 +248,7 @@ bool gma_power_is_on(struct drm_device *dev)
*/ */
bool gma_power_begin(struct drm_device *dev, bool force_on) bool gma_power_begin(struct drm_device *dev, bool force_on)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
int ret; int ret;
unsigned long flags; unsigned long flags;
...@@ -288,7 +288,7 @@ bool gma_power_begin(struct drm_device *dev, bool force_on) ...@@ -288,7 +288,7 @@ bool gma_power_begin(struct drm_device *dev, bool force_on)
*/ */
void gma_power_end(struct drm_device *dev) void gma_power_end(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&power_ctrl_lock, flags); spin_lock_irqsave(&power_ctrl_lock, flags);
dev_priv->display_count--; dev_priv->display_count--;
...@@ -310,7 +310,7 @@ int psb_runtime_resume(struct device *dev) ...@@ -310,7 +310,7 @@ int psb_runtime_resume(struct device *dev)
int psb_runtime_idle(struct device *dev) int psb_runtime_idle(struct device *dev)
{ {
struct drm_device *drmdev = pci_get_drvdata(to_pci_dev(dev)); struct drm_device *drmdev = pci_get_drvdata(to_pci_dev(dev));
struct drm_psb_private *dev_priv = drmdev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(drmdev);
if (dev_priv->display_count) if (dev_priv->display_count)
return 0; return 0;
else else
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
static int psb_output_init(struct drm_device *dev) static int psb_output_init(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
psb_intel_lvds_init(dev, &dev_priv->mode_dev); psb_intel_lvds_init(dev, &dev_priv->mode_dev);
psb_intel_sdvo_init(dev, SDVOB); psb_intel_sdvo_init(dev, SDVOB);
return 0; return 0;
...@@ -55,7 +55,7 @@ static int psb_get_brightness(struct backlight_device *bd) ...@@ -55,7 +55,7 @@ static int psb_get_brightness(struct backlight_device *bd)
static int psb_backlight_setup(struct drm_device *dev) static int psb_backlight_setup(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
unsigned long core_clock; unsigned long core_clock;
/* u32 bl_max_freq; */ /* u32 bl_max_freq; */
/* unsigned long value; */ /* unsigned long value; */
...@@ -110,7 +110,7 @@ static const struct backlight_ops psb_ops = { ...@@ -110,7 +110,7 @@ static const struct backlight_ops psb_ops = {
static int psb_backlight_init(struct drm_device *dev) static int psb_backlight_init(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
int ret; int ret;
struct backlight_properties props; struct backlight_properties props;
...@@ -149,7 +149,7 @@ static int psb_backlight_init(struct drm_device *dev) ...@@ -149,7 +149,7 @@ static int psb_backlight_init(struct drm_device *dev)
static void psb_init_pm(struct drm_device *dev) static void psb_init_pm(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 gating = PSB_RSGX32(PSB_CR_CLKGATECTL); u32 gating = PSB_RSGX32(PSB_CR_CLKGATECTL);
gating &= ~3; /* Disable 2D clock gating */ gating &= ~3; /* Disable 2D clock gating */
...@@ -167,7 +167,7 @@ static void psb_init_pm(struct drm_device *dev) ...@@ -167,7 +167,7 @@ static void psb_init_pm(struct drm_device *dev)
*/ */
static int psb_save_display_registers(struct drm_device *dev) static int psb_save_display_registers(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct gma_connector *connector; struct gma_connector *connector;
struct psb_state *regs = &dev_priv->regs.psb; struct psb_state *regs = &dev_priv->regs.psb;
...@@ -205,7 +205,7 @@ static int psb_save_display_registers(struct drm_device *dev) ...@@ -205,7 +205,7 @@ static int psb_save_display_registers(struct drm_device *dev)
*/ */
static int psb_restore_display_registers(struct drm_device *dev) static int psb_restore_display_registers(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct gma_connector *connector; struct gma_connector *connector;
struct psb_state *regs = &dev_priv->regs.psb; struct psb_state *regs = &dev_priv->regs.psb;
...@@ -300,7 +300,7 @@ static const struct psb_offset psb_regmap[2] = { ...@@ -300,7 +300,7 @@ static const struct psb_offset psb_regmap[2] = {
static int psb_chip_setup(struct drm_device *dev) static int psb_chip_setup(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
dev_priv->regmap = psb_regmap; dev_priv->regmap = psb_regmap;
gma_get_core_freq(dev); gma_get_core_freq(dev);
gma_intel_setup_gmbus(dev); gma_intel_setup_gmbus(dev);
...@@ -311,7 +311,7 @@ static int psb_chip_setup(struct drm_device *dev) ...@@ -311,7 +311,7 @@ static int psb_chip_setup(struct drm_device *dev)
static void psb_chip_teardown(struct drm_device *dev) static void psb_chip_teardown(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
psb_lid_timer_takedown(dev_priv); psb_lid_timer_takedown(dev_priv);
gma_intel_teardown_gmbus(dev); gma_intel_teardown_gmbus(dev);
} }
......
...@@ -124,7 +124,7 @@ void psb_spank(struct drm_psb_private *dev_priv) ...@@ -124,7 +124,7 @@ void psb_spank(struct drm_psb_private *dev_priv)
static int psb_do_init(struct drm_device *dev) static int psb_do_init(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_gtt *pg = &dev_priv->gtt; struct psb_gtt *pg = &dev_priv->gtt;
uint32_t stolen_gtt; uint32_t stolen_gtt;
...@@ -163,7 +163,7 @@ static int psb_do_init(struct drm_device *dev) ...@@ -163,7 +163,7 @@ static int psb_do_init(struct drm_device *dev)
static void psb_driver_unload(struct drm_device *dev) static void psb_driver_unload(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
/* TODO: Kill vblank etc here */ /* TODO: Kill vblank etc here */
...@@ -431,7 +431,7 @@ static long psb_unlocked_ioctl(struct file *filp, unsigned int cmd, ...@@ -431,7 +431,7 @@ static long psb_unlocked_ioctl(struct file *filp, unsigned int cmd,
{ {
struct drm_file *file_priv = filp->private_data; struct drm_file *file_priv = filp->private_data;
struct drm_device *dev = file_priv->minor->dev; struct drm_device *dev = file_priv->minor->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
static unsigned int runtime_allowed; static unsigned int runtime_allowed;
if (runtime_allowed == 1 && dev_priv->is_lvds_on) { if (runtime_allowed == 1 && dev_priv->is_lvds_on) {
......
...@@ -567,6 +567,10 @@ struct drm_psb_private { ...@@ -567,6 +567,10 @@ struct drm_psb_private {
uint8_t panel_type; uint8_t panel_type;
}; };
static inline struct drm_psb_private *to_drm_psb_private(struct drm_device *dev)
{
return dev->dev_private;
}
/* Operations for each board type */ /* Operations for each board type */
struct psb_ops { struct psb_ops {
...@@ -618,11 +622,6 @@ struct psb_ops { ...@@ -618,11 +622,6 @@ struct psb_ops {
extern int drm_crtc_probe_output_modes(struct drm_device *dev, int, int); extern int drm_crtc_probe_output_modes(struct drm_device *dev, int, int);
extern int drm_pick_crtcs(struct drm_device *dev); extern int drm_pick_crtcs(struct drm_device *dev);
static inline struct drm_psb_private *psb_priv(struct drm_device *dev)
{
return (struct drm_psb_private *) dev->dev_private;
}
/* psb_irq.c */ /* psb_irq.c */
extern void psb_irq_uninstall_islands(struct drm_device *dev, int hw_islands); extern void psb_irq_uninstall_islands(struct drm_device *dev, int hw_islands);
extern int psb_vblank_wait2(struct drm_device *dev, unsigned int *sequence); extern int psb_vblank_wait2(struct drm_device *dev, unsigned int *sequence);
...@@ -729,13 +728,13 @@ static inline void MRST_MSG_WRITE32(int domain, uint port, uint offset, ...@@ -729,13 +728,13 @@ static inline void MRST_MSG_WRITE32(int domain, uint port, uint offset,
static inline uint32_t REGISTER_READ(struct drm_device *dev, uint32_t reg) static inline uint32_t REGISTER_READ(struct drm_device *dev, uint32_t reg)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
return ioread32(dev_priv->vdc_reg + reg); return ioread32(dev_priv->vdc_reg + reg);
} }
static inline uint32_t REGISTER_READ_AUX(struct drm_device *dev, uint32_t reg) static inline uint32_t REGISTER_READ_AUX(struct drm_device *dev, uint32_t reg)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
return ioread32(dev_priv->aux_reg + reg); return ioread32(dev_priv->aux_reg + reg);
} }
...@@ -761,14 +760,14 @@ static inline uint32_t REGISTER_READ_WITH_AUX(struct drm_device *dev, ...@@ -761,14 +760,14 @@ static inline uint32_t REGISTER_READ_WITH_AUX(struct drm_device *dev,
static inline void REGISTER_WRITE(struct drm_device *dev, uint32_t reg, static inline void REGISTER_WRITE(struct drm_device *dev, uint32_t reg,
uint32_t val) uint32_t val)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
iowrite32((val), dev_priv->vdc_reg + (reg)); iowrite32((val), dev_priv->vdc_reg + (reg));
} }
static inline void REGISTER_WRITE_AUX(struct drm_device *dev, uint32_t reg, static inline void REGISTER_WRITE_AUX(struct drm_device *dev, uint32_t reg,
uint32_t val) uint32_t val)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
iowrite32((val), dev_priv->aux_reg + (reg)); iowrite32((val), dev_priv->aux_reg + (reg));
} }
...@@ -789,7 +788,7 @@ static inline void REGISTER_WRITE_WITH_AUX(struct drm_device *dev, uint32_t reg, ...@@ -789,7 +788,7 @@ static inline void REGISTER_WRITE_WITH_AUX(struct drm_device *dev, uint32_t reg,
static inline void REGISTER_WRITE16(struct drm_device *dev, static inline void REGISTER_WRITE16(struct drm_device *dev,
uint32_t reg, uint32_t val) uint32_t reg, uint32_t val)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
iowrite16((val), dev_priv->vdc_reg + (reg)); iowrite16((val), dev_priv->vdc_reg + (reg));
} }
...@@ -798,7 +797,7 @@ static inline void REGISTER_WRITE16(struct drm_device *dev, ...@@ -798,7 +797,7 @@ static inline void REGISTER_WRITE16(struct drm_device *dev,
static inline void REGISTER_WRITE8(struct drm_device *dev, static inline void REGISTER_WRITE8(struct drm_device *dev,
uint32_t reg, uint32_t val) uint32_t reg, uint32_t val)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
iowrite8((val), dev_priv->vdc_reg + (reg)); iowrite8((val), dev_priv->vdc_reg + (reg));
} }
......
...@@ -95,7 +95,7 @@ static int psb_intel_crtc_mode_set(struct drm_crtc *crtc, ...@@ -95,7 +95,7 @@ static int psb_intel_crtc_mode_set(struct drm_crtc *crtc,
struct drm_framebuffer *old_fb) struct drm_framebuffer *old_fb)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
int pipe = gma_crtc->pipe; int pipe = gma_crtc->pipe;
...@@ -298,7 +298,7 @@ static int psb_intel_crtc_clock_get(struct drm_device *dev, ...@@ -298,7 +298,7 @@ static int psb_intel_crtc_clock_get(struct drm_device *dev,
struct drm_crtc *crtc) struct drm_crtc *crtc)
{ {
struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
int pipe = gma_crtc->pipe; int pipe = gma_crtc->pipe;
const struct psb_offset *map = &dev_priv->regmap[pipe]; const struct psb_offset *map = &dev_priv->regmap[pipe];
u32 dpll; u32 dpll;
...@@ -380,7 +380,7 @@ struct drm_display_mode *psb_intel_crtc_mode_get(struct drm_device *dev, ...@@ -380,7 +380,7 @@ struct drm_display_mode *psb_intel_crtc_mode_get(struct drm_device *dev,
int hsync; int hsync;
int vtot; int vtot;
int vsync; int vsync;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_pipe *p = &dev_priv->regs.pipe[pipe]; struct psb_pipe *p = &dev_priv->regs.pipe[pipe];
const struct psb_offset *map = &dev_priv->regmap[pipe]; const struct psb_offset *map = &dev_priv->regmap[pipe];
...@@ -451,7 +451,7 @@ const struct gma_clock_funcs psb_clock_funcs = { ...@@ -451,7 +451,7 @@ const struct gma_clock_funcs psb_clock_funcs = {
static void psb_intel_cursor_init(struct drm_device *dev, static void psb_intel_cursor_init(struct drm_device *dev,
struct gma_crtc *gma_crtc) struct gma_crtc *gma_crtc)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 control[3] = { CURACNTR, CURBCNTR, CURCCNTR }; u32 control[3] = { CURACNTR, CURBCNTR, CURCCNTR };
u32 base[3] = { CURABASE, CURBBASE, CURCBASE }; u32 base[3] = { CURABASE, CURBBASE, CURCBASE };
struct gtt_range *cursor_gt; struct gtt_range *cursor_gt;
...@@ -481,7 +481,7 @@ static void psb_intel_cursor_init(struct drm_device *dev, ...@@ -481,7 +481,7 @@ static void psb_intel_cursor_init(struct drm_device *dev,
void psb_intel_crtc_init(struct drm_device *dev, int pipe, void psb_intel_crtc_init(struct drm_device *dev, int pipe,
struct psb_intel_mode_device *mode_dev) struct psb_intel_mode_device *mode_dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_crtc *gma_crtc; struct gma_crtc *gma_crtc;
int i; int i;
......
...@@ -59,7 +59,7 @@ struct psb_intel_lvds_priv { ...@@ -59,7 +59,7 @@ struct psb_intel_lvds_priv {
*/ */
static u32 psb_intel_lvds_get_max_backlight(struct drm_device *dev) static u32 psb_intel_lvds_get_max_backlight(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 ret; u32 ret;
if (gma_power_begin(dev, false)) { if (gma_power_begin(dev, false)) {
...@@ -88,8 +88,7 @@ static u32 psb_intel_lvds_get_max_backlight(struct drm_device *dev) ...@@ -88,8 +88,7 @@ static u32 psb_intel_lvds_get_max_backlight(struct drm_device *dev)
static int psb_lvds_i2c_set_brightness(struct drm_device *dev, static int psb_lvds_i2c_set_brightness(struct drm_device *dev,
unsigned int level) unsigned int level)
{ {
struct drm_psb_private *dev_priv = struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
(struct drm_psb_private *)dev->dev_private;
struct psb_intel_i2c_chan *lvds_i2c_bus = dev_priv->lvds_i2c_bus; struct psb_intel_i2c_chan *lvds_i2c_bus = dev_priv->lvds_i2c_bus;
u8 out_buf[2]; u8 out_buf[2];
...@@ -128,8 +127,7 @@ static int psb_lvds_i2c_set_brightness(struct drm_device *dev, ...@@ -128,8 +127,7 @@ static int psb_lvds_i2c_set_brightness(struct drm_device *dev,
static int psb_lvds_pwm_set_brightness(struct drm_device *dev, int level) static int psb_lvds_pwm_set_brightness(struct drm_device *dev, int level)
{ {
struct drm_psb_private *dev_priv = struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
(struct drm_psb_private *)dev->dev_private;
u32 max_pwm_blc; u32 max_pwm_blc;
u32 blc_pwm_duty_cycle; u32 blc_pwm_duty_cycle;
...@@ -161,7 +159,7 @@ static int psb_lvds_pwm_set_brightness(struct drm_device *dev, int level) ...@@ -161,7 +159,7 @@ static int psb_lvds_pwm_set_brightness(struct drm_device *dev, int level)
*/ */
void psb_intel_lvds_set_brightness(struct drm_device *dev, int level) void psb_intel_lvds_set_brightness(struct drm_device *dev, int level)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
dev_dbg(dev->dev, "backlight level is %d\n", level); dev_dbg(dev->dev, "backlight level is %d\n", level);
...@@ -183,7 +181,7 @@ void psb_intel_lvds_set_brightness(struct drm_device *dev, int level) ...@@ -183,7 +181,7 @@ void psb_intel_lvds_set_brightness(struct drm_device *dev, int level)
*/ */
static void psb_intel_lvds_set_backlight(struct drm_device *dev, int level) static void psb_intel_lvds_set_backlight(struct drm_device *dev, int level)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 blc_pwm_ctl; u32 blc_pwm_ctl;
if (gma_power_begin(dev, false)) { if (gma_power_begin(dev, false)) {
...@@ -208,7 +206,7 @@ static void psb_intel_lvds_set_backlight(struct drm_device *dev, int level) ...@@ -208,7 +206,7 @@ static void psb_intel_lvds_set_backlight(struct drm_device *dev, int level)
*/ */
static void psb_intel_lvds_set_power(struct drm_device *dev, bool on) static void psb_intel_lvds_set_power(struct drm_device *dev, bool on)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
u32 pp_status; u32 pp_status;
...@@ -254,8 +252,7 @@ static void psb_intel_lvds_encoder_dpms(struct drm_encoder *encoder, int mode) ...@@ -254,8 +252,7 @@ static void psb_intel_lvds_encoder_dpms(struct drm_encoder *encoder, int mode)
static void psb_intel_lvds_save(struct drm_connector *connector) static void psb_intel_lvds_save(struct drm_connector *connector)
{ {
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct drm_psb_private *dev_priv = struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
(struct drm_psb_private *)dev->dev_private;
struct gma_encoder *gma_encoder = gma_attached_encoder(connector); struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
struct psb_intel_lvds_priv *lvds_priv = struct psb_intel_lvds_priv *lvds_priv =
(struct psb_intel_lvds_priv *)gma_encoder->dev_priv; (struct psb_intel_lvds_priv *)gma_encoder->dev_priv;
...@@ -335,7 +332,7 @@ static void psb_intel_lvds_restore(struct drm_connector *connector) ...@@ -335,7 +332,7 @@ static void psb_intel_lvds_restore(struct drm_connector *connector)
enum drm_mode_status psb_intel_lvds_mode_valid(struct drm_connector *connector, enum drm_mode_status psb_intel_lvds_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
struct drm_psb_private *dev_priv = connector->dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev);
struct gma_encoder *gma_encoder = gma_attached_encoder(connector); struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
struct drm_display_mode *fixed_mode = struct drm_display_mode *fixed_mode =
dev_priv->mode_dev.panel_fixed_mode; dev_priv->mode_dev.panel_fixed_mode;
...@@ -365,7 +362,7 @@ bool psb_intel_lvds_mode_fixup(struct drm_encoder *encoder, ...@@ -365,7 +362,7 @@ bool psb_intel_lvds_mode_fixup(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode) struct drm_display_mode *adjusted_mode)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
struct gma_crtc *gma_crtc = to_gma_crtc(encoder->crtc); struct gma_crtc *gma_crtc = to_gma_crtc(encoder->crtc);
struct drm_encoder *tmp_encoder; struct drm_encoder *tmp_encoder;
...@@ -426,7 +423,7 @@ bool psb_intel_lvds_mode_fixup(struct drm_encoder *encoder, ...@@ -426,7 +423,7 @@ bool psb_intel_lvds_mode_fixup(struct drm_encoder *encoder,
static void psb_intel_lvds_prepare(struct drm_encoder *encoder) static void psb_intel_lvds_prepare(struct drm_encoder *encoder)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
if (!gma_power_begin(dev, true)) if (!gma_power_begin(dev, true))
...@@ -444,7 +441,7 @@ static void psb_intel_lvds_prepare(struct drm_encoder *encoder) ...@@ -444,7 +441,7 @@ static void psb_intel_lvds_prepare(struct drm_encoder *encoder)
static void psb_intel_lvds_commit(struct drm_encoder *encoder) static void psb_intel_lvds_commit(struct drm_encoder *encoder)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
if (mode_dev->backlight_duty_cycle == 0) if (mode_dev->backlight_duty_cycle == 0)
...@@ -459,7 +456,7 @@ static void psb_intel_lvds_mode_set(struct drm_encoder *encoder, ...@@ -459,7 +456,7 @@ static void psb_intel_lvds_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode) struct drm_display_mode *adjusted_mode)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 pfit_control; u32 pfit_control;
/* /*
...@@ -493,7 +490,7 @@ static void psb_intel_lvds_mode_set(struct drm_encoder *encoder, ...@@ -493,7 +490,7 @@ static void psb_intel_lvds_mode_set(struct drm_encoder *encoder,
static int psb_intel_lvds_get_modes(struct drm_connector *connector) static int psb_intel_lvds_get_modes(struct drm_connector *connector)
{ {
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
struct gma_encoder *gma_encoder = gma_attached_encoder(connector); struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
struct psb_intel_lvds_priv *lvds_priv = gma_encoder->dev_priv; struct psb_intel_lvds_priv *lvds_priv = gma_encoder->dev_priv;
...@@ -641,7 +638,7 @@ void psb_intel_lvds_init(struct drm_device *dev, ...@@ -641,7 +638,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct drm_display_mode *scan; /* *modes, *bios_mode; */ struct drm_display_mode *scan; /* *modes, *bios_mode; */
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 lvds; u32 lvds;
int pipe; int pipe;
......
...@@ -1217,7 +1217,7 @@ psb_intel_sdvo_get_edid(struct drm_connector *connector) ...@@ -1217,7 +1217,7 @@ psb_intel_sdvo_get_edid(struct drm_connector *connector)
static struct edid * static struct edid *
psb_intel_sdvo_get_analog_edid(struct drm_connector *connector) psb_intel_sdvo_get_analog_edid(struct drm_connector *connector)
{ {
struct drm_psb_private *dev_priv = connector->dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev);
return drm_get_edid(connector, return drm_get_edid(connector,
&dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter); &dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter);
...@@ -1486,7 +1486,7 @@ static void psb_intel_sdvo_get_tv_modes(struct drm_connector *connector) ...@@ -1486,7 +1486,7 @@ static void psb_intel_sdvo_get_tv_modes(struct drm_connector *connector)
static void psb_intel_sdvo_get_lvds_modes(struct drm_connector *connector) static void psb_intel_sdvo_get_lvds_modes(struct drm_connector *connector)
{ {
struct psb_intel_sdvo *psb_intel_sdvo = intel_attached_sdvo(connector); struct psb_intel_sdvo *psb_intel_sdvo = intel_attached_sdvo(connector);
struct drm_psb_private *dev_priv = connector->dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev);
struct drm_display_mode *newmode; struct drm_display_mode *newmode;
/* /*
...@@ -1570,7 +1570,7 @@ psb_intel_sdvo_set_property(struct drm_connector *connector, ...@@ -1570,7 +1570,7 @@ psb_intel_sdvo_set_property(struct drm_connector *connector,
{ {
struct psb_intel_sdvo *psb_intel_sdvo = intel_attached_sdvo(connector); struct psb_intel_sdvo *psb_intel_sdvo = intel_attached_sdvo(connector);
struct psb_intel_sdvo_connector *psb_intel_sdvo_connector = to_psb_intel_sdvo_connector(connector); struct psb_intel_sdvo_connector *psb_intel_sdvo_connector = to_psb_intel_sdvo_connector(connector);
struct drm_psb_private *dev_priv = connector->dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev);
uint16_t temp_value; uint16_t temp_value;
uint8_t cmd; uint8_t cmd;
int ret; int ret;
...@@ -1878,7 +1878,7 @@ psb_intel_sdvo_is_hdmi_connector(struct psb_intel_sdvo *psb_intel_sdvo, int devi ...@@ -1878,7 +1878,7 @@ psb_intel_sdvo_is_hdmi_connector(struct psb_intel_sdvo *psb_intel_sdvo, int devi
static u8 static u8
psb_intel_sdvo_get_slave_addr(struct drm_device *dev, int sdvo_reg) psb_intel_sdvo_get_slave_addr(struct drm_device *dev, int sdvo_reg)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct sdvo_device_mapping *my_mapping, *other_mapping; struct sdvo_device_mapping *my_mapping, *other_mapping;
if (IS_SDVOB(sdvo_reg)) { if (IS_SDVOB(sdvo_reg)) {
...@@ -2415,7 +2415,7 @@ psb_intel_sdvo_init_ddc_proxy(struct psb_intel_sdvo *sdvo, ...@@ -2415,7 +2415,7 @@ psb_intel_sdvo_init_ddc_proxy(struct psb_intel_sdvo *sdvo,
bool psb_intel_sdvo_init(struct drm_device *dev, int sdvo_reg) bool psb_intel_sdvo_init(struct drm_device *dev, int sdvo_reg)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct gma_encoder *gma_encoder; struct gma_encoder *gma_encoder;
struct psb_intel_sdvo *psb_intel_sdvo; struct psb_intel_sdvo *psb_intel_sdvo;
int i; int i;
......
...@@ -107,8 +107,7 @@ psb_disable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask) ...@@ -107,8 +107,7 @@ psb_disable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask)
*/ */
static void mid_pipe_event_handler(struct drm_device *dev, int pipe) static void mid_pipe_event_handler(struct drm_device *dev, int pipe)
{ {
struct drm_psb_private *dev_priv = struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
(struct drm_psb_private *) dev->dev_private;
uint32_t pipe_stat_val = 0; uint32_t pipe_stat_val = 0;
uint32_t pipe_stat_reg = psb_pipestat(pipe); uint32_t pipe_stat_reg = psb_pipestat(pipe);
...@@ -178,7 +177,7 @@ static void psb_vdc_interrupt(struct drm_device *dev, uint32_t vdc_stat) ...@@ -178,7 +177,7 @@ static void psb_vdc_interrupt(struct drm_device *dev, uint32_t vdc_stat)
*/ */
static void psb_sgx_interrupt(struct drm_device *dev, u32 stat_1, u32 stat_2) static void psb_sgx_interrupt(struct drm_device *dev, u32 stat_1, u32 stat_2)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 val, addr; u32 val, addr;
if (stat_1 & _PSB_CE_TWOD_COMPLETE) if (stat_1 & _PSB_CE_TWOD_COMPLETE)
...@@ -226,7 +225,7 @@ static void psb_sgx_interrupt(struct drm_device *dev, u32 stat_1, u32 stat_2) ...@@ -226,7 +225,7 @@ static void psb_sgx_interrupt(struct drm_device *dev, u32 stat_1, u32 stat_2)
static irqreturn_t psb_irq_handler(int irq, void *arg) static irqreturn_t psb_irq_handler(int irq, void *arg)
{ {
struct drm_device *dev = arg; struct drm_device *dev = arg;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
uint32_t vdc_stat, dsp_int = 0, sgx_int = 0, hotplug_int = 0; uint32_t vdc_stat, dsp_int = 0, sgx_int = 0, hotplug_int = 0;
u32 sgx_stat_1, sgx_stat_2; u32 sgx_stat_1, sgx_stat_2;
int handled = 0; int handled = 0;
...@@ -277,8 +276,7 @@ static irqreturn_t psb_irq_handler(int irq, void *arg) ...@@ -277,8 +276,7 @@ static irqreturn_t psb_irq_handler(int irq, void *arg)
void psb_irq_preinstall(struct drm_device *dev) void psb_irq_preinstall(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
(struct drm_psb_private *) dev->dev_private;
unsigned long irqflags; unsigned long irqflags;
spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags); spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags);
...@@ -307,7 +305,7 @@ void psb_irq_preinstall(struct drm_device *dev) ...@@ -307,7 +305,7 @@ void psb_irq_preinstall(struct drm_device *dev)
void psb_irq_postinstall(struct drm_device *dev) void psb_irq_postinstall(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
unsigned long irqflags; unsigned long irqflags;
unsigned int i; unsigned int i;
...@@ -356,7 +354,7 @@ int psb_irq_install(struct drm_device *dev, unsigned int irq) ...@@ -356,7 +354,7 @@ int psb_irq_install(struct drm_device *dev, unsigned int irq)
void psb_irq_uninstall(struct drm_device *dev) void psb_irq_uninstall(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
unsigned long irqflags; unsigned long irqflags;
unsigned int i; unsigned int i;
...@@ -397,7 +395,7 @@ int psb_enable_vblank(struct drm_crtc *crtc) ...@@ -397,7 +395,7 @@ int psb_enable_vblank(struct drm_crtc *crtc)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
unsigned int pipe = crtc->index; unsigned int pipe = crtc->index;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
unsigned long irqflags; unsigned long irqflags;
uint32_t reg_val = 0; uint32_t reg_val = 0;
uint32_t pipeconf_reg = mid_pipeconf(pipe); uint32_t pipeconf_reg = mid_pipeconf(pipe);
...@@ -433,7 +431,7 @@ void psb_disable_vblank(struct drm_crtc *crtc) ...@@ -433,7 +431,7 @@ void psb_disable_vblank(struct drm_crtc *crtc)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
unsigned int pipe = crtc->index; unsigned int pipe = crtc->index;
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
unsigned long irqflags; unsigned long irqflags;
spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags); spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment