Commit 2195a22f authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/bios/init: rename 'crtc' to 'head'

Compatibility temporarily in place until all callers have been updated.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 5b0e787a
...@@ -5,8 +5,12 @@ struct nvbios_init { ...@@ -5,8 +5,12 @@ struct nvbios_init {
struct nvkm_subdev *subdev; struct nvkm_subdev *subdev;
struct nvkm_bios *bios; struct nvkm_bios *bios;
u16 offset; u16 offset;
struct dcb_output *outp; struct dcb_output *outp;
union {
int head;
int crtc; int crtc;
};
/* internal state used during parsing */ /* internal state used during parsing */
u8 execute; u8 execute;
......
...@@ -106,12 +106,12 @@ init_link(struct nvbios_init *init) ...@@ -106,12 +106,12 @@ init_link(struct nvbios_init *init)
} }
static inline int static inline int
init_crtc(struct nvbios_init *init) init_head(struct nvbios_init *init)
{ {
if (init_exec(init)) { if (init_exec(init)) {
if (init->crtc >= 0) if (init->head >= 0)
return init->crtc; return init->head;
error("script needs crtc\n"); error("script needs head\n");
} }
return 0; return 0;
} }
...@@ -156,7 +156,7 @@ init_nvreg(struct nvbios_init *init, u32 reg) ...@@ -156,7 +156,7 @@ init_nvreg(struct nvbios_init *init, u32 reg)
*/ */
if (init->subdev->device->card_type >= NV_50) { if (init->subdev->device->card_type >= NV_50) {
if (reg & 0x80000000) { if (reg & 0x80000000) {
reg += init_crtc(init) * 0x800; reg += init_head(init) * 0x800;
reg &= ~0x80000000; reg &= ~0x80000000;
} }
...@@ -212,7 +212,7 @@ static u8 ...@@ -212,7 +212,7 @@ static u8
init_rdport(struct nvbios_init *init, u16 port) init_rdport(struct nvbios_init *init, u16 port)
{ {
if (init_exec(init)) if (init_exec(init))
return nvkm_rdport(init->subdev->device, init->crtc, port); return nvkm_rdport(init->subdev->device, init->head, port);
return 0x00; return 0x00;
} }
...@@ -220,7 +220,7 @@ static void ...@@ -220,7 +220,7 @@ static void
init_wrport(struct nvbios_init *init, u16 port, u8 value) init_wrport(struct nvbios_init *init, u16 port, u8 value)
{ {
if (init_exec(init)) if (init_exec(init))
nvkm_wrport(init->subdev->device, init->crtc, port, value); nvkm_wrport(init->subdev->device, init->head, port, value);
} }
static u8 static u8
...@@ -228,7 +228,7 @@ init_rdvgai(struct nvbios_init *init, u16 port, u8 index) ...@@ -228,7 +228,7 @@ init_rdvgai(struct nvbios_init *init, u16 port, u8 index)
{ {
struct nvkm_subdev *subdev = init->subdev; struct nvkm_subdev *subdev = init->subdev;
if (init_exec(init)) { if (init_exec(init)) {
int head = init->crtc < 0 ? 0 : init->crtc; int head = init->head < 0 ? 0 : init->head;
return nvkm_rdvgai(subdev->device, head, port, index); return nvkm_rdvgai(subdev->device, head, port, index);
} }
return 0x00; return 0x00;
...@@ -242,18 +242,18 @@ init_wrvgai(struct nvbios_init *init, u16 port, u8 index, u8 value) ...@@ -242,18 +242,18 @@ init_wrvgai(struct nvbios_init *init, u16 port, u8 index, u8 value)
/* force head 0 for updates to cr44, it only exists on first head */ /* force head 0 for updates to cr44, it only exists on first head */
if (device->card_type < NV_50) { if (device->card_type < NV_50) {
if (port == 0x03d4 && index == 0x44) if (port == 0x03d4 && index == 0x44)
init->crtc = 0; init->head = 0;
} }
if (init_exec(init)) { if (init_exec(init)) {
int head = init->crtc < 0 ? 0 : init->crtc; int head = init->head < 0 ? 0 : init->head;
nvkm_wrvgai(device, head, port, index, value); nvkm_wrvgai(device, head, port, index, value);
} }
/* select head 1 if cr44 write selected it */ /* select head 1 if cr44 write selected it */
if (device->card_type < NV_50) { if (device->card_type < NV_50) {
if (port == 0x03d4 && index == 0x44 && value == 3) if (port == 0x03d4 && index == 0x44 && value == 3)
init->crtc = 1; init->head = 1;
} }
} }
...@@ -2307,7 +2307,7 @@ nvbios_post(struct nvkm_subdev *subdev, bool execute) ...@@ -2307,7 +2307,7 @@ nvbios_post(struct nvkm_subdev *subdev, bool execute)
.bios = bios, .bios = bios,
.offset = data, .offset = data,
.outp = NULL, .outp = NULL,
.crtc = -1, .head = -1,
.execute = execute ? 1 : 0, .execute = execute ? 1 : 0,
}; };
...@@ -2323,7 +2323,7 @@ nvbios_post(struct nvkm_subdev *subdev, bool execute) ...@@ -2323,7 +2323,7 @@ nvbios_post(struct nvkm_subdev *subdev, bool execute)
.bios = bios, .bios = bios,
.offset = data, .offset = data,
.outp = NULL, .outp = NULL,
.crtc = -1, .head = -1,
.execute = execute ? 1 : 0, .execute = execute ? 1 : 0,
}; };
......
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