Commit 59c0f578 authored by Ben Skeggs's avatar Ben Skeggs

drm/nv50-nvc0: rename disp->evo to disp->master

More appropriate, and we're about to be using more than just the master
EVO channel.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent ef8389a8
...@@ -65,7 +65,7 @@ nv50_crtc_blank(struct nouveau_crtc *nv_crtc, bool blanked) ...@@ -65,7 +65,7 @@ nv50_crtc_blank(struct nouveau_crtc *nv_crtc, bool blanked)
{ {
struct drm_device *dev = nv_crtc->base.dev; struct drm_device *dev = nv_crtc->base.dev;
struct drm_nouveau_private *dev_priv = dev->dev_private; struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_channel *evo = nv50_display(dev)->evo; struct nouveau_channel *evo = nv50_display(dev)->master;
int index = nv_crtc->index, ret; int index = nv_crtc->index, ret;
NV_DEBUG_KMS(dev, "index %d\n", nv_crtc->index); NV_DEBUG_KMS(dev, "index %d\n", nv_crtc->index);
...@@ -135,7 +135,7 @@ static int ...@@ -135,7 +135,7 @@ static int
nv50_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool on, bool update) nv50_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool on, bool update)
{ {
struct drm_device *dev = nv_crtc->base.dev; struct drm_device *dev = nv_crtc->base.dev;
struct nouveau_channel *evo = nv50_display(dev)->evo; struct nouveau_channel *evo = nv50_display(dev)->master;
int ret; int ret;
NV_DEBUG_KMS(dev, "\n"); NV_DEBUG_KMS(dev, "\n");
...@@ -185,7 +185,7 @@ nv50_crtc_set_scale(struct nouveau_crtc *nv_crtc, int scaling_mode, bool update) ...@@ -185,7 +185,7 @@ nv50_crtc_set_scale(struct nouveau_crtc *nv_crtc, int scaling_mode, bool update)
struct nouveau_connector *nv_connector = struct nouveau_connector *nv_connector =
nouveau_crtc_connector_get(nv_crtc); nouveau_crtc_connector_get(nv_crtc);
struct drm_device *dev = nv_crtc->base.dev; struct drm_device *dev = nv_crtc->base.dev;
struct nouveau_channel *evo = nv50_display(dev)->evo; struct nouveau_channel *evo = nv50_display(dev)->master;
struct drm_display_mode *native_mode = NULL; struct drm_display_mode *native_mode = NULL;
struct drm_display_mode *mode = &nv_crtc->base.mode; struct drm_display_mode *mode = &nv_crtc->base.mode;
uint32_t outX, outY, horiz, vert; uint32_t outX, outY, horiz, vert;
...@@ -459,7 +459,7 @@ static void ...@@ -459,7 +459,7 @@ static void
nv50_crtc_commit(struct drm_crtc *crtc) nv50_crtc_commit(struct drm_crtc *crtc)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct nouveau_channel *evo = nv50_display(dev)->evo; struct nouveau_channel *evo = nv50_display(dev)->master;
struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
int ret; int ret;
...@@ -493,7 +493,7 @@ nv50_crtc_do_mode_set_base(struct drm_crtc *crtc, ...@@ -493,7 +493,7 @@ nv50_crtc_do_mode_set_base(struct drm_crtc *crtc,
struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
struct drm_device *dev = nv_crtc->base.dev; struct drm_device *dev = nv_crtc->base.dev;
struct drm_nouveau_private *dev_priv = dev->dev_private; struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_channel *evo = nv50_display(dev)->evo; struct nouveau_channel *evo = nv50_display(dev)->master;
struct drm_framebuffer *drm_fb = nv_crtc->base.fb; struct drm_framebuffer *drm_fb = nv_crtc->base.fb;
struct nouveau_framebuffer *fb = nouveau_framebuffer(drm_fb); struct nouveau_framebuffer *fb = nouveau_framebuffer(drm_fb);
int ret, format; int ret, format;
...@@ -616,7 +616,7 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, ...@@ -616,7 +616,7 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
struct drm_framebuffer *old_fb) struct drm_framebuffer *old_fb)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct nouveau_channel *evo = nv50_display(dev)->evo; struct nouveau_channel *evo = nv50_display(dev)->master;
struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
struct nouveau_connector *nv_connector = NULL; struct nouveau_connector *nv_connector = NULL;
uint32_t hsync_dur, vsync_dur, hsync_start_to_end, vsync_start_to_end; uint32_t hsync_dur, vsync_dur, hsync_start_to_end, vsync_start_to_end;
......
...@@ -38,7 +38,7 @@ nv50_cursor_show(struct nouveau_crtc *nv_crtc, bool update) ...@@ -38,7 +38,7 @@ nv50_cursor_show(struct nouveau_crtc *nv_crtc, bool update)
{ {
struct drm_device *dev = nv_crtc->base.dev; struct drm_device *dev = nv_crtc->base.dev;
struct drm_nouveau_private *dev_priv = dev->dev_private; struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_channel *evo = nv50_display(dev)->evo; struct nouveau_channel *evo = nv50_display(dev)->master;
int ret; int ret;
NV_DEBUG_KMS(dev, "\n"); NV_DEBUG_KMS(dev, "\n");
...@@ -73,7 +73,7 @@ nv50_cursor_hide(struct nouveau_crtc *nv_crtc, bool update) ...@@ -73,7 +73,7 @@ nv50_cursor_hide(struct nouveau_crtc *nv_crtc, bool update)
{ {
struct drm_device *dev = nv_crtc->base.dev; struct drm_device *dev = nv_crtc->base.dev;
struct drm_nouveau_private *dev_priv = dev->dev_private; struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_channel *evo = nv50_display(dev)->evo; struct nouveau_channel *evo = nv50_display(dev)->master;
int ret; int ret;
NV_DEBUG_KMS(dev, "\n"); NV_DEBUG_KMS(dev, "\n");
......
...@@ -41,7 +41,7 @@ nv50_dac_disconnect(struct drm_encoder *encoder) ...@@ -41,7 +41,7 @@ nv50_dac_disconnect(struct drm_encoder *encoder)
{ {
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct nouveau_channel *evo = nv50_display(dev)->evo; struct nouveau_channel *evo = nv50_display(dev)->master;
int ret; int ret;
if (!nv_encoder->crtc) if (!nv_encoder->crtc)
...@@ -215,7 +215,7 @@ nv50_dac_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, ...@@ -215,7 +215,7 @@ nv50_dac_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
{ {
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct nouveau_channel *evo = nv50_display(dev)->evo; struct nouveau_channel *evo = nv50_display(dev)->master;
struct nouveau_crtc *crtc = nouveau_crtc(encoder->crtc); struct nouveau_crtc *crtc = nouveau_crtc(encoder->crtc);
uint32_t mode_ctl = 0, mode_ctl2 = 0; uint32_t mode_ctl = 0, mode_ctl2 = 0;
int ret; int ret;
......
...@@ -172,7 +172,7 @@ nv50_display_init(struct drm_device *dev) ...@@ -172,7 +172,7 @@ nv50_display_init(struct drm_device *dev)
ret = nv50_evo_init(dev); ret = nv50_evo_init(dev);
if (ret) if (ret)
return ret; return ret;
evo = nv50_display(dev)->evo; evo = nv50_display(dev)->master;
nv_wr32(dev, NV50_PDISPLAY_OBJECTS, (evo->ramin->vinst >> 8) | 9); nv_wr32(dev, NV50_PDISPLAY_OBJECTS, (evo->ramin->vinst >> 8) | 9);
...@@ -202,7 +202,7 @@ static int nv50_display_disable(struct drm_device *dev) ...@@ -202,7 +202,7 @@ static int nv50_display_disable(struct drm_device *dev)
{ {
struct drm_nouveau_private *dev_priv = dev->dev_private; struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nv50_display *disp = nv50_display(dev); struct nv50_display *disp = nv50_display(dev);
struct nouveau_channel *evo = disp->evo; struct nouveau_channel *evo = disp->master;
struct drm_crtc *drm_crtc; struct drm_crtc *drm_crtc;
int ret, i; int ret, i;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "nv50_evo.h" #include "nv50_evo.h"
struct nv50_display { struct nv50_display {
struct nouveau_channel *evo; struct nouveau_channel *master;
u32 evo_alloc; u32 evo_alloc;
struct { struct {
......
...@@ -62,7 +62,7 @@ nv50_evo_dmaobj_new(struct nouveau_channel *evo, u32 class, u32 name, ...@@ -62,7 +62,7 @@ nv50_evo_dmaobj_new(struct nouveau_channel *evo, u32 class, u32 name,
struct nouveau_gpuobj *obj = NULL; struct nouveau_gpuobj *obj = NULL;
int ret; int ret;
ret = nouveau_gpuobj_new(evo->dev, disp->evo, 6*4, 32, 0, &obj); ret = nouveau_gpuobj_new(evo->dev, disp->master, 6*4, 32, 0, &obj);
if (ret) if (ret)
return ret; return ret;
obj->engine = NVOBJ_ENGINE_DISPLAY; obj->engine = NVOBJ_ENGINE_DISPLAY;
...@@ -139,8 +139,8 @@ nv50_evo_channel_new(struct drm_device *dev, struct nouveau_channel **pevo) ...@@ -139,8 +139,8 @@ nv50_evo_channel_new(struct drm_device *dev, struct nouveau_channel **pevo)
} }
/* bind primary evo channel's ramht to the channel */ /* bind primary evo channel's ramht to the channel */
if (disp->evo && evo != disp->evo) if (disp->master && evo != disp->master)
nouveau_ramht_ref(disp->evo->ramht, &evo->ramht, NULL); nouveau_ramht_ref(disp->master->ramht, &evo->ramht, NULL);
return 0; return 0;
} }
...@@ -225,10 +225,10 @@ nv50_evo_create(struct drm_device *dev) ...@@ -225,10 +225,10 @@ nv50_evo_create(struct drm_device *dev)
/* create primary evo channel, the one we use for modesetting /* create primary evo channel, the one we use for modesetting
* purporses * purporses
*/ */
ret = nv50_evo_channel_new(dev, &disp->evo); ret = nv50_evo_channel_new(dev, &disp->master);
if (ret) if (ret)
return ret; return ret;
evo = disp->evo; evo = disp->master;
/* setup object management on it, any other evo channel will /* setup object management on it, any other evo channel will
* use this also as there's no per-channel support on the * use this also as there's no per-channel support on the
...@@ -238,28 +238,28 @@ nv50_evo_create(struct drm_device *dev) ...@@ -238,28 +238,28 @@ nv50_evo_create(struct drm_device *dev)
NVOBJ_FLAG_ZERO_ALLOC, &evo->ramin); NVOBJ_FLAG_ZERO_ALLOC, &evo->ramin);
if (ret) { if (ret) {
NV_ERROR(dev, "Error allocating EVO channel memory: %d\n", ret); NV_ERROR(dev, "Error allocating EVO channel memory: %d\n", ret);
nv50_evo_channel_del(&disp->evo); nv50_evo_channel_del(&disp->master);
return ret; return ret;
} }
ret = drm_mm_init(&evo->ramin_heap, 0, 32768); ret = drm_mm_init(&evo->ramin_heap, 0, 32768);
if (ret) { if (ret) {
NV_ERROR(dev, "Error initialising EVO PRAMIN heap: %d\n", ret); NV_ERROR(dev, "Error initialising EVO PRAMIN heap: %d\n", ret);
nv50_evo_channel_del(&disp->evo); nv50_evo_channel_del(&disp->master);
return ret; return ret;
} }
ret = nouveau_gpuobj_new(dev, evo, 4096, 16, 0, &ramht); ret = nouveau_gpuobj_new(dev, evo, 4096, 16, 0, &ramht);
if (ret) { if (ret) {
NV_ERROR(dev, "Unable to allocate EVO RAMHT: %d\n", ret); NV_ERROR(dev, "Unable to allocate EVO RAMHT: %d\n", ret);
nv50_evo_channel_del(&disp->evo); nv50_evo_channel_del(&disp->master);
return ret; return ret;
} }
ret = nouveau_ramht_new(dev, ramht, &evo->ramht); ret = nouveau_ramht_new(dev, ramht, &evo->ramht);
nouveau_gpuobj_ref(NULL, &ramht); nouveau_gpuobj_ref(NULL, &ramht);
if (ret) { if (ret) {
nv50_evo_channel_del(&disp->evo); nv50_evo_channel_del(&disp->master);
return ret; return ret;
} }
...@@ -268,28 +268,28 @@ nv50_evo_create(struct drm_device *dev) ...@@ -268,28 +268,28 @@ nv50_evo_create(struct drm_device *dev)
ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoFB32, 0xfe, 0x19, ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoFB32, 0xfe, 0x19,
0, 0xffffffff, 0x00000000); 0, 0xffffffff, 0x00000000);
if (ret) { if (ret) {
nv50_evo_channel_del(&disp->evo); nv50_evo_channel_del(&disp->master);
return ret; return ret;
} }
ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoVRAM, 0, 0x19, ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoVRAM, 0, 0x19,
0, dev_priv->vram_size, 0x00020000); 0, dev_priv->vram_size, 0x00020000);
if (ret) { if (ret) {
nv50_evo_channel_del(&disp->evo); nv50_evo_channel_del(&disp->master);
return ret; return ret;
} }
ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoVRAM_LP, 0, 0x19, ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoVRAM_LP, 0, 0x19,
0, dev_priv->vram_size, 0x00000000); 0, dev_priv->vram_size, 0x00000000);
if (ret) { if (ret) {
nv50_evo_channel_del(&disp->evo); nv50_evo_channel_del(&disp->master);
return ret; return ret;
} }
} else { } else {
ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoFB16, 0x70, 0x19, ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoFB16, 0x70, 0x19,
0, 0xffffffff, 0x00010000); 0, 0xffffffff, 0x00010000);
if (ret) { if (ret) {
nv50_evo_channel_del(&disp->evo); nv50_evo_channel_del(&disp->master);
return ret; return ret;
} }
...@@ -297,21 +297,21 @@ nv50_evo_create(struct drm_device *dev) ...@@ -297,21 +297,21 @@ nv50_evo_create(struct drm_device *dev)
ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoFB32, 0x7a, 0x19, ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoFB32, 0x7a, 0x19,
0, 0xffffffff, 0x00010000); 0, 0xffffffff, 0x00010000);
if (ret) { if (ret) {
nv50_evo_channel_del(&disp->evo); nv50_evo_channel_del(&disp->master);
return ret; return ret;
} }
ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoVRAM, 0, 0x19, ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoVRAM, 0, 0x19,
0, dev_priv->vram_size, 0x00010000); 0, dev_priv->vram_size, 0x00010000);
if (ret) { if (ret) {
nv50_evo_channel_del(&disp->evo); nv50_evo_channel_del(&disp->master);
return ret; return ret;
} }
ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoVRAM_LP, 0, 0x19, ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoVRAM_LP, 0, 0x19,
0, dev_priv->vram_size, 0x00010000); 0, dev_priv->vram_size, 0x00010000);
if (ret) { if (ret) {
nv50_evo_channel_del(&disp->evo); nv50_evo_channel_del(&disp->master);
return ret; return ret;
} }
} }
...@@ -325,13 +325,13 @@ nv50_evo_init(struct drm_device *dev) ...@@ -325,13 +325,13 @@ nv50_evo_init(struct drm_device *dev)
struct nv50_display *disp = nv50_display(dev); struct nv50_display *disp = nv50_display(dev);
int ret; int ret;
if (!disp->evo) { if (!disp->master) {
ret = nv50_evo_create(dev); ret = nv50_evo_create(dev);
if (ret) if (ret)
return ret; return ret;
} }
return nv50_evo_channel_init(disp->evo); return nv50_evo_channel_init(disp->master);
} }
void void
...@@ -339,8 +339,8 @@ nv50_evo_fini(struct drm_device *dev) ...@@ -339,8 +339,8 @@ nv50_evo_fini(struct drm_device *dev)
{ {
struct nv50_display *disp = nv50_display(dev); struct nv50_display *disp = nv50_display(dev);
if (disp->evo) { if (disp->master) {
nv50_evo_channel_fini(disp->evo); nv50_evo_channel_fini(disp->master);
nv50_evo_channel_del(&disp->evo); nv50_evo_channel_del(&disp->master);
} }
} }
...@@ -41,7 +41,7 @@ nv50_sor_disconnect(struct drm_encoder *encoder) ...@@ -41,7 +41,7 @@ nv50_sor_disconnect(struct drm_encoder *encoder)
{ {
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct nouveau_channel *evo = nv50_display(dev)->evo; struct nouveau_channel *evo = nv50_display(dev)->master;
int ret; int ret;
if (!nv_encoder->crtc) if (!nv_encoder->crtc)
...@@ -183,7 +183,7 @@ static void ...@@ -183,7 +183,7 @@ static void
nv50_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, nv50_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode) struct drm_display_mode *adjusted_mode)
{ {
struct nouveau_channel *evo = nv50_display(encoder->dev)->evo; struct nouveau_channel *evo = nv50_display(encoder->dev)->master;
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct nouveau_crtc *crtc = nouveau_crtc(encoder->crtc); struct nouveau_crtc *crtc = nouveau_crtc(encoder->crtc);
......
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