drm/i915: Fix module initialisation, v2.
The driver doesn't support UMS any more, so set DRIVER_MODESET by default, remove the legacy s/r callbacks, and rename the s/r functions to make it more clear they're only in use by switcheroo now. Also remove an obsolete comment about atomic. Normal updates are supported only async updates aren't yet. v2: Don't unconditionally set DRIVER_ATOMIC, we're not yet there. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
02e93c3537
commit
1751fcf9f9
|
@ -364,12 +364,12 @@ static void i915_switcheroo_set_state(struct pci_dev *pdev, enum vga_switcheroo_
|
||||||
dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
|
dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
|
||||||
/* i915 resume handler doesn't set to D0 */
|
/* i915 resume handler doesn't set to D0 */
|
||||||
pci_set_power_state(dev->pdev, PCI_D0);
|
pci_set_power_state(dev->pdev, PCI_D0);
|
||||||
i915_resume_legacy(dev);
|
i915_resume_switcheroo(dev);
|
||||||
dev->switch_power_state = DRM_SWITCH_POWER_ON;
|
dev->switch_power_state = DRM_SWITCH_POWER_ON;
|
||||||
} else {
|
} else {
|
||||||
pr_err("switched off\n");
|
pr_err("switched off\n");
|
||||||
dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
|
dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
|
||||||
i915_suspend_legacy(dev, pmm);
|
i915_suspend_switcheroo(dev, pmm);
|
||||||
dev->switch_power_state = DRM_SWITCH_POWER_OFF;
|
dev->switch_power_state = DRM_SWITCH_POWER_OFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -679,7 +679,7 @@ static int i915_drm_suspend_late(struct drm_device *drm_dev, bool hibernation)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int i915_suspend_legacy(struct drm_device *dev, pm_message_t state)
|
int i915_suspend_switcheroo(struct drm_device *dev, pm_message_t state)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
|
@ -812,7 +812,7 @@ static int i915_drm_resume_early(struct drm_device *dev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int i915_resume_legacy(struct drm_device *dev)
|
int i915_resume_switcheroo(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -1649,7 +1649,7 @@ static struct drm_driver driver = {
|
||||||
*/
|
*/
|
||||||
.driver_features =
|
.driver_features =
|
||||||
DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM | DRIVER_PRIME |
|
DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM | DRIVER_PRIME |
|
||||||
DRIVER_RENDER,
|
DRIVER_RENDER | DRIVER_MODESET,
|
||||||
.load = i915_driver_load,
|
.load = i915_driver_load,
|
||||||
.unload = i915_driver_unload,
|
.unload = i915_driver_unload,
|
||||||
.open = i915_driver_open,
|
.open = i915_driver_open,
|
||||||
|
@ -1658,10 +1658,6 @@ static struct drm_driver driver = {
|
||||||
.postclose = i915_driver_postclose,
|
.postclose = i915_driver_postclose,
|
||||||
.set_busid = drm_pci_set_busid,
|
.set_busid = drm_pci_set_busid,
|
||||||
|
|
||||||
/* Used in place of i915_pm_ops for non-DRIVER_MODESET */
|
|
||||||
.suspend = i915_suspend_legacy,
|
|
||||||
.resume = i915_resume_legacy,
|
|
||||||
|
|
||||||
#if defined(CONFIG_DEBUG_FS)
|
#if defined(CONFIG_DEBUG_FS)
|
||||||
.debugfs_init = i915_debugfs_init,
|
.debugfs_init = i915_debugfs_init,
|
||||||
.debugfs_cleanup = i915_debugfs_cleanup,
|
.debugfs_cleanup = i915_debugfs_cleanup,
|
||||||
|
@ -1704,7 +1700,6 @@ static int __init i915_init(void)
|
||||||
* either the i915.modeset prarameter or by the
|
* either the i915.modeset prarameter or by the
|
||||||
* vga_text_mode_force boot option.
|
* vga_text_mode_force boot option.
|
||||||
*/
|
*/
|
||||||
driver.driver_features |= DRIVER_MODESET;
|
|
||||||
|
|
||||||
if (i915.modeset == 0)
|
if (i915.modeset == 0)
|
||||||
driver.driver_features &= ~DRIVER_MODESET;
|
driver.driver_features &= ~DRIVER_MODESET;
|
||||||
|
@ -1715,17 +1710,11 @@ static int __init i915_init(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!(driver.driver_features & DRIVER_MODESET)) {
|
if (!(driver.driver_features & DRIVER_MODESET)) {
|
||||||
driver.get_vblank_timestamp = NULL;
|
|
||||||
/* Silently fail loading to not upset userspace. */
|
/* Silently fail loading to not upset userspace. */
|
||||||
DRM_DEBUG_DRIVER("KMS and UMS disabled.\n");
|
DRM_DEBUG_DRIVER("KMS and UMS disabled.\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* FIXME: Note that we're lying to the DRM core here so that we can get access
|
|
||||||
* to the atomic ioctl and the atomic properties. Only plane operations on
|
|
||||||
* a single CRTC will actually work.
|
|
||||||
*/
|
|
||||||
if (i915.nuclear_pageflip)
|
if (i915.nuclear_pageflip)
|
||||||
driver.driver_features |= DRIVER_ATOMIC;
|
driver.driver_features |= DRIVER_ATOMIC;
|
||||||
|
|
||||||
|
|
|
@ -2606,8 +2606,8 @@ struct drm_i915_cmd_table {
|
||||||
extern const struct drm_ioctl_desc i915_ioctls[];
|
extern const struct drm_ioctl_desc i915_ioctls[];
|
||||||
extern int i915_max_ioctl;
|
extern int i915_max_ioctl;
|
||||||
|
|
||||||
extern int i915_suspend_legacy(struct drm_device *dev, pm_message_t state);
|
extern int i915_suspend_switcheroo(struct drm_device *dev, pm_message_t state);
|
||||||
extern int i915_resume_legacy(struct drm_device *dev);
|
extern int i915_resume_switcheroo(struct drm_device *dev);
|
||||||
|
|
||||||
/* i915_params.c */
|
/* i915_params.c */
|
||||||
struct i915_params {
|
struct i915_params {
|
||||||
|
|
Loading…
Reference in New Issue