drivers/gpu/drm/i915/display/intel_plane.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_plane.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/i915/display/intel_plane.c
Extension
.c
Size
60156 bytes
Lines
1927
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

for_each_new_colorop_in_state(state, colorop, new_colorop_state, i) {
			if (new_colorop_state->colorop == iter_colorop) {
				blob = new_colorop_state->bypass ? NULL : new_colorop_state->data;
				intel_colorop = to_intel_colorop(colorop);
				changed |= intel_plane_colorop_replace_blob(plane_state,
									    intel_colorop,
									    blob);
			}
		}
		iter_colorop = iter_colorop->next;
	}

	if (new_crtc_state && changed)
		new_crtc_state->plane_color_changed = true;
}

void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state,
				       const struct intel_plane_state *from_plane_state,
				       struct intel_crtc *crtc)
{
	intel_plane_clear_hw_state(plane_state);

	/*
	 * For the joiner secondary uapi.crtc will point at
	 * the primary crtc. So we explicitly assign the right
	 * secondary crtc to hw.crtc. uapi.crtc!=NULL simply
	 * indicates the plane is logically enabled on the uapi level.
	 */
	plane_state->hw.crtc = from_plane_state->uapi.crtc ? &crtc->base : NULL;

	plane_state->hw.fb = from_plane_state->uapi.fb;
	if (plane_state->hw.fb)
		drm_framebuffer_get(plane_state->hw.fb);

	plane_state->hw.alpha = from_plane_state->uapi.alpha;
	plane_state->hw.pixel_blend_mode =
		from_plane_state->uapi.pixel_blend_mode;
	plane_state->hw.rotation = from_plane_state->uapi.rotation;
	plane_state->hw.color_encoding = from_plane_state->uapi.color_encoding;
	plane_state->hw.color_range = from_plane_state->uapi.color_range;
	plane_state->hw.scaling_filter = from_plane_state->uapi.scaling_filter;

	plane_state->uapi.src = drm_plane_state_src(&from_plane_state->uapi);
	plane_state->uapi.dst = drm_plane_state_dest(&from_plane_state->uapi);

	intel_plane_color_copy_uapi_to_hw_state(plane_state, from_plane_state, crtc);
}

void intel_plane_copy_hw_state(struct intel_plane_state *plane_state,
			       const struct intel_plane_state *from_plane_state)
{
	intel_plane_clear_hw_state(plane_state);

	memcpy(&plane_state->hw, &from_plane_state->hw,
	       sizeof(plane_state->hw));

	if (plane_state->hw.fb)
		drm_framebuffer_get(plane_state->hw.fb);
}

static void unlink_nv12_plane(struct intel_crtc_state *crtc_state,
			      struct intel_plane_state *plane_state)
{
	struct intel_display *display = to_intel_display(plane_state);
	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);

	if (!plane_state->planar_linked_plane)
		return;

	plane_state->planar_linked_plane = NULL;

	if (!plane_state->is_y_plane)
		return;

	drm_WARN_ON(display->drm, plane_state->uapi.visible);

	plane_state->is_y_plane = false;

	crtc_state->enabled_planes &= ~BIT(plane->id);
	crtc_state->active_planes &= ~BIT(plane->id);
	crtc_state->update_planes |= BIT(plane->id);
	crtc_state->data_rate[plane->id] = 0;
	crtc_state->rel_data_rate[plane->id] = 0;
}

void intel_plane_set_invisible(struct intel_crtc_state *crtc_state,
			       struct intel_plane_state *plane_state)
{
	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);

Annotation

Implementation Notes