Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
drm: Remove duplicate "return" statement
drm/nv04/crtc: Bail out if FB is not bound to crtc
drm/nouveau: fix nv04_sgdma_bind on non-"4kB pages" archs
drm/nouveau: properly handle allocation failure in nouveau_sgdma_populate
drm/nouveau: fix oops on pre-semaphore hardware
drm/nv50/crtc: Bail out if FB is not bound to crtc
drm/radeon/kms: fix DP detect and EDID fetch for DP bridges

+66 -28
-1
drivers/gpu/drm/drm_fb_helper.c
··· 256 { 257 printk(KERN_ERR "panic occurred, switching back to text console\n"); 258 return drm_fb_helper_force_kernel_mode(); 259 - return 0; 260 } 261 EXPORT_SYMBOL(drm_fb_helper_panic); 262
··· 256 { 257 printk(KERN_ERR "panic occurred, switching back to text console\n"); 258 return drm_fb_helper_force_kernel_mode(); 259 } 260 EXPORT_SYMBOL(drm_fb_helper_panic); 261
+2 -1
drivers/gpu/drm/nouveau/nouveau_fence.c
··· 530 nouveau_gpuobj_ref(NULL, &obj); 531 if (ret) 532 return ret; 533 - } else { 534 /* map fence bo into channel's vm */ 535 ret = nouveau_bo_vma_add(dev_priv->fence.bo, chan->vm, 536 &chan->fence.vma);
··· 530 nouveau_gpuobj_ref(NULL, &obj); 531 if (ret) 532 return ret; 533 + } else 534 + if (USE_SEMA(dev)) { 535 /* map fence bo into channel's vm */ 536 ret = nouveau_bo_vma_add(dev_priv->fence.bo, chan->vm, 537 &chan->fence.vma);
+5 -2
drivers/gpu/drm/nouveau/nouveau_sgdma.c
··· 37 return -ENOMEM; 38 39 nvbe->ttm_alloced = kmalloc(sizeof(bool) * num_pages, GFP_KERNEL); 40 - if (!nvbe->ttm_alloced) 41 return -ENOMEM; 42 43 nvbe->nr_pages = 0; 44 while (num_pages--) { ··· 129 130 for (j = 0; j < PAGE_SIZE / NV_CTXDMA_PAGE_SIZE; j++, pte++) { 131 nv_wo32(gpuobj, (pte * 4) + 0, offset_l | 3); 132 - dma_offset += NV_CTXDMA_PAGE_SIZE; 133 } 134 } 135
··· 37 return -ENOMEM; 38 39 nvbe->ttm_alloced = kmalloc(sizeof(bool) * num_pages, GFP_KERNEL); 40 + if (!nvbe->ttm_alloced) { 41 + kfree(nvbe->pages); 42 + nvbe->pages = NULL; 43 return -ENOMEM; 44 + } 45 46 nvbe->nr_pages = 0; 47 while (num_pages--) { ··· 126 127 for (j = 0; j < PAGE_SIZE / NV_CTXDMA_PAGE_SIZE; j++, pte++) { 128 nv_wo32(gpuobj, (pte * 4) + 0, offset_l | 3); 129 + offset_l += NV_CTXDMA_PAGE_SIZE; 130 } 131 } 132
+13 -2
drivers/gpu/drm/nouveau/nv04_crtc.c
··· 781 struct drm_device *dev = crtc->dev; 782 struct drm_nouveau_private *dev_priv = dev->dev_private; 783 struct nv04_crtc_reg *regp = &dev_priv->mode_reg.crtc_reg[nv_crtc->index]; 784 - struct drm_framebuffer *drm_fb = nv_crtc->base.fb; 785 - struct nouveau_framebuffer *fb = nouveau_framebuffer(drm_fb); 786 int arb_burst, arb_lwm; 787 int ret; 788 789 /* If atomic, we want to switch to the fb we were passed, so 790 * now we update pointers to do that. (We don't pin; just ··· 803 drm_fb = passed_fb; 804 fb = nouveau_framebuffer(passed_fb); 805 } else { 806 /* If not atomic, we can go ahead and pin, and unpin the 807 * old fb we were passed. 808 */
··· 781 struct drm_device *dev = crtc->dev; 782 struct drm_nouveau_private *dev_priv = dev->dev_private; 783 struct nv04_crtc_reg *regp = &dev_priv->mode_reg.crtc_reg[nv_crtc->index]; 784 + struct drm_framebuffer *drm_fb; 785 + struct nouveau_framebuffer *fb; 786 int arb_burst, arb_lwm; 787 int ret; 788 + 789 + NV_DEBUG_KMS(dev, "index %d\n", nv_crtc->index); 790 + 791 + /* no fb bound */ 792 + if (!atomic && !crtc->fb) { 793 + NV_DEBUG_KMS(dev, "No FB bound\n"); 794 + return 0; 795 + } 796 + 797 798 /* If atomic, we want to switch to the fb we were passed, so 799 * now we update pointers to do that. (We don't pin; just ··· 794 drm_fb = passed_fb; 795 fb = nouveau_framebuffer(passed_fb); 796 } else { 797 + drm_fb = crtc->fb; 798 + fb = nouveau_framebuffer(crtc->fb); 799 /* If not atomic, we can go ahead and pin, and unpin the 800 * old fb we were passed. 801 */
+10 -2
drivers/gpu/drm/nouveau/nv50_crtc.c
··· 519 struct drm_device *dev = nv_crtc->base.dev; 520 struct drm_nouveau_private *dev_priv = dev->dev_private; 521 struct nouveau_channel *evo = nv50_display(dev)->master; 522 - struct drm_framebuffer *drm_fb = nv_crtc->base.fb; 523 - struct nouveau_framebuffer *fb = nouveau_framebuffer(drm_fb); 524 int ret; 525 526 NV_DEBUG_KMS(dev, "index %d\n", nv_crtc->index); 527 528 /* If atomic, we want to switch to the fb we were passed, so 529 * now we update pointers to do that. (We don't pin; just ··· 539 drm_fb = passed_fb; 540 fb = nouveau_framebuffer(passed_fb); 541 } else { 542 /* If not atomic, we can go ahead and pin, and unpin the 543 * old fb we were passed. 544 */
··· 519 struct drm_device *dev = nv_crtc->base.dev; 520 struct drm_nouveau_private *dev_priv = dev->dev_private; 521 struct nouveau_channel *evo = nv50_display(dev)->master; 522 + struct drm_framebuffer *drm_fb; 523 + struct nouveau_framebuffer *fb; 524 int ret; 525 526 NV_DEBUG_KMS(dev, "index %d\n", nv_crtc->index); 527 + 528 + /* no fb bound */ 529 + if (!atomic && !crtc->fb) { 530 + NV_DEBUG_KMS(dev, "No FB bound\n"); 531 + return 0; 532 + } 533 534 /* If atomic, we want to switch to the fb we were passed, so 535 * now we update pointers to do that. (We don't pin; just ··· 533 drm_fb = passed_fb; 534 fb = nouveau_framebuffer(passed_fb); 535 } else { 536 + drm_fb = crtc->fb; 537 + fb = nouveau_framebuffer(crtc->fb); 538 /* If not atomic, we can go ahead and pin, and unpin the 539 * old fb we were passed. 540 */
+24 -13
drivers/gpu/drm/radeon/radeon_connectors.c
··· 1297 if (!radeon_dig_connector->edp_on) 1298 atombios_set_edp_panel_power(connector, 1299 ATOM_TRANSMITTER_ACTION_POWER_OFF); 1300 - } else { 1301 - /* need to setup ddc on the bridge */ 1302 - if (radeon_connector_encoder_is_dp_bridge(connector)) { 1303 if (encoder) 1304 radeon_atom_ext_encoder_setup_ddc(encoder); 1305 } 1306 radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector); 1307 if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) { 1308 ret = connector_status_connected; ··· 1337 if (radeon_ddc_probe(radeon_connector, 1338 radeon_connector->requires_extended_probe)) 1339 ret = connector_status_connected; 1340 - } 1341 - } 1342 - 1343 - if ((ret == connector_status_disconnected) && 1344 - radeon_connector->dac_load_detect) { 1345 - struct drm_encoder *encoder = radeon_best_single_encoder(connector); 1346 - struct drm_encoder_helper_funcs *encoder_funcs; 1347 - if (encoder) { 1348 - encoder_funcs = encoder->helper_private; 1349 - ret = encoder_funcs->detect(encoder, connector); 1350 } 1351 } 1352 }
··· 1297 if (!radeon_dig_connector->edp_on) 1298 atombios_set_edp_panel_power(connector, 1299 ATOM_TRANSMITTER_ACTION_POWER_OFF); 1300 + } else if (radeon_connector_encoder_is_dp_bridge(connector)) { 1301 + /* DP bridges are always DP */ 1302 + radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT; 1303 + /* get the DPCD from the bridge */ 1304 + radeon_dp_getdpcd(radeon_connector); 1305 + 1306 + if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) 1307 + ret = connector_status_connected; 1308 + else { 1309 + /* need to setup ddc on the bridge */ 1310 if (encoder) 1311 radeon_atom_ext_encoder_setup_ddc(encoder); 1312 + if (radeon_ddc_probe(radeon_connector, 1313 + radeon_connector->requires_extended_probe)) 1314 + ret = connector_status_connected; 1315 } 1316 + 1317 + if ((ret == connector_status_disconnected) && 1318 + radeon_connector->dac_load_detect) { 1319 + struct drm_encoder *encoder = radeon_best_single_encoder(connector); 1320 + struct drm_encoder_helper_funcs *encoder_funcs; 1321 + if (encoder) { 1322 + encoder_funcs = encoder->helper_private; 1323 + ret = encoder_funcs->detect(encoder, connector); 1324 + } 1325 + } 1326 + } else { 1327 radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector); 1328 if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) { 1329 ret = connector_status_connected; ··· 1316 if (radeon_ddc_probe(radeon_connector, 1317 radeon_connector->requires_extended_probe)) 1318 ret = connector_status_connected; 1319 } 1320 } 1321 }
+12 -7
drivers/gpu/drm/radeon/radeon_display.c
··· 707 radeon_router_select_ddc_port(radeon_connector); 708 709 if ((radeon_connector->base.connector_type == DRM_MODE_CONNECTOR_DisplayPort) || 710 - (radeon_connector->base.connector_type == DRM_MODE_CONNECTOR_eDP)) { 711 struct radeon_connector_atom_dig *dig = radeon_connector->con_priv; 712 if ((dig->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT || 713 dig->dp_sink_type == CONNECTOR_OBJECT_ID_eDP) && dig->dp_i2c_bus) 714 - radeon_connector->edid = drm_get_edid(&radeon_connector->base, &dig->dp_i2c_bus->adapter); 715 - } 716 - if (!radeon_connector->ddc_bus) 717 - return -1; 718 - if (!radeon_connector->edid) { 719 - radeon_connector->edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter); 720 } 721 722 if (!radeon_connector->edid) {
··· 707 radeon_router_select_ddc_port(radeon_connector); 708 709 if ((radeon_connector->base.connector_type == DRM_MODE_CONNECTOR_DisplayPort) || 710 + (radeon_connector->base.connector_type == DRM_MODE_CONNECTOR_eDP) || 711 + radeon_connector_encoder_is_dp_bridge(&radeon_connector->base)) { 712 struct radeon_connector_atom_dig *dig = radeon_connector->con_priv; 713 + 714 if ((dig->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT || 715 dig->dp_sink_type == CONNECTOR_OBJECT_ID_eDP) && dig->dp_i2c_bus) 716 + radeon_connector->edid = drm_get_edid(&radeon_connector->base, 717 + &dig->dp_i2c_bus->adapter); 718 + else if (radeon_connector->ddc_bus && !radeon_connector->edid) 719 + radeon_connector->edid = drm_get_edid(&radeon_connector->base, 720 + &radeon_connector->ddc_bus->adapter); 721 + } else { 722 + if (radeon_connector->ddc_bus && !radeon_connector->edid) 723 + radeon_connector->edid = drm_get_edid(&radeon_connector->base, 724 + &radeon_connector->ddc_bus->adapter); 725 } 726 727 if (!radeon_connector->edid) {