drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c
Extension
.c
Size
18132 bytes
Lines
666
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (ret >= 0) {
			args->v0.level = ret;
			ret = 0;
		}
	} else {
		ret = -EINVAL;
	}

	return ret;
}

static int
nvkm_uoutp_mthd_release(struct nvkm_outp *outp, void *argv, u32 argc)
{
	union nvif_outp_release_args *args = argv;

	if (argc != sizeof(args->vn))
		return -ENOSYS;
	if (!outp->ior)
		return -EINVAL;

	outp->func->release(outp);
	return 0;
}

static int
nvkm_uoutp_mthd_acquire(struct nvkm_outp *outp, void *argv, u32 argc)
{
	union nvif_outp_acquire_args *args = argv;
	int ret;

	if (argc != sizeof(args->v0) || args->v0.version != 0)
		return -ENOSYS;
	if (outp->ior && args->v0.type <= NVIF_OUTP_ACQUIRE_V0_PIOR)
		return -EBUSY;

	switch (args->v0.type) {
	case NVIF_OUTP_ACQUIRE_V0_DAC:
	case NVIF_OUTP_ACQUIRE_V0_PIOR:
		ret = outp->func->acquire(outp, false);
		break;
	case NVIF_OUTP_ACQUIRE_V0_SOR:
		ret = outp->func->acquire(outp, args->v0.sor.hda);
		break;
	default:
		ret = -EINVAL;
		break;
	}

	if (ret)
		return ret;

	args->v0.or = outp->ior->id;
	args->v0.link = outp->ior->asy.link;
	return 0;
}

static int
nvkm_uoutp_mthd_inherit(struct nvkm_outp *outp, void *argv, u32 argc)
{
	union nvif_outp_inherit_args *args = argv;
	struct nvkm_ior *ior;
	int ret = 0;

	if (argc != sizeof(args->v0) || args->v0.version != 0)
		return -ENOSYS;

	/* Ensure an ior is hooked up to this outp already */
	ior = outp->func->inherit(outp);
	if (!ior || !ior->arm.head)
		return -ENODEV;

	/* With iors, there will be a separate output path for each type of connector - and all of
	 * them will appear to be hooked up. Figure out which one is actually the one we're using
	 * based on the protocol we were given over nvif
	 */
	switch (args->v0.proto) {
	case NVIF_OUTP_INHERIT_V0_TMDS:
		if (ior->arm.proto != TMDS)
			return -ENODEV;
		break;
	case NVIF_OUTP_INHERIT_V0_DP:
		if (ior->arm.proto != DP)
			return -ENODEV;
		break;
	case NVIF_OUTP_INHERIT_V0_LVDS:
		if (ior->arm.proto != LVDS)
			return -ENODEV;
		break;
	case NVIF_OUTP_INHERIT_V0_TV:

Annotation

Implementation Notes