diff options
| author | Dave Airlie <airlied@redhat.com> | 2018-12-12 18:32:41 -0500 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2018-12-12 18:33:50 -0500 |
| commit | b5f436e7b4c2fcdb96204dbba346bddc7fc3e850 (patch) | |
| tree | 532feaaa4d1f74df0a4203c94d2d642b891cec45 | |
| parent | 26eacb788b7e37f9b08e6e6fc9686bf0817c0163 (diff) | |
| parent | 24199c5436f267399afed0c4f1f57663c0408f57 (diff) | |
Merge branch 'linux-4.20' of git://github.com/skeggsb/linux into drm-fixes
Three fixes:
tegra regression fix
display flushing fix
mst cleanup fix.
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Ben Skeggs <skeggsb@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/CACAvsv7WCPzjQZonk+eS1FgEUKirz-4LOrVpMUVMM=D-GjbVpg@mail.gmail.com
| -rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/disp.c | 30 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.c | 6 |
2 files changed, 25 insertions, 11 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 6cbbae3f438b..db1bf7f88c1f 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c | |||
| @@ -198,6 +198,22 @@ nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp, | |||
| 198 | /****************************************************************************** | 198 | /****************************************************************************** |
| 199 | * EVO channel helpers | 199 | * EVO channel helpers |
| 200 | *****************************************************************************/ | 200 | *****************************************************************************/ |
| 201 | static void | ||
| 202 | evo_flush(struct nv50_dmac *dmac) | ||
| 203 | { | ||
| 204 | /* Push buffer fetches are not coherent with BAR1, we need to ensure | ||
| 205 | * writes have been flushed right through to VRAM before writing PUT. | ||
| 206 | */ | ||
| 207 | if (dmac->push.type & NVIF_MEM_VRAM) { | ||
| 208 | struct nvif_device *device = dmac->base.device; | ||
| 209 | nvif_wr32(&device->object, 0x070000, 0x00000001); | ||
| 210 | nvif_msec(device, 2000, | ||
| 211 | if (!(nvif_rd32(&device->object, 0x070000) & 0x00000002)) | ||
| 212 | break; | ||
| 213 | ); | ||
| 214 | } | ||
| 215 | } | ||
| 216 | |||
| 201 | u32 * | 217 | u32 * |
| 202 | evo_wait(struct nv50_dmac *evoc, int nr) | 218 | evo_wait(struct nv50_dmac *evoc, int nr) |
| 203 | { | 219 | { |
| @@ -208,6 +224,7 @@ evo_wait(struct nv50_dmac *evoc, int nr) | |||
| 208 | mutex_lock(&dmac->lock); | 224 | mutex_lock(&dmac->lock); |
| 209 | if (put + nr >= (PAGE_SIZE / 4) - 8) { | 225 | if (put + nr >= (PAGE_SIZE / 4) - 8) { |
| 210 | dmac->ptr[put] = 0x20000000; | 226 | dmac->ptr[put] = 0x20000000; |
| 227 | evo_flush(dmac); | ||
| 211 | 228 | ||
| 212 | nvif_wr32(&dmac->base.user, 0x0000, 0x00000000); | 229 | nvif_wr32(&dmac->base.user, 0x0000, 0x00000000); |
| 213 | if (nvif_msec(device, 2000, | 230 | if (nvif_msec(device, 2000, |
| @@ -230,17 +247,7 @@ evo_kick(u32 *push, struct nv50_dmac *evoc) | |||
| 230 | { | 247 | { |
| 231 | struct nv50_dmac *dmac = evoc; | 248 | struct nv50_dmac *dmac = evoc; |
| 232 | 249 | ||
| 233 | /* Push buffer fetches are not coherent with BAR1, we need to ensure | 250 | evo_flush(dmac); |
| 234 | * writes have been flushed right through to VRAM before writing PUT. | ||
| 235 | */ | ||
| 236 | if (dmac->push.type & NVIF_MEM_VRAM) { | ||
| 237 | struct nvif_device *device = dmac->base.device; | ||
| 238 | nvif_wr32(&device->object, 0x070000, 0x00000001); | ||
| 239 | nvif_msec(device, 2000, | ||
| 240 | if (!(nvif_rd32(&device->object, 0x070000) & 0x00000002)) | ||
| 241 | break; | ||
| 242 | ); | ||
| 243 | } | ||
| 244 | 251 | ||
| 245 | nvif_wr32(&dmac->base.user, 0x0000, (push - dmac->ptr) << 2); | 252 | nvif_wr32(&dmac->base.user, 0x0000, (push - dmac->ptr) << 2); |
| 246 | mutex_unlock(&dmac->lock); | 253 | mutex_unlock(&dmac->lock); |
| @@ -1264,6 +1271,7 @@ nv50_mstm_del(struct nv50_mstm **pmstm) | |||
| 1264 | { | 1271 | { |
| 1265 | struct nv50_mstm *mstm = *pmstm; | 1272 | struct nv50_mstm *mstm = *pmstm; |
| 1266 | if (mstm) { | 1273 | if (mstm) { |
| 1274 | drm_dp_mst_topology_mgr_destroy(&mstm->mgr); | ||
| 1267 | kfree(*pmstm); | 1275 | kfree(*pmstm); |
| 1268 | *pmstm = NULL; | 1276 | *pmstm = NULL; |
| 1269 | } | 1277 | } |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 2b2baf6e0e0d..d2928d43f29a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
| @@ -1171,10 +1171,16 @@ nouveau_platform_device_create(const struct nvkm_device_tegra_func *func, | |||
| 1171 | goto err_free; | 1171 | goto err_free; |
| 1172 | } | 1172 | } |
| 1173 | 1173 | ||
| 1174 | err = nouveau_drm_device_init(drm); | ||
| 1175 | if (err) | ||
| 1176 | goto err_put; | ||
| 1177 | |||
| 1174 | platform_set_drvdata(pdev, drm); | 1178 | platform_set_drvdata(pdev, drm); |
| 1175 | 1179 | ||
| 1176 | return drm; | 1180 | return drm; |
| 1177 | 1181 | ||
| 1182 | err_put: | ||
| 1183 | drm_dev_put(drm); | ||
| 1178 | err_free: | 1184 | err_free: |
| 1179 | nvkm_device_del(pdevice); | 1185 | nvkm_device_del(pdevice); |
| 1180 | 1186 | ||
