Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/nv50/disp: fix evo for create/init + destroy/fini split

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

+13 -11
+9 -1
drivers/gpu/drm/nouveau/nv50_display.c
··· 347 347 struct dcb_table *dcb = &dev_priv->vbios.dcb; 348 348 struct drm_connector *connector, *ct; 349 349 struct nv50_display *priv; 350 - int i; 350 + int ret, i; 351 351 352 352 NV_DEBUG_KMS(dev, "\n"); 353 353 ··· 400 400 401 401 tasklet_init(&priv->tasklet, nv50_display_bh, (unsigned long)dev); 402 402 nouveau_irq_register(dev, 26, nv50_display_isr); 403 + 404 + ret = nv50_evo_create(dev); 405 + if (ret) { 406 + nv50_display_destroy(dev); 407 + return ret; 408 + } 409 + 403 410 return 0; 404 411 } 405 412 ··· 417 410 418 411 NV_DEBUG_KMS(dev, "\n"); 419 412 413 + nv50_evo_destroy(dev); 420 414 nouveau_irq_unregister(dev, 26); 421 415 kfree(disp); 422 416 }
+2
drivers/gpu/drm/nouveau/nv50_display.h
··· 79 79 struct nouveau_channel *chan); 80 80 void nv50_display_flip_stop(struct drm_crtc *); 81 81 82 + int nv50_evo_create(struct drm_device *dev); 83 + void nv50_evo_destroy(struct drm_device *dev); 82 84 int nv50_evo_init(struct drm_device *dev); 83 85 void nv50_evo_fini(struct drm_device *dev); 84 86 void nv50_evo_dmaobj_init(struct nouveau_gpuobj *, u32 memtype, u64 base,
+2 -10
drivers/gpu/drm/nouveau/nv50_evo.c
··· 218 218 } 219 219 } 220 220 221 - static void 221 + void 222 222 nv50_evo_destroy(struct drm_device *dev) 223 223 { 224 224 struct nv50_display *disp = nv50_display(dev); ··· 235 235 nv50_evo_channel_del(&disp->master); 236 236 } 237 237 238 - static int 238 + int 239 239 nv50_evo_create(struct drm_device *dev) 240 240 { 241 241 struct drm_nouveau_private *dev_priv = dev->dev_private; ··· 388 388 struct nv50_display *disp = nv50_display(dev); 389 389 int ret, i; 390 390 391 - if (!disp->master) { 392 - ret = nv50_evo_create(dev); 393 - if (ret) 394 - return ret; 395 - } 396 - 397 391 ret = nv50_evo_channel_init(disp->master); 398 392 if (ret) 399 393 return ret; ··· 414 420 415 421 if (disp->master) 416 422 nv50_evo_channel_fini(disp->master); 417 - 418 - nv50_evo_destroy(dev); 419 423 }