2018-05-08 20:39:47 +10:00
|
|
|
#ifndef __NV50_KMS_WNDW_H__
|
|
|
|
#define __NV50_KMS_WNDW_H__
|
|
|
|
#define nv50_wndw(p) container_of((p), struct nv50_wndw, plane)
|
|
|
|
#include "disp.h"
|
|
|
|
#include "atom.h"
|
2018-05-08 20:39:47 +10:00
|
|
|
#include "lut.h"
|
2018-05-08 20:39:47 +10:00
|
|
|
|
|
|
|
struct nv50_wndw_ctxdma {
|
|
|
|
struct list_head head;
|
|
|
|
struct nvif_object object;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nv50_wndw {
|
|
|
|
const struct nv50_wndw_func *func;
|
|
|
|
const struct nv50_wimm_func *immd;
|
|
|
|
int id;
|
2018-05-08 20:39:47 +10:00
|
|
|
struct nv50_disp_interlock interlock;
|
2018-05-08 20:39:47 +10:00
|
|
|
|
|
|
|
struct {
|
|
|
|
struct nvif_object *parent;
|
|
|
|
struct list_head list;
|
|
|
|
} ctxdma;
|
|
|
|
|
|
|
|
struct drm_plane plane;
|
|
|
|
|
2018-05-08 20:39:47 +10:00
|
|
|
struct nv50_lut ilut;
|
|
|
|
|
2018-05-08 20:39:47 +10:00
|
|
|
struct nv50_dmac wndw;
|
|
|
|
struct nv50_dmac wimm;
|
|
|
|
|
|
|
|
u16 ntfy;
|
|
|
|
u16 sema;
|
|
|
|
u32 data;
|
|
|
|
};
|
|
|
|
|
|
|
|
int nv50_wndw_new_(const struct nv50_wndw_func *, struct drm_device *,
|
|
|
|
enum drm_plane_type, const char *name, int index,
|
drm/nouveau/kms/nv50: fix nv50_wndw_new_ prototype
gcc-13 warns about mismatching types for enums. That revealed switched
arguments of nv50_wndw_new_():
drivers/gpu/drm/nouveau/dispnv50/wndw.c:696:1: error: conflicting types for 'nv50_wndw_new_' due to enum/integer mismatch; have 'int(const struct nv50_wndw_func *, struct drm_device *, enum drm_plane_type, const char *, int, const u32 *, u32, enum nv50_disp_interlock_type, u32, struct nv50_wndw **)'
drivers/gpu/drm/nouveau/dispnv50/wndw.h:36:5: note: previous declaration of 'nv50_wndw_new_' with type 'int(const struct nv50_wndw_func *, struct drm_device *, enum drm_plane_type, const char *, int, const u32 *, enum nv50_disp_interlock_type, u32, u32, struct nv50_wndw **)'
It can be barely visible, but the declaration says about the parameters
in the middle:
enum nv50_disp_interlock_type,
u32 interlock_data,
u32 heads,
While the definition states differently:
u32 heads,
enum nv50_disp_interlock_type interlock_type,
u32 interlock_data,
Unify/fix the declaration to match the definition.
Fixes: 53e0a3e70de6 ("drm/nouveau/kms/nv50-: simplify tracking of channel interlocks")
Cc: Martin Liska <mliska@suse.cz>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Karol Herbst <kherbst@redhat.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221031114229.10289-1-jirislaby@kernel.org
2022-10-31 12:42:29 +01:00
|
|
|
const u32 *format, u32 heads,
|
|
|
|
enum nv50_disp_interlock_type, u32 interlock_data,
|
|
|
|
struct nv50_wndw **);
|
2018-05-08 20:39:47 +10:00
|
|
|
void nv50_wndw_flush_set(struct nv50_wndw *, u32 *interlock,
|
|
|
|
struct nv50_wndw_atom *);
|
|
|
|
void nv50_wndw_flush_clr(struct nv50_wndw *, u32 *interlock, bool flush,
|
|
|
|
struct nv50_wndw_atom *);
|
2018-05-08 20:39:47 +10:00
|
|
|
void nv50_wndw_ntfy_enable(struct nv50_wndw *, struct nv50_wndw_atom *);
|
2018-05-08 20:39:47 +10:00
|
|
|
int nv50_wndw_wait_armed(struct nv50_wndw *, struct nv50_wndw_atom *);
|
|
|
|
|
|
|
|
struct nv50_wndw_func {
|
|
|
|
int (*acquire)(struct nv50_wndw *, struct nv50_wndw_atom *asyw,
|
|
|
|
struct nv50_head_atom *asyh);
|
|
|
|
void (*release)(struct nv50_wndw *, struct nv50_wndw_atom *asyw,
|
|
|
|
struct nv50_head_atom *asyh);
|
|
|
|
void (*prepare)(struct nv50_wndw *, struct nv50_head_atom *asyh,
|
|
|
|
struct nv50_wndw_atom *asyw);
|
|
|
|
|
2020-06-20 07:57:12 +10:00
|
|
|
int (*sema_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
|
2020-06-20 08:04:01 +10:00
|
|
|
int (*sema_clr)(struct nv50_wndw *);
|
2018-05-08 20:39:47 +10:00
|
|
|
void (*ntfy_reset)(struct nouveau_bo *, u32 offset);
|
2020-06-20 08:29:31 +10:00
|
|
|
int (*ntfy_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
|
2020-06-20 08:32:28 +10:00
|
|
|
int (*ntfy_clr)(struct nv50_wndw *);
|
2018-05-08 20:39:47 +10:00
|
|
|
int (*ntfy_wait_begun)(struct nouveau_bo *, u32 offset,
|
|
|
|
struct nvif_device *);
|
2021-03-17 19:01:46 -04:00
|
|
|
void (*ilut)(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyh, int size);
|
2019-06-11 22:40:36 -04:00
|
|
|
void (*csc)(struct nv50_wndw *, struct nv50_wndw_atom *,
|
|
|
|
const struct drm_color_ctm *);
|
2020-06-20 08:39:21 +10:00
|
|
|
int (*csc_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
|
2020-06-20 08:44:11 +10:00
|
|
|
int (*csc_clr)(struct nv50_wndw *);
|
2018-12-11 14:50:02 +10:00
|
|
|
bool ilut_identity;
|
2019-09-06 00:13:59 -04:00
|
|
|
int ilut_size;
|
2018-05-08 20:39:47 +10:00
|
|
|
bool olut_core;
|
2020-06-20 08:47:20 +10:00
|
|
|
int (*xlut_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
|
2020-06-20 08:50:50 +10:00
|
|
|
int (*xlut_clr)(struct nv50_wndw *);
|
2020-06-20 09:20:17 +10:00
|
|
|
int (*image_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
|
2020-06-20 09:23:10 +10:00
|
|
|
int (*image_clr)(struct nv50_wndw *);
|
2020-06-20 09:24:21 +10:00
|
|
|
int (*scale_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
|
2020-06-20 09:25:55 +10:00
|
|
|
int (*blend_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
|
2018-05-08 20:39:47 +10:00
|
|
|
|
2020-06-20 09:32:58 +10:00
|
|
|
int (*update)(struct nv50_wndw *, u32 *interlock);
|
2018-05-08 20:39:47 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
extern const struct drm_plane_funcs nv50_wndw;
|
|
|
|
|
2018-05-08 20:39:47 +10:00
|
|
|
void base507c_ntfy_reset(struct nouveau_bo *, u32);
|
2020-06-20 08:29:31 +10:00
|
|
|
int base507c_ntfy_set(struct nv50_wndw *, struct nv50_wndw_atom *);
|
2020-06-20 08:32:28 +10:00
|
|
|
int base507c_ntfy_clr(struct nv50_wndw *);
|
2018-05-08 20:39:47 +10:00
|
|
|
int base507c_ntfy_wait_begun(struct nouveau_bo *, u32, struct nvif_device *);
|
2020-06-20 09:23:10 +10:00
|
|
|
int base507c_image_clr(struct nv50_wndw *);
|
2020-06-20 09:32:58 +10:00
|
|
|
int base507c_update(struct nv50_wndw *, u32 *);
|
2018-05-08 20:39:47 +10:00
|
|
|
|
2019-06-11 17:46:39 +10:00
|
|
|
void base907c_csc(struct nv50_wndw *, struct nv50_wndw_atom *,
|
|
|
|
const struct drm_color_ctm *);
|
|
|
|
|
2018-05-08 20:39:47 +10:00
|
|
|
struct nv50_wimm_func {
|
2020-06-21 10:19:40 +10:00
|
|
|
int (*point)(struct nv50_wndw *, struct nv50_wndw_atom *);
|
2018-05-08 20:39:47 +10:00
|
|
|
|
2020-06-21 10:22:35 +10:00
|
|
|
int (*update)(struct nv50_wndw *, u32 *interlock);
|
2018-05-08 20:39:47 +10:00
|
|
|
};
|
2018-05-08 20:39:47 +10:00
|
|
|
|
|
|
|
extern const struct nv50_wimm_func curs507a;
|
2020-02-17 14:33:57 +10:00
|
|
|
bool curs507a_space(struct nv50_wndw *);
|
2018-05-08 20:39:48 +10:00
|
|
|
|
2020-06-21 10:19:40 +10:00
|
|
|
static inline __must_check int
|
|
|
|
nvif_chan_wait(struct nv50_dmac *dmac, u32 size)
|
|
|
|
{
|
|
|
|
struct nv50_wndw *wndw = container_of(dmac, typeof(*wndw), wimm);
|
|
|
|
return curs507a_space(wndw) ? 0 : -ETIMEDOUT;
|
|
|
|
}
|
|
|
|
|
2018-05-08 20:39:48 +10:00
|
|
|
int wndwc37e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
|
|
|
|
struct nv50_wndw **);
|
2018-12-11 14:50:02 +10:00
|
|
|
int wndwc37e_new_(const struct nv50_wndw_func *, struct nouveau_drm *,
|
|
|
|
enum drm_plane_type type, int index, s32 oclass, u32 heads,
|
|
|
|
struct nv50_wndw **);
|
|
|
|
int wndwc37e_acquire(struct nv50_wndw *, struct nv50_wndw_atom *,
|
|
|
|
struct nv50_head_atom *);
|
|
|
|
void wndwc37e_release(struct nv50_wndw *, struct nv50_wndw_atom *,
|
|
|
|
struct nv50_head_atom *);
|
2020-06-20 07:57:12 +10:00
|
|
|
int wndwc37e_sema_set(struct nv50_wndw *, struct nv50_wndw_atom *);
|
2020-06-20 08:04:01 +10:00
|
|
|
int wndwc37e_sema_clr(struct nv50_wndw *);
|
2020-06-20 08:29:31 +10:00
|
|
|
int wndwc37e_ntfy_set(struct nv50_wndw *, struct nv50_wndw_atom *);
|
2020-06-20 08:32:28 +10:00
|
|
|
int wndwc37e_ntfy_clr(struct nv50_wndw *);
|
2020-06-20 09:23:10 +10:00
|
|
|
int wndwc37e_image_clr(struct nv50_wndw *);
|
2020-06-20 09:25:55 +10:00
|
|
|
int wndwc37e_blend_set(struct nv50_wndw *, struct nv50_wndw_atom *);
|
2020-06-20 09:32:58 +10:00
|
|
|
int wndwc37e_update(struct nv50_wndw *, u32 *);
|
2018-12-11 14:50:02 +10:00
|
|
|
|
|
|
|
int wndwc57e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
|
|
|
|
struct nv50_wndw **);
|
2021-03-17 19:01:46 -04:00
|
|
|
void wndwc57e_ilut(struct nv50_wndw *, struct nv50_wndw_atom *, int);
|
2021-01-13 17:12:52 +10:00
|
|
|
int wndwc57e_ilut_set(struct nv50_wndw *, struct nv50_wndw_atom *);
|
|
|
|
int wndwc57e_ilut_clr(struct nv50_wndw *);
|
|
|
|
int wndwc57e_csc_set(struct nv50_wndw *, struct nv50_wndw_atom *);
|
|
|
|
int wndwc57e_csc_clr(struct nv50_wndw *);
|
|
|
|
|
|
|
|
int wndwc67e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
|
|
|
|
struct nv50_wndw **);
|
2018-05-08 20:39:48 +10:00
|
|
|
|
2025-02-04 08:55:17 +10:00
|
|
|
int wndwca7e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
|
|
|
|
struct nv50_wndw **);
|
|
|
|
|
2018-05-08 20:39:48 +10:00
|
|
|
int nv50_wndw_new(struct nouveau_drm *, enum drm_plane_type, int index,
|
|
|
|
struct nv50_wndw **);
|
2018-05-08 20:39:47 +10:00
|
|
|
#endif
|