diff options
Diffstat (limited to 'drivers/gpu/drm')
| -rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_fb_helper.c | 8 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_fops.c | 6 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_crt.c | 40 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/mgag200/mgag200_mode.c | 13 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/bios/base.c | 17 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_abi16.c | 18 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.c | 32 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.h | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nv50_display.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_bios.c | 26 | ||||
| -rw-r--r-- | drivers/gpu/drm/udl/udl_connector.c | 4 |
14 files changed, 112 insertions, 63 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 792c3e3795ca..dd64a06dc5b4 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
| @@ -2326,7 +2326,6 @@ int drm_mode_addfb(struct drm_device *dev, | |||
| 2326 | fb = dev->mode_config.funcs->fb_create(dev, file_priv, &r); | 2326 | fb = dev->mode_config.funcs->fb_create(dev, file_priv, &r); |
| 2327 | if (IS_ERR(fb)) { | 2327 | if (IS_ERR(fb)) { |
| 2328 | DRM_DEBUG_KMS("could not create framebuffer\n"); | 2328 | DRM_DEBUG_KMS("could not create framebuffer\n"); |
| 2329 | drm_modeset_unlock_all(dev); | ||
| 2330 | return PTR_ERR(fb); | 2329 | return PTR_ERR(fb); |
| 2331 | } | 2330 | } |
| 2332 | 2331 | ||
| @@ -2506,7 +2505,6 @@ int drm_mode_addfb2(struct drm_device *dev, | |||
| 2506 | fb = dev->mode_config.funcs->fb_create(dev, file_priv, r); | 2505 | fb = dev->mode_config.funcs->fb_create(dev, file_priv, r); |
| 2507 | if (IS_ERR(fb)) { | 2506 | if (IS_ERR(fb)) { |
| 2508 | DRM_DEBUG_KMS("could not create framebuffer\n"); | 2507 | DRM_DEBUG_KMS("could not create framebuffer\n"); |
| 2509 | drm_modeset_unlock_all(dev); | ||
| 2510 | return PTR_ERR(fb); | 2508 | return PTR_ERR(fb); |
| 2511 | } | 2509 | } |
| 2512 | 2510 | ||
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 59d6b9bf204b..892ff9f95975 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c | |||
| @@ -1544,10 +1544,10 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) | |||
| 1544 | if (!fb_helper->fb) | 1544 | if (!fb_helper->fb) |
| 1545 | return 0; | 1545 | return 0; |
| 1546 | 1546 | ||
| 1547 | drm_modeset_lock_all(dev); | 1547 | mutex_lock(&fb_helper->dev->mode_config.mutex); |
| 1548 | if (!drm_fb_helper_is_bound(fb_helper)) { | 1548 | if (!drm_fb_helper_is_bound(fb_helper)) { |
| 1549 | fb_helper->delayed_hotplug = true; | 1549 | fb_helper->delayed_hotplug = true; |
| 1550 | drm_modeset_unlock_all(dev); | 1550 | mutex_unlock(&fb_helper->dev->mode_config.mutex); |
| 1551 | return 0; | 1551 | return 0; |
| 1552 | } | 1552 | } |
| 1553 | DRM_DEBUG_KMS("\n"); | 1553 | DRM_DEBUG_KMS("\n"); |
| @@ -1558,9 +1558,11 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) | |||
| 1558 | 1558 | ||
| 1559 | count = drm_fb_helper_probe_connector_modes(fb_helper, max_width, | 1559 | count = drm_fb_helper_probe_connector_modes(fb_helper, max_width, |
| 1560 | max_height); | 1560 | max_height); |
| 1561 | mutex_unlock(&fb_helper->dev->mode_config.mutex); | ||
| 1562 | |||
| 1563 | drm_modeset_lock_all(dev); | ||
| 1561 | drm_setup_crtcs(fb_helper); | 1564 | drm_setup_crtcs(fb_helper); |
| 1562 | drm_modeset_unlock_all(dev); | 1565 | drm_modeset_unlock_all(dev); |
| 1563 | |||
| 1564 | drm_fb_helper_set_par(fb_helper->fbdev); | 1566 | drm_fb_helper_set_par(fb_helper->fbdev); |
| 1565 | 1567 | ||
| 1566 | return 0; | 1568 | return 0; |
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 13fdcd10a605..429e07d0b0f1 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c | |||
| @@ -123,6 +123,7 @@ int drm_open(struct inode *inode, struct file *filp) | |||
| 123 | int retcode = 0; | 123 | int retcode = 0; |
| 124 | int need_setup = 0; | 124 | int need_setup = 0; |
| 125 | struct address_space *old_mapping; | 125 | struct address_space *old_mapping; |
| 126 | struct address_space *old_imapping; | ||
| 126 | 127 | ||
| 127 | minor = idr_find(&drm_minors_idr, minor_id); | 128 | minor = idr_find(&drm_minors_idr, minor_id); |
| 128 | if (!minor) | 129 | if (!minor) |
| @@ -137,6 +138,7 @@ int drm_open(struct inode *inode, struct file *filp) | |||
| 137 | if (!dev->open_count++) | 138 | if (!dev->open_count++) |
| 138 | need_setup = 1; | 139 | need_setup = 1; |
| 139 | mutex_lock(&dev->struct_mutex); | 140 | mutex_lock(&dev->struct_mutex); |
| 141 | old_imapping = inode->i_mapping; | ||
| 140 | old_mapping = dev->dev_mapping; | 142 | old_mapping = dev->dev_mapping; |
| 141 | if (old_mapping == NULL) | 143 | if (old_mapping == NULL) |
| 142 | dev->dev_mapping = &inode->i_data; | 144 | dev->dev_mapping = &inode->i_data; |
| @@ -159,8 +161,8 @@ int drm_open(struct inode *inode, struct file *filp) | |||
| 159 | 161 | ||
| 160 | err_undo: | 162 | err_undo: |
| 161 | mutex_lock(&dev->struct_mutex); | 163 | mutex_lock(&dev->struct_mutex); |
| 162 | filp->f_mapping = old_mapping; | 164 | filp->f_mapping = old_imapping; |
| 163 | inode->i_mapping = old_mapping; | 165 | inode->i_mapping = old_imapping; |
| 164 | iput(container_of(dev->dev_mapping, struct inode, i_data)); | 166 | iput(container_of(dev->dev_mapping, struct inode, i_data)); |
| 165 | dev->dev_mapping = old_mapping; | 167 | dev->dev_mapping = old_mapping; |
| 166 | mutex_unlock(&dev->struct_mutex); | 168 | mutex_unlock(&dev->struct_mutex); |
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 3b11ab0fbc96..9a48e1a2d417 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
| @@ -57,7 +57,7 @@ eb_create(struct drm_i915_gem_execbuffer2 *args) | |||
| 57 | if (eb == NULL) { | 57 | if (eb == NULL) { |
| 58 | int size = args->buffer_count; | 58 | int size = args->buffer_count; |
| 59 | int count = PAGE_SIZE / sizeof(struct hlist_head) / 2; | 59 | int count = PAGE_SIZE / sizeof(struct hlist_head) / 2; |
| 60 | BUILD_BUG_ON(!is_power_of_2(PAGE_SIZE / sizeof(struct hlist_head))); | 60 | BUILD_BUG_ON_NOT_POWER_OF_2(PAGE_SIZE / sizeof(struct hlist_head)); |
| 61 | while (count > 2*size) | 61 | while (count > 2*size) |
| 62 | count >>= 1; | 62 | count >>= 1; |
| 63 | eb = kzalloc(count*sizeof(struct hlist_head) + | 63 | eb = kzalloc(count*sizeof(struct hlist_head) + |
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 32a3693905ec..1ce45a0a2d3e 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
| @@ -45,6 +45,9 @@ | |||
| 45 | 45 | ||
| 46 | struct intel_crt { | 46 | struct intel_crt { |
| 47 | struct intel_encoder base; | 47 | struct intel_encoder base; |
| 48 | /* DPMS state is stored in the connector, which we need in the | ||
| 49 | * encoder's enable/disable callbacks */ | ||
| 50 | struct intel_connector *connector; | ||
| 48 | bool force_hotplug_required; | 51 | bool force_hotplug_required; |
| 49 | u32 adpa_reg; | 52 | u32 adpa_reg; |
| 50 | }; | 53 | }; |
| @@ -81,29 +84,6 @@ static bool intel_crt_get_hw_state(struct intel_encoder *encoder, | |||
| 81 | return true; | 84 | return true; |
| 82 | } | 85 | } |
| 83 | 86 | ||
| 84 | static void intel_disable_crt(struct intel_encoder *encoder) | ||
| 85 | { | ||
| 86 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; | ||
| 87 | struct intel_crt *crt = intel_encoder_to_crt(encoder); | ||
| 88 | u32 temp; | ||
| 89 | |||
| 90 | temp = I915_READ(crt->adpa_reg); | ||
| 91 | temp |= ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE; | ||
| 92 | temp &= ~ADPA_DAC_ENABLE; | ||
| 93 | I915_WRITE(crt->adpa_reg, temp); | ||
| 94 | } | ||
| 95 | |||
| 96 | static void intel_enable_crt(struct intel_encoder *encoder) | ||
| 97 | { | ||
| 98 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; | ||
| 99 | struct intel_crt *crt = intel_encoder_to_crt(encoder); | ||
| 100 | u32 temp; | ||
| 101 | |||
| 102 | temp = I915_READ(crt->adpa_reg); | ||
| 103 | temp |= ADPA_DAC_ENABLE; | ||
| 104 | I915_WRITE(crt->adpa_reg, temp); | ||
| 105 | } | ||
| 106 | |||
| 107 | /* Note: The caller is required to filter out dpms modes not supported by the | 87 | /* Note: The caller is required to filter out dpms modes not supported by the |
| 108 | * platform. */ | 88 | * platform. */ |
| 109 | static void intel_crt_set_dpms(struct intel_encoder *encoder, int mode) | 89 | static void intel_crt_set_dpms(struct intel_encoder *encoder, int mode) |
| @@ -135,6 +115,19 @@ static void intel_crt_set_dpms(struct intel_encoder *encoder, int mode) | |||
| 135 | I915_WRITE(crt->adpa_reg, temp); | 115 | I915_WRITE(crt->adpa_reg, temp); |
| 136 | } | 116 | } |
| 137 | 117 | ||
| 118 | static void intel_disable_crt(struct intel_encoder *encoder) | ||
| 119 | { | ||
| 120 | intel_crt_set_dpms(encoder, DRM_MODE_DPMS_OFF); | ||
| 121 | } | ||
| 122 | |||
| 123 | static void intel_enable_crt(struct intel_encoder *encoder) | ||
| 124 | { | ||
| 125 | struct intel_crt *crt = intel_encoder_to_crt(encoder); | ||
| 126 | |||
| 127 | intel_crt_set_dpms(encoder, crt->connector->base.dpms); | ||
| 128 | } | ||
| 129 | |||
| 130 | |||
| 138 | static void intel_crt_dpms(struct drm_connector *connector, int mode) | 131 | static void intel_crt_dpms(struct drm_connector *connector, int mode) |
| 139 | { | 132 | { |
| 140 | struct drm_device *dev = connector->dev; | 133 | struct drm_device *dev = connector->dev; |
| @@ -746,6 +739,7 @@ void intel_crt_init(struct drm_device *dev) | |||
| 746 | } | 739 | } |
| 747 | 740 | ||
| 748 | connector = &intel_connector->base; | 741 | connector = &intel_connector->base; |
| 742 | crt->connector = intel_connector; | ||
| 749 | drm_connector_init(dev, &intel_connector->base, | 743 | drm_connector_init(dev, &intel_connector->base, |
| 750 | &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA); | 744 | &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA); |
| 751 | 745 | ||
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index d7d4afe01341..8fc93f90a7cd 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
| @@ -2559,12 +2559,15 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder) | |||
| 2559 | { | 2559 | { |
| 2560 | struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder); | 2560 | struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder); |
| 2561 | struct intel_dp *intel_dp = &intel_dig_port->dp; | 2561 | struct intel_dp *intel_dp = &intel_dig_port->dp; |
| 2562 | struct drm_device *dev = intel_dp_to_dev(intel_dp); | ||
| 2562 | 2563 | ||
| 2563 | i2c_del_adapter(&intel_dp->adapter); | 2564 | i2c_del_adapter(&intel_dp->adapter); |
| 2564 | drm_encoder_cleanup(encoder); | 2565 | drm_encoder_cleanup(encoder); |
| 2565 | if (is_edp(intel_dp)) { | 2566 | if (is_edp(intel_dp)) { |
| 2566 | cancel_delayed_work_sync(&intel_dp->panel_vdd_work); | 2567 | cancel_delayed_work_sync(&intel_dp->panel_vdd_work); |
| 2568 | mutex_lock(&dev->mode_config.mutex); | ||
| 2567 | ironlake_panel_vdd_off_sync(intel_dp); | 2569 | ironlake_panel_vdd_off_sync(intel_dp); |
| 2570 | mutex_unlock(&dev->mode_config.mutex); | ||
| 2568 | } | 2571 | } |
| 2569 | kfree(intel_dig_port); | 2572 | kfree(intel_dig_port); |
| 2570 | } | 2573 | } |
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index fe22bb780e1d..78d8e919509f 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c | |||
| @@ -751,8 +751,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, | |||
| 751 | int i; | 751 | int i; |
| 752 | unsigned char misc = 0; | 752 | unsigned char misc = 0; |
| 753 | unsigned char ext_vga[6]; | 753 | unsigned char ext_vga[6]; |
| 754 | unsigned char ext_vga_index24; | ||
| 755 | unsigned char dac_index90 = 0; | ||
| 756 | u8 bppshift; | 754 | u8 bppshift; |
| 757 | 755 | ||
| 758 | static unsigned char dacvalue[] = { | 756 | static unsigned char dacvalue[] = { |
| @@ -803,7 +801,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, | |||
| 803 | option2 = 0x0000b000; | 801 | option2 = 0x0000b000; |
| 804 | break; | 802 | break; |
| 805 | case G200_ER: | 803 | case G200_ER: |
| 806 | dac_index90 = 0; | ||
| 807 | break; | 804 | break; |
| 808 | } | 805 | } |
| 809 | 806 | ||
| @@ -852,10 +849,8 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, | |||
| 852 | WREG_DAC(i, dacvalue[i]); | 849 | WREG_DAC(i, dacvalue[i]); |
| 853 | } | 850 | } |
| 854 | 851 | ||
| 855 | if (mdev->type == G200_ER) { | 852 | if (mdev->type == G200_ER) |
| 856 | WREG_DAC(0x90, dac_index90); | 853 | WREG_DAC(0x90, 0); |
| 857 | } | ||
| 858 | |||
| 859 | 854 | ||
| 860 | if (option) | 855 | if (option) |
| 861 | pci_write_config_dword(dev->pdev, PCI_MGA_OPTION, option); | 856 | pci_write_config_dword(dev->pdev, PCI_MGA_OPTION, option); |
| @@ -952,8 +947,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, | |||
| 952 | if (mdev->type == G200_WB) | 947 | if (mdev->type == G200_WB) |
| 953 | ext_vga[1] |= 0x88; | 948 | ext_vga[1] |= 0x88; |
| 954 | 949 | ||
| 955 | ext_vga_index24 = 0x05; | ||
| 956 | |||
| 957 | /* Set pixel clocks */ | 950 | /* Set pixel clocks */ |
| 958 | misc = 0x2d; | 951 | misc = 0x2d; |
| 959 | WREG8(MGA_MISC_OUT, misc); | 952 | WREG8(MGA_MISC_OUT, misc); |
| @@ -965,7 +958,7 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, | |||
| 965 | } | 958 | } |
| 966 | 959 | ||
| 967 | if (mdev->type == G200_ER) | 960 | if (mdev->type == G200_ER) |
| 968 | WREG_ECRT(24, ext_vga_index24); | 961 | WREG_ECRT(0x24, 0x5); |
| 969 | 962 | ||
| 970 | if (mdev->type == G200_EV) { | 963 | if (mdev->type == G200_EV) { |
| 971 | WREG_ECRT(6, 0); | 964 | WREG_ECRT(6, 0); |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c index e816f06637a7..0e2c1a4f1659 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c | |||
| @@ -248,6 +248,22 @@ nouveau_bios_shadow_pci(struct nouveau_bios *bios) | |||
| 248 | } | 248 | } |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | static void | ||
| 252 | nouveau_bios_shadow_platform(struct nouveau_bios *bios) | ||
| 253 | { | ||
| 254 | struct pci_dev *pdev = nv_device(bios)->pdev; | ||
| 255 | size_t size; | ||
| 256 | |||
| 257 | void __iomem *rom = pci_platform_rom(pdev, &size); | ||
| 258 | if (rom && size) { | ||
| 259 | bios->data = kmalloc(size, GFP_KERNEL); | ||
| 260 | if (bios->data) { | ||
| 261 | memcpy_fromio(bios->data, rom, size); | ||
| 262 | bios->size = size; | ||
| 263 | } | ||
| 264 | } | ||
| 265 | } | ||
| 266 | |||
| 251 | static int | 267 | static int |
| 252 | nouveau_bios_score(struct nouveau_bios *bios, const bool writeable) | 268 | nouveau_bios_score(struct nouveau_bios *bios, const bool writeable) |
| 253 | { | 269 | { |
| @@ -288,6 +304,7 @@ nouveau_bios_shadow(struct nouveau_bios *bios) | |||
| 288 | { "PROM", nouveau_bios_shadow_prom, false, 0, 0, NULL }, | 304 | { "PROM", nouveau_bios_shadow_prom, false, 0, 0, NULL }, |
| 289 | { "ACPI", nouveau_bios_shadow_acpi, true, 0, 0, NULL }, | 305 | { "ACPI", nouveau_bios_shadow_acpi, true, 0, 0, NULL }, |
| 290 | { "PCIROM", nouveau_bios_shadow_pci, true, 0, 0, NULL }, | 306 | { "PCIROM", nouveau_bios_shadow_pci, true, 0, 0, NULL }, |
| 307 | { "PLATFORM", nouveau_bios_shadow_platform, true, 0, 0, NULL }, | ||
| 291 | {} | 308 | {} |
| 292 | }; | 309 | }; |
| 293 | struct methods *mthd, *best; | 310 | struct methods *mthd, *best; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c index 3b6dc883e150..5eb3e0da7c6e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c | |||
| @@ -391,7 +391,7 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS) | |||
| 391 | struct nouveau_drm *drm = nouveau_drm(dev); | 391 | struct nouveau_drm *drm = nouveau_drm(dev); |
| 392 | struct nouveau_device *device = nv_device(drm->device); | 392 | struct nouveau_device *device = nv_device(drm->device); |
| 393 | struct nouveau_abi16 *abi16 = nouveau_abi16_get(file_priv, dev); | 393 | struct nouveau_abi16 *abi16 = nouveau_abi16_get(file_priv, dev); |
| 394 | struct nouveau_abi16_chan *chan, *temp; | 394 | struct nouveau_abi16_chan *chan = NULL, *temp; |
| 395 | struct nouveau_abi16_ntfy *ntfy; | 395 | struct nouveau_abi16_ntfy *ntfy; |
| 396 | struct nouveau_object *object; | 396 | struct nouveau_object *object; |
| 397 | struct nv_dma_class args = {}; | 397 | struct nv_dma_class args = {}; |
| @@ -404,10 +404,11 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS) | |||
| 404 | if (unlikely(nv_device(abi16->device)->card_type >= NV_C0)) | 404 | if (unlikely(nv_device(abi16->device)->card_type >= NV_C0)) |
| 405 | return nouveau_abi16_put(abi16, -EINVAL); | 405 | return nouveau_abi16_put(abi16, -EINVAL); |
| 406 | 406 | ||
| 407 | list_for_each_entry_safe(chan, temp, &abi16->channels, head) { | 407 | list_for_each_entry(temp, &abi16->channels, head) { |
| 408 | if (chan->chan->handle == (NVDRM_CHAN | info->channel)) | 408 | if (temp->chan->handle == (NVDRM_CHAN | info->channel)) { |
| 409 | chan = temp; | ||
| 409 | break; | 410 | break; |
| 410 | chan = NULL; | 411 | } |
| 411 | } | 412 | } |
| 412 | 413 | ||
| 413 | if (!chan) | 414 | if (!chan) |
| @@ -459,17 +460,18 @@ nouveau_abi16_ioctl_gpuobj_free(ABI16_IOCTL_ARGS) | |||
| 459 | { | 460 | { |
| 460 | struct drm_nouveau_gpuobj_free *fini = data; | 461 | struct drm_nouveau_gpuobj_free *fini = data; |
| 461 | struct nouveau_abi16 *abi16 = nouveau_abi16_get(file_priv, dev); | 462 | struct nouveau_abi16 *abi16 = nouveau_abi16_get(file_priv, dev); |
| 462 | struct nouveau_abi16_chan *chan, *temp; | 463 | struct nouveau_abi16_chan *chan = NULL, *temp; |
| 463 | struct nouveau_abi16_ntfy *ntfy; | 464 | struct nouveau_abi16_ntfy *ntfy; |
| 464 | int ret; | 465 | int ret; |
| 465 | 466 | ||
| 466 | if (unlikely(!abi16)) | 467 | if (unlikely(!abi16)) |
| 467 | return -ENOMEM; | 468 | return -ENOMEM; |
| 468 | 469 | ||
| 469 | list_for_each_entry_safe(chan, temp, &abi16->channels, head) { | 470 | list_for_each_entry(temp, &abi16->channels, head) { |
| 470 | if (chan->chan->handle == (NVDRM_CHAN | fini->channel)) | 471 | if (temp->chan->handle == (NVDRM_CHAN | fini->channel)) { |
| 472 | chan = temp; | ||
| 471 | break; | 473 | break; |
| 472 | chan = NULL; | 474 | } |
| 473 | } | 475 | } |
| 474 | 476 | ||
| 475 | if (!chan) | 477 | if (!chan) |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index d1099365bfc1..c95decf543e9 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
| @@ -72,11 +72,25 @@ module_param_named(modeset, nouveau_modeset, int, 0400); | |||
| 72 | static struct drm_driver driver; | 72 | static struct drm_driver driver; |
| 73 | 73 | ||
| 74 | static int | 74 | static int |
| 75 | nouveau_drm_vblank_handler(struct nouveau_eventh *event, int head) | ||
| 76 | { | ||
| 77 | struct nouveau_drm *drm = | ||
| 78 | container_of(event, struct nouveau_drm, vblank[head]); | ||
| 79 | drm_handle_vblank(drm->dev, head); | ||
| 80 | return NVKM_EVENT_KEEP; | ||
| 81 | } | ||
| 82 | |||
| 83 | static int | ||
| 75 | nouveau_drm_vblank_enable(struct drm_device *dev, int head) | 84 | nouveau_drm_vblank_enable(struct drm_device *dev, int head) |
| 76 | { | 85 | { |
| 77 | struct nouveau_drm *drm = nouveau_drm(dev); | 86 | struct nouveau_drm *drm = nouveau_drm(dev); |
| 78 | struct nouveau_disp *pdisp = nouveau_disp(drm->device); | 87 | struct nouveau_disp *pdisp = nouveau_disp(drm->device); |
| 79 | nouveau_event_get(pdisp->vblank, head, &drm->vblank); | 88 | |
| 89 | if (WARN_ON_ONCE(head > ARRAY_SIZE(drm->vblank))) | ||
| 90 | return -EIO; | ||
| 91 | WARN_ON_ONCE(drm->vblank[head].func); | ||
| 92 | drm->vblank[head].func = nouveau_drm_vblank_handler; | ||
| 93 | nouveau_event_get(pdisp->vblank, head, &drm->vblank[head]); | ||
| 80 | return 0; | 94 | return 0; |
| 81 | } | 95 | } |
| 82 | 96 | ||
| @@ -85,16 +99,11 @@ nouveau_drm_vblank_disable(struct drm_device *dev, int head) | |||
| 85 | { | 99 | { |
| 86 | struct nouveau_drm *drm = nouveau_drm(dev); | 100 | struct nouveau_drm *drm = nouveau_drm(dev); |
| 87 | struct nouveau_disp *pdisp = nouveau_disp(drm->device); | 101 | struct nouveau_disp *pdisp = nouveau_disp(drm->device); |
| 88 | nouveau_event_put(pdisp->vblank, head, &drm->vblank); | 102 | if (drm->vblank[head].func) |
| 89 | } | 103 | nouveau_event_put(pdisp->vblank, head, &drm->vblank[head]); |
| 90 | 104 | else | |
| 91 | static int | 105 | WARN_ON_ONCE(1); |
| 92 | nouveau_drm_vblank_handler(struct nouveau_eventh *event, int head) | 106 | drm->vblank[head].func = NULL; |
| 93 | { | ||
| 94 | struct nouveau_drm *drm = | ||
| 95 | container_of(event, struct nouveau_drm, vblank); | ||
| 96 | drm_handle_vblank(drm->dev, head); | ||
| 97 | return NVKM_EVENT_KEEP; | ||
| 98 | } | 107 | } |
| 99 | 108 | ||
| 100 | static u64 | 109 | static u64 |
| @@ -292,7 +301,6 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) | |||
| 292 | 301 | ||
| 293 | dev->dev_private = drm; | 302 | dev->dev_private = drm; |
| 294 | drm->dev = dev; | 303 | drm->dev = dev; |
| 295 | drm->vblank.func = nouveau_drm_vblank_handler; | ||
| 296 | 304 | ||
| 297 | INIT_LIST_HEAD(&drm->clients); | 305 | INIT_LIST_HEAD(&drm->clients); |
| 298 | spin_lock_init(&drm->tile.lock); | 306 | spin_lock_init(&drm->tile.lock); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.h b/drivers/gpu/drm/nouveau/nouveau_drm.h index b25df374c901..9c39bafbef2c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.h +++ b/drivers/gpu/drm/nouveau/nouveau_drm.h | |||
| @@ -113,7 +113,7 @@ struct nouveau_drm { | |||
| 113 | struct nvbios vbios; | 113 | struct nvbios vbios; |
| 114 | struct nouveau_display *display; | 114 | struct nouveau_display *display; |
| 115 | struct backlight_device *backlight; | 115 | struct backlight_device *backlight; |
| 116 | struct nouveau_eventh vblank; | 116 | struct nouveau_eventh vblank[4]; |
| 117 | 117 | ||
| 118 | /* power management */ | 118 | /* power management */ |
| 119 | struct nouveau_pm *pm; | 119 | struct nouveau_pm *pm; |
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 7f0e6c3f37d1..1ddc03e51bf4 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
| @@ -479,7 +479,7 @@ nv50_display_flip_wait(void *data) | |||
| 479 | { | 479 | { |
| 480 | struct nv50_display_flip *flip = data; | 480 | struct nv50_display_flip *flip = data; |
| 481 | if (nouveau_bo_rd32(flip->disp->sync, flip->chan->addr / 4) == | 481 | if (nouveau_bo_rd32(flip->disp->sync, flip->chan->addr / 4) == |
| 482 | flip->chan->data); | 482 | flip->chan->data) |
| 483 | return true; | 483 | return true; |
| 484 | usleep_range(1, 2); | 484 | usleep_range(1, 2); |
| 485 | return false; | 485 | return false; |
diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c index b8015913d382..fa3c56fba294 100644 --- a/drivers/gpu/drm/radeon/radeon_bios.c +++ b/drivers/gpu/drm/radeon/radeon_bios.c | |||
| @@ -99,6 +99,29 @@ static bool radeon_read_bios(struct radeon_device *rdev) | |||
| 99 | return true; | 99 | return true; |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | static bool radeon_read_platform_bios(struct radeon_device *rdev) | ||
| 103 | { | ||
| 104 | uint8_t __iomem *bios; | ||
| 105 | size_t size; | ||
| 106 | |||
| 107 | rdev->bios = NULL; | ||
| 108 | |||
| 109 | bios = pci_platform_rom(rdev->pdev, &size); | ||
| 110 | if (!bios) { | ||
| 111 | return false; | ||
| 112 | } | ||
| 113 | |||
| 114 | if (size == 0 || bios[0] != 0x55 || bios[1] != 0xaa) { | ||
| 115 | return false; | ||
| 116 | } | ||
| 117 | rdev->bios = kmemdup(bios, size, GFP_KERNEL); | ||
| 118 | if (rdev->bios == NULL) { | ||
| 119 | return false; | ||
| 120 | } | ||
| 121 | |||
| 122 | return true; | ||
| 123 | } | ||
| 124 | |||
| 102 | #ifdef CONFIG_ACPI | 125 | #ifdef CONFIG_ACPI |
| 103 | /* ATRM is used to get the BIOS on the discrete cards in | 126 | /* ATRM is used to get the BIOS on the discrete cards in |
| 104 | * dual-gpu systems. | 127 | * dual-gpu systems. |
| @@ -620,6 +643,9 @@ bool radeon_get_bios(struct radeon_device *rdev) | |||
| 620 | if (r == false) { | 643 | if (r == false) { |
| 621 | r = radeon_read_disabled_bios(rdev); | 644 | r = radeon_read_disabled_bios(rdev); |
| 622 | } | 645 | } |
| 646 | if (r == false) { | ||
| 647 | r = radeon_read_platform_bios(rdev); | ||
| 648 | } | ||
| 623 | if (r == false || rdev->bios == NULL) { | 649 | if (r == false || rdev->bios == NULL) { |
| 624 | DRM_ERROR("Unable to locate a BIOS ROM\n"); | 650 | DRM_ERROR("Unable to locate a BIOS ROM\n"); |
| 625 | rdev->bios = NULL; | 651 | rdev->bios = NULL; |
diff --git a/drivers/gpu/drm/udl/udl_connector.c b/drivers/gpu/drm/udl/udl_connector.c index fe5cdbcf2636..b44d548c56f8 100644 --- a/drivers/gpu/drm/udl/udl_connector.c +++ b/drivers/gpu/drm/udl/udl_connector.c | |||
| @@ -61,6 +61,10 @@ static int udl_get_modes(struct drm_connector *connector) | |||
| 61 | int ret; | 61 | int ret; |
| 62 | 62 | ||
| 63 | edid = (struct edid *)udl_get_edid(udl); | 63 | edid = (struct edid *)udl_get_edid(udl); |
| 64 | if (!edid) { | ||
| 65 | drm_mode_connector_update_edid_property(connector, NULL); | ||
| 66 | return 0; | ||
| 67 | } | ||
| 64 | 68 | ||
| 65 | /* | 69 | /* |
| 66 | * We only read the main block, but if the monitor reports extension | 70 | * We only read the main block, but if the monitor reports extension |
