GMA500 updates for -next
Subsystems (4)
cover GMA500 updates for -next
Start the clean up work and add Medfield support
---
Alan Cox (6):
gma500: rework register stuff sanely
gma500: re-order calling on the fix setup so we set up after the DRM layer
gma500: Kconfig documentation tweak
gma500: now move the Oaktrail save state into its own structure
gma500: clean up some of the struct fields we no longer use
gma500: plug in more of the gamma functionality
Jesper Juhl (1):
intel, gma500, lvds: Fix use after free and mem leak in psb_intel_lvds_init()
Kirill A. Shutemov (40):
gma500: psb_irq: mark mid_{enable,disable}_pipe_event() as static
gma500: mark psb_intel_sdvo_hdmi_sink_detect() as static
gma500: psb_intel_display: drop unused variables
gma500: mark psb_intel_pipe_set_base() as static
gma500: drop unused psb_intel_modeset_cleanup()
gma500: oaktrail_lvds_init() drop unused variable
gma500: oaktrail_hdmi_i2c_access() drop unused variable
gma500: mark oaktrail_backlight_init() as static
gma500: oaktrail_hdmi: fix -Wmissing-field-initializers warning
gma500: oaktrail_hdmi: drop dead code
gma500: oaktrail_crtc: drop unused variables
gma500: oaktrail_crtc: mark few functions as static
gma500: mdfld_intel_display: drop unused variables
gma500: mdfld_dsi_pkg_sender: fix -Wtype-limits warning
gma500: mdfld_dsi_dpi: drop unused variables
gma500: mdfld_device: mark few functions as static
gma500: cdv_intel_lvds: #if 0 currently unused functions
gma500: cdv_intel_lvds: mark few functions as static
gma500: cdv_intel_hdmi: add missing include
gma500: cdv_intel_crt: mark few functions as static
gma500: cdv_intel_crt: drop unused variables
gma500: cdv_intel_crt: drop dead code
gma500: cdv_intel_crt: add missing include
gma500: fix cdv_intel_wait_for_vblank() prototype
gma500: fix two -Wmissing-field-initializers warnings
gma500: mark psb_driver_device_is_agp() and psb_driver_preclose() as static
gma500: psb_driver_load(): drop unused variables
gma500: fix ioctl confict
gma500: use DRM_IOCTL_DEF_DRV instead of custom PSB_IOCTL_DEF
gma500: mmu: mark psb_mmu_free_pt() and psb_mmu_pt_alloc_map_lock() as static
gma500: mmu: drop unused psb_get_default_pd_addr()
gma500: gtt: mark psb_gtt_entry() and psb_gtt_alloc() as static
gma500: mark psb_fbdev_destroy() and psb_fbdev_fini() as static
gma500: drop unused psbfb_suspend()/psbfb_resume()
gma500: gem_glue: add missing include
gma500: medfield: drop a bit of dead code
gma500: mdfld_dsi_output_init() drop unused parameter
gma500: psbfb_create(): move depth initialization out of loop
gma500: initial medfield merge
gma500: make init_pm callback in struct psb_op optional
arch/x86/platform/mrst/mrst.c | 16 drivers/gpu/drm/gma500/Kconfig | 10 drivers/gpu/drm/gma500/Makefile | 10 drivers/gpu/drm/gma500/cdv_device.h | 2 drivers/gpu/drm/gma500/cdv_intel_crt.c | 1 drivers/gpu/drm/gma500/cdv_intel_display.c | 91 -- drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 1 drivers/gpu/drm/gma500/cdv_intel_lvds.c | 16 drivers/gpu/drm/gma500/framebuffer.c | 51 - drivers/gpu/drm/gma500/gem_glue.c | 1 drivers/gpu/drm/gma500/gtt.c | 4 drivers/gpu/drm/gma500/mdfld_device.c | 691 +++++++++++++++ drivers/gpu/drm/gma500/mdfld_dsi_dpi.c | 1017 ++++++++++++++++++++++ drivers/gpu/drm/gma500/mdfld_dsi_dpi.h | 79 ++ drivers/gpu/drm/gma500/mdfld_dsi_output.c | 618 +++++++++++++ drivers/gpu/drm/gma500/mdfld_dsi_output.h | 378 ++++++++ drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c | 694 +++++++++++++++ drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.h | 92 ++ drivers/gpu/drm/gma500/mdfld_intel_display.c | 1180 +++++++++++++++++++++++++ drivers/gpu/drm/gma500/mdfld_output.c | 74 ++ drivers/gpu/drm/gma500/mdfld_output.h | 77 ++ drivers/gpu/drm/gma500/mdfld_tmd_vid.c | 201 ++++ drivers/gpu/drm/gma500/mdfld_tpo_vid.c | 124 +++ drivers/gpu/drm/gma500/mmu.c | 13 drivers/gpu/drm/gma500/oaktrail_crtc.c | 18 drivers/gpu/drm/gma500/oaktrail_device.c | 211 ++-- drivers/gpu/drm/gma500/oaktrail_hdmi.c | 401 +------- drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c | 6 drivers/gpu/drm/gma500/oaktrail_lvds.c | 5 drivers/gpu/drm/gma500/power.c | 11 drivers/gpu/drm/gma500/psb_device.c | 34 - drivers/gpu/drm/gma500/psb_drv.c | 63 + drivers/gpu/drm/gma500/psb_drv.h | 415 +++++---- drivers/gpu/drm/gma500/psb_intel_display.c | 50 - drivers/gpu/drm/gma500/psb_intel_lvds.c | 21 drivers/gpu/drm/gma500/psb_intel_sdvo.c | 2 drivers/gpu/drm/gma500/psb_irq.c | 62 + drivers/gpu/drm/gma500/psb_irq.h | 2 drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c | 829 ++++++++++++++++++ drivers/gpu/drm/gma500/tc35876x-dsi-lvds.h | 38 + include/drm/gma_drm.h | 2 include/linux/i2c/tc35876x.h | 11 42 files changed, 6705 insertions(+), 917 deletions(-) create mode 100644 drivers/gpu/drm/gma500/mdfld_device.c create mode 100644 drivers/gpu/drm/gma500/mdfld_dsi_dpi.c create mode 100644 drivers/gpu/drm/gma500/mdfld_dsi_dpi.h create mode 100644 drivers/gpu/drm/gma500/mdfld_dsi_output.c create mode 100644 drivers/gpu/drm/gma500/mdfld_dsi_output.h create mode 100644 drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c create mode 100644 drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.h create mode 100644 drivers/gpu/drm/gma500/mdfld_intel_display.c create mode 100644 drivers/gpu/drm/gma500/mdfld_output.c create mode 100644 drivers/gpu/drm/gma500/mdfld_output.h create mode 100644 drivers/gpu/drm/gma500/mdfld_tmd_vid.c create mode 100644 drivers/gpu/drm/gma500/mdfld_tpo_vid.c create mode 100644 drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c create mode 100644 drivers/gpu/drm/gma500/tc35876x-dsi-lvds.h create mode 100644 include/linux/i2c/tc35876x.h
Signature · 1 line
Signature
PATCH 1/47 gma500: plug in more of the gamma functionality
From: Alan Cox <[email protected]>
---
drivers/gpu/drm/gma500/framebuffer.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
drivers/gpu/drm/gma500/framebuffer.c +10 -0
@@ -556,11 +556,21 @@ static struct drm_framebuffer *psb_user_framebuffer_createstatic void psbfb_gamma_set (struct drm_crtc *crtc,u16 red,u16 green,u16 blue,int regno) { +struct psb_intel_crtc *intel_crtc =to_psb_intel_crtc (crtc); + + intel_crtc->lut_r[regno] = red >>8 ; + intel_crtc->lut_g[regno] = green >>8 ; + intel_crtc->lut_b[regno] = blue >>8 ; }static void psbfb_gamma_get (struct drm_crtc *crtc,u16 *red,u16 *green,u16 *blue,int regno) { +struct psb_intel_crtc *intel_crtc =to_psb_intel_crtc (crtc); + + *red = intel_crtc->lut_r[regno] <<8 ; + *green = intel_crtc->lut_g[regno] <<8 ; + *blue = intel_crtc->lut_b[regno] <<8 ; } static int psbfb_probe(struct drm_fb_helper *helper,
PATCH 2/47 gma500: clean up some of the struct fields we no longer use
In reply to Alan CoxFrom: Alan Cox <[email protected]>
Some this is Medfield stuff that may reappear in some form later, other bits are just dead stuff
---
drivers/gpu/drm/gma500/oaktrail_crtc.c | 3 - drivers/gpu/drm/gma500/psb_drv.h | 94 +------------------------------- 2 files changed, 2 insertions(+), 95 deletions(-)
drivers/gpu/drm/gma500/oaktrail_crtc.c +0 -3
@@ -428,9 +428,6 @@ static int oaktrail_crtc_mode_set(struct drm_crtc *crtc,else dspcntr |=DISPPLANE_SEL_PIPE_B ; - dev_priv->dspcntr = dspcntr |=DISPLAY_PLANE_ENABLE ; - dev_priv->pipeconf = pipeconf |=PIPEACONF_ENABLE ; -if (is_mipi) goto oaktrail_crtc_mode_set_exit;
drivers/gpu/drm/gma500/psb_drv.h +2 -92
113 lines not on this page · raw message
PATCH 3/47 gma500: now move the Oaktrail save state into its own structure
In reply to Alan CoxFrom: Alan Cox <[email protected]>
---
drivers/gpu/drm/gma500/cdv_intel_display.c | 27 ++- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 6 - drivers/gpu/drm/gma500/oaktrail_device.c | 204 +++++++++++++------------ drivers/gpu/drm/gma500/oaktrail_hdmi.c | 72 +++++---- drivers/gpu/drm/gma500/oaktrail_lvds.c | 2 drivers/gpu/drm/gma500/power.c | 8 - drivers/gpu/drm/gma500/psb_device.c | 34 ++-- drivers/gpu/drm/gma500/psb_drv.h | 226 +++++++++++++++------------- drivers/gpu/drm/gma500/psb_intel_display.c | 27 ++- drivers/gpu/drm/gma500/psb_intel_lvds.c | 12 + 10 files changed, 322 insertions(+), 296 deletions(-)
drivers/gpu/drm/gma500/cdv_intel_display.c +16 -11
@@ -968,7 +968,7 @@ void cdv_intel_crtc_load_lut(struct drm_crtc *crtc)gma_power_end (dev); }else {for (i =0 ; i <256 ; i++) { - dev_priv->save_palette_a[i] = + dev_priv->regs.save_palette_a[i] = ((psb_intel_crtc->lut_r[i] + psb_intel_crtc->lut_adj[i]) << 16) | ((psb_intel_crtc->lut_g[i] +
@@ -1338,18 +1338,19 @@ static int cdv_intel_crtc_clock_get(struct drm_device *dev,gma_power_end (dev); }else { dpll = (pipe ==0 ) ? - dev_priv->saveDPLL_A : dev_priv->saveDPLL_B; + dev_priv->regs.saveDPLL_A : dev_priv->regs.saveDPLL_B;if ((dpll &DISPLAY_RATE_SELECT_FPA1 ) ==0 ) fp = (pipe ==0 ) ? - dev_priv->saveFPA0 : - dev_priv->saveFPB0; + dev_priv->regs.saveFPA0 : + dev_priv->regs.saveFPB0;else fp = (pipe ==0 ) ? - dev_priv->saveFPA1 : - dev_priv->saveFPB1; + dev_priv->regs.saveFPA1 : + dev_priv->regs.saveFPB1; - is_lvds = (pipe ==1 ) && (dev_priv->saveLVDS &LVDS_PORT_EN ); + is_lvds = (pipe ==1 ) && + (dev_priv->regs.saveLVDS &LVDS_PORT_EN ); } clock.m1 = (fp &FP_M1_DIV_MASK ) >>FP_M1_DIV_SHIFT ;
@@ -1419,13 +1420,17 @@ struct drm_display_mode *cdv_intel_crtc_mode_get(struct drm_device *dev,gma_power_end (dev); }else { htot = (pipe ==0 ) ? - dev_priv->saveHTOTAL_A : dev_priv->saveHTOTAL_B; + dev_priv->regs.saveHTOTAL_A : + dev_priv->regs.saveHTOTAL_B; hsync = (pipe ==0 ) ? - dev_priv->saveHSYNC_A : dev_priv->saveHSYNC_B; + dev_priv->regs.saveHSYNC_A : + dev_priv->regs.saveHSYNC_B; vtot = (pipe ==0 ) ? - dev_priv->saveVTOTAL_A : dev_priv->saveVTOTAL_B; + dev_priv->regs.saveVTOTAL_A : + dev_priv->regs.saveVTOTAL_B; vsync = (pipe ==0 ) ? - dev_priv->saveVSYNC_A : dev_priv->saveVSYNC_B; + dev_priv->regs.saveVSYNC_A : + dev_priv->regs.saveVSYNC_B; } mode =kzalloc (sizeof (*mode),GFP_KERNEL );
drivers/gpu/drm/gma500/cdv_intel_lvds.c +3 -3
@@ -78,7 +78,7 @@ static u32 cdv_intel_lvds_get_max_backlight(struct drm_device *dev)gma_power_end (dev); }else - retval = ((dev_priv->saveBLC_PWM_CTL & + retval = ((dev_priv->regs.saveBLC_PWM_CTL &BACKLIGHT_MODULATION_FREQ_MASK ) >>BACKLIGHT_MODULATION_FREQ_SHIFT ) *2 ;
@@ -184,9 +184,9 @@ static void cdv_intel_lvds_set_backlight(struct drm_device *dev, int level) (level << BACKLIGHT_DUTY_CYCLE_SHIFT)));gma_power_end (dev); }else { - blc_pwm_ctl = dev_priv->saveBLC_PWM_CTL & + blc_pwm_ctl = dev_priv->regs.saveBLC_PWM_CTL & ~BACKLIGHT_DUTY_CYCLE_MASK ; - dev_priv->saveBLC_PWM_CTL = (blc_pwm_ctl | + dev_priv->regs.saveBLC_PWM_CTL = (blc_pwm_ctl | (level <<BACKLIGHT_DUTY_CYCLE_SHIFT )); } }
drivers/gpu/drm/gma500/oaktrail_device.c +103 -101
283 lines not on this page · raw message
drivers/gpu/drm/gma500/oaktrail_hdmi.c +37 -35
119 lines not on this page · raw message
drivers/gpu/drm/gma500/oaktrail_lvds.c +1 -1
@@ -192,7 +192,7 @@ static u32 oaktrail_lvds_get_max_backlight(struct drm_device *dev)gma_power_end (dev); }else - ret = ((dev_priv->saveBLC_PWM_CTL & + ret = ((dev_priv->regs.saveBLC_PWM_CTL &BACKLIGHT_MODULATION_FREQ_MASK ) >>BACKLIGHT_MODULATION_FREQ_SHIFT ) *2 ;
drivers/gpu/drm/gma500/power.c +4 -4
@@ -132,9 +132,9 @@ static void gma_suspend_pci(struct pci_dev *pdev)pci_save_state (pdev);pci_read_config_dword (pdev,0x5C , &bsm); - dev_priv->saveBSM = bsm; + dev_priv->regs.saveBSM = bsm;pci_read_config_dword (pdev,0xFC , &vbt); - dev_priv->saveVBT = vbt; + dev_priv->regs.saveVBT = vbt;pci_read_config_dword (pdev, PSB_PCIx_MSI_ADDR_LOC, &dev_priv->msi_addr);pci_read_config_dword (pdev, PSB_PCIx_MSI_DATA_LOC, &dev_priv->msi_data);
@@ -162,8 +162,8 @@ static bool gma_resume_pci(struct pci_dev *pdev)pci_set_power_state (pdev,PCI_D0 );pci_restore_state (pdev); -pci_write_config_dword (pdev,0x5c , dev_priv->saveBSM); -pci_write_config_dword (pdev,0xFC , dev_priv->saveVBT); +pci_write_config_dword (pdev,0x5c , dev_priv->regs.saveBSM); +pci_write_config_dword (pdev,0xFC , dev_priv->regs.saveVBT);/* restoring MSI address and data in PCIx space */ pci_write_config_dword (pdev, PSB_PCIx_MSI_ADDR_LOC, dev_priv->msi_addr);pci_write_config_dword (pdev, PSB_PCIx_MSI_DATA_LOC, dev_priv->msi_data);
drivers/gpu/drm/gma500/psb_device.c +18 -16
@@ -177,16 +177,17 @@ static int psb_save_display_registers(struct drm_device *dev)struct drm_psb_private *dev_priv = dev->dev_private;struct drm_crtc *crtc;struct drm_connector *connector; +struct psb_state *regs = &dev_priv->regs;/* Display arbitration control + watermarks */ - dev_priv->saveDSPARB =PSB_RVDC32 (DSPARB ); - dev_priv->saveDSPFW1 =PSB_RVDC32 (DSPFW1 ); - dev_priv->saveDSPFW2 =PSB_RVDC32 (DSPFW2 ); - dev_priv->saveDSPFW3 =PSB_RVDC32 (DSPFW3 ); - dev_priv->saveDSPFW4 =PSB_RVDC32 (DSPFW4 ); - dev_priv->saveDSPFW5 =PSB_RVDC32 (DSPFW5 ); - dev_priv->saveDSPFW6 =PSB_RVDC32 (DSPFW6 ); - dev_priv->saveCHICKENBIT =PSB_RVDC32 (DSPCHICKENBIT ); + regs->saveDSPARB =PSB_RVDC32 (DSPARB ); + regs->saveDSPFW1 =PSB_RVDC32 (DSPFW1 ); + regs->saveDSPFW2 =PSB_RVDC32 (DSPFW2 ); + regs->saveDSPFW3 =PSB_RVDC32 (DSPFW3 ); + regs->saveDSPFW4 =PSB_RVDC32 (DSPFW4 ); + regs->saveDSPFW5 =PSB_RVDC32 (DSPFW5 ); + regs->saveDSPFW6 =PSB_RVDC32 (DSPFW6 ); + regs->saveCHICKENBIT =PSB_RVDC32 (DSPCHICKENBIT );/* Save crtc and output state */ mutex_lock (&dev->mode_config.mutex);
@@ -213,16 +214,17 @@ static int psb_restore_display_registers(struct drm_device *dev)struct drm_psb_private *dev_priv = dev->dev_private;struct drm_crtc *crtc;struct drm_connector *connector; +struct psb_state *regs = &dev_priv->regs;/* Display arbitration + watermarks */ -PSB_WVDC32 (dev_priv->saveDSPARB,DSPARB ); -PSB_WVDC32 (dev_priv->saveDSPFW1,DSPFW1 ); -PSB_WVDC32 (dev_priv->saveDSPFW2,DSPFW2 ); -PSB_WVDC32 (dev_priv->saveDSPFW3,DSPFW3 ); -PSB_WVDC32 (dev_priv->saveDSPFW4,DSPFW4 ); -PSB_WVDC32 (dev_priv->saveDSPFW5,DSPFW5 ); -PSB_WVDC32 (dev_priv->saveDSPFW6,DSPFW6 ); -PSB_WVDC32 (dev_priv->saveCHICKENBIT,DSPCHICKENBIT ); +PSB_WVDC32 (regs->saveDSPARB,DSPARB ); +PSB_WVDC32 (regs->saveDSPFW1,DSPFW1 ); +PSB_WVDC32 (regs->saveDSPFW2,DSPFW2 ); +PSB_WVDC32 (regs->saveDSPFW3,DSPFW3 ); +PSB_WVDC32 (regs->saveDSPFW4,DSPFW4 ); +PSB_WVDC32 (regs->saveDSPFW5,DSPFW5 ); +PSB_WVDC32 (regs->saveDSPFW6,DSPFW6 ); +PSB_WVDC32 (regs->saveCHICKENBIT,DSPCHICKENBIT );/*make sure VGA plane is off. it initializes to on after reset!*/ PSB_WVDC32 (0x80000000 ,VGACNTRL );
drivers/gpu/drm/gma500/psb_drv.h +118 -108
242 lines not on this page · raw message
drivers/gpu/drm/gma500/psb_intel_display.c +16 -11
@@ -845,7 +845,7 @@ void psb_intel_crtc_load_lut(struct drm_crtc *crtc)gma_power_end (dev); }else {for (i =0 ; i <256 ; i++) { - dev_priv->save_palette_a[i] = + dev_priv->regs.save_palette_a[i] = ((psb_intel_crtc->lut_r[i] + psb_intel_crtc->lut_adj[i]) << 16) | ((psb_intel_crtc->lut_g[i] +
@@ -1141,18 +1141,19 @@ static int psb_intel_crtc_clock_get(struct drm_device *dev,gma_power_end (dev); }else { dpll = (pipe ==0 ) ? - dev_priv->saveDPLL_A : dev_priv->saveDPLL_B; + dev_priv->regs.saveDPLL_A : dev_priv->regs.saveDPLL_B;if ((dpll &DISPLAY_RATE_SELECT_FPA1 ) ==0 ) fp = (pipe ==0 ) ? - dev_priv->saveFPA0 : - dev_priv->saveFPB0; + dev_priv->regs.saveFPA0 : + dev_priv->regs.saveFPB0;else fp = (pipe ==0 ) ? - dev_priv->saveFPA1 : - dev_priv->saveFPB1; + dev_priv->regs.saveFPA1 : + dev_priv->regs.saveFPB1; - is_lvds = (pipe ==1 ) && (dev_priv->saveLVDS &LVDS_PORT_EN ); + is_lvds = (pipe ==1 ) && (dev_priv->regs.saveLVDS & +LVDS_PORT_EN ); } clock.m1 = (fp &FP_M1_DIV_MASK ) >>FP_M1_DIV_SHIFT ;
@@ -1218,13 +1219,17 @@ struct drm_display_mode *psb_intel_crtc_mode_get(struct drm_device *dev,gma_power_end (dev); }else { htot = (pipe ==0 ) ? - dev_priv->saveHTOTAL_A : dev_priv->saveHTOTAL_B; + dev_priv->regs.saveHTOTAL_A : + dev_priv->regs.saveHTOTAL_B; hsync = (pipe ==0 ) ? - dev_priv->saveHSYNC_A : dev_priv->saveHSYNC_B; + dev_priv->regs.saveHSYNC_A : + dev_priv->regs.saveHSYNC_B; vtot = (pipe ==0 ) ? - dev_priv->saveVTOTAL_A : dev_priv->saveVTOTAL_B; + dev_priv->regs.saveVTOTAL_A : + dev_priv->regs.saveVTOTAL_B; vsync = (pipe ==0 ) ? - dev_priv->saveVSYNC_A : dev_priv->saveVSYNC_B; + dev_priv->regs.saveVSYNC_A : + dev_priv->regs.saveVSYNC_B; } mode =kzalloc (sizeof (*mode),GFP_KERNEL );
drivers/gpu/drm/gma500/psb_intel_lvds.c +6 -6
@@ -77,7 +77,7 @@ static u32 psb_intel_lvds_get_max_backlight(struct drm_device *dev) ret =REG_READ (BLC_PWM_CTL );gma_power_end (dev); }else /* Powered off, use the saved value */ - ret = dev_priv->saveBLC_PWM_CTL; + ret = dev_priv->regs.saveBLC_PWM_CTL;/* Top 15bits hold the frequency mask */ ret = (ret & BACKLIGHT_MODULATION_FREQ_MASK) >>
@@ -86,7 +86,7 @@ static u32 psb_intel_lvds_get_max_backlight(struct drm_device *dev) ret *=2 ;/* Return a 16bit range as needed for setting */ if (ret ==0 )dev_err (dev->dev,"BL bug: Reg %08x save %08X\n" , -REG_READ (BLC_PWM_CTL ), dev_priv->saveBLC_PWM_CTL); +REG_READ (BLC_PWM_CTL ), dev_priv->regs.saveBLC_PWM_CTL);return ret; }
@@ -203,13 +203,13 @@ static void psb_intel_lvds_set_backlight(struct drm_device *dev, int level)REG_WRITE (BLC_PWM_CTL , (blc_pwm_ctl | (level <<BACKLIGHT_DUTY_CYCLE_SHIFT ))); - dev_priv->saveBLC_PWM_CTL = (blc_pwm_ctl | + dev_priv->regs.saveBLC_PWM_CTL = (blc_pwm_ctl | (level <<BACKLIGHT_DUTY_CYCLE_SHIFT ));gma_power_end (dev); }else { - blc_pwm_ctl = dev_priv->saveBLC_PWM_CTL & + blc_pwm_ctl = dev_priv->regs.saveBLC_PWM_CTL & ~BACKLIGHT_DUTY_CYCLE_MASK ; - dev_priv->saveBLC_PWM_CTL = (blc_pwm_ctl | + dev_priv->regs.saveBLC_PWM_CTL = (blc_pwm_ctl | (level <<BACKLIGHT_DUTY_CYCLE_SHIFT )); } }
@@ -283,7 +283,7 @@ static void psb_intel_lvds_save(struct drm_connector *connector) lvds_priv->savePFIT_PGM_RATIOS =REG_READ (PFIT_PGM_RATIOS );/*TODO: move backlight_duty_cycle to psb_intel_lvds_priv*/ - dev_priv->backlight_duty_cycle = (dev_priv->saveBLC_PWM_CTL & + dev_priv->backlight_duty_cycle = (dev_priv->regs.saveBLC_PWM_CTL &BACKLIGHT_DUTY_CYCLE_MASK );/*
PATCH 4/47 gma500: Kconfig documentation tweak
In reply to Alan CoxFrom: Alan Cox <[email protected]>
Update this to better reflect the status
---
drivers/gpu/drm/gma500/Kconfig | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/gpu/drm/gma500/Kconfig +1 -2
@@ -16,8 +16,7 @@ config DRM_GMA600 depends on DRM_GMA500 help Say yes to include support for GMA600 (Intel Moorestown/Oaktrail) - platforms with LVDS ports. HDMI and MIPI are not currently - supported. + platforms with LVDS ports. MIPI is not currently supported. config DRM_GMA3600 bool "Intel GMA3600/3650 support (Experimental)"
PATCH 5/47 intel, gma500, lvds: Fix use after free and mem leak in psb_intel_lvds_init()
In reply to Alan CoxFrom: Jesper Juhl <[email protected]>
In psb_intel_lvds_init(), if we fail to allocate memory for 'psb_intel_connector' we free the memory we previously allocated for 'psb_intel_encoder', but we then proceed to use that free'd pointer when we do 'psb_intel_encoder->dev_priv = lvds_priv;'.
We may also leak the memory we allocated for 'psb_intel_encoder' if we 'goto failed_connector;' and the variable goes out of scope.
While I was there anyway, I also removed the pointless 'if (psb_intel_connector)' before freeing it at the 'failed_connector:' label - kfree() deals gracefully with NULL pointers, so it is not needed.
---
drivers/gpu/drm/gma500/psb_intel_lvds.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/gma500/psb_intel_lvds.c +4 -5
@@ -713,7 +713,6 @@ void psb_intel_lvds_init(struct drm_device *dev, psb_intel_encoder =kzalloc (sizeof (struct psb_intel_encoder ),GFP_KERNEL ); -if (!psb_intel_encoder) {dev_err (dev->dev,"psb_intel_encoder allocation error\n" );return ;
@@ -721,10 +720,9 @@ void psb_intel_lvds_init(struct drm_device *dev, psb_intel_connector =kzalloc (sizeof (struct psb_intel_connector ),GFP_KERNEL ); -if (!psb_intel_connector) { -kfree (psb_intel_encoder);dev_err (dev->dev,"psb_intel_connector allocation error\n" ); + goto failed_encoder; } lvds_priv =kzalloc (sizeof (struct psb_intel_lvds_priv ),GFP_KERNEL );
@@ -862,7 +860,8 @@ failed_blc_i2c:drm_encoder_cleanup (encoder);drm_connector_cleanup (connector); failed_connector: -if (psb_intel_connector) -kfree (psb_intel_connector); +kfree (psb_intel_connector); +failed_encoder: +kfree (psb_intel_encoder); }
PATCH 6/47 gma500: re-order calling on the fix setup so we set up after the DRM layer
In reply to Alan CoxFrom: Alan Cox <[email protected]>
Noted by Kirill A Shutemov
---
drivers/gpu/drm/gma500/framebuffer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/gma500/framebuffer.c +1 -1
@@ -463,6 +463,7 @@ static int psbfb_create(struct psb_fbdev *fbdev, fbdev->psb_fb_helper.fb = fb; fbdev->psb_fb_helper.fbdev = info; +drm_fb_helper_fill_fix (info, fb->pitches[0 ], fb->depth);strcpy (info->fix.id,"psbfb" ); info->flags =FBINFO_DEFAULT ;
@@ -500,7 +501,6 @@ static int psbfb_create(struct psb_fbdev *fbdev, info->apertures->ranges[0 ].size = dev_priv->gtt.stolen_size; } -drm_fb_helper_fill_fix (info, fb->pitches[0 ], fb->depth);drm_fb_helper_fill_var (info, &fbdev->psb_fb_helper, sizes->fb_width, sizes->fb_height);
PATCH 7/47 gma500: make init_pm callback in struct psb_op optional
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/oaktrail_device.c | 5 ----- drivers/gpu/drm/gma500/power.c | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/gma500/oaktrail_device.c +0 -5
@@ -176,10 +176,6 @@ int oaktrail_backlight_init(struct drm_device *dev)* for power management */ -static void oaktrail_init_pm (struct drm_device *dev) -{ -} -/** * oaktrail_save_display_registers - save registers lost on suspend * @dev: our DRM device
@@ -504,7 +500,6 @@ const struct psb_ops oaktrail_chip_ops = { .backlight_init = oaktrail_backlight_init, #endif - .init_pm = oaktrail_init_pm, .save_regs = oaktrail_save_display_registers, .restore_regs = oaktrail_restore_display_registers, .power_down = oaktrail_power_down,
drivers/gpu/drm/gma500/power.c +2 -1
@@ -58,7 +58,8 @@ void gma_power_init(struct drm_device *dev)spin_lock_init (&power_ctrl_lock);mutex_init (&power_mutex); - dev_priv->ops->init_pm (dev); +if (dev_priv->ops->init_pm) + dev_priv->ops->init_pm (dev); }/**
PATCH 8/47 gma500: rework register stuff sanely
In reply to Alan CoxFrom: Alan Cox <[email protected]>
Rework registers handling to prepare for Medfield.
---
drivers/gpu/drm/gma500/cdv_intel_display.c | 31 ++-- drivers/gpu/drm/gma500/oaktrail_device.c | 198 ++++++++++++++-------------- drivers/gpu/drm/gma500/oaktrail_hdmi.c | 4 - drivers/gpu/drm/gma500/psb_device.c | 4 - drivers/gpu/drm/gma500/psb_drv.h | 18 ++- drivers/gpu/drm/gma500/psb_intel_display.c | 31 ++-- 6 files changed, 148 insertions(+), 138 deletions(-)
drivers/gpu/drm/gma500/cdv_intel_display.c +16 -15
@@ -968,7 +968,7 @@ void cdv_intel_crtc_load_lut(struct drm_crtc *crtc)gma_power_end (dev); }else {for (i =0 ; i <256 ; i++) { - dev_priv->regs.save_palette_a[i] = + dev_priv->regs.psb.save_palette_a[i] = ((psb_intel_crtc->lut_r[i] + psb_intel_crtc->lut_adj[i]) << 16) | ((psb_intel_crtc->lut_g[i] +
@@ -1338,19 +1338,20 @@ static int cdv_intel_crtc_clock_get(struct drm_device *dev,gma_power_end (dev); }else { dpll = (pipe ==0 ) ? - dev_priv->regs.saveDPLL_A : dev_priv->regs.saveDPLL_B; + dev_priv->regs.psb.saveDPLL_A : + dev_priv->regs.psb.saveDPLL_B;if ((dpll &DISPLAY_RATE_SELECT_FPA1 ) ==0 ) fp = (pipe ==0 ) ? - dev_priv->regs.saveFPA0 : - dev_priv->regs.saveFPB0; + dev_priv->regs.psb.saveFPA0 : + dev_priv->regs.psb.saveFPB0;else fp = (pipe ==0 ) ? - dev_priv->regs.saveFPA1 : - dev_priv->regs.saveFPB1; + dev_priv->regs.psb.saveFPA1 : + dev_priv->regs.psb.saveFPB1; is_lvds = (pipe ==1 ) && - (dev_priv->regs.saveLVDS &LVDS_PORT_EN ); + (dev_priv->regs.psb.saveLVDS &LVDS_PORT_EN ); } clock.m1 = (fp &FP_M1_DIV_MASK ) >>FP_M1_DIV_SHIFT ;
@@ -1420,17 +1421,17 @@ struct drm_display_mode *cdv_intel_crtc_mode_get(struct drm_device *dev,gma_power_end (dev); }else { htot = (pipe ==0 ) ? - dev_priv->regs.saveHTOTAL_A : - dev_priv->regs.saveHTOTAL_B; + dev_priv->regs.psb.saveHTOTAL_A : + dev_priv->regs.psb.saveHTOTAL_B; hsync = (pipe ==0 ) ? - dev_priv->regs.saveHSYNC_A : - dev_priv->regs.saveHSYNC_B; + dev_priv->regs.psb.saveHSYNC_A : + dev_priv->regs.psb.saveHSYNC_B; vtot = (pipe ==0 ) ? - dev_priv->regs.saveVTOTAL_A : - dev_priv->regs.saveVTOTAL_B; + dev_priv->regs.psb.saveVTOTAL_A : + dev_priv->regs.psb.saveVTOTAL_B; vsync = (pipe ==0 ) ? - dev_priv->regs.saveVSYNC_A : - dev_priv->regs.saveVSYNC_B; + dev_priv->regs.psb.saveVSYNC_A : + dev_priv->regs.psb.saveVSYNC_B; } mode =kzalloc (sizeof (*mode),GFP_KERNEL );
drivers/gpu/drm/gma500/oaktrail_device.c +99 -99
281 lines not on this page · raw message
drivers/gpu/drm/gma500/oaktrail_hdmi.c +2 -2
@@ -766,7 +766,7 @@ void oaktrail_hdmi_save(struct drm_device *dev) {struct drm_psb_private *dev_priv = dev->dev_private;struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; -struct psb_state *regs = &dev_priv->regs; +struct psb_state *regs = &dev_priv->regs.psb;int i;/* dpll */
@@ -818,7 +818,7 @@ void oaktrail_hdmi_restore(struct drm_device *dev) {struct drm_psb_private *dev_priv = dev->dev_private;struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; -struct psb_state *regs = &dev_priv->regs; +struct psb_state *regs = &dev_priv->regs.psb;int i;/* dpll */
drivers/gpu/drm/gma500/psb_device.c +2 -2
@@ -177,7 +177,7 @@ static int psb_save_display_registers(struct drm_device *dev)struct drm_psb_private *dev_priv = dev->dev_private;struct drm_crtc *crtc;struct drm_connector *connector; -struct psb_state *regs = &dev_priv->regs; +struct psb_state *regs = &dev_priv->regs.psb;/* Display arbitration control + watermarks */ regs->saveDSPARB =PSB_RVDC32 (DSPARB );
@@ -214,7 +214,7 @@ static int psb_restore_display_registers(struct drm_device *dev)struct drm_psb_private *dev_priv = dev->dev_private;struct drm_crtc *crtc;struct drm_connector *connector; -struct psb_state *regs = &dev_priv->regs; +struct psb_state *regs = &dev_priv->regs.psb;/* Display arbitration + watermarks */ PSB_WVDC32 (regs->saveDSPARB,DSPARB );
drivers/gpu/drm/gma500/psb_drv.h +13 -5
@@ -337,8 +337,6 @@ struct psb_state {uint32_t savePFIT_CONTROL;uint32_t savePaletteA[256 ];uint32_t savePaletteB[256 ]; -uint32_t saveBLC_PWM_CTL2; -uint32_t saveBLC_PWM_CTL;uint32_t saveCLOCKGATING;uint32_t saveDSPARB;uint32_t saveDSPATILEOFF;
@@ -350,8 +348,6 @@ struct psb_state {uint32_t savePP_ON_DELAYS;uint32_t savePP_OFF_DELAYS;uint32_t savePP_DIVISOR; -uint32_t saveBSM; -uint32_t saveVBT;uint32_t saveBCLRPAT_A;uint32_t saveBCLRPAT_B;uint32_t saveDSPALINOFF;
@@ -393,6 +389,16 @@ struct psb_state {uint32_t savePWM_CONTROL_LOGIC; }; +struct psb_save_area { +uint32_t saveBSM; +uint32_t saveVBT; +union { +struct psb_state psb; + }; +uint32_t saveBLC_PWM_CTL2; +uint32_t saveBLC_PWM_CTL; +}; +struct psb_ops ;#define PSB_NUM_PIPE 3
@@ -520,7 +526,9 @@ struct drm_psb_private {/* * Register state */ -struct psb_state regs; + +struct psb_save_area regs; +/* MSI reg save */ uint32_t msi_addr;uint32_t msi_data;
drivers/gpu/drm/gma500/psb_intel_display.c +16 -15
@@ -845,7 +845,7 @@ void psb_intel_crtc_load_lut(struct drm_crtc *crtc)gma_power_end (dev); }else {for (i =0 ; i <256 ; i++) { - dev_priv->regs.save_palette_a[i] = + dev_priv->regs.psb.save_palette_a[i] = ((psb_intel_crtc->lut_r[i] + psb_intel_crtc->lut_adj[i]) << 16) | ((psb_intel_crtc->lut_g[i] +
@@ -1141,18 +1141,19 @@ static int psb_intel_crtc_clock_get(struct drm_device *dev,gma_power_end (dev); }else { dpll = (pipe ==0 ) ? - dev_priv->regs.saveDPLL_A : dev_priv->regs.saveDPLL_B; + dev_priv->regs.psb.saveDPLL_A : + dev_priv->regs.psb.saveDPLL_B;if ((dpll &DISPLAY_RATE_SELECT_FPA1 ) ==0 ) fp = (pipe ==0 ) ? - dev_priv->regs.saveFPA0 : - dev_priv->regs.saveFPB0; + dev_priv->regs.psb.saveFPA0 : + dev_priv->regs.psb.saveFPB0;else fp = (pipe ==0 ) ? - dev_priv->regs.saveFPA1 : - dev_priv->regs.saveFPB1; + dev_priv->regs.psb.saveFPA1 : + dev_priv->regs.psb.saveFPB1; - is_lvds = (pipe ==1 ) && (dev_priv->regs.saveLVDS & + is_lvds = (pipe ==1 ) && (dev_priv->regs.psb.saveLVDS &LVDS_PORT_EN ); }
@@ -1219,17 +1220,17 @@ struct drm_display_mode *psb_intel_crtc_mode_get(struct drm_device *dev,gma_power_end (dev); }else { htot = (pipe ==0 ) ? - dev_priv->regs.saveHTOTAL_A : - dev_priv->regs.saveHTOTAL_B; + dev_priv->regs.psb.saveHTOTAL_A : + dev_priv->regs.psb.saveHTOTAL_B; hsync = (pipe ==0 ) ? - dev_priv->regs.saveHSYNC_A : - dev_priv->regs.saveHSYNC_B; + dev_priv->regs.psb.saveHSYNC_A : + dev_priv->regs.psb.saveHSYNC_B; vtot = (pipe ==0 ) ? - dev_priv->regs.saveVTOTAL_A : - dev_priv->regs.saveVTOTAL_B; + dev_priv->regs.psb.saveVTOTAL_A : + dev_priv->regs.psb.saveVTOTAL_B; vsync = (pipe ==0 ) ? - dev_priv->regs.saveVSYNC_A : - dev_priv->regs.saveVSYNC_B; + dev_priv->regs.psb.saveVSYNC_A : + dev_priv->regs.psb.saveVSYNC_B; } mode =kzalloc (sizeof (*mode),GFP_KERNEL );
PATCH 9/47 gma500: initial medfield merge
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
We need to merge this ahead of some of the cleanup because a lot of needed cleanup spans both new and old chips. If we try and clean up and the merge we end up fighting ourselves.
---
arch/x86/platform/mrst/mrst.c | 16 drivers/gpu/drm/gma500/Kconfig | 7 drivers/gpu/drm/gma500/Makefile | 10 drivers/gpu/drm/gma500/mdfld_device.c | 691 ++++++++++++++ drivers/gpu/drm/gma500/mdfld_dsi_dpi.c | 1024 +++++++++++++++++++++ drivers/gpu/drm/gma500/mdfld_dsi_dpi.h | 79 ++ drivers/gpu/drm/gma500/mdfld_dsi_output.c | 635 +++++++++++++ drivers/gpu/drm/gma500/mdfld_dsi_output.h | 389 ++++++++ drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c | 694 +++++++++++++++ drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.h | 92 ++ drivers/gpu/drm/gma500/mdfld_intel_display.c | 1192 +++++++++++++++++++++++++ drivers/gpu/drm/gma500/mdfld_output.c | 77 ++ drivers/gpu/drm/gma500/mdfld_output.h | 77 ++ drivers/gpu/drm/gma500/mdfld_tmd_vid.c | 201 ++++ drivers/gpu/drm/gma500/mdfld_tpo_vid.c | 124 +++ drivers/gpu/drm/gma500/psb_drv.c | 10 drivers/gpu/drm/gma500/psb_drv.h | 89 ++ drivers/gpu/drm/gma500/psb_irq.c | 58 + drivers/gpu/drm/gma500/psb_irq.h | 2 drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c | 829 +++++++++++++++++ drivers/gpu/drm/gma500/tc35876x-dsi-lvds.h | 38 + include/linux/i2c/tc35876x.h | 11 22 files changed, 6345 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/gma500/mdfld_device.c create mode 100644 drivers/gpu/drm/gma500/mdfld_dsi_dpi.c create mode 100644 drivers/gpu/drm/gma500/mdfld_dsi_dpi.h create mode 100644 drivers/gpu/drm/gma500/mdfld_dsi_output.c create mode 100644 drivers/gpu/drm/gma500/mdfld_dsi_output.h create mode 100644 drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c create mode 100644 drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.h create mode 100644 drivers/gpu/drm/gma500/mdfld_intel_display.c create mode 100644 drivers/gpu/drm/gma500/mdfld_output.c create mode 100644 drivers/gpu/drm/gma500/mdfld_output.h create mode 100644 drivers/gpu/drm/gma500/mdfld_tmd_vid.c create mode 100644 drivers/gpu/drm/gma500/mdfld_tpo_vid.c create mode 100644 drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c create mode 100644 drivers/gpu/drm/gma500/tc35876x-dsi-lvds.h create mode 100644 include/linux/i2c/tc35876x.h
arch/x86/platform/mrst/mrst.c +16 -0
@@ -28,6 +28,8 @@#include <linux/module.h> #include <linux/notifier.h> #include <linux/mfd/intel_msic.h> +#include <linux/gpio.h> +#include <linux/i2c/tc35876x.h> #include <asm/setup.h> #include <asm/mpspec_def.h>
@@ -686,6 +688,19 @@ static void *msic_ocd_platform_data(void *info)return msic_generic_platform_data (info,INTEL_MSIC_BLOCK_OCD ); } +/* tc35876x DSI-LVDS bridge chip and panel platform data */ +static void *tc35876x_platform_data (void *data) +{ +static struct tc35876x_platform_data pdata; + +/* gpio pins set to -1 will not be used by the driver */ + pdata.gpio_bridge_reset =get_gpio_by_name ("LCMB_RXEN" ); + pdata.gpio_panel_bl_en =get_gpio_by_name ("6S6P_BL_EN" ); + pdata.gpio_panel_vadd =get_gpio_by_name ("EN_VREG_LCD_V3P3" ); + +return &pdata; +} +static const struct devs_id __initconst device_ids[] = { {"bma023" ,SFI_DEV_TYPE_I2C ,1 , &no_platform_data}, {"pmic_gpio" ,SFI_DEV_TYPE_SPI ,1 , &pmic_gpio_platform_data},
@@ -698,6 +713,7 @@ static const struct devs_id __initconst device_ids[] = { {"i2c_accel", SFI_DEV_TYPE_I2C, 0, &lis331dl_platform_data}, {"pmic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data}, {"mpu3050", SFI_DEV_TYPE_I2C, 1, &mpu3050_platform_data}, + {"i2c_disp_brig", SFI_DEV_TYPE_I2C, 0, &tc35876x_platform_data},/* MSIC subdevices */ {"msic_battery", SFI_DEV_TYPE_IPC, 1, &msic_battery_platform_data},
drivers/gpu/drm/gma500/Kconfig +7 -0
@@ -24,3 +24,10 @@ config DRM_GMA3600 help Say yes to include basic support for Intel GMA3600/3650 (Intel Cedar Trail) platforms. + +config DRM_MEDFIELD + bool "Intel Medfield support (Experimental)" + depends on DRM_GMA500 && X86_INTEL_MID + help + Say yes to include support for the Intel Medfield platform. +
drivers/gpu/drm/gma500/Makefile +10 -0
@@ -37,4 +37,14 @@ gma500_gfx-$(CONFIG_DRM_GMA600) += oaktrail_device.o \ oaktrail_hdmi.o \ oaktrail_hdmi_i2c.o +gma500_gfx-$(CONFIG_DRM_MEDFIELD) += mdfld_device.o \ + mdfld_output.o \ + mdfld_intel_display.o \ + mdfld_dsi_output.o \ + mdfld_dsi_dpi.o \ + mdfld_dsi_pkg_sender.o \ + mdfld_tpo_vid.o \ + mdfld_tmd_vid.o \ + tc35876x-dsi-lvds.o + obj-$(CONFIG_DRM_GMA500) += gma500_gfx.o
drivers/gpu/drm/gma500/mdfld_device.c new file +691 -0
691 lines not on this page · raw message
drivers/gpu/drm/gma500/mdfld_dsi_dpi.c new file +1024 -0
1,024 lines not on this page · raw message
drivers/gpu/drm/gma500/mdfld_dsi_dpi.h new file +79 -0
79 lines not on this page · raw message
drivers/gpu/drm/gma500/mdfld_dsi_output.c new file +635 -0
635 lines not on this page · raw message
drivers/gpu/drm/gma500/mdfld_dsi_output.h new file +389 -0
389 lines not on this page · raw message
drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c new file +694 -0
124 lines not on this page · raw message
drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.h new file +92 -0
92 lines not on this page · raw message
drivers/gpu/drm/gma500/mdfld_intel_display.c new file +1192 -0
1,192 lines not on this page · raw message
drivers/gpu/drm/gma500/mdfld_output.c new file +77 -0
77 lines not on this page · raw message
drivers/gpu/drm/gma500/mdfld_output.h new file +77 -0
77 lines not on this page · raw message
drivers/gpu/drm/gma500/mdfld_tmd_vid.c new file +201 -0
201 lines not on this page · raw message
drivers/gpu/drm/gma500/mdfld_tpo_vid.c new file +124 -0
124 lines not on this page · raw message
drivers/gpu/drm/gma500/psb_drv.h +89 -0
89 lines not on this page · raw message
drivers/gpu/drm/gma500/psb_irq.c +58 -0
58 lines not on this page · raw message
drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c new file +829 -0
829 lines not on this page · raw message
drivers/gpu/drm/gma500/tc35876x-dsi-lvds.h new file +38 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Part of the diff is not shown here. View the raw message.
PATCH 10/47 gma500: psbfb_create(): move depth initialization out of loop
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/framebuffer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/gma500/framebuffer.c +1 -1
@@ -391,6 +391,7 @@ static int psbfb_create(struct psb_fbdev *fbdev, mode_cmd.width = sizes->surface_width; mode_cmd.height = sizes->surface_height; bpp = sizes->surface_bpp; + depth = sizes->surface_depth;/* No 24bit packed */ if (bpp ==24 )
@@ -403,7 +404,6 @@ static int psbfb_create(struct psb_fbdev *fbdev,* is ok with some fonts */ mode_cmd.pitches[0 ] =ALIGN (mode_cmd.width * ((bpp +7 ) /8 ),4096 >> pitch_lines); - depth = sizes->surface_depth; size = mode_cmd.pitches[0 ] * mode_cmd.height; size =ALIGN (size,PAGE_SIZE );
PATCH 11/47 gma500: mdfld_dsi_output_init() drop unused parameter
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
Nobody uses 'config' parameter.
---
drivers/gpu/drm/gma500/mdfld_dsi_output.c | 18 ++++++------------ drivers/gpu/drm/gma500/mdfld_dsi_output.h | 1 - drivers/gpu/drm/gma500/mdfld_output.c | 9 +++------ 3 files changed, 9 insertions(+), 19 deletions(-)
drivers/gpu/drm/gma500/mdfld_dsi_output.c +6 -12
@@ -511,7 +511,6 @@ gpio_error:*/ void mdfld_dsi_output_init (struct drm_device *dev,int pipe, -struct mdfld_dsi_config *config,const struct panel_funcs *p_vid_funcs) {struct mdfld_dsi_config *dsi_config;
@@ -538,18 +537,13 @@ void mdfld_dsi_output_init(struct drm_device *dev, dsi_connector->pipe = pipe; -/*set DSI config*/ -if (config) - dsi_config = config; -else { - dsi_config =kzalloc (sizeof (struct mdfld_dsi_config ), -GFP_KERNEL ); -if (!dsi_config) { -DRM_ERROR ("cannot allocate memory for DSI config\n" ); - goto dsi_init_err0; - } -mdfld_dsi_get_default_config (dev, dsi_config, pipe); + dsi_config =kzalloc (sizeof (struct mdfld_dsi_config ), +GFP_KERNEL ); +if (!dsi_config) { +DRM_ERROR ("cannot allocate memory for DSI config\n" ); + goto dsi_init_err0; } +mdfld_dsi_get_default_config (dev, dsi_config, pipe); dsi_connector->private = dsi_config;
drivers/gpu/drm/gma500/mdfld_dsi_output.h +0 -1
@@ -375,7 +375,6 @@ extern void mdfld_dsi_brightness_control(struct drm_device *dev, int pipe, int level);extern void mdfld_dsi_output_init (struct drm_device *dev,int pipe, -struct mdfld_dsi_config *config,const struct panel_funcs *p_vid_funcs);extern void mdfld_dsi_controller_init (struct mdfld_dsi_config *dsi_config,int pipe);
drivers/gpu/drm/gma500/mdfld_output.c +3 -6
@@ -42,17 +42,14 @@ static void mdfld_init_panel(struct drm_device *dev, int mipi_pipe, {switch (p_type) {case TPO_VID : -mdfld_dsi_output_init (dev, mipi_pipe,NULL , - &mdfld_tpo_vid_funcs); +mdfld_dsi_output_init (dev, mipi_pipe, &mdfld_tpo_vid_funcs);break ;case TC35876X :tc35876x_init (dev); -mdfld_dsi_output_init (dev, mipi_pipe,NULL , - &mdfld_tc35876x_funcs); +mdfld_dsi_output_init (dev, mipi_pipe, &mdfld_tc35876x_funcs);break ;case TMD_VID : -mdfld_dsi_output_init (dev, mipi_pipe,NULL , - &mdfld_tmd_vid_funcs); +mdfld_dsi_output_init (dev, mipi_pipe, &mdfld_tmd_vid_funcs);break ;case HDMI :/* if (dev_priv->mdfld_hdmi_present)
PATCH 12/47 gma500: medfield: drop a bit of dead code
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/mdfld_dsi_output.c | 11 ----------- drivers/gpu/drm/gma500/mdfld_dsi_output.h | 10 ---------- 2 files changed, 0 insertions(+), 21 deletions(-)
drivers/gpu/drm/gma500/mdfld_dsi_output.c +0 -11
@@ -205,17 +205,6 @@ int mdfld_dsi_get_power_mode(struct mdfld_dsi_config *dsi_config, u32 *mode,return mdfld_dsi_get_panel_status (dsi_config,0x0a , mode, hs); } -int mdfld_dsi_get_diagnostic_result (struct mdfld_dsi_config *dsi_config, -u32 *result,bool hs) -{ -if (!dsi_config || !result) { -DRM_ERROR ("Invalid parameter\n" ); -return -EINVAL ; - } - -return mdfld_dsi_get_panel_status (dsi_config,0x0f , result, hs); -} -/* * NOTE: this function was used by OSPM. * TODO: will be removed later, should work out display interfaces for OSPM
drivers/gpu/drm/gma500/mdfld_dsi_output.h +0 -10
@@ -227,14 +227,6 @@ enum {#define DSI_DPI_COMPLETE_LAST_LINE BIT(2)#define DSI_DPI_DISABLE_BTA BIT(3) -struct mdfld_dsi_connector_state { -u32 mipi_ctrl_reg; -}; - -struct mdfld_dsi_encoder_state { - -}; -struct mdfld_dsi_connector {struct psb_intel_connector base;
@@ -381,8 +373,6 @@ extern void mdfld_dsi_controller_init(struct mdfld_dsi_config *dsi_config,extern int mdfld_dsi_get_power_mode (struct mdfld_dsi_config *dsi_config,u32 *mode,bool hs); -extern int mdfld_dsi_get_diagnostic_result (struct mdfld_dsi_config *dsi_config, -u32 *result,bool hs);extern int mdfld_dsi_panel_reset (int pipe);#endif /*__MDFLD_DSI_OUTPUT_H__*/
PATCH 13/47 gma500: gem_glue: add missing include
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
It fixes W=1 warnings:
drivers/gpu/drm/gma500/gem_glue.c:23:6: warning: no previous prototype for ‘drm_gem_object_release_wrap’ [-Wmissing-prototypes] drivers/gpu/drm/gma500/gem_glue.c:44:5: warning: no previous prototype for ‘gem_create_mmap_offset’ [-Wmissing-prototypes]
---
drivers/gpu/drm/gma500/gem_glue.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/gpu/drm/gma500/gem_glue.c +1 -0
@@ -19,6 +19,7 @@#include <drm/drmP.h> #include <drm/drm.h> +#include "gem_glue.h" void drm_gem_object_release_wrap (struct drm_gem_object *obj) {
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 14/47 gma500: drop unused psbfb_suspend()/psbfb_resume()
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/framebuffer.c | 33 --------------------------------- 1 files changed, 0 insertions(+), 33 deletions(-)
drivers/gpu/drm/gma500/framebuffer.c +0 -33
@@ -111,39 +111,6 @@ static int psbfb_pan(struct fb_var_screeninfo *var, struct fb_info *info)return 0 ; } -void psbfb_suspend (struct drm_device *dev) -{ -struct drm_framebuffer *fb; - -console_lock (); -mutex_lock (&dev->mode_config.mutex); -list_for_each_entry (fb, &dev->mode_config.fb_list, head) { -struct psb_framebuffer *psbfb =to_psb_fb (fb); -struct fb_info *info = psbfb->fbdev; -fb_set_suspend (info,1 ); -drm_fb_helper_blank (FB_BLANK_POWERDOWN , info); - } -mutex_unlock (&dev->mode_config.mutex); -console_unlock (); -} - -void psbfb_resume (struct drm_device *dev) -{ -struct drm_framebuffer *fb; - -console_lock (); -mutex_lock (&dev->mode_config.mutex); -list_for_each_entry (fb, &dev->mode_config.fb_list, head) { -struct psb_framebuffer *psbfb =to_psb_fb (fb); -struct fb_info *info = psbfb->fbdev; -fb_set_suspend (info,0 ); -drm_fb_helper_blank (FB_BLANK_UNBLANK , info); - } -mutex_unlock (&dev->mode_config.mutex); -console_unlock (); -drm_helper_disable_unused_functions (dev); -} -static int psbfb_vm_fault (struct vm_area_struct *vma,struct vm_fault *vmf) {struct psb_framebuffer *psbfb = vma->vm_private_data;
PATCH 15/47 gma500: mark psb_fbdev_destroy() and psb_fbdev_fini() as static
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/framebuffer.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/gma500/framebuffer.c +2 -2
@@ -562,7 +562,7 @@ struct drm_fb_helper_funcs psb_fb_helper_funcs = { .fb_probe = psbfb_probe, }; -int psb_fbdev_destroy (struct drm_device *dev,struct psb_fbdev *fbdev) +static int psb_fbdev_destroy (struct drm_device *dev,struct psb_fbdev *fbdev) {struct fb_info *info;struct psb_framebuffer *psbfb = &fbdev->pfb;
@@ -604,7 +604,7 @@ int psb_fbdev_init(struct drm_device *dev)return 0 ; } -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;
PATCH 16/47 gma500: gtt: mark psb_gtt_entry() and psb_gtt_alloc() as static
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/gtt.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/gma500/gtt.c +2 -2
@@ -57,7 +57,7 @@ static inline uint32_t psb_gtt_mask_pte(uint32_t pfn, int type)* Given a gtt_range object return the GTT offset of the page table * entries for this gtt_range */ -u32 *psb_gtt_entry (struct drm_device *dev,struct gtt_range *r) +static u32 *psb_gtt_entry (struct drm_device *dev,struct gtt_range *r) {struct drm_psb_private *dev_priv = dev->dev_private;unsigned long offset;
@@ -378,7 +378,7 @@ void psb_gtt_free_range(struct drm_device *dev, struct gtt_range *gt)kfree (gt); } -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;init_rwsem (&dev_priv->gtt.sem);
PATCH 17/47 gma500: mmu: drop unused psb_get_default_pd_addr()
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/mmu.c | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-)
drivers/gpu/drm/gma500/mmu.c +0 -9
@@ -488,15 +488,6 @@ struct psb_mmu_pd *psb_mmu_get_default_pd(struct psb_mmu_driver *driver)return pd; } -/* Returns the physical address of the PD shared by sgx/msvdx */ -uint32_t psb_get_default_pd_addr (struct psb_mmu_driver *driver) -{ -struct psb_mmu_pd *pd; - - pd =psb_mmu_get_default_pd (driver); -return page_to_pfn (pd->p) <<PAGE_SHIFT ; -} -void psb_mmu_driver_takedown (struct psb_mmu_driver *driver) {psb_mmu_free_pagedir (driver->default_pd);
PATCH 18/47 gma500: mmu: mark psb_mmu_free_pt() and psb_mmu_pt_alloc_map_lock() as static
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/mmu.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/gma500/mmu.c +2 -2
@@ -270,7 +270,7 @@ out_err1:return NULL ; } -void psb_mmu_free_pt (struct psb_mmu_pt *pt) +static void psb_mmu_free_pt (struct psb_mmu_pt *pt) {__free_page (pt->p);kfree (pt);
@@ -351,7 +351,7 @@ static struct psb_mmu_pt *psb_mmu_alloc_pt(struct psb_mmu_pd *pd)return pt; } -struct psb_mmu_pt *psb_mmu_pt_alloc_map_lock (struct psb_mmu_pd *pd, +static struct psb_mmu_pt *psb_mmu_pt_alloc_map_lock (struct psb_mmu_pd *pd,unsigned long addr) {uint32_t index =psb_mmu_pd_index (addr);
PATCH 19/47 gma500: use DRM_IOCTL_DEF_DRV instead of custom PSB_IOCTL_DEF
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/psb_drv.c | 35 ++++++++++++++++------------------- 1 files changed, 16 insertions(+), 19 deletions(-)
drivers/gpu/drm/gma500/psb_drv.c +16 -19
@@ -88,27 +88,27 @@ MODULE_DEVICE_TABLE(pci, pciidlist);* Standard IOCTLs. */ -#define DRM_IOCTL_PSB_ADB \ +#define DRM_IOCTL_GMA_ADB \ DRM_IOWR(DRM_GMA_ADB + DRM_COMMAND_BASE, uint32_t) -#define DRM_IOCTL_PSB_MODE_OPERATION \ +#define DRM_IOCTL_GMA_MODE_OPERATION \ DRM_IOWR(DRM_GMA_MODE_OPERATION + DRM_COMMAND_BASE, \ struct drm_psb_mode_operation_arg) -#define DRM_IOCTL_PSB_STOLEN_MEMORY \ +#define DRM_IOCTL_GMA_STOLEN_MEMORY \ DRM_IOWR(DRM_GMA_STOLEN_MEMORY + DRM_COMMAND_BASE, \ struct drm_psb_stolen_memory_arg) -#define DRM_IOCTL_PSB_GAMMA \ +#define DRM_IOCTL_GMA_GAMMA \ DRM_IOWR(DRM_GMA_GAMMA + DRM_COMMAND_BASE, \ struct drm_psb_dpst_lut_arg) -#define DRM_IOCTL_PSB_DPST_BL \ +#define DRM_IOCTL_GMA_DPST_BL \ DRM_IOWR(DRM_GMA_DPST_BL + DRM_COMMAND_BASE, \ uint32_t) -#define DRM_IOCTL_PSB_GET_PIPE_FROM_CRTC_ID \ +#define DRM_IOCTL_GMA_GET_PIPE_FROM_CRTC_ID \ DRM_IOWR(DRM_GMA_GET_PIPE_FROM_CRTC_ID + DRM_COMMAND_BASE, \ struct drm_psb_get_pipe_from_crtc_id_arg) -#define DRM_IOCTL_PSB_GEM_CREATE \ +#define DRM_IOCTL_GMA_GEM_CREATE \ DRM_IOWR(DRM_GMA_GEM_CREATE + DRM_COMMAND_BASE, \ struct drm_psb_gem_create) -#define DRM_IOCTL_PSB_GEM_MMAP \ +#define DRM_IOCTL_GMA_GEM_MMAP \ DRM_IOWR(DRM_GMA_GEM_MMAP + DRM_COMMAND_BASE, \ struct drm_psb_gem_mmap)
@@ -123,22 +123,19 @@ static int psb_gamma_ioctl(struct drm_device *dev, void *data,static int psb_dpst_bl_ioctl (struct drm_device *dev,void *data,struct drm_file *file_priv); -#define PSB_IOCTL_DEF (ioctl, func, flags) \ - [DRM_IOCTL_NR(ioctl) - DRM_COMMAND_BASE] = {ioctl, flags, func} -static struct drm_ioctl_desc psb_ioctls[] = { -PSB_IOCTL_DEF (DRM_IOCTL_PSB_ADB , psb_adb_ioctl,DRM_AUTH ), -PSB_IOCTL_DEF (DRM_IOCTL_PSB_MODE_OPERATION , psb_mode_operation_ioctl, +DRM_IOCTL_DEF_DRV (GMA_ADB , psb_adb_ioctl,DRM_AUTH ), +DRM_IOCTL_DEF_DRV (GMA_MODE_OPERATION , psb_mode_operation_ioctl,DRM_AUTH ), -PSB_IOCTL_DEF (DRM_IOCTL_PSB_STOLEN_MEMORY , psb_stolen_memory_ioctl, +DRM_IOCTL_DEF_DRV (GMA_STOLEN_MEMORY , psb_stolen_memory_ioctl,DRM_AUTH ), -PSB_IOCTL_DEF (DRM_IOCTL_PSB_GAMMA , psb_gamma_ioctl,DRM_AUTH ), -PSB_IOCTL_DEF (DRM_IOCTL_PSB_DPST_BL , psb_dpst_bl_ioctl,DRM_AUTH ), -PSB_IOCTL_DEF (DRM_IOCTL_PSB_GET_PIPE_FROM_CRTC_ID , +DRM_IOCTL_DEF_DRV (GMA_GAMMA , psb_gamma_ioctl,DRM_AUTH ), +DRM_IOCTL_DEF_DRV (GMA_DPST_BL , psb_dpst_bl_ioctl,DRM_AUTH ), +DRM_IOCTL_DEF_DRV (GMA_GET_PIPE_FROM_CRTC_ID , psb_intel_get_pipe_from_crtc_id,0 ), -PSB_IOCTL_DEF (DRM_IOCTL_PSB_GEM_CREATE , psb_gem_create_ioctl, +DRM_IOCTL_DEF_DRV (GMA_GEM_CREATE , psb_gem_create_ioctl,DRM_UNLOCKED |DRM_AUTH ), -PSB_IOCTL_DEF (DRM_IOCTL_PSB_GEM_MMAP , psb_gem_mmap_ioctl, +DRM_IOCTL_DEF_DRV (GMA_GEM_MMAP , psb_gem_mmap_ioctl,DRM_UNLOCKED |DRM_AUTH ), };
PATCH 20/47 gma500: fix ioctl confict
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
Move DRM_GMA_GET_PIPE_FROM_CRTC_ID to 0x08 to avoid confict with DRM_GMA_GEM_MMAP.
---
include/drm/gma_drm.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/drm/gma_drm.h +1 -1
@@ -83,9 +83,9 @@ struct drm_psb_gem_mmap {#define DRM_GMA_GAMMA 0x04/* Set gamma table */ #define DRM_GMA_ADB 0x05/* Get backlight */ #define DRM_GMA_DPST_BL 0x06/* Set backlight */ -#define DRM_GMA_GET_PIPE_FROM_CRTC_ID 0x1/* CRTC to physical pipe# */ #define DRM_GMA_MODE_OPERATION 0x07/* Mode validation/DC set */ #define PSB_MODE_OPERATION_MODE_VALID 0x01 +#define DRM_GMA_GET_PIPE_FROM_CRTC_ID 0x08/* CRTC to physical pipe# */ #endif
PATCH 21/47 gma500: psb_driver_load(): drop unused variables
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/psb_drv.c | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-)
drivers/gpu/drm/gma500/psb_drv.c +0 -8
@@ -276,10 +276,8 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset) {struct drm_psb_private *dev_priv;unsigned long resource_start; -struct psb_gtt *pg;unsigned long irqflags;int ret = -ENOMEM ; -uint32_t tt_pages;struct drm_connector *connector;struct psb_intel_encoder *psb_intel_encoder;
@@ -337,12 +335,6 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset)if (!dev_priv->mmu) goto out_err; - pg = &dev_priv->gtt; - - tt_pages = (pg->gatt_pages <PSB_TT_PRIV0_PLIMIT ) ? - (pg->gatt_pages) :PSB_TT_PRIV0_PLIMIT ; - - dev_priv->pf_pd =psb_mmu_alloc_pd (dev_priv->mmu,1 ,0 );if (!dev_priv->pf_pd) goto out_err;
PATCH 22/47 gma500: mark psb_driver_device_is_agp() and psb_driver_preclose() as static
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/psb_drv.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/gma500/psb_drv.c +2 -2
@@ -411,7 +411,7 @@ out_err:return ret; } -int psb_driver_device_is_agp (struct drm_device *dev) +static int psb_driver_device_is_agp (struct drm_device *dev) {return 0 ; }
@@ -602,7 +602,7 @@ static long psb_unlocked_ioctl(struct file *filp, unsigned int cmd,/* When a client dies: * - Check for and clean up flipped page state */ -void psb_driver_preclose (struct drm_device *dev,struct drm_file *priv) +static void psb_driver_preclose (struct drm_device *dev,struct drm_file *priv) { }
PATCH 23/47 gma500: fix two -Wmissing-field-initializers warnings
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/psb_drv.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/gma500/psb_drv.c +4 -2
@@ -80,7 +80,7 @@ static DEFINE_PCI_DEVICE_TABLE(pciidlist) = { { 0x8086, 0x0be6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops}, { 0x8086, 0x0be7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops}, #endif - { 0, 0, 0} + { 0, } }; MODULE_DEVICE_TABLE(pci, pciidlist);
@@ -679,7 +679,9 @@ static struct pci_driver psb_pci_driver = { .id_table = pciidlist, .probe = psb_probe, .remove = psb_remove, - .driver.pm = &psb_pm_ops, + .driver = { + .pm = &psb_pm_ops, + } };static int psb_probe (struct pci_dev *pdev,const struct pci_device_id *ent)
PATCH 24/47 gma500: fix cdv_intel_wait_for_vblank() prototype
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/cdv_device.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/gma500/cdv_device.h +1 -1
@@ -26,7 +26,7 @@ extern void cdv_hdmi_init(struct drm_device *dev, struct psb_intel_mode_device *extern struct drm_display_mode *cdv_intel_crtc_mode_get (struct drm_device *dev,struct drm_crtc *crtc); -extern inline void cdv_intel_wait_for_vblank (struct drm_device *dev) +static inline void cdv_intel_wait_for_vblank (struct drm_device *dev) {/* Wait for 20ms, i.e. one cycle at 50hz. */ /* FIXME: msleep ?? */
PATCH 25/47 gma500: cdv_intel_crt: add missing include
In reply to Alan CoxFrom: \"Kirill A. Shutemov\" <[email protected]>
drivers/gpu/drm/gma500/cdv_intel_crt.c:273:6: warning: no previous prototype for 'cdv_intel_crt_init' [-Wmissing-prototypes]
---
drivers/gpu/drm/gma500/cdv_intel_crt.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/gpu/drm/gma500/cdv_intel_crt.c +1 -0
@@ -32,6 +32,7 @@#include "psb_intel_drv.h" #include "psb_intel_reg.h" #include "power.h" +#include "cdv_device.h" #include <linux/pm_runtime.h>
PATCH 26/47 gma500: cdv_intel_crt: drop dead code
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/cdv_intel_display.c | 47 ---------------------------- 1 files changed, 0 insertions(+), 47 deletions(-)
drivers/gpu/drm/gma500/cdv_intel_display.c +0 -47
@@ -680,22 +680,6 @@ static void cdv_intel_crtc_commit(struct drm_crtc *crtc) crtc_funcs->dpms (crtc,DRM_MODE_DPMS_ON ); } -void cdv_intel_encoder_prepare (struct drm_encoder *encoder) -{ -struct drm_encoder_helper_funcs *encoder_funcs = - encoder->helper_private; -/* lvds has its own version of prepare see cdv_intel_lvds_prepare */ - encoder_funcs->dpms (encoder,DRM_MODE_DPMS_OFF ); -} - -void cdv_intel_encoder_commit (struct drm_encoder *encoder) -{ -struct drm_encoder_helper_funcs *encoder_funcs = - encoder->helper_private; -/* lvds has its own version of commit see cdv_intel_lvds_commit */ - encoder_funcs->dpms (encoder,DRM_MODE_DPMS_ON ); -} -static bool cdv_intel_crtc_mode_fixup (struct drm_crtc *crtc,struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode)
@@ -1481,34 +1465,3 @@ const struct drm_crtc_funcs cdv_intel_crtc_funcs = { .set_config = cdv_crtc_set_config, .destroy = cdv_intel_crtc_destroy, }; - -/* -* Set the default value of cursor control and base register -* to zero. This is a workaround for h/w defect on oaktrail -*/ -void cdv_intel_cursor_init (struct drm_device *dev,int pipe) -{ -uint32_t control; -uint32_t base; - -switch (pipe) { -case 0 : - control =CURACNTR ; - base =CURABASE ; -break ; -case 1 : - control =CURBCNTR ; - base =CURBBASE ; -break ; -case 2 : - control =CURCCNTR ; - base =CURCBASE ; -break ; -default : -return ; - } - -REG_WRITE (control,0 ); -REG_WRITE (base,0 ); -} -
PATCH 27/47 gma500: cdv_intel_crt: drop unused variables
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/cdv_intel_display.c | 10 +--------- 1 files changed, 1 insertions(+), 9 deletions(-)
drivers/gpu/drm/gma500/cdv_intel_display.c +1 -9
@@ -569,7 +569,6 @@ static void cdv_intel_crtc_dpms(struct drm_crtc *crtc, int mode)int dspbase_reg = (pipe ==0 ) ?DSPABASE :DSPBBASE ;int pipeconf_reg = (pipe ==0 ) ?PIPEACONF :PIPEBCONF ;u32 temp; -bool enabled;/* XXX: When our outputs are all unaware of DPMS modes other than off * and on, we should map those modes to DRM_MODE_DPMS_OFF in the CRTC.
@@ -663,7 +662,6 @@ static void cdv_intel_crtc_dpms(struct drm_crtc *crtc, int mode)udelay (150 );break ; } - enabled = crtc->enabled && mode !=DRM_MODE_DPMS_OFF ;/*Set FIFO Watermarks*/ REG_WRITE (DSPARB ,0x3F3E ); }
@@ -729,7 +727,7 @@ static int cdv_intel_crtc_mode_set(struct drm_crtc *crtc,int refclk;struct cdv_intel_clock_t clock;u32 dpll =0 , dspcntr, pipeconf; -bool ok, is_sdvo = false, is_dvo = false; +bool ok;bool is_crt = false, is_lvds = false, is_tv = false;bool is_hdmi = false;struct drm_mode_config *mode_config = &dev->mode_config;
@@ -747,12 +745,6 @@ static int cdv_intel_crtc_mode_set(struct drm_crtc *crtc,case INTEL_OUTPUT_LVDS : is_lvds = true;break ; -case INTEL_OUTPUT_SDVO : - is_sdvo = true; -break ; -case INTEL_OUTPUT_DVO : - is_dvo = true; -break ;case INTEL_OUTPUT_TVOUT : is_tv = true;break ;
PATCH 28/47 gma500: cdv_intel_crt: mark few functions as static
In reply to Alan CoxFrom: \"Kirill A. Shutemov\" <[email protected]>
---
drivers/gpu/drm/gma500/cdv_intel_display.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/gma500/cdv_intel_display.c +3 -3
@@ -344,7 +344,7 @@ cdv_dpll_set_clock_cdv(struct drm_device *dev, struct drm_crtc *crtc,/* * Returns whether any encoder on the specified pipe is of the specified type */ -bool cdv_intel_pipe_has_type (struct drm_crtc *crtc,int type) +static bool cdv_intel_pipe_has_type (struct drm_crtc *crtc,int type) {struct drm_device *dev = crtc->dev;struct drm_mode_config *mode_config = &dev->mode_config;
@@ -476,7 +476,7 @@ static bool cdv_intel_find_best_PLL(struct drm_crtc *crtc, int target,return err != target; } -int cdv_intel_pipe_set_base (struct drm_crtc *crtc, +static int cdv_intel_pipe_set_base (struct drm_crtc *crtc,int x,int y,struct drm_framebuffer *old_fb) {struct drm_device *dev = crtc->dev;
@@ -904,7 +904,7 @@ static int cdv_intel_crtc_mode_set(struct drm_crtc *crtc, }/** Loads the palette/gamma unit for the CRTC with the prepared values */ -void cdv_intel_crtc_load_lut (struct drm_crtc *crtc) +static void cdv_intel_crtc_load_lut (struct drm_crtc *crtc) {struct drm_device *dev = crtc->dev; struct drm_psb_private *dev_priv =
PATCH 29/47 gma500: cdv_intel_hdmi: add missing include
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
drivers/gpu/drm/gma500/cdv_intel_hdmi.c:305:6: warning: no previous prototype for 'cdv_hdmi_init' [-Wmissing-prototypes]
---
drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/gpu/drm/gma500/cdv_intel_hdmi.c +1 -0
@@ -34,6 +34,7 @@#include "psb_intel_drv.h" #include "psb_drv.h" #include "psb_intel_reg.h" +#include "cdv_device.h" #include <linux/pm_runtime.h> /* hdmi control bits */
PATCH 30/47 gma500: cdv_intel_lvds: mark few functions as static
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/cdv_intel_lvds.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/gma500/cdv_intel_lvds.c +4 -4
@@ -242,7 +242,7 @@ static void cdv_intel_lvds_restore(struct drm_connector *connector) { } -int cdv_intel_lvds_mode_valid (struct drm_connector *connector, +static int cdv_intel_lvds_mode_valid (struct drm_connector *connector,struct drm_display_mode *mode) {struct drm_device *dev = connector->dev;
@@ -267,7 +267,7 @@ int cdv_intel_lvds_mode_valid(struct drm_connector *connector,return MODE_OK ; } -bool cdv_intel_lvds_mode_fixup (struct drm_encoder *encoder, +static bool cdv_intel_lvds_mode_fixup (struct drm_encoder *encoder,struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {
@@ -436,7 +436,7 @@ static int cdv_intel_lvds_get_modes(struct drm_connector *connector)* Unregister the DDC bus for this connector then free the driver private * structure. */ -void cdv_intel_lvds_destroy (struct drm_connector *connector) +static void cdv_intel_lvds_destroy (struct drm_connector *connector) {struct psb_intel_encoder *psb_intel_encoder =psb_intel_attached_encoder (connector);
@@ -448,7 +448,7 @@ void cdv_intel_lvds_destroy(struct drm_connector *connector)kfree (connector); } -int cdv_intel_lvds_set_property (struct drm_connector *connector, +static int cdv_intel_lvds_set_property (struct drm_connector *connector,struct drm_property *property,uint64_t value) {
PATCH 31/47 gma500: cdv_intel_lvds: #if 0 currently unused functions
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
cdv_intel_lvds_set_brightness() is only used in commented out code in cdv_set_brightness().
---
drivers/gpu/drm/gma500/cdv_intel_lvds.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/gpu/drm/gma500/cdv_intel_lvds.c +2 -0
@@ -85,6 +85,7 @@ static u32 cdv_intel_lvds_get_max_backlight(struct drm_device *dev)return retval; } +#if 0 /* * Set LVDS backlight level by I2C command */
@@ -165,6 +166,7 @@ void cdv_intel_lvds_set_brightness(struct drm_device *dev, int level) else cdv_lvds_pwm_set_brightness(dev, level); } +#endif /** * Sets the backlight level.
PATCH 32/47 gma500: mdfld_device: mark few functions as static
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/mdfld_device.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/gma500/mdfld_device.c +2 -2
@@ -93,7 +93,7 @@ int mdfld_set_brightness(struct backlight_device *bd)return 0 ; } -int mdfld_get_brightness (struct backlight_device *bd) +static int mdfld_get_brightness (struct backlight_device *bd) {struct drm_device *dev = (struct drm_device *)bl_get_data (mdfld_backlight_device);
@@ -121,7 +121,7 @@ static int device_backlight_init(struct drm_device *dev)return 0 ; } -int mdfld_backlight_init (struct drm_device *dev) +static int mdfld_backlight_init (struct drm_device *dev) {struct backlight_properties props;int ret =0 ;
PATCH 33/47 gma500: mdfld_dsi_dpi: drop unused variables
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/mdfld_dsi_dpi.c | 9 +-------- 1 files changed, 1 insertions(+), 8 deletions(-)
drivers/gpu/drm/gma500/mdfld_dsi_dpi.c +1 -8
@@ -430,14 +430,13 @@ int mdfld_dsi_dpi_timing_calculation(struct drm_display_mode *mode, int num_lane, int bpp) { int pclk_hsync, pclk_hfp, pclk_hbp, pclk_hactive; -int pclk_vsync, pclk_vfp, pclk_vbp, pclk_vactive; +int pclk_vsync, pclk_vfp, pclk_vbp; pclk_hactive = mode->hdisplay; pclk_hfp = mode->hsync_start - mode->hdisplay; pclk_hsync = mode->hsync_end - mode->hsync_start; pclk_hbp = mode->htotal - mode->hsync_end; - pclk_vactive = mode->vdisplay; pclk_vfp = mode->vsync_start - mode->vdisplay; pclk_vsync = mode->vsync_end - mode->vsync_start; pclk_vbp = mode->vtotal - mode->vsync_end;
@@ -641,10 +640,6 @@ static void mdfld_dsi_dpi_set_power(struct drm_encoder *encoder, bool on)int pipe =mdfld_dsi_encoder_get_pipe (dsi_encoder);struct drm_device *dev = dsi_config->dev;struct drm_psb_private *dev_priv = dev->dev_private; -u32 pipeconf_reg =PIPEACONF ; - -if (pipe) - pipeconf_reg =PIPECCONF ;/*start up display island if it was shutdown*/ if (!gma_power_begin (dev, true))
@@ -942,7 +937,6 @@ struct mdfld_dsi_encoder *mdfld_dsi_dpi_init(struct drm_device *dev,struct mdfld_dsi_config *dsi_config;struct drm_connector *connector =NULL ;struct drm_encoder *encoder =NULL ; -struct drm_display_mode *fixed_mode =NULL ;int pipe;u32 data;int ret;
@@ -994,7 +988,6 @@ struct mdfld_dsi_encoder *mdfld_dsi_dpi_init(struct drm_device *dev,/*get fixed mode*/ dsi_config =mdfld_dsi_get_config (dsi_connector); - fixed_mode = dsi_config->fixed_mode;/*create drm encoder object*/ connector = &dsi_connector->base.base;
PATCH 34/47 gma500: mdfld_dsi_pkg_sender: fix -Wtype-limits warning
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c +1 -1
@@ -482,7 +482,7 @@ int mdfld_dsi_send_gen_short(struct mdfld_dsi_pkg_sender *sender, u8 param0,unsigned long flags;u8 data_type; -if (!sender || param_num <0 || param_num >2 ) { +if (!sender || param_num >2 ) {DRM_ERROR ("Invalid parameter\n" );return -EINVAL ; }
PATCH 35/47 gma500: mdfld_intel_display: drop unused variables
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/mdfld_intel_display.c | 12 ------------ 1 files changed, 0 insertions(+), 12 deletions(-)
drivers/gpu/drm/gma500/mdfld_intel_display.c +0 -12
@@ -380,7 +380,6 @@ static void mdfld_crtc_dpms(struct drm_crtc *crtc, int mode)u32 pipestat_reg =PIPEASTAT ;u32 pipeconf = dev_priv->pipeconf[pipe];u32 temp; -bool enabled;int timeout =0 ;dev_dbg (dev->dev,"mode = %d, pipe = %d\n" , mode, pipe);
@@ -566,7 +565,6 @@ static void mdfld_crtc_dpms(struct drm_crtc *crtc, int mode) }break ; } - enabled = crtc->enabled && mode !=DRM_MODE_DPMS_OFF ;gma_power_end (dev); }
@@ -787,7 +785,6 @@ static int mdfld_crtc_mode_set(struct drm_crtc *crtc,struct mrst_clock_t clock;bool ok;u32 dpll =0 , fp =0 ; -bool is_crt = false, is_lvds = false, is_tv = false;bool is_mipi = false, is_mipi2 = false, is_hdmi = false;struct drm_mode_config *mode_config = &dev->mode_config;struct psb_intel_encoder *psb_intel_encoder =NULL ;
@@ -898,15 +895,6 @@ static int mdfld_crtc_mode_set(struct drm_crtc *crtc, psb_intel_encoder =psb_intel_attached_encoder (connector);switch (psb_intel_encoder->type) { -case INTEL_OUTPUT_LVDS : - is_lvds = true; -break ; -case INTEL_OUTPUT_TVOUT : - is_tv = true; -break ; -case INTEL_OUTPUT_ANALOG : - is_crt = true; -break ;case INTEL_OUTPUT_MIPI : is_mipi = true;break ;
PATCH 36/47 gma500: oaktrail_crtc: mark few functions as static
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/oaktrail_crtc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/gma500/oaktrail_crtc.c +2 -2
@@ -115,7 +115,7 @@ static void oaktrail_clock(int refclk, struct oaktrail_clock_t *clock) clock->dot = (refclk * clock->m) / (14 * clock->p1); } -void mrstPrintPll (char *prefix,struct oaktrail_clock_t *clock) +static void mrstPrintPll (char *prefix,struct oaktrail_clock_t *clock) {pr_debug ("%s: dotclock = %d, m = %d, p1 = %d.\n" , prefix, clock->dot, clock->m, clock->p1);
@@ -514,7 +514,7 @@ static bool oaktrail_crtc_mode_fixup(struct drm_crtc *crtc,return true; } -int oaktrail_pipe_set_base (struct drm_crtc *crtc, +static int oaktrail_pipe_set_base (struct drm_crtc *crtc,int x,int y,struct drm_framebuffer *old_fb) {struct drm_device *dev = crtc->dev;
PATCH 37/47 gma500: oaktrail_crtc: drop unused variables
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/oaktrail_crtc.c | 11 +---------- 1 files changed, 1 insertions(+), 10 deletions(-)
drivers/gpu/drm/gma500/oaktrail_crtc.c +1 -10
@@ -169,7 +169,6 @@ static void oaktrail_crtc_dpms(struct drm_crtc *crtc, int mode)int dspbase_reg = (pipe ==0 ) ?MRST_DSPABASE :DSPBBASE ;int pipeconf_reg = (pipe ==0 ) ?PIPEACONF :PIPEBCONF ;u32 temp; -bool enabled;if (!gma_power_begin (dev, true))return ;
@@ -253,8 +252,6 @@ static void oaktrail_crtc_dpms(struct drm_crtc *crtc, int mode)break ; } - enabled = crtc->enabled && mode !=DRM_MODE_DPMS_OFF ; -/*Set FIFO Watermarks*/ REG_WRITE (DSPARB ,0x3FFF );REG_WRITE (DSPFW1 ,0x3F88080A );
@@ -310,7 +307,7 @@ static int oaktrail_crtc_mode_set(struct drm_crtc *crtc,struct oaktrail_clock_t clock;u32 dpll =0 , fp =0 , dspcntr, pipeconf;bool ok, is_sdvo = false; -bool is_crt = false, is_lvds = false, is_tv = false; +bool is_lvds = false;bool is_mipi = false;struct drm_mode_config *mode_config = &dev->mode_config;struct psb_intel_encoder *psb_intel_encoder =NULL ;
@@ -340,12 +337,6 @@ static int oaktrail_crtc_mode_set(struct drm_crtc *crtc,case INTEL_OUTPUT_SDVO : is_sdvo = true;break ; -case INTEL_OUTPUT_TVOUT : - is_tv = true; -break ; -case INTEL_OUTPUT_ANALOG : - is_crt = true; -break ;case INTEL_OUTPUT_MIPI : is_mipi = true;break ;
PATCH 38/47 gma500: oaktrail_hdmi: drop dead code
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/oaktrail_hdmi.c | 327 -------------------------------- 1 files changed, 0 insertions(+), 327 deletions(-)
drivers/gpu/drm/gma500/oaktrail_hdmi.c +0 -327
@@ -125,59 +125,6 @@ static const struct oaktrail_hdmi_limit oaktrail_hdmi_limit = { .nf = { .min = NF_MIN, .max = NF_MAX }, }; -static void wait_for_vblank (struct drm_device *dev) -{ -/* FIXME: Can we do this as a sleep ? */ -/* Wait for 20ms, i.e. one cycle at 50hz. */ -mdelay (20 ); -} - -static void scu_busy_loop (void *scu_base) -{ -u32 status =0 ; -u32 loop_count =0 ; - - status =readl (scu_base +0x04 ); -while (status &1 ) { -udelay (1 );/* scu processing time is in few u secods */ - status =readl (scu_base +0x04 ); - loop_count++; -/* break if scu doesn't reset busy bit after huge retry */ -if (loop_count >1000 ) { -DRM_DEBUG_KMS ("SCU IPC timed out" ); -return ; - } - } -} - -static void oaktrail_hdmi_reset (struct drm_device *dev) -{ -void *base; -/* FIXME: at least make these defines */ -unsigned int scu_ipc_mmio =0xff11c000 ; -int scu_len =1024 ; - - base =ioremap ((resource_size_t )scu_ipc_mmio, scu_len); -if (base ==NULL ) { -DRM_ERROR ("failed to map SCU mmio\n" ); -return ; - } - -/* scu ipc: assert hdmi controller reset */ -writel (0xff11d118 , base +0x0c ); -writel (0x7fffffdf , base +0x80 ); -writel (0x42005 , base +0x0 ); -scu_busy_loop (base); - -/* scu ipc: de-assert hdmi controller reset */ -writel (0xff11d118 , base +0x0c ); -writel (0x7fffffff , base +0x80 ); -writel (0x42005 , base +0x0 ); -scu_busy_loop (base); - -iounmap (base); -} -static void oaktrail_hdmi_audio_enable (struct drm_device *dev) {struct drm_psb_private *dev_priv = dev->dev_private;
@@ -208,104 +155,6 @@ static void oaktrail_hdmi_audio_disable(struct drm_device *dev)HDMI_READ (HDMI_HCR ); } -void oaktrail_crtc_hdmi_dpms (struct drm_crtc *crtc,int mode) -{ -struct drm_device *dev = crtc->dev; -u32 temp; - -switch (mode) { -case DRM_MODE_DPMS_OFF : -/* Disable VGACNTRL */ -REG_WRITE (VGACNTRL ,0x80000000 ); - -/* Disable plane */ - temp =REG_READ (DSPBCNTR ); -if ((temp &DISPLAY_PLANE_ENABLE ) !=0 ) { -REG_WRITE (DSPBCNTR , temp & ~DISPLAY_PLANE_ENABLE ); -REG_READ (DSPBCNTR ); -/* Flush the plane changes */ -REG_WRITE (DSPBSURF ,REG_READ (DSPBSURF )); -REG_READ (DSPBSURF ); - } - -/* Disable pipe B */ - temp =REG_READ (PIPEBCONF ); -if ((temp &PIPEACONF_ENABLE ) !=0 ) { -REG_WRITE (PIPEBCONF , temp & ~PIPEACONF_ENABLE ); -REG_READ (PIPEBCONF ); - } - -/* Disable LNW Pipes, etc */ - temp =REG_READ (PCH_PIPEBCONF ); -if ((temp &PIPEACONF_ENABLE ) !=0 ) { -REG_WRITE (PCH_PIPEBCONF , temp & ~PIPEACONF_ENABLE ); -REG_READ (PCH_PIPEBCONF ); - } -/* wait for pipe off */ -udelay (150 ); -/* Disable dpll */ - temp =REG_READ (DPLL_CTRL ); -if ((temp &DPLL_PWRDN ) ==0 ) { -REG_WRITE (DPLL_CTRL , temp | (DPLL_PWRDN |DPLL_RESET )); -REG_WRITE (DPLL_STATUS ,0x1 ); - } -/* wait for dpll off */ -udelay (150 ); -break ; -case DRM_MODE_DPMS_ON : -case DRM_MODE_DPMS_STANDBY : -case DRM_MODE_DPMS_SUSPEND : -/* Enable dpll */ - temp =REG_READ (DPLL_CTRL ); -if ((temp &DPLL_PWRDN ) !=0 ) { -REG_WRITE (DPLL_CTRL , temp & ~(DPLL_PWRDN |DPLL_RESET )); - temp =REG_READ (DPLL_CLK_ENABLE ); -REG_WRITE (DPLL_CLK_ENABLE , temp |DPLL_EN_DISP |DPLL_SEL_HDMI |DPLL_EN_HDMI ); -REG_READ (DPLL_CLK_ENABLE ); - } -/* wait for dpll warm up */ -udelay (150 ); - -/* Enable pipe B */ - temp =REG_READ (PIPEBCONF ); -if ((temp &PIPEACONF_ENABLE ) ==0 ) { -REG_WRITE (PIPEBCONF , temp |PIPEACONF_ENABLE ); -REG_READ (PIPEBCONF ); - } - -/* Enable LNW Pipe B */ - temp =REG_READ (PCH_PIPEBCONF ); -if ((temp &PIPEACONF_ENABLE ) ==0 ) { -REG_WRITE (PCH_PIPEBCONF , temp |PIPEACONF_ENABLE ); -REG_READ (PCH_PIPEBCONF ); - } -wait_for_vblank (dev); - -/* Enable plane */ - temp =REG_READ (DSPBCNTR ); -if ((temp &DISPLAY_PLANE_ENABLE ) ==0 ) { -REG_WRITE (DSPBCNTR , temp |DISPLAY_PLANE_ENABLE ); -/* Flush the plane changes */ -REG_WRITE (DSPBSURF ,REG_READ (DSPBSURF )); -REG_READ (DSPBSURF ); - } -psb_intel_crtc_load_lut (crtc); - } -/* DSPARB */ -REG_WRITE (DSPARB ,0x00003fbf ); -/* FW1 */ -REG_WRITE (0x70034 ,0x3f880a0a ); -/* FW2 */ -REG_WRITE (0x70038 ,0x0b060808 ); -/* FW4 */ -REG_WRITE (0x70050 ,0x08030404 ); -/* FW5 */ -REG_WRITE (0x70054 ,0x04040404 ); -/* LNC Chicken Bits */ -REG_WRITE (0x70400 ,0x4000 ); -} - -static void oaktrail_hdmi_dpms (struct drm_encoder *encoder,int mode) {static int dpms_mode =-1 ;
@@ -327,182 +176,6 @@ static void oaktrail_hdmi_dpms(struct drm_encoder *encoder, int mode)HDMI_WRITE (HDMI_VIDEO_REG , temp); } -static unsigned int htotal_calculate (struct drm_display_mode *mode) -{ -u32 htotal, new_crtc_htotal; - - htotal = (mode->crtc_hdisplay -1 ) | ((mode->crtc_htotal -1 ) <<16 ); - -/* -* 1024 x 768 new_crtc_htotal = 0x1024; -* 1280 x 1024 new_crtc_htotal = 0x0c34; -*/ - new_crtc_htotal = (mode->crtc_htotal -1 ) *200 *1000 / mode->clock; - -return (mode->crtc_hdisplay -1 ) | (new_crtc_htotal <<16 ); -} - -static void oaktrail_hdmi_find_dpll (struct drm_crtc *crtc,int target, -int refclk,struct oaktrail_hdmi_clock *best_clock) -{ -int np_min, np_max, nr_min, nr_max; -int np, nr, nf; - - np_min =DIV_ROUND_UP (oaktrail_hdmi_limit.vco.min, target *10 ); - np_max = oaktrail_hdmi_limit.vco.max / (target *10 ); -if (np_min < oaktrail_hdmi_limit.np.min) - np_min = oaktrail_hdmi_limit.np.min; -if (np_max > oaktrail_hdmi_limit.np.max) - np_max = oaktrail_hdmi_limit.np.max; - - nr_min =DIV_ROUND_UP ((refclk *1000 ), (target *10 * np_max)); - nr_max =DIV_ROUND_UP ((refclk *1000 ), (target *10 * np_min)); -if (nr_min < oaktrail_hdmi_limit.nr.min) - nr_min = oaktrail_hdmi_limit.nr.min; -if (nr_max > oaktrail_hdmi_limit.nr.max) - nr_max = oaktrail_hdmi_limit.nr.max; - - np =DIV_ROUND_UP ((refclk *1000 ), (target *10 * nr_max)); - nr =DIV_ROUND_UP ((refclk *1000 ), (target *10 * np)); - nf =DIV_ROUND_CLOSEST ((target *10 * np * nr), refclk); -DRM_DEBUG_KMS ("np, nr, nf %d %d %d\n" , np, nr, nf); - -/* -* 1024 x 768 np = 1; nr = 0x26; nf = 0x0fd8000; -* 1280 x 1024 np = 1; nr = 0x17; nf = 0x1034000; -*/ - best_clock->np = np; - best_clock->nr = nr -1 ; - best_clock->nf = (nf <<14 ); -} - -int oaktrail_crtc_hdmi_mode_set (struct drm_crtc *crtc, -struct drm_display_mode *mode, -struct drm_display_mode *adjusted_mode, -int x,int y, -struct drm_framebuffer *old_fb) -{ -struct drm_device *dev = crtc->dev; -struct drm_psb_private *dev_priv = dev->dev_private; -struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; -int pipe =1 ; -int htot_reg = (pipe ==0 ) ?HTOTAL_A :HTOTAL_B ; -int hblank_reg = (pipe ==0 ) ?HBLANK_A :HBLANK_B ; -int hsync_reg = (pipe ==0 ) ?HSYNC_A :HSYNC_B ; -int vtot_reg = (pipe ==0 ) ?VTOTAL_A :VTOTAL_B ; -int vblank_reg = (pipe ==0 ) ?VBLANK_A :VBLANK_B ; -int vsync_reg = (pipe ==0 ) ?VSYNC_A :VSYNC_B ; -int dspsize_reg = (pipe ==0 ) ?DSPASIZE :DSPBSIZE ; -int dsppos_reg = (pipe ==0 ) ?DSPAPOS :DSPBPOS ; -int pipesrc_reg = (pipe ==0 ) ?PIPEASRC :PIPEBSRC ; -int pipeconf_reg = (pipe ==0 ) ?PIPEACONF :PIPEBCONF ; -int refclk; -struct oaktrail_hdmi_clock clock; -u32 dspcntr, pipeconf, dpll, temp; -int dspcntr_reg =DSPBCNTR ; - -/* Disable the VGA plane that we never use */ -REG_WRITE (VGACNTRL ,VGA_DISP_DISABLE ); - -/* XXX: Disable the panel fitter if it was on our pipe */ - -/* Disable dpll if necessary */ - dpll =REG_READ (DPLL_CTRL ); -if ((dpll &DPLL_PWRDN ) ==0 ) { -REG_WRITE (DPLL_CTRL , dpll | (DPLL_PWRDN |DPLL_RESET )); -REG_WRITE (DPLL_DIV_CTRL ,0x00000000 ); -REG_WRITE (DPLL_STATUS ,0x1 ); - } -udelay (150 ); - -/* reset controller: FIXME - can we sort out the ioremap mess ? */ -iounmap (hdmi_dev->regs); -oaktrail_hdmi_reset (dev); - -/* program and enable dpll */ - refclk =25000 ; -oaktrail_hdmi_find_dpll (crtc, adjusted_mode->clock, refclk, &clock); - -/* Setting DPLL */ - dpll =REG_READ (DPLL_CTRL ); - dpll &= ~DPLL_PDIV_MASK ; - dpll &= ~(DPLL_PWRDN |DPLL_RESET ); -REG_WRITE (DPLL_CTRL ,0x00000008 ); -REG_WRITE (DPLL_DIV_CTRL , ((clock.nf <<6 ) | clock.nr)); -REG_WRITE (DPLL_ADJUST , ((clock.nf >>14 ) -1 )); -REG_WRITE (DPLL_CTRL , (dpll | (clock.np <<DPLL_PDIV_SHIFT ) |DPLL_ENSTAT |DPLL_DITHEN )); -REG_WRITE (DPLL_UPDATE ,0x80000000 ); -REG_WRITE (DPLL_CLK_ENABLE ,0x80050102 ); -udelay (150 ); - - hdmi_dev->regs =ioremap (hdmi_dev->mmio, hdmi_dev->mmio_len); -if (hdmi_dev->regs ==NULL ) { -DRM_ERROR ("failed to do hdmi mmio mapping\n" ); -return -ENOMEM ; - } - -/* configure HDMI */ -HDMI_WRITE (0x1004 ,0x1fd ); -HDMI_WRITE (0x2000 ,0x1 ); -HDMI_WRITE (0x2008 ,0x0 ); -HDMI_WRITE (0x3130 ,0x8 ); -HDMI_WRITE (0x101c ,0x1800810 ); - - temp =htotal_calculate (adjusted_mode); -REG_WRITE (htot_reg, temp); -REG_WRITE (hblank_reg, (adjusted_mode->crtc_hblank_start -1 ) | ((adjusted_mode->crtc_hblank_end -1 ) <<16 )); -REG_WRITE (hsync_reg, (adjusted_mode->crtc_hsync_start -1 ) | ((adjusted_mode->crtc_hsync_end -1 ) <<16 )); -REG_WRITE (vtot_reg, (adjusted_mode->crtc_vdisplay -1 ) | ((adjusted_mode->crtc_vtotal -1 ) <<16 )); -REG_WRITE (vblank_reg, (adjusted_mode->crtc_vblank_start -1 ) | ((adjusted_mode->crtc_vblank_end -1 ) <<16 )); -REG_WRITE (vsync_reg, (adjusted_mode->crtc_vsync_start -1 ) | ((adjusted_mode->crtc_vsync_end -1 ) <<16 )); -REG_WRITE (pipesrc_reg, - ((mode->crtc_hdisplay -1 ) <<16 ) | (mode->crtc_vdisplay -1 )); - -REG_WRITE (PCH_HTOTAL_B , (adjusted_mode->crtc_hdisplay -1 ) | ((adjusted_mode->crtc_htotal -1 ) <<16 )); -REG_WRITE (PCH_HBLANK_B , (adjusted_mode->crtc_hblank_start -1 ) | ((adjusted_mode->crtc_hblank_end -1 ) <<16 )); -REG_WRITE (PCH_HSYNC_B , (adjusted_mode->crtc_hsync_start -1 ) | ((adjusted_mode->crtc_hsync_end -1 ) <<16 )); -REG_WRITE (PCH_VTOTAL_B , (adjusted_mode->crtc_vdisplay -1 ) | ((adjusted_mode->crtc_vtotal -1 ) <<16 )); -REG_WRITE (PCH_VBLANK_B , (adjusted_mode->crtc_vblank_start -1 ) | ((adjusted_mode->crtc_vblank_end -1 ) <<16 )); -REG_WRITE (PCH_VSYNC_B , (adjusted_mode->crtc_vsync_start -1 ) | ((adjusted_mode->crtc_vsync_end -1 ) <<16 )); -REG_WRITE (PCH_PIPEBSRC , - ((mode->crtc_hdisplay -1 ) <<16 ) | (mode->crtc_vdisplay -1 )); - - temp = adjusted_mode->crtc_hblank_end - adjusted_mode->crtc_hblank_start; -HDMI_WRITE (HDMI_HBLANK_A , ((adjusted_mode->crtc_hdisplay -1 ) <<16 ) | temp); - -REG_WRITE (dspsize_reg, - ((mode->vdisplay -1 ) <<16 ) | (mode->hdisplay -1 )); -REG_WRITE (dsppos_reg,0 ); - -/* Flush the plane changes */ - { -struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; - crtc_funcs->mode_set_base (crtc, x, y, old_fb); - } - -/* Set up the display plane register */ - dspcntr =REG_READ (dspcntr_reg); - dspcntr |=DISPPLANE_GAMMA_ENABLE ; - dspcntr |=DISPPLANE_SEL_PIPE_B ; - dspcntr |=DISPLAY_PLANE_ENABLE ; - -/* setup pipeconf */ - pipeconf =REG_READ (pipeconf_reg); - pipeconf |=PIPEACONF_ENABLE ; - -REG_WRITE (pipeconf_reg, pipeconf); -REG_READ (pipeconf_reg); - -REG_WRITE (PCH_PIPEBCONF , pipeconf); -REG_READ (PCH_PIPEBCONF ); -wait_for_vblank (dev); - -REG_WRITE (dspcntr_reg, dspcntr); -wait_for_vblank (dev); - -return 0 ; -} -static int oaktrail_hdmi_mode_valid (struct drm_connector *connector,struct drm_display_mode *mode) {
PATCH 39/47 gma500: oaktrail_hdmi: fix -Wmissing-field-initializers warning
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/oaktrail_hdmi.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/gma500/oaktrail_hdmi.c +1 -1
@@ -365,7 +365,7 @@ failed_connector:static DEFINE_PCI_DEVICE_TABLE (hdmi_ids) = { {PCI_DEVICE (PCI_VENDOR_ID_INTEL ,0x080d ) }, - {} + {0 } };void oaktrail_hdmi_setup (struct drm_device *dev)
PATCH 40/47 gma500: mark oaktrail_backlight_init() as static
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/oaktrail_device.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/gma500/oaktrail_device.c +1 -1
@@ -141,7 +141,7 @@ static const struct backlight_ops oaktrail_ops = { .update_status = oaktrail_set_brightness, }; -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;int ret;
PATCH 41/47 gma500: oaktrail_hdmi_i2c_access() drop unused variable
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c +3 -3
@@ -127,7 +127,7 @@ static int oaktrail_hdmi_i2c_access(struct i2c_adapter *adap, {struct oaktrail_hdmi_dev *hdmi_dev =i2c_get_adapdata (adap);struct hdmi_i2c_dev *i2c_dev = hdmi_dev->i2c_dev; -int i, err =0 ; +int i;mutex_lock (&i2c_dev->i2c_lock);
@@ -139,9 +139,9 @@ static int oaktrail_hdmi_i2c_access(struct i2c_adapter *adap,for (i =0 ; i < num; i++) {if (pmsg->len && pmsg->buf) {if (pmsg->flags &I2C_M_RD ) - err =xfer_read (adap, pmsg); +xfer_read (adap, pmsg);else - err =xfer_write (adap, pmsg); +xfer_write (adap, pmsg); } pmsg++;/* next message */ }
PATCH 42/47 gma500: oaktrail_lvds_init() drop unused variable
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/oaktrail_lvds.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/gpu/drm/gma500/oaktrail_lvds.c +1 -2
@@ -331,7 +331,6 @@ void oaktrail_lvds_init(struct drm_device *dev,struct drm_encoder *encoder;struct drm_psb_private *dev_priv = dev->dev_private;struct edid *edid; -int ret =0 ;struct i2c_adapter *i2c_adap;struct drm_display_mode *scan;/* *modes, *bios_mode; */
@@ -400,7 +399,7 @@ void oaktrail_lvds_init(struct drm_device *dev,if (edid) {drm_mode_connector_update_edid_property (connector, edid); - ret =drm_add_edid_modes (connector, edid); +drm_add_edid_modes (connector, edid);kfree (edid); }
PATCH 43/47 gma500: drop unused psb_intel_modeset_cleanup()
In reply to Alan CoxFrom: \"Kirill A. Shutemov\" <[email protected]>
---
drivers/gpu/drm/gma500/psb_intel_display.c | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-)
drivers/gpu/drm/gma500/psb_intel_display.c +0 -7
@@ -1425,13 +1425,6 @@ int psb_intel_connector_clones(struct drm_device *dev, int type_mask)return index_mask; } - -void psb_intel_modeset_cleanup (struct drm_device *dev) -{ -drm_mode_config_cleanup (dev); -} - -/* current intel driver doesn't take advantage of encoders always give back the encoder for the connector */
PATCH 44/47 gma500: mark psb_intel_pipe_set_base() as static
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/psb_intel_display.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/gma500/psb_intel_display.c +1 -1
@@ -333,7 +333,7 @@ void psb_intel_wait_for_vblank(struct drm_device *dev)mdelay (20 ); } -int psb_intel_pipe_set_base (struct drm_crtc *crtc, +static int psb_intel_pipe_set_base (struct drm_crtc *crtc,int x,int y,struct drm_framebuffer *old_fb) {struct drm_device *dev = crtc->dev;
PATCH 45/47 gma500: psb_intel_display: drop unused variables
In reply to Alan CoxFrom: \"Kirill A. Shutemov\" <[email protected]>
---
drivers/gpu/drm/gma500/psb_intel_display.c | 13 ++----------- 1 files changed, 2 insertions(+), 11 deletions(-)
drivers/gpu/drm/gma500/psb_intel_display.c +2 -11
@@ -433,7 +433,6 @@ static void psb_intel_crtc_dpms(struct drm_crtc *crtc, int mode)int dspbase_reg = (pipe ==0 ) ?DSPABASE :DSPBBASE ;int pipeconf_reg = (pipe ==0 ) ?PIPEACONF :PIPEBCONF ;u32 temp; -bool enabled;/* XXX: When our outputs are all unaware of DPMS modes other than off * and on, we should map those modes to DRM_MODE_DPMS_OFF in the CRTC.
@@ -518,8 +517,6 @@ static void psb_intel_crtc_dpms(struct drm_crtc *crtc, int mode)break ; } - enabled = crtc->enabled && mode !=DRM_MODE_DPMS_OFF ; -/*Set FIFO Watermarks*/ REG_WRITE (DSPARB ,0x3F3E ); }
@@ -611,8 +608,8 @@ static int psb_intel_crtc_mode_set(struct drm_crtc *crtc,int refclk;struct psb_intel_clock_t clock;u32 dpll =0 , fp =0 , dspcntr, pipeconf; -bool ok, is_sdvo = false, is_dvo = false; -bool is_crt = false, is_lvds = false, is_tv = false; +bool ok, is_sdvo = false; +bool is_lvds = false, is_tv = false;struct drm_mode_config *mode_config = &dev->mode_config;struct drm_connector *connector;
@@ -637,15 +634,9 @@ static int psb_intel_crtc_mode_set(struct drm_crtc *crtc,case INTEL_OUTPUT_SDVO : is_sdvo = true;break ; -case INTEL_OUTPUT_DVO : - is_dvo = true; -break ;case INTEL_OUTPUT_TVOUT : is_tv = true;break ; -case INTEL_OUTPUT_ANALOG : - is_crt = true; -break ; } }
PATCH 46/47 gma500: mark psb_intel_sdvo_hdmi_sink_detect() as static
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/psb_intel_sdvo.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/gma500/psb_intel_sdvo.c +1 -1
@@ -1301,7 +1301,7 @@ psb_intel_sdvo_get_analog_edid(struct drm_connector *connector)return NULL ; } -enum drm_connector_status +static enum drm_connector_status psb_intel_sdvo_hdmi_sink_detect (struct drm_connector *connector) {struct psb_intel_sdvo *psb_intel_sdvo =intel_attached_sdvo (connector);
PATCH 47/47 gma500: psb_irq: mark mid_{enable, disable}_pipe_event() as static
In reply to Alan CoxFrom: Kirill A. Shutemov <[email protected]>
---
drivers/gpu/drm/gma500/psb_irq.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/gma500/psb_irq.c +2 -2
@@ -115,7 +115,7 @@ psb_disable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask) } } -void mid_enable_pipe_event (struct drm_psb_private *dev_priv,int pipe) +static void mid_enable_pipe_event (struct drm_psb_private *dev_priv,int pipe) {if (gma_power_begin (dev_priv->dev, false)) {u32 pipe_event =mid_pipe_event (pipe);
@@ -126,7 +126,7 @@ void mid_enable_pipe_event(struct drm_psb_private *dev_priv, int pipe) } } -void mid_disable_pipe_event (struct drm_psb_private *dev_priv,int pipe) +static void mid_disable_pipe_event (struct drm_psb_private *dev_priv,int pipe) {if (dev_priv->pipestat[pipe] ==0 ) {if (gma_power_begin (dev_priv->dev, false)) {