Skip to content

Commit

Permalink
drm/nv50/disp: fix evo for create/init + destroy/fini split
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Dec 21, 2011
1 parent cf41d53 commit 1772fcc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
10 changes: 9 additions & 1 deletion drivers/gpu/drm/nouveau/nv50_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ nv50_display_create(struct drm_device *dev)
struct dcb_table *dcb = &dev_priv->vbios.dcb;
struct drm_connector *connector, *ct;
struct nv50_display *priv;
int i;
int ret, i;

NV_DEBUG_KMS(dev, "\n");

Expand Down Expand Up @@ -400,6 +400,13 @@ nv50_display_create(struct drm_device *dev)

tasklet_init(&priv->tasklet, nv50_display_bh, (unsigned long)dev);
nouveau_irq_register(dev, 26, nv50_display_isr);

ret = nv50_evo_create(dev);
if (ret) {
nv50_display_destroy(dev);
return ret;
}

return 0;
}

Expand All @@ -410,6 +417,7 @@ nv50_display_destroy(struct drm_device *dev)

NV_DEBUG_KMS(dev, "\n");

nv50_evo_destroy(dev);
nouveau_irq_unregister(dev, 26);
kfree(disp);
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/nouveau/nv50_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ int nv50_display_flip_next(struct drm_crtc *, struct drm_framebuffer *,
struct nouveau_channel *chan);
void nv50_display_flip_stop(struct drm_crtc *);

int nv50_evo_create(struct drm_device *dev);
void nv50_evo_destroy(struct drm_device *dev);
int nv50_evo_init(struct drm_device *dev);
void nv50_evo_fini(struct drm_device *dev);
void nv50_evo_dmaobj_init(struct nouveau_gpuobj *, u32 memtype, u64 base,
Expand Down
12 changes: 2 additions & 10 deletions drivers/gpu/drm/nouveau/nv50_evo.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ nv50_evo_channel_fini(struct nouveau_channel *evo)
}
}

static void
void
nv50_evo_destroy(struct drm_device *dev)
{
struct nv50_display *disp = nv50_display(dev);
Expand All @@ -235,7 +235,7 @@ nv50_evo_destroy(struct drm_device *dev)
nv50_evo_channel_del(&disp->master);
}

static int
int
nv50_evo_create(struct drm_device *dev)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
Expand Down Expand Up @@ -388,12 +388,6 @@ nv50_evo_init(struct drm_device *dev)
struct nv50_display *disp = nv50_display(dev);
int ret, i;

if (!disp->master) {
ret = nv50_evo_create(dev);
if (ret)
return ret;
}

ret = nv50_evo_channel_init(disp->master);
if (ret)
return ret;
Expand All @@ -420,6 +414,4 @@ nv50_evo_fini(struct drm_device *dev)

if (disp->master)
nv50_evo_channel_fini(disp->master);

nv50_evo_destroy(dev);
}

0 comments on commit 1772fcc

Please sign in to comment.