diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv10_gpio.c | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index 5fc201b49d30..41899eccf570 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
@@ -5834,7 +5834,8 @@ parse_dcb_gpio_table(struct nvbios *bios) | |||
5834 | e = new_gpio_entry(bios); | 5834 | e = new_gpio_entry(bios); |
5835 | e->tag = DCB_GPIO_TVDAC0; | 5835 | e->tag = DCB_GPIO_TVDAC0; |
5836 | e->line = tvdac_gpio[1] >> 4; | 5836 | e->line = tvdac_gpio[1] >> 4; |
5837 | e->invert = tvdac_gpio[0] & 2; | 5837 | e->state[0] = !!(tvdac_gpio[0] & 2); |
5838 | e->state[1] = !e->state[0]; | ||
5838 | } | 5839 | } |
5839 | 5840 | ||
5840 | goto no_table; | 5841 | goto no_table; |
@@ -5858,7 +5859,8 @@ parse_dcb_gpio_table(struct nvbios *bios) | |||
5858 | } | 5859 | } |
5859 | 5860 | ||
5860 | e->line = (e->entry & 0x001f); | 5861 | e->line = (e->entry & 0x001f); |
5861 | e->invert = ((e->entry & 0xf800) >> 11) != 4; | 5862 | e->state[0] = ((e->entry & 0xf800) >> 11) != 4; |
5863 | e->state[1] = !e->state[0]; | ||
5862 | } else { | 5864 | } else { |
5863 | e->entry = ROM32(entry[0]); | 5865 | e->entry = ROM32(entry[0]); |
5864 | e->tag = (e->entry & 0x0000ff00) >> 8; | 5866 | e->tag = (e->entry & 0x0000ff00) >> 8; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.h b/drivers/gpu/drm/nouveau/nouveau_bios.h index 3f36c7074d4f..a1e31ea2ecbf 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.h +++ b/drivers/gpu/drm/nouveau/nouveau_bios.h | |||
@@ -65,7 +65,6 @@ enum dcb_gpio_tag { | |||
65 | struct dcb_gpio_entry { | 65 | struct dcb_gpio_entry { |
66 | enum dcb_gpio_tag tag; | 66 | enum dcb_gpio_tag tag; |
67 | int line; | 67 | int line; |
68 | bool invert; | ||
69 | uint32_t entry; | 68 | uint32_t entry; |
70 | uint8_t state_default; | 69 | uint8_t state_default; |
71 | uint8_t state[2]; | 70 | uint8_t state[2]; |
diff --git a/drivers/gpu/drm/nouveau/nv10_gpio.c b/drivers/gpu/drm/nouveau/nv10_gpio.c index 007fc29e2f86..748c9f739116 100644 --- a/drivers/gpu/drm/nouveau/nv10_gpio.c +++ b/drivers/gpu/drm/nouveau/nv10_gpio.c | |||
@@ -68,7 +68,7 @@ nv10_gpio_get(struct drm_device *dev, enum dcb_gpio_tag tag) | |||
68 | 68 | ||
69 | value = NVReadCRTC(dev, 0, reg) >> shift; | 69 | value = NVReadCRTC(dev, 0, reg) >> shift; |
70 | 70 | ||
71 | return (ent->invert ? 1 : 0) ^ (value & 1); | 71 | return (value & 1) == ent->state[1]; |
72 | } | 72 | } |
73 | 73 | ||
74 | int | 74 | int |
@@ -83,7 +83,7 @@ nv10_gpio_set(struct drm_device *dev, enum dcb_gpio_tag tag, int state) | |||
83 | if (!get_gpio_location(ent, ®, &shift, &mask)) | 83 | if (!get_gpio_location(ent, ®, &shift, &mask)) |
84 | return -ENODEV; | 84 | return -ENODEV; |
85 | 85 | ||
86 | value = ((ent->invert ? 1 : 0) ^ (state ? 1 : 0)) << shift; | 86 | value = ent->state[state & 1] << shift; |
87 | mask = ~(mask << shift); | 87 | mask = ~(mask << shift); |
88 | 88 | ||
89 | NVWriteCRTC(dev, 0, reg, value | (NVReadCRTC(dev, 0, reg) & mask)); | 89 | NVWriteCRTC(dev, 0, reg, value | (NVReadCRTC(dev, 0, reg) & mask)); |