Skip to content

Commit 889fcbe

Browse files
Ben Skeggsairlied
authored andcommitted
drm/nouveau/disp: add common channel class handling
Replaces a bunch of unnecessarily duplicated boilerplate in per-chipset code with a simpler, common, implementation. Channel "awaken" notify code is completely gone for now. KMS has never made use of it so far, and event notify handling is about to be changed in general anyway. Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
1 parent 7bcf89e commit 889fcbe

Some content is hidden

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

42 files changed

+470
-841
lines changed

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: 2 additions & 2 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

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)