Skip to content

Commit 9c34696

Browse files
committed
Merge branch 'linux-5.7' of git://github.com/skeggsb/linux into drm-next
A couple of misc fixes/workarounds for some issues that are causing a lot of pain for people. Of most interest are the PCI power management and GR init WARs, which effect a rather significant number of laptop systems that are in use today. Signed-off-by: Dave Airlie <[email protected]> From: Ben Skeggs <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/ <CACAvsv5Ef5YKS9EPBH3YUubzvVr++_rzjgSqV_B5nC0L2kB6-Q@mail.gmail.com
2 parents 3208a24 + 374b558 commit 9c34696

File tree

23 files changed

+263
-50
lines changed

23 files changed

+263
-50
lines changed

drivers/gpu/drm/nouveau/dispnv04/dac.c

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

3636
#include <subdev/bios/gpio.h>
3737
#include <subdev/gpio.h>
38-
#include <subdev/timer.h>
38+
39+
#include <nvif/timer.h>
3940

4041
int nv04_dac_output_offset(struct drm_encoder *encoder)
4142
{

drivers/gpu/drm/nouveau/dispnv04/hw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "hw.h"
2727

2828
#include <subdev/bios/pll.h>
29+
#include <nvif/timer.h>
2930

3031
#define CHIPSET_NFORCE 0x01a0
3132
#define CHIPSET_NFORCE2 0x01f0

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include <nvif/cl507c.h>
2525
#include <nvif/event.h>
26+
#include <nvif/timer.h>
2627

2728
#include <drm/drm_atomic_helper.h>
2829
#include <drm/drm_fourcc.h>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "head.h"
2424

2525
#include <nvif/cl507d.h>
26+
#include <nvif/timer.h>
2627

2728
#include "nouveau_bo.h"
2829

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
#include <nouveau_bo.h>
2626

27+
#include <nvif/timer.h>
28+
2729
void
2830
corec37d_wndw_owner(struct nv50_core *core)
2931
{

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,36 @@
2424
#include "head.h"
2525

2626
#include <nvif/cl507a.h>
27+
#include <nvif/timer.h>
2728

2829
#include <drm/drm_atomic_helper.h>
2930
#include <drm/drm_plane_helper.h>
3031

32+
bool
33+
curs507a_space(struct nv50_wndw *wndw)
34+
{
35+
nvif_msec(&nouveau_drm(wndw->plane.dev)->client.device, 2,
36+
if (nvif_rd32(&wndw->wimm.base.user, 0x0008) >= 4)
37+
return true;
38+
);
39+
WARN_ON(1);
40+
return false;
41+
}
42+
3143
static void
3244
curs507a_update(struct nv50_wndw *wndw, u32 *interlock)
3345
{
34-
nvif_wr32(&wndw->wimm.base.user, 0x0080, 0x00000000);
46+
if (curs507a_space(wndw))
47+
nvif_wr32(&wndw->wimm.base.user, 0x0080, 0x00000000);
3548
}
3649

3750
static void
3851
curs507a_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
3952
{
40-
nvif_wr32(&wndw->wimm.base.user, 0x0084, asyw->point.y << 16 |
41-
asyw->point.x);
53+
if (curs507a_space(wndw)) {
54+
nvif_wr32(&wndw->wimm.base.user, 0x0084, asyw->point.y << 16 |
55+
asyw->point.x);
56+
}
4257
}
4358

4459
const struct nv50_wimm_func

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@
2525
static void
2626
cursc37a_update(struct nv50_wndw *wndw, u32 *interlock)
2727
{
28-
nvif_wr32(&wndw->wimm.base.user, 0x0200, 0x00000001);
28+
if (curs507a_space(wndw))
29+
nvif_wr32(&wndw->wimm.base.user, 0x0200, 0x00000001);
2930
}
3031

3132
static void
3233
cursc37a_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
3334
{
34-
nvif_wr32(&wndw->wimm.base.user, 0x0208, asyw->point.y << 16 |
35-
asyw->point.x);
35+
if (curs507a_space(wndw)) {
36+
nvif_wr32(&wndw->wimm.base.user, 0x0208, asyw->point.y << 16 |
37+
asyw->point.x);
38+
}
3639
}
3740

3841
static const struct nv50_wimm_func

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include <nvif/cl5070.h>
4646
#include <nvif/cl507d.h>
4747
#include <nvif/event.h>
48+
#include <nvif/timer.h>
4849

4950
#include "nouveau_drv.h"
5051
#include "nouveau_dma.h"

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
#include <nouveau_bo.h>
2626

27+
#include <nvif/timer.h>
28+
2729
static void
2830
ovly827e_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
2931
{

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ struct nv50_wimm_func {
9797
};
9898

9999
extern const struct nv50_wimm_func curs507a;
100+
bool curs507a_space(struct nv50_wndw *);
100101

101102
int wndwc37e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
102103
struct nv50_wndw **);

0 commit comments

Comments
 (0)