Commit e6296126 authored by Dave Airlie's avatar Dave Airlie

Merge branch 'linux-4.12' of git://github.com/skeggsb/linux into drm-fixes

misc nouveau fixes.

* 'linux-4.12' of git://github.com/skeggsb/linux:
  drm/nouveau/fifo/gk104-: Silence a locking warning
  drm/nouveau/secboot: plug memory leak in ls_ucode_img_load_gr() error path
  drm/nouveau: Fix drm poll_helper handling
parents 6de92ab8 2579b8b0
...@@ -360,6 +360,8 @@ nouveau_display_hpd_work(struct work_struct *work) ...@@ -360,6 +360,8 @@ nouveau_display_hpd_work(struct work_struct *work)
pm_runtime_get_sync(drm->dev->dev); pm_runtime_get_sync(drm->dev->dev);
drm_helper_hpd_irq_event(drm->dev); drm_helper_hpd_irq_event(drm->dev);
/* enable polling for external displays */
drm_kms_helper_poll_enable(drm->dev);
pm_runtime_mark_last_busy(drm->dev->dev); pm_runtime_mark_last_busy(drm->dev->dev);
pm_runtime_put_sync(drm->dev->dev); pm_runtime_put_sync(drm->dev->dev);
...@@ -413,10 +415,6 @@ nouveau_display_init(struct drm_device *dev) ...@@ -413,10 +415,6 @@ nouveau_display_init(struct drm_device *dev)
if (ret) if (ret)
return ret; return ret;
/* enable polling for external displays */
if (!dev->mode_config.poll_enabled)
drm_kms_helper_poll_enable(dev);
/* enable hotplug interrupts */ /* enable hotplug interrupts */
list_for_each_entry(connector, &dev->mode_config.connector_list, head) { list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
struct nouveau_connector *conn = nouveau_connector(connector); struct nouveau_connector *conn = nouveau_connector(connector);
......
...@@ -502,6 +502,9 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) ...@@ -502,6 +502,9 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags)
pm_runtime_allow(dev->dev); pm_runtime_allow(dev->dev);
pm_runtime_mark_last_busy(dev->dev); pm_runtime_mark_last_busy(dev->dev);
pm_runtime_put(dev->dev); pm_runtime_put(dev->dev);
} else {
/* enable polling for external displays */
drm_kms_helper_poll_enable(dev);
} }
return 0; return 0;
...@@ -774,9 +777,6 @@ nouveau_pmops_runtime_resume(struct device *dev) ...@@ -774,9 +777,6 @@ nouveau_pmops_runtime_resume(struct device *dev)
ret = nouveau_do_resume(drm_dev, true); ret = nouveau_do_resume(drm_dev, true);
if (!drm_dev->mode_config.poll_enabled)
drm_kms_helper_poll_enable(drm_dev);
/* do magic */ /* do magic */
nvif_mask(&device->object, 0x088488, (1 << 25), (1 << 25)); nvif_mask(&device->object, 0x088488, (1 << 25), (1 << 25));
vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_ON); vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_ON);
......
...@@ -148,7 +148,7 @@ gk104_fifo_runlist_commit(struct gk104_fifo *fifo, int runl) ...@@ -148,7 +148,7 @@ gk104_fifo_runlist_commit(struct gk104_fifo *fifo, int runl)
case NVKM_MEM_TARGET_NCOH: target = 3; break; case NVKM_MEM_TARGET_NCOH: target = 3; break;
default: default:
WARN_ON(1); WARN_ON(1);
return; goto unlock;
} }
nvkm_wr32(device, 0x002270, (nvkm_memory_addr(mem) >> 12) | nvkm_wr32(device, 0x002270, (nvkm_memory_addr(mem) >> 12) |
...@@ -160,6 +160,7 @@ gk104_fifo_runlist_commit(struct gk104_fifo *fifo, int runl) ...@@ -160,6 +160,7 @@ gk104_fifo_runlist_commit(struct gk104_fifo *fifo, int runl)
& 0x00100000), & 0x00100000),
msecs_to_jiffies(2000)) == 0) msecs_to_jiffies(2000)) == 0)
nvkm_error(subdev, "runlist %d update timeout\n", runl); nvkm_error(subdev, "runlist %d update timeout\n", runl);
unlock:
mutex_unlock(&subdev->mutex); mutex_unlock(&subdev->mutex);
} }
......
...@@ -116,6 +116,7 @@ ls_ucode_img_load_gr(const struct nvkm_subdev *subdev, struct ls_ucode_img *img, ...@@ -116,6 +116,7 @@ ls_ucode_img_load_gr(const struct nvkm_subdev *subdev, struct ls_ucode_img *img,
ret = nvkm_firmware_get(subdev->device, f, &sig); ret = nvkm_firmware_get(subdev->device, f, &sig);
if (ret) if (ret)
goto free_data; goto free_data;
img->sig = kmemdup(sig->data, sig->size, GFP_KERNEL); img->sig = kmemdup(sig->data, sig->size, GFP_KERNEL);
if (!img->sig) { if (!img->sig) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -126,8 +127,9 @@ ls_ucode_img_load_gr(const struct nvkm_subdev *subdev, struct ls_ucode_img *img, ...@@ -126,8 +127,9 @@ ls_ucode_img_load_gr(const struct nvkm_subdev *subdev, struct ls_ucode_img *img,
img->ucode_data = ls_ucode_img_build(bl, code, data, img->ucode_data = ls_ucode_img_build(bl, code, data,
&img->ucode_desc); &img->ucode_desc);
if (IS_ERR(img->ucode_data)) { if (IS_ERR(img->ucode_data)) {
kfree(img->sig);
ret = PTR_ERR(img->ucode_data); ret = PTR_ERR(img->ucode_data);
goto free_data; goto free_sig;
} }
img->ucode_size = img->ucode_desc.image_size; img->ucode_size = img->ucode_desc.image_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment