Skip to content

Commit 2bc7ea7

Browse files
committed
Merge tag 'topic/nouveau-misc-2022-07-27' of git://anongit.freedesktop.org/drm/drm into drm-next
drm/nouveau-misc: display patches. These are just some precursor and cleanup display patches from Ben, tested by Lyude. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Dave Airlie <airlied@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/CAPM=9ty0R37q0mohBr_CegpYLXK2=fAH54QfAsMhHfPygTsdQA@mail.gmail.com
2 parents ee8b1ef + dfc4005 commit 2bc7ea7

158 files changed

Lines changed: 6386 additions & 8845 deletions

File tree

Some content is hidden

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

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

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
*/
2222
#include "base.h"
2323

24-
#include <nvif/cl507c.h>
25-
#include <nvif/event.h>
24+
#include <nvif/if0014.h>
2625
#include <nvif/push507c.h>
2726
#include <nvif/timer.h>
2827

@@ -306,8 +305,8 @@ base507c_new_(const struct nv50_wndw_func *func, const u32 *format,
306305
struct nouveau_drm *drm, int head, s32 oclass, u32 interlock_data,
307306
struct nv50_wndw **pwndw)
308307
{
309-
struct nv50_disp_base_channel_dma_v0 args = {
310-
.head = head,
308+
struct nvif_disp_chan_v0 args = {
309+
.id = head,
311310
};
312311
struct nouveau_display *disp = nouveau_display(drm->dev);
313312
struct nv50_disp *disp50 = nv50_disp(drm->dev);
@@ -328,16 +327,6 @@ base507c_new_(const struct nv50_wndw_func *func, const u32 *format,
328327
return ret;
329328
}
330329

331-
ret = nvif_notify_ctor(&wndw->wndw.base.user, "kmsBaseNtfy",
332-
wndw->notify.func, false,
333-
NV50_DISP_BASE_CHANNEL_DMA_V0_NTFY_UEVENT,
334-
&(struct nvif_notify_uevent_req) {},
335-
sizeof(struct nvif_notify_uevent_req),
336-
sizeof(struct nvif_notify_uevent_rep),
337-
&wndw->notify);
338-
if (ret)
339-
return ret;
340-
341330
wndw->ntfy = NV50_DISP_BASE_NTFY(wndw->id);
342331
wndw->sema = NV50_DISP_BASE_SEM0(wndw->id);
343332
wndw->data = 0x00000000;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "core.h"
2323
#include "head.h"
2424

25-
#include <nvif/cl507d.h>
25+
#include <nvif/if0014.h>
2626
#include <nvif/push507c.h>
2727
#include <nvif/timer.h>
2828

@@ -157,7 +157,7 @@ int
157157
core507d_new_(const struct nv50_core_func *func, struct nouveau_drm *drm,
158158
s32 oclass, struct nv50_core **pcore)
159159
{
160-
struct nv50_disp_core_channel_dma_v0 args = {};
160+
struct nvif_disp_chan_v0 args = {};
161161
struct nv50_disp *disp = nv50_disp(drm->dev);
162162
struct nv50_core *core;
163163
int ret;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "core.h"
2424
#include "head.h"
2525

26-
#include <nvif/cl507a.h>
26+
#include <nvif/if0014.h>
2727
#include <nvif/timer.h>
2828

2929
#include <nvhw/class/cl507a.h>
@@ -150,8 +150,8 @@ curs507a_new_(const struct nv50_wimm_func *func, struct nouveau_drm *drm,
150150
int head, s32 oclass, u32 interlock_data,
151151
struct nv50_wndw **pwndw)
152152
{
153-
struct nv50_disp_cursor_v0 args = {
154-
.head = head,
153+
struct nvif_disp_chan_v0 args = {
154+
.id = head,
155155
};
156156
struct nv50_disp *disp = nv50_disp(drm->dev);
157157
struct nv50_wndw *wndw;

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

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
#include <nvif/class.h>
4949
#include <nvif/cl0002.h>
5050
#include <nvif/cl5070.h>
51-
#include <nvif/cl507d.h>
5251
#include <nvif/event.h>
52+
#include <nvif/if0014.h>
5353
#include <nvif/timer.h>
5454

5555
#include <nvhw/class/cl507c.h>
@@ -231,7 +231,7 @@ nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
231231
struct nv50_dmac *dmac)
232232
{
233233
struct nouveau_cli *cli = (void *)device->object.client;
234-
struct nv50_disp_core_channel_dma_v0 *args = data;
234+
struct nvif_disp_chan_v0 *args = data;
235235
u8 type = NVIF_MEM_COHERENT;
236236
int ret;
237237

@@ -529,24 +529,15 @@ static enum drm_connector_status
529529
nv50_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector)
530530
{
531531
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
532-
struct nv50_disp *disp = nv50_disp(encoder->dev);
533-
struct {
534-
struct nv50_disp_mthd_v1 base;
535-
struct nv50_disp_dac_load_v0 load;
536-
} args = {
537-
.base.version = 1,
538-
.base.method = NV50_DISP_MTHD_V1_DAC_LOAD,
539-
.base.hasht = nv_encoder->dcb->hasht,
540-
.base.hashm = nv_encoder->dcb->hashm,
541-
};
532+
u32 loadval;
542533
int ret;
543534

544-
args.load.data = nouveau_drm(encoder->dev)->vbios.dactestval;
545-
if (args.load.data == 0)
546-
args.load.data = 340;
535+
loadval = nouveau_drm(encoder->dev)->vbios.dactestval;
536+
if (loadval == 0)
537+
loadval = 340;
547538

548-
ret = nvif_mthd(&disp->disp->object, 0, &args, sizeof(args));
549-
if (ret || !args.load.load)
539+
ret = nvif_outp_load_detect(&nv_encoder->outp, loadval);
540+
if (ret <= 0)
550541
return connector_status_disconnected;
551542

552543
return connector_status_connected;
@@ -563,6 +554,10 @@ nv50_dac_help = {
563554
static void
564555
nv50_dac_destroy(struct drm_encoder *encoder)
565556
{
557+
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
558+
559+
nvif_outp_dtor(&nv_encoder->outp);
560+
566561
drm_encoder_cleanup(encoder);
567562
kfree(encoder);
568563
}
@@ -576,6 +571,7 @@ static int
576571
nv50_dac_create(struct drm_connector *connector, struct dcb_output *dcbe)
577572
{
578573
struct nouveau_drm *drm = nouveau_drm(connector->dev);
574+
struct nv50_disp *disp = nv50_disp(connector->dev);
579575
struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device);
580576
struct nvkm_i2c_bus *bus;
581577
struct nouveau_encoder *nv_encoder;
@@ -599,7 +595,7 @@ nv50_dac_create(struct drm_connector *connector, struct dcb_output *dcbe)
599595
drm_encoder_helper_add(encoder, &nv50_dac_help);
600596

601597
drm_connector_attach_encoder(connector, encoder);
602-
return 0;
598+
return nvif_outp_ctor(disp->disp, nv_encoder->base.base.name, dcbe->id, &nv_encoder->outp);
603599
}
604600

605601
/*
@@ -1822,6 +1818,9 @@ static void
18221818
nv50_sor_destroy(struct drm_encoder *encoder)
18231819
{
18241820
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
1821+
1822+
nvif_outp_dtor(&nv_encoder->outp);
1823+
18251824
nv50_mstm_del(&nv_encoder->dp.mstm);
18261825
drm_encoder_cleanup(encoder);
18271826

@@ -1918,7 +1917,7 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
19181917
nv_encoder->i2c = &bus->i2c;
19191918
}
19201919

1921-
return 0;
1920+
return nvif_outp_ctor(disp->disp, nv_encoder->base.base.name, dcbe->id, &nv_encoder->outp);
19221921
}
19231922

19241923
/******************************************************************************
@@ -1999,6 +1998,10 @@ nv50_pior_help = {
19991998
static void
20001999
nv50_pior_destroy(struct drm_encoder *encoder)
20012000
{
2001+
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
2002+
2003+
nvif_outp_dtor(&nv_encoder->outp);
2004+
20022005
drm_encoder_cleanup(encoder);
20032006
kfree(encoder);
20042007
}
@@ -2056,7 +2059,7 @@ nv50_pior_create(struct drm_connector *connector, struct dcb_output *dcbe)
20562059
disp->core->func->pior->get_caps(disp, nv_encoder, ffs(dcbe->or) - 1);
20572060
nv50_outp_dump_caps(drm, nv_encoder);
20582061

2059-
return 0;
2062+
return nvif_outp_ctor(disp->disp, nv_encoder->base.base.name, dcbe->id, &nv_encoder->outp);
20602063
}
20612064

20622065
/******************************************************************************

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
*/
2222
#include "oimm.h"
2323

24-
#include <nvif/cl507b.h>
24+
#include <nvif/if0014.h>
2525

2626
static int
2727
oimm507b_init_(const struct nv50_wimm_func *func, struct nouveau_drm *drm,
2828
s32 oclass, struct nv50_wndw *wndw)
2929
{
30-
struct nv50_disp_overlay_v0 args = {
31-
.head = wndw->id,
30+
struct nvif_disp_chan_v0 args = {
31+
.id = wndw->id,
3232
};
3333
struct nv50_disp *disp = nv50_disp(drm->dev);
3434
int ret;

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

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
#include <drm/drm_fourcc.h>
2727
#include <drm/drm_plane_helper.h>
2828

29-
#include <nvif/cl507e.h>
30-
#include <nvif/event.h>
29+
#include <nvif/if0014.h>
3130
#include <nvif/push507c.h>
3231

3332
#include <nvhw/class/cl507e.h>
@@ -147,8 +146,8 @@ ovly507e_new_(const struct nv50_wndw_func *func, const u32 *format,
147146
struct nouveau_drm *drm, int head, s32 oclass, u32 interlock_data,
148147
struct nv50_wndw **pwndw)
149148
{
150-
struct nv50_disp_overlay_channel_dma_v0 args = {
151-
.head = head,
149+
struct nvif_disp_chan_v0 args = {
150+
.id = head,
152151
};
153152
struct nv50_disp *disp = nv50_disp(drm->dev);
154153
struct nv50_wndw *wndw;
@@ -169,16 +168,6 @@ ovly507e_new_(const struct nv50_wndw_func *func, const u32 *format,
169168
return ret;
170169
}
171170

172-
ret = nvif_notify_ctor(&wndw->wndw.base.user, "kmsOvlyNtfy",
173-
wndw->notify.func, false,
174-
NV50_DISP_OVERLAY_CHANNEL_DMA_V0_NTFY_UEVENT,
175-
&(struct nvif_notify_uevent_req) {},
176-
sizeof(struct nvif_notify_uevent_req),
177-
sizeof(struct nvif_notify_uevent_rep),
178-
&wndw->notify);
179-
if (ret)
180-
return ret;
181-
182171
wndw->ntfy = NV50_DISP_OVLY_NTFY(wndw->id);
183172
wndw->sema = NV50_DISP_OVLY_SEM0(wndw->id);
184173
wndw->data = 0x00000000;

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "atom.h"
2424
#include "wndw.h"
2525

26-
#include <nvif/clc37b.h>
26+
#include <nvif/if0014.h>
2727
#include <nvif/pushc37b.h>
2828

2929
#include <nvhw/class/clc37b.h>
@@ -68,9 +68,8 @@ static int
6868
wimmc37b_init_(const struct nv50_wimm_func *func, struct nouveau_drm *drm,
6969
s32 oclass, struct nv50_wndw *wndw)
7070
{
71-
struct nvc37b_window_imm_channel_dma_v0 args = {
72-
.pushbuf = 0xb0007b00 | wndw->id,
73-
.index = wndw->id,
71+
struct nvif_disp_chan_v0 args = {
72+
.id = wndw->id,
7473
};
7574
struct nv50_disp *disp = nv50_disp(drm->dev);
7675
int ret;

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,6 @@ nv50_wndw_destroy(struct drm_plane *plane)
644644
nv50_wndw_ctxdma_del(ctxdma);
645645
}
646646

647-
nvif_notify_dtor(&wndw->notify);
648647
nv50_dmac_destroy(&wndw->wimm);
649648
nv50_dmac_destroy(&wndw->wndw);
650649

@@ -688,12 +687,6 @@ nv50_wndw = {
688687
.format_mod_supported = nv50_plane_format_mod_supported,
689688
};
690689

691-
static int
692-
nv50_wndw_notify(struct nvif_notify *notify)
693-
{
694-
return NVIF_NOTIFY_KEEP;
695-
}
696-
697690
static const u64 nv50_cursor_format_modifiers[] = {
698691
DRM_FORMAT_MOD_LINEAR,
699692
DRM_FORMAT_MOD_INVALID,
@@ -747,8 +740,6 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev,
747740
return ret;
748741
}
749742

750-
wndw->notify.func = nv50_wndw_notify;
751-
752743
if (wndw->func->blend_set) {
753744
ret = drm_plane_create_zpos_property(&wndw->plane,
754745
nv50_wndw_zpos_default(&wndw->plane), 0, 254);

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#include "atom.h"
66
#include "lut.h"
77

8-
#include <nvif/notify.h>
9-
108
struct nv50_wndw_ctxdma {
119
struct list_head head;
1210
struct nvif_object object;
@@ -30,7 +28,6 @@ struct nv50_wndw {
3028
struct nv50_dmac wndw;
3129
struct nv50_dmac wimm;
3230

33-
struct nvif_notify notify;
3431
u16 ntfy;
3532
u16 sema;
3633
u32 data;

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <drm/drm_plane_helper.h>
2727
#include <nouveau_bo.h>
2828

29-
#include <nvif/clc37e.h>
29+
#include <nvif/if0014.h>
3030
#include <nvif/pushc37b.h>
3131

3232
#include <nvhw/class/clc37e.h>
@@ -351,9 +351,8 @@ wndwc37e_new_(const struct nv50_wndw_func *func, struct nouveau_drm *drm,
351351
enum drm_plane_type type, int index, s32 oclass, u32 heads,
352352
struct nv50_wndw **pwndw)
353353
{
354-
struct nvc37e_window_channel_dma_v0 args = {
355-
.pushbuf = 0xb0007e00 | index,
356-
.index = index,
354+
struct nvif_disp_chan_v0 args = {
355+
.id = index,
357356
};
358357
struct nv50_disp *disp = nv50_disp(drm->dev);
359358
struct nv50_wndw *wndw;

0 commit comments

Comments
 (0)