Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Documentation/devicetree/bindings/display/apple,dcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,16 @@ properties:
Per-slot enable flags, in slot order. The legacy J700 bootloader
supplies a single zero to select surface zero instead.

apple,camera-indicator-surface:
$ref: /schemas/types.yaml#/definitions/uint32
maximum: 3
description: |
Swap slot the kernel reserves for the software camera indicator, a
kernel-owned overlay on the internal panel that the camera driver shows
while it streams, on a best-effort basis: the camera does not depend on
it. The slot must not be enabled in apple,iomfb-surfaces. Userspace cannot
use the slot. This is a software indicator, not a privacy guarantee.

apple,power-lut-data-x:
$ref: /schemas/types.yaml#/definitions/uint8-array
minItems: 4
Expand Down
8 changes: 8 additions & 0 deletions Documentation/devicetree/bindings/media/apple,t6050-isp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ properties:
description:
Firmware temporal-filter strength selected for the attached sensor.

apple,camera-indicator:
$ref: /schemas/types.yaml#/definitions/phandle
description:
Optional. The display coprocessor asked to present the software camera
indicator while the camera streams. The request is best-effort and the
camera streams whether or not the indicator is shown. The indicator is
software, not a privacy guarantee.

sensor-presets:
type: object
description:
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/apple/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ appledrm-$(CONFIG_DRM_APPLE_KUNIT_TEST) += dcp_dropped_swap_test.o
appledrm-y += iomfb_v26_6.o iomfb_v26_6_link.o j613_dcp_activate.o
appledrm-y += iomfb_v27.o
appledrm-y += epic/dpavservep.o
appledrm-y += plane.o
appledrm-y += plane.o dcp-indicator.o


appledrm-$(CONFIG_TRACING) += trace.o

obj-$(CONFIG_DRM_APPLE) += appledrm.o
obj-$(CONFIG_DRM_APPLE_KUNIT_TEST) += afk_test.o
obj-$(CONFIG_DRM_APPLE_KUNIT_TEST) += dcp_backlight_test.o
obj-$(CONFIG_DRM_APPLE_KUNIT_TEST) += dcp-indicator-test.o
obj-$(CONFIG_DRM_APPLE_KUNIT_TEST) += dcp-announce-test.o

obj-$(CONFIG_DRM_APPLE_KUNIT_TEST) += afk-service-test.o
Expand Down
26 changes: 26 additions & 0 deletions drivers/gpu/drm/apple/apple_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,26 @@ static int apple_probe_per_dcp(struct device *dev,
zpos++;
}

if (dcp_data->camera_ind.has_surf) {
struct drm_plane *ind_plane;

ind_plane = apple_plane_init(drm, 1U << num, dcp_data->camera_ind.surf,
supports_l10r, supports_xrgb2101010,
dcp_data->hw.iomfb_method_profile ==
DCP_IOMFB_METHODS_H17G,
DRM_PLANE_TYPE_OVERLAY, false,
supports_premultiplied);
if (IS_ERR(ind_plane))
return PTR_ERR(ind_plane);
ret = drm_plane_create_zpos_immutable_property(ind_plane, zpos++);
if (ret)
return ret;
/* Without its buffer the plane stays reserved and no indicator is shown. */
ret = dcp_indicator_attach_plane(dcp_data, drm, ind_plane);
if (ret)
dev_err(dev, "camera indicator unavailable: %d\n", ret);
}

/*
* Even though we have an overlay plane, we cannot expose it to legacy
* userspace for cursors as we cannot make the same guarantees as ye olde
Expand Down Expand Up @@ -1992,6 +2012,7 @@ static bool apple_drm_hold_resume_events(struct apple_drm_private *apple, u32 cr

static void apple_drm_resume_outputs(struct apple_drm_private *apple)
{
struct drm_crtc *crtc;
u32 dropped = 0;

apple->dark_held = false;
Expand All @@ -2001,6 +2022,11 @@ static void apple_drm_resume_outputs(struct apple_drm_private *apple)
if (dropped && apple_drm_hold_resume_events(apple, dropped))
dropped = 0;
drm_mode_config_helper_resume(&apple->drm);
drm_for_each_crtc(crtc, &apple->drm) {
if (t8132_ext_crtc(crtc))
continue;
dcp_indicator_display_resumed(platform_get_drvdata(to_apple_crtc(crtc)->dcp));
}
if (dropped)
drm_kms_helper_hotplug_event(&apple->drm);
}
Expand Down
Loading
Loading