Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c66c87d authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/disp: remove hw-specific customisation of output paths



All of the necessary hw-specific logic is now handled at the output
resource level, so all of this can go away.

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent e8ccc96d
Loading
Loading
Loading
Loading
+21 −33
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
 */
#include "priv.h"
#include "conn.h"
#include "dp.h"
#include "head.h"
#include "ior.h"
#include "outp.h"
@@ -252,7 +253,8 @@ static int
nvkm_disp_oneinit(struct nvkm_engine *engine)
{
	struct nvkm_disp *disp = nvkm_disp(engine);
	struct nvkm_bios *bios = disp->engine.subdev.device->bios;
	struct nvkm_subdev *subdev = &disp->engine.subdev;
	struct nvkm_bios *bios = subdev->device->bios;
	struct nvkm_outp *outp, *outt, *pair;
	struct nvkm_conn *conn;
	struct nvkm_head *head;
@@ -265,52 +267,38 @@ nvkm_disp_oneinit(struct nvkm_engine *engine)
	/* Create output path objects for each VBIOS display path. */
	i = -1;
	while ((data = dcb_outp_parse(bios, ++i, &ver, &hdr, &dcbE))) {
		const struct nvkm_disp_func_outp *outps;
		int (*ctor)(struct nvkm_disp *, int, struct dcb_output *,
			    struct nvkm_outp **);

		if (dcbE.type == DCB_OUTPUT_UNUSED)
			continue;
		if (dcbE.type == DCB_OUTPUT_EOL)
			break;
		outp = NULL;

		switch (dcbE.location) {
		case 0: outps = &disp->func->outp.internal; break;
		case 1: outps = &disp->func->outp.external; break;
		default:
			nvkm_warn(&disp->engine.subdev,
				  "dcb %d locn %d unknown\n", i, dcbE.location);
			continue;
		}

		switch (dcbE.type) {
		case DCB_OUTPUT_ANALOG: ctor = outps->crt ; break;
		case DCB_OUTPUT_TV    : ctor = outps->tv  ; break;
		case DCB_OUTPUT_TMDS  : ctor = outps->tmds; break;
		case DCB_OUTPUT_LVDS  : ctor = outps->lvds; break;
		case DCB_OUTPUT_DP    : ctor = outps->dp  ; break;
		case DCB_OUTPUT_ANALOG:
		case DCB_OUTPUT_TV:
		case DCB_OUTPUT_TMDS:
		case DCB_OUTPUT_LVDS:
			ret = nvkm_outp_new(disp, i, &dcbE, &outp);
			break;
		case DCB_OUTPUT_DP:
			ret = nvkm_dp_new(disp, i, &dcbE, &outp);
			break;
		default:
			nvkm_warn(&disp->engine.subdev,
				  "dcb %d type %d unknown\n", i, dcbE.type);
			nvkm_warn(subdev, "dcb %d type %d unknown\n",
				  i, dcbE.type);
			continue;
		}

		if (ctor)
			ret = ctor(disp, i, &dcbE, &outp);
		else
			ret = -ENODEV;

		if (ret) {
			if (ret == -ENODEV) {
				nvkm_debug(&disp->engine.subdev,
					   "dcb %d %d/%d not supported\n",
					   i, dcbE.location, dcbE.type);
			if (outp) {
				if (ret != -ENODEV)
					OUTP_ERR(outp, "ctor failed: %d", ret);
				else
					OUTP_DBG(outp, "not supported");
				nvkm_outp_del(&outp);
				continue;
			}
			nvkm_error(&disp->engine.subdev,
				   "failed to create outp %d\n", i);
			nvkm_outp_del(&outp);
			nvkm_error(subdev, "failed to create outp %d\n", i);
			continue;
		}

+0 −13
Original line number Diff line number Diff line
@@ -22,22 +22,9 @@
 * Authors: Ben Skeggs
 */
#include "ior.h"
#include "outp.h"

#include <subdev/timer.h>

static const struct nvkm_output_func
nv50_dac_output_func = {
};

int
nv50_dac_output_new(struct nvkm_disp *disp, int index,
		    struct dcb_output *dcbE, struct nvkm_output **poutp)
{
	return nvkm_output_new_(&nv50_dac_output_func, disp,
				index, dcbE, poutp);
}

int
nv50_dac_sense(struct nvkm_ior *dac, u32 loadval)
{
+4 −6
Original line number Diff line number Diff line
@@ -580,7 +580,7 @@ nvkm_dp_ctor(struct nvkm_disp *disp, int index, struct dcb_output *dcbE,
	dp->aux = aux;
	if (!dp->aux) {
		OUTP_ERR(&dp->outp, "no aux");
		return -ENODEV;
		return -EINVAL;
	}

	/* bios data is not optional */
@@ -589,7 +589,7 @@ nvkm_dp_ctor(struct nvkm_disp *disp, int index, struct dcb_output *dcbE,
				  &hdr, &cnt, &len, &dp->info);
	if (!data) {
		OUTP_ERR(&dp->outp, "no bios dp data");
		return -ENODEV;
		return -EINVAL;
	}

	OUTP_DBG(&dp->outp, "bios dp %02x %02x %02x %02x",
@@ -616,8 +616,7 @@ nvkm_dp_ctor(struct nvkm_disp *disp, int index, struct dcb_output *dcbE,
}

int
nvkm_output_dp_new_(const struct nvkm_output_dp_func *func,
		    struct nvkm_disp *disp, int index, struct dcb_output *dcbE,
nvkm_dp_new(struct nvkm_disp *disp, int index, struct dcb_output *dcbE,
	    struct nvkm_outp **poutp)
{
	struct nvkm_i2c *i2c = disp->engine.subdev.device->i2c;
@@ -631,7 +630,6 @@ nvkm_output_dp_new_(const struct nvkm_output_dp_func *func,

	if (!(dp = kzalloc(sizeof(*dp), GFP_KERNEL)))
		return -ENOMEM;
	dp->func = func;
	*poutp = &dp->outp;

	return nvkm_dp_ctor(disp, index, dcbE, aux, dp);
+2 −21
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@
#include <subdev/bios/dp.h>

struct nvkm_dp {
	const struct nvkm_output_dp_func *func;
	union {
		struct nvkm_outp base;
		struct nvkm_outp outp;
@@ -32,28 +31,10 @@ struct nvkm_dp {

#define nvkm_output_dp nvkm_dp

struct nvkm_output_dp_func {
};

int nvkm_output_dp_train(struct nvkm_output *, u32 rate);

int nvkm_output_dp_new_(const struct nvkm_output_dp_func *, struct nvkm_disp *,
			int index, struct dcb_output *, struct nvkm_output **);

int nv50_pior_dp_new(struct nvkm_disp *, int, struct dcb_output *,
		     struct nvkm_output **);

int g94_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
		   struct nvkm_output **);

int gf119_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
		     struct nvkm_output **);

int gm107_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
		     struct nvkm_output **);

int gm200_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
		     struct nvkm_output **);
int nvkm_dp_new(struct nvkm_disp *, int index, struct dcb_output *,
		struct nvkm_outp **);

/* DPCD Receiver Capabilities */
#define DPCD_RC00_DPCD_REV                                              0x00000
+0 −5
Original line number Diff line number Diff line
@@ -33,11 +33,6 @@ g84_disp = {
	.super = nv50_disp_super,
	.root = &g84_disp_root_oclass,
	.head.new = nv50_head_new,
	.outp.internal.crt = nv50_dac_output_new,
	.outp.internal.tmds = nv50_sor_output_new,
	.outp.internal.lvds = nv50_sor_output_new,
	.outp.external.tmds = nv50_pior_output_new,
	.outp.external.dp = nv50_pior_dp_new,
	.dac = { .nr = 3, .new = nv50_dac_new },
	.sor = { .nr = 2, .new = g84_sor_new },
	.pior = { .nr = 3, .new = nv50_pior_new },
Loading