diff --git a/drivers/staging/gma500/framebuffer.c b/drivers/staging/gma500/framebuffer.c index d890a5091cd29436438527039c6b1d64b277965d..ebfde13ec18fe7a39bbbad173a913297e07cbd6d 100644 --- a/drivers/staging/gma500/framebuffer.c +++ b/drivers/staging/gma500/framebuffer.c @@ -578,7 +578,7 @@ int psb_fbdev_init(struct drm_device *dev) dev_priv->fbdev = fbdev; fbdev->psb_fb_helper.funcs = &psb_fb_helper_funcs; - drm_fb_helper_init(dev, &fbdev->psb_fb_helper, 2, + drm_fb_helper_init(dev, &fbdev->psb_fb_helper, dev_priv->ops->crtcs, INTELFB_CONN_LIMIT); drm_fb_helper_single_add_all_connectors(&fbdev->psb_fb_helper); diff --git a/drivers/staging/gma500/mdfld_device.c b/drivers/staging/gma500/mdfld_device.c index f258b0620a9d7985606d17708a4b2021f3d26d5e..f47aeb7a203942a3097868ccf65b52cda572c29e 100644 --- a/drivers/staging/gma500/mdfld_device.c +++ b/drivers/staging/gma500/mdfld_device.c @@ -691,6 +691,7 @@ const struct psb_ops mdfld_chip_ops = { .name = "Medfield", .accel_2d = 0, .pipes = 3, + .crtcs = 2, .sgx_offset = MRST_SGX_OFFSET, .chip_setup = mid_chip_setup, diff --git a/drivers/staging/gma500/mrst_device.c b/drivers/staging/gma500/mrst_device.c index 436580d02ef7b567b81039c930386db38a8d8a6a..3d525a032135bc88e8200ca7a3db4e69fc9b1fda 100644 --- a/drivers/staging/gma500/mrst_device.c +++ b/drivers/staging/gma500/mrst_device.c @@ -24,9 +24,12 @@ #include "psb_drv.h" #include "psb_reg.h" #include "psb_intel_reg.h" +#include #include #include "mid_bios.h" +static const struct psb_ops oaktrail_chip_ops; + /* IPC message and command defines used to enable/disable mipi panel voltages */ #define IPC_MSG_PANEL_ON_OFF 0xE9 #define IPC_CMD_PANEL_ON 1 @@ -352,10 +355,48 @@ static int mrst_power_up(struct drm_device *dev) return 0; } +static int mrst_chip_setup(struct drm_device *dev) +{ + struct drm_psb_private *dev_priv = dev->dev_private; + +#if defined(CONFIG_X86_MRST) + if (mrst_identify_cpu()) + return mid_chip_setup(dev); +#endif + dev_priv->ops = &oaktrail_chip_ops; + /* Check - may be better to go via BIOS paths ? */ + return mid_chip_setup(dev); +} + const struct psb_ops mrst_chip_ops = { .name = "Moorestown", .accel_2d = 1, .pipes = 1, + .crtcs = 1, + .sgx_offset = MRST_SGX_OFFSET, + + .chip_setup = mrst_chip_setup, + .crtc_helper = &mrst_helper_funcs, + .crtc_funcs = &psb_intel_crtc_funcs, + + .output_init = mrst_output_init, + +#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE + .backlight_init = mrst_backlight_init, +#endif + + .init_pm = mrst_init_pm, + .save_regs = mrst_save_display_registers, + .restore_regs = mrst_restore_display_registers, + .power_down = mrst_power_down, + .power_up = mrst_power_up, +}; + +static const struct psb_ops oaktrail_chip_ops = { + .name = "Oaktrail", + .accel_2d = 1, + .pipes = 2, + .crtcs = 2, .sgx_offset = MRST_SGX_OFFSET, .chip_setup = mid_chip_setup, diff --git a/drivers/staging/gma500/psb_device.c b/drivers/staging/gma500/psb_device.c index 1e117f0f209828d065fe220ae5990ef65f622657..46591323595a8e0c2303a666407b20c14b06dc30 100644 --- a/drivers/staging/gma500/psb_device.c +++ b/drivers/staging/gma500/psb_device.c @@ -331,6 +331,7 @@ const struct psb_ops psb_chip_ops = { .name = "Poulsbo", .accel_2d = 1, .pipes = 2, + .crtcs = 2, .sgx_offset = PSB_SGX_OFFSET, .chip_setup = psb_chip_setup, diff --git a/drivers/staging/gma500/psb_drv.h b/drivers/staging/gma500/psb_drv.h index daf3ca5e6517364ab5dd138d7c0988d54b7f9b0a..8184c2349d148a2fd3812783e3aa1deaac0de33d 100644 --- a/drivers/staging/gma500/psb_drv.h +++ b/drivers/staging/gma500/psb_drv.h @@ -622,6 +622,7 @@ struct psb_ops { const char *name; unsigned int accel_2d:1; int pipes; /* Number of output pipes */ + int crtcs; /* Number of CRTCs */ int sgx_offset; /* Base offset of SGX device */ /* Sub functions */