mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
This information will be exposed to userspace in the following commit. Add struct nvkm_gr_zcull_info, which serves as abstraction layer between the corresponding uAPI (added in a subsequent patch) and the firmware structure. Extend the existing get_ctxbufs callback to also fill in zcull info. ctxsw_size and ctxsw_align come from NV2080_CTRL_CMD_INTERNAL_STATIC_KGR_GET_CONTEXT_BUFFERS_INFO, which is already called by r570_gr_get_ctxbufs, while the rest of the zcull info comes from NV0080_CTRL_FIFO_GET_ENGINE_CONTEXT_PROPERTIES_ENGINE_ID_GRAPHICS_ZCULL. Adding a separate callback for zcull info would require us to either: 1) Call GET_CONTEXT_BUFFERS_INFO twice, once for each callback. This is a little slower and more verbose than calling it once. or 2) Fill out zcull_info partially in r570_gr_get_ctxbufs and partially in the new callback. Since we fill out only some of the info in each we now need to handle edge cases where one function is called but not the other as well as them being called in an arbitrary order. Because of this, it's simplest to combine them in a single call (get_ctxbufs_and_zcull_info), which avoids repeated rpc calls to the gpu without the complexity of handling partially complete states. Signed-off-by: Mel Henning <mhenning@darkrefraction.com> Link: https://patch.msgid.link/20260219-zcull3-v3-1-dbe6a716f104@darkrefraction.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
78 lines
4.5 KiB
C
78 lines
4.5 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
#ifndef __NVKM_GR_H__
|
|
#define __NVKM_GR_H__
|
|
#include <core/engine.h>
|
|
|
|
struct nvkm_gr_zcull_info {
|
|
__u32 width_align_pixels;
|
|
__u32 height_align_pixels;
|
|
__u32 pixel_squares_by_aliquots;
|
|
__u32 aliquot_total;
|
|
__u32 zcull_region_byte_multiplier;
|
|
__u32 zcull_region_header_size;
|
|
__u32 zcull_subregion_header_size;
|
|
__u32 subregion_count;
|
|
__u32 subregion_width_align_pixels;
|
|
__u32 subregion_height_align_pixels;
|
|
|
|
__u32 ctxsw_size;
|
|
__u32 ctxsw_align;
|
|
};
|
|
|
|
struct nvkm_gr {
|
|
const struct nvkm_gr_func *func;
|
|
struct nvkm_engine engine;
|
|
|
|
struct nvkm_gr_zcull_info zcull_info;
|
|
bool has_zcull_info;
|
|
};
|
|
|
|
u64 nvkm_gr_units(struct nvkm_gr *);
|
|
int nvkm_gr_tlb_flush(struct nvkm_gr *);
|
|
int nvkm_gr_ctxsw_pause(struct nvkm_device *);
|
|
int nvkm_gr_ctxsw_resume(struct nvkm_device *);
|
|
u32 nvkm_gr_ctxsw_inst(struct nvkm_device *);
|
|
|
|
int nv04_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int nv10_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int nv15_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int nv17_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int nv20_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int nv25_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int nv2a_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int nv30_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int nv34_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int nv35_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int nv40_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int nv44_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int nv50_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int g84_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gt200_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int mcp79_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gt215_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int mcp89_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gf100_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gf104_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gf108_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gf110_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gf117_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gf119_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gk104_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gk110_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gk110b_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gk208_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gk20a_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gm107_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gm200_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gm20b_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gp100_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gp102_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gp104_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gp107_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gp108_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gp10b_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int gv100_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int tu102_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
int ga102_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
|
|
#endif
|