aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-03 19:40:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-03 19:40:21 -0500
commit0cb65c83304a341b9d09678448d7c8b550689531 (patch)
treeef0c7158b4c065feb39fa59dbeea1d68b5eac2c0
parent3c49de52d5647cda8b42c4255cf8a29d1e22eff5 (diff)
parentab7cd8d83e5dba13027de66f1b008b08b30b71a4 (diff)
Merge tag 'drm-fixes-for-v4.9-rc8' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "A pretty small pull request: a couple of AMD powerxpress regression fixes and a power management fix, a couple of i915 fixes and one hdlcd fix, along with one core don't oops because of incorrect API usage fix" * tag 'drm-fixes-for-v4.9-rc8' of git://people.freedesktop.org/~airlied/linux: drm/i915: drop the struct_mutex when wedged or trying to reset drm/i915: Don't touch NULL sg on i915_gem_object_get_pages_gtt() error drm: Don't call drm_for_each_crtc with a non-KMS driver drm/radeon: fix check for port PM availability drm/amdgpu: fix check for port PM availability drm/amd/powerplay: initialize the soft_regs offset in struct smu7_hwmgr drm: hdlcd: Fix cleanup order
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c11
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c5
-rw-r--r--drivers/gpu/drm/arm/hdlcd_drv.c2
-rw-r--r--drivers/gpu/drm/drm_ioctl.c10
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c5
-rw-r--r--drivers/gpu/drm/i915/intel_display.c3
-rw-r--r--drivers/gpu/drm/radeon/radeon_atpx_handler.c11
7 files changed, 34 insertions, 13 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
index 02ca5dd978f6..6c343a933182 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
@@ -485,7 +485,6 @@ static int amdgpu_atpx_power_state(enum vga_switcheroo_client_id id,
485 */ 485 */
486static bool amdgpu_atpx_pci_probe_handle(struct pci_dev *pdev) 486static bool amdgpu_atpx_pci_probe_handle(struct pci_dev *pdev)
487{ 487{
488 struct pci_dev *parent_pdev = pci_upstream_bridge(pdev);
489 acpi_handle dhandle, atpx_handle; 488 acpi_handle dhandle, atpx_handle;
490 acpi_status status; 489 acpi_status status;
491 490
@@ -500,7 +499,6 @@ static bool amdgpu_atpx_pci_probe_handle(struct pci_dev *pdev)
500 } 499 }
501 amdgpu_atpx_priv.dhandle = dhandle; 500 amdgpu_atpx_priv.dhandle = dhandle;
502 amdgpu_atpx_priv.atpx.handle = atpx_handle; 501 amdgpu_atpx_priv.atpx.handle = atpx_handle;
503 amdgpu_atpx_priv.bridge_pm_usable = parent_pdev && parent_pdev->bridge_d3;
504 return true; 502 return true;
505} 503}
506 504
@@ -562,17 +560,25 @@ static bool amdgpu_atpx_detect(void)
562 struct pci_dev *pdev = NULL; 560 struct pci_dev *pdev = NULL;
563 bool has_atpx = false; 561 bool has_atpx = false;
564 int vga_count = 0; 562 int vga_count = 0;
563 bool d3_supported = false;
564 struct pci_dev *parent_pdev;
565 565
566 while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) { 566 while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
567 vga_count++; 567 vga_count++;
568 568
569 has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true); 569 has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true);
570
571 parent_pdev = pci_upstream_bridge(pdev);
572 d3_supported |= parent_pdev && parent_pdev->bridge_d3;
570 } 573 }
571 574
572 while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL) { 575 while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL) {
573 vga_count++; 576 vga_count++;
574 577
575 has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true); 578 has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true);
579
580 parent_pdev = pci_upstream_bridge(pdev);
581 d3_supported |= parent_pdev && parent_pdev->bridge_d3;
576 } 582 }
577 583
578 if (has_atpx && vga_count == 2) { 584 if (has_atpx && vga_count == 2) {
@@ -580,6 +586,7 @@ static bool amdgpu_atpx_detect(void)
580 printk(KERN_INFO "vga_switcheroo: detected switching method %s handle\n", 586 printk(KERN_INFO "vga_switcheroo: detected switching method %s handle\n",
581 acpi_method_name); 587 acpi_method_name);
582 amdgpu_atpx_priv.atpx_detected = true; 588 amdgpu_atpx_priv.atpx_detected = true;
589 amdgpu_atpx_priv.bridge_pm_usable = d3_supported;
583 amdgpu_atpx_init(); 590 amdgpu_atpx_init();
584 return true; 591 return true;
585 } 592 }
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c
index 4ccc0b72324d..71bb2f8dc157 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c
@@ -2214,6 +2214,7 @@ uint32_t polaris10_get_mac_definition(uint32_t value)
2214int polaris10_process_firmware_header(struct pp_hwmgr *hwmgr) 2214int polaris10_process_firmware_header(struct pp_hwmgr *hwmgr)
2215{ 2215{
2216 struct polaris10_smumgr *smu_data = (struct polaris10_smumgr *)(hwmgr->smumgr->backend); 2216 struct polaris10_smumgr *smu_data = (struct polaris10_smumgr *)(hwmgr->smumgr->backend);
2217 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
2217 uint32_t tmp; 2218 uint32_t tmp;
2218 int result; 2219 int result;
2219 bool error = false; 2220 bool error = false;
@@ -2233,8 +2234,10 @@ int polaris10_process_firmware_header(struct pp_hwmgr *hwmgr)
2233 offsetof(SMU74_Firmware_Header, SoftRegisters), 2234 offsetof(SMU74_Firmware_Header, SoftRegisters),
2234 &tmp, SMC_RAM_END); 2235 &tmp, SMC_RAM_END);
2235 2236
2236 if (!result) 2237 if (!result) {
2238 data->soft_regs_start = tmp;
2237 smu_data->smu7_data.soft_regs_start = tmp; 2239 smu_data->smu7_data.soft_regs_start = tmp;
2240 }
2238 2241
2239 error |= (0 != result); 2242 error |= (0 != result);
2240 2243
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index fb6a418ce6be..e138fb51e8ce 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -375,7 +375,6 @@ static int hdlcd_drm_bind(struct device *dev)
375 375
376err_fbdev: 376err_fbdev:
377 drm_kms_helper_poll_fini(drm); 377 drm_kms_helper_poll_fini(drm);
378 drm_mode_config_cleanup(drm);
379 drm_vblank_cleanup(drm); 378 drm_vblank_cleanup(drm);
380err_vblank: 379err_vblank:
381 pm_runtime_disable(drm->dev); 380 pm_runtime_disable(drm->dev);
@@ -387,6 +386,7 @@ err_unload:
387 drm_irq_uninstall(drm); 386 drm_irq_uninstall(drm);
388 of_reserved_mem_device_release(drm->dev); 387 of_reserved_mem_device_release(drm->dev);
389err_free: 388err_free:
389 drm_mode_config_cleanup(drm);
390 dev_set_drvdata(dev, NULL); 390 dev_set_drvdata(dev, NULL);
391 drm_dev_unref(drm); 391 drm_dev_unref(drm);
392 392
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 0ad2c47f808f..71c3473476c7 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -254,10 +254,12 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
254 req->value = dev->mode_config.async_page_flip; 254 req->value = dev->mode_config.async_page_flip;
255 break; 255 break;
256 case DRM_CAP_PAGE_FLIP_TARGET: 256 case DRM_CAP_PAGE_FLIP_TARGET:
257 req->value = 1; 257 if (drm_core_check_feature(dev, DRIVER_MODESET)) {
258 drm_for_each_crtc(crtc, dev) { 258 req->value = 1;
259 if (!crtc->funcs->page_flip_target) 259 drm_for_each_crtc(crtc, dev) {
260 req->value = 0; 260 if (!crtc->funcs->page_flip_target)
261 req->value = 0;
262 }
261 } 263 }
262 break; 264 break;
263 case DRM_CAP_CURSOR_WIDTH: 265 case DRM_CAP_CURSOR_WIDTH:
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 91ab7e9d6d2e..00eb4814b913 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2268,7 +2268,7 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj)
2268 page = shmem_read_mapping_page(mapping, i); 2268 page = shmem_read_mapping_page(mapping, i);
2269 if (IS_ERR(page)) { 2269 if (IS_ERR(page)) {
2270 ret = PTR_ERR(page); 2270 ret = PTR_ERR(page);
2271 goto err_pages; 2271 goto err_sg;
2272 } 2272 }
2273 } 2273 }
2274#ifdef CONFIG_SWIOTLB 2274#ifdef CONFIG_SWIOTLB
@@ -2311,8 +2311,9 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj)
2311 2311
2312 return 0; 2312 return 0;
2313 2313
2314err_pages: 2314err_sg:
2315 sg_mark_end(sg); 2315 sg_mark_end(sg);
2316err_pages:
2316 for_each_sgt_page(page, sgt_iter, st) 2317 for_each_sgt_page(page, sgt_iter, st)
2317 put_page(page); 2318 put_page(page);
2318 sg_free_table(st); 2319 sg_free_table(st);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 81c11499bcf0..3cb70d73239b 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12260,7 +12260,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
12260 intel_crtc->reset_count = i915_reset_count(&dev_priv->gpu_error); 12260 intel_crtc->reset_count = i915_reset_count(&dev_priv->gpu_error);
12261 if (i915_reset_in_progress_or_wedged(&dev_priv->gpu_error)) { 12261 if (i915_reset_in_progress_or_wedged(&dev_priv->gpu_error)) {
12262 ret = -EIO; 12262 ret = -EIO;
12263 goto cleanup; 12263 goto unlock;
12264 } 12264 }
12265 12265
12266 atomic_inc(&intel_crtc->unpin_work_count); 12266 atomic_inc(&intel_crtc->unpin_work_count);
@@ -12352,6 +12352,7 @@ cleanup_unpin:
12352 intel_unpin_fb_obj(fb, crtc->primary->state->rotation); 12352 intel_unpin_fb_obj(fb, crtc->primary->state->rotation);
12353cleanup_pending: 12353cleanup_pending:
12354 atomic_dec(&intel_crtc->unpin_work_count); 12354 atomic_dec(&intel_crtc->unpin_work_count);
12355unlock:
12355 mutex_unlock(&dev->struct_mutex); 12356 mutex_unlock(&dev->struct_mutex);
12356cleanup: 12357cleanup:
12357 crtc->primary->fb = old_fb; 12358 crtc->primary->fb = old_fb;
diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
index 4129b12521a6..0ae13cd2adda 100644
--- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c
+++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
@@ -479,7 +479,6 @@ static int radeon_atpx_power_state(enum vga_switcheroo_client_id id,
479 */ 479 */
480static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev) 480static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev)
481{ 481{
482 struct pci_dev *parent_pdev = pci_upstream_bridge(pdev);
483 acpi_handle dhandle, atpx_handle; 482 acpi_handle dhandle, atpx_handle;
484 acpi_status status; 483 acpi_status status;
485 484
@@ -493,7 +492,6 @@ static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev)
493 492
494 radeon_atpx_priv.dhandle = dhandle; 493 radeon_atpx_priv.dhandle = dhandle;
495 radeon_atpx_priv.atpx.handle = atpx_handle; 494 radeon_atpx_priv.atpx.handle = atpx_handle;
496 radeon_atpx_priv.bridge_pm_usable = parent_pdev && parent_pdev->bridge_d3;
497 return true; 495 return true;
498} 496}
499 497
@@ -555,11 +553,16 @@ static bool radeon_atpx_detect(void)
555 struct pci_dev *pdev = NULL; 553 struct pci_dev *pdev = NULL;
556 bool has_atpx = false; 554 bool has_atpx = false;
557 int vga_count = 0; 555 int vga_count = 0;
556 bool d3_supported = false;
557 struct pci_dev *parent_pdev;
558 558
559 while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) { 559 while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
560 vga_count++; 560 vga_count++;
561 561
562 has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true); 562 has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true);
563
564 parent_pdev = pci_upstream_bridge(pdev);
565 d3_supported |= parent_pdev && parent_pdev->bridge_d3;
563 } 566 }
564 567
565 /* some newer PX laptops mark the dGPU as a non-VGA display device */ 568 /* some newer PX laptops mark the dGPU as a non-VGA display device */
@@ -567,6 +570,9 @@ static bool radeon_atpx_detect(void)
567 vga_count++; 570 vga_count++;
568 571
569 has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true); 572 has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true);
573
574 parent_pdev = pci_upstream_bridge(pdev);
575 d3_supported |= parent_pdev && parent_pdev->bridge_d3;
570 } 576 }
571 577
572 if (has_atpx && vga_count == 2) { 578 if (has_atpx && vga_count == 2) {
@@ -574,6 +580,7 @@ static bool radeon_atpx_detect(void)
574 printk(KERN_INFO "vga_switcheroo: detected switching method %s handle\n", 580 printk(KERN_INFO "vga_switcheroo: detected switching method %s handle\n",
575 acpi_method_name); 581 acpi_method_name);
576 radeon_atpx_priv.atpx_detected = true; 582 radeon_atpx_priv.atpx_detected = true;
583 radeon_atpx_priv.bridge_pm_usable = d3_supported;
577 radeon_atpx_init(); 584 radeon_atpx_init();
578 return true; 585 return true;
579 } 586 }