Commit 6901f1d6 authored by Ben Skeggs's avatar Ben Skeggs Committed by Danilo Krummrich
Browse files

drm/nouveau: move nvxx_* definitions to nouveau_drv.h



These are some dodgy "convenience" macros for the DRM driver to peek
into NVKM state.  They're still used in a few places, but don't belong
in nvif/device.h in any case.

Move them to nouveau_drv.h, and modify callers to pass a nouveau_drm
instead of an nvif_device.

v2:
- use drm->nvkm pointer for nvxx_*() macros, removing some void*
v3:
- add some explanation of the nvxx_*() macros

Signed-off-by: default avatarBen Skeggs <bskeggs@nvidia.com>
Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-28-bskeggs@nvidia.com
parent 8d7b2d3a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -118,8 +118,8 @@ static void nv_crtc_calc_state_ext(struct drm_crtc *crtc, struct drm_display_mod
{
	struct drm_device *dev = crtc->dev;
	struct nouveau_drm *drm = nouveau_drm(dev);
	struct nvkm_bios *bios = nvxx_bios(&drm->client.device);
	struct nvkm_clk *clk = nvxx_clk(&drm->client.device);
	struct nvkm_bios *bios = nvxx_bios(drm);
	struct nvkm_clk *clk = nvxx_clk(drm);
	struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
	struct nv04_mode_state *state = &nv04_display(dev)->mode_reg;
	struct nv04_crtc_reg *regp = &state->crtc_reg[nv_crtc->index];
+1 −1
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ uint32_t nv17_dac_sample_load(struct drm_encoder *encoder)
	struct drm_device *dev = encoder->dev;
	struct nouveau_drm *drm = nouveau_drm(dev);
	struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
	struct nvkm_gpio *gpio = nvxx_gpio(&drm->client.device);
	struct nvkm_gpio *gpio = nvxx_gpio(drm);
	struct dcb_output *dcb = nouveau_encoder(encoder)->dcb;
	uint32_t sample, testval, regoffset = nv04_dac_output_offset(encoder);
	uint32_t saved_powerctrl_2 = 0, saved_powerctrl_4 = 0, saved_routput,
+1 −1
Original line number Diff line number Diff line
@@ -626,7 +626,7 @@ static void nv04_tmds_slave_init(struct drm_encoder *encoder)
	struct drm_device *dev = encoder->dev;
	struct dcb_output *dcb = nouveau_encoder(encoder)->dcb;
	struct nouveau_drm *drm = nouveau_drm(dev);
	struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device);
	struct nvkm_i2c *i2c = nvxx_i2c(drm);
	struct nvkm_i2c_bus *bus = nvkm_i2c_bus_find(i2c, NVKM_I2C_BUS_PRI);
	struct nvkm_i2c_bus_probe info[] = {
		{
+1 −1
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ int
nv04_display_create(struct drm_device *dev)
{
	struct nouveau_drm *drm = nouveau_drm(dev);
	struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device);
	struct nvkm_i2c *i2c = nvxx_i2c(drm);
	struct dcb_table *dcb = &drm->vbios.dcb;
	struct drm_connector *connector, *ct;
	struct drm_encoder *encoder;
+1 −1
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ static inline void
nouveau_bios_run_init_table(struct drm_device *dev, u16 table,
			    struct dcb_output *outp, int crtc)
{
	nvbios_init(&nvxx_bios(&nouveau_drm(dev)->client.device)->subdev, table,
	nvbios_init(&nvxx_bios(nouveau_drm(dev))->subdev, table,
		init.outp = outp;
		init.head = crtc;
	);
Loading