drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c
Extension
.c
Size
6142 bytes
Lines
238
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 (!ops[i]) {
			ret = -ENOMEM;
			goto cleanup;
		}

		ret = drm_plane_colorop_curve_1d_init(dev, ops[i], plane, &dm_colorop_funcs,
						amdgpu_dm_supported_shaper_tfs,
						DRM_COLOROP_FLAG_ALLOW_BYPASS);
		if (ret)
			goto cleanup;

		drm_colorop_set_next_property(ops[i-1], ops[i]);

		i++;

		/* 1D LUT - SHAPER LUT */
		ops[i] = kzalloc_obj(*ops[0]);
		if (!ops[i]) {
			ret = -ENOMEM;
			goto cleanup;
		}

		ret = drm_plane_colorop_curve_1d_lut_init(dev, ops[i], plane,
							&dm_colorop_funcs,
							MAX_COLOR_LUT_ENTRIES,
							DRM_COLOROP_LUT1D_INTERPOLATION_LINEAR,
							DRM_COLOROP_FLAG_ALLOW_BYPASS);
		if (ret)
			goto cleanup;

		drm_colorop_set_next_property(ops[i-1], ops[i]);

		i++;

		/* 3D LUT */
		ops[i] = kzalloc_obj(*ops[0]);
		if (!ops[i]) {
			ret = -ENOMEM;
			goto cleanup;
		}

		ret = drm_plane_colorop_3dlut_init(dev, ops[i], plane,
					&dm_colorop_funcs, LUT3D_SIZE,
					DRM_COLOROP_LUT3D_INTERPOLATION_TETRAHEDRAL,
					DRM_COLOROP_FLAG_ALLOW_BYPASS);
		if (ret)
			goto cleanup;

		drm_colorop_set_next_property(ops[i-1], ops[i]);

		i++;
	}

	/* 1D curve - BLND TF */
	ops[i] = kzalloc_obj(*ops[0]);
	if (!ops[i]) {
		ret = -ENOMEM;
		goto cleanup;
	}

	ret = drm_plane_colorop_curve_1d_init(dev, ops[i], plane, &dm_colorop_funcs,
					      amdgpu_dm_supported_blnd_tfs,
					      DRM_COLOROP_FLAG_ALLOW_BYPASS);
	if (ret)
		goto cleanup;

	drm_colorop_set_next_property(ops[i - 1], ops[i]);

	i++;

	/* 1D LUT - BLND LUT */
	ops[i] = kzalloc_obj(struct drm_colorop);
	if (!ops[i]) {
		ret = -ENOMEM;
		goto cleanup;
	}

	ret = drm_plane_colorop_curve_1d_lut_init(dev, ops[i], plane, &dm_colorop_funcs,
						  MAX_COLOR_LUT_ENTRIES,
						  DRM_COLOROP_LUT1D_INTERPOLATION_LINEAR,
						  DRM_COLOROP_FLAG_ALLOW_BYPASS);
	if (ret)
		goto cleanup;

	drm_colorop_set_next_property(ops[i-1], ops[i]);

	list->name = kasprintf(GFP_KERNEL, "Color Pipeline %d", ops[0]->base.id);

	return 0;

Annotation

Implementation Notes