Skip to content

Commit b88aefc

Browse files
committed
Merge branch 'linux-5.14' of git://github.com/skeggsb/linux into drm-fixes
- Ampere display fixes - Fix longstanding MM race issue by removing unused code. Signed-off-by: Dave Airlie <[email protected]> From: Ben Skeggs <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/CACAvsv5jtUFkHsGe-pf-=RceDOgKygjPnCi=6d5vCLM_f5aeMQ@mail.gmail.com
2 parents e213bd1 + 59f216c commit b88aefc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+144
-334
lines changed

drivers/gpu/drm/nouveau/dispnv50/disp.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,6 +2237,33 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)
22372237
interlock[NV50_DISP_INTERLOCK_CORE] = 0;
22382238
}
22392239

2240+
/* Finish updating head(s)...
2241+
*
2242+
* NVD is rather picky about both where window assignments can change,
2243+
* *and* about certain core and window channel states matching.
2244+
*
2245+
* The EFI GOP driver on newer GPUs configures window channels with a
2246+
* different output format to what we do, and the core channel update
2247+
* in the assign_windows case above would result in a state mismatch.
2248+
*
2249+
* Delay some of the head update until after that point to workaround
2250+
* the issue. This only affects the initial modeset.
2251+
*
2252+
* TODO: handle this better when adding flexible window mapping
2253+
*/
2254+
for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
2255+
struct nv50_head_atom *asyh = nv50_head_atom(new_crtc_state);
2256+
struct nv50_head *head = nv50_head(crtc);
2257+
2258+
NV_ATOMIC(drm, "%s: set %04x (clr %04x)\n", crtc->name,
2259+
asyh->set.mask, asyh->clr.mask);
2260+
2261+
if (asyh->set.mask) {
2262+
nv50_head_flush_set_wndw(head, asyh);
2263+
interlock[NV50_DISP_INTERLOCK_CORE] = 1;
2264+
}
2265+
}
2266+
22402267
/* Update plane(s). */
22412268
for_each_new_plane_in_state(state, plane, new_plane_state, i) {
22422269
struct nv50_wndw_atom *asyw = nv50_wndw_atom(new_plane_state);

drivers/gpu/drm/nouveau/dispnv50/head.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,23 @@ nv50_head_flush_clr(struct nv50_head *head,
5050
}
5151

5252
void
53-
nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh)
53+
nv50_head_flush_set_wndw(struct nv50_head *head, struct nv50_head_atom *asyh)
5454
{
55-
if (asyh->set.view ) head->func->view (head, asyh);
56-
if (asyh->set.mode ) head->func->mode (head, asyh);
57-
if (asyh->set.core ) head->func->core_set(head, asyh);
5855
if (asyh->set.olut ) {
5956
asyh->olut.offset = nv50_lut_load(&head->olut,
6057
asyh->olut.buffer,
6158
asyh->state.gamma_lut,
6259
asyh->olut.load);
6360
head->func->olut_set(head, asyh);
6461
}
62+
}
63+
64+
void
65+
nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh)
66+
{
67+
if (asyh->set.view ) head->func->view (head, asyh);
68+
if (asyh->set.mode ) head->func->mode (head, asyh);
69+
if (asyh->set.core ) head->func->core_set(head, asyh);
6570
if (asyh->set.curs ) head->func->curs_set(head, asyh);
6671
if (asyh->set.base ) head->func->base (head, asyh);
6772
if (asyh->set.ovly ) head->func->ovly (head, asyh);

drivers/gpu/drm/nouveau/dispnv50/head.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct nv50_head {
2121

2222
struct nv50_head *nv50_head_create(struct drm_device *, int index);
2323
void nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh);
24+
void nv50_head_flush_set_wndw(struct nv50_head *head, struct nv50_head_atom *asyh);
2425
void nv50_head_flush_clr(struct nv50_head *head,
2526
struct nv50_head_atom *asyh, bool flush);
2627

drivers/gpu/drm/nouveau/include/nvif/cl0080.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
struct nv_device_v0 {
66
__u8 version;
7-
__u8 pad01[7];
7+
__u8 priv;
8+
__u8 pad02[6];
89
__u64 device; /* device identifier, ~0 for client default */
910
};
1011

drivers/gpu/drm/nouveau/include/nvif/class.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
#define NV10_CHANNEL_DMA /* cl506b.h */ 0x0000006e
6262
#define NV17_CHANNEL_DMA /* cl506b.h */ 0x0000176e
6363
#define NV40_CHANNEL_DMA /* cl506b.h */ 0x0000406e
64-
#define NV50_CHANNEL_DMA /* cl506e.h */ 0x0000506e
65-
#define G82_CHANNEL_DMA /* cl826e.h */ 0x0000826e
6664

6765
#define NV50_CHANNEL_GPFIFO /* cl506f.h */ 0x0000506f
6866
#define G82_CHANNEL_GPFIFO /* cl826f.h */ 0x0000826f

drivers/gpu/drm/nouveau/include/nvif/client.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ struct nvif_client {
99
const struct nvif_driver *driver;
1010
u64 version;
1111
u8 route;
12-
bool super;
1312
};
1413

1514
int nvif_client_ctor(struct nvif_client *parent, const char *name, u64 device,

drivers/gpu/drm/nouveau/include/nvif/driver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct nvif_driver {
1111
void (*fini)(void *priv);
1212
int (*suspend)(void *priv);
1313
int (*resume)(void *priv);
14-
int (*ioctl)(void *priv, bool super, void *data, u32 size, void **hack);
14+
int (*ioctl)(void *priv, void *data, u32 size, void **hack);
1515
void __iomem *(*map)(void *priv, u64 handle, u32 size);
1616
void (*unmap)(void *priv, void __iomem *ptr, u32 size);
1717
bool keep;

drivers/gpu/drm/nouveau/include/nvkm/core/client.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ struct nvkm_client {
1313
struct nvkm_client_notify *notify[32];
1414
struct rb_root objroot;
1515

16-
bool super;
1716
void *data;
1817
int (*ntfy)(const void *, u32, const void *, u32);
1918

drivers/gpu/drm/nouveau/include/nvkm/core/ioctl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
#include <core/os.h>
55
struct nvkm_client;
66

7-
int nvkm_ioctl(struct nvkm_client *, bool, void *, u32, void **);
7+
int nvkm_ioctl(struct nvkm_client *, void *, u32, void **);
88
#endif

drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ struct nvkm_vma {
1515
u8 refd:3; /* Current page type (index, or NONE for unreferenced). */
1616
bool used:1; /* Region allocated. */
1717
bool part:1; /* Region was split from an allocated region by map(). */
18-
bool user:1; /* Region user-allocated. */
1918
bool busy:1; /* Region busy (for temporarily preventing user access). */
2019
bool mapped:1; /* Region contains valid pages. */
2120
struct nvkm_memory *memory; /* Memory currently mapped into VMA. */

0 commit comments

Comments
 (0)