Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raspberrypi: Report sensor orientation through DT #3723

Merged
merged 13 commits into from
Jul 16, 2020

Conversation

pinchartl
Copy link
Contributor

This patch series reports sensor orientation through DT for the OV5647, IMX219 and IMX477. The first 8 patches are backported from mainline, while the last 5 patches are new.

All the patches, as well as the corresponding libcamera changes, have been posted to the libcamera-devel mailing list. The kernel and libcamera sides should be merged in lockstep, so please let me know when you plan to merge this and I'll push the corresponding changes to libcamera.

jmondi and others added 10 commits July 15, 2020 03:16
Add the 'orientation' device property, used to specify the device mounting
position. The property is particularly meaningful for mobile devices
with a well defined usage orientation.

Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

Commit cabc918 upstream

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Replace the 'rotation' property description by providing a definition
relative to the camera sensor pixel array coordinate system and the
captured scene.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

Commit 915bd31 upstream

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Add documentation for the V4L2_CID_CAMERA_ORIENTATION camera
control. The newly added read-only control reports the camera device
orientation relative to the usage orientation of the system the camera
is installed on.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

Commit 9397a83 upstream

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Add documentation for the V4L2_CID_CAMERA_SENSOR_ROTATION camera
control. The newly added read-only control reports the rotation
correction to be applied to images before displaying them to the user.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

Commit 9926c22 upstream

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Add support for the newly defined V4L2_CID_CAMERA_ORIENTATION
and V4L2_CID_CAMERA_SENSOR_ROTATION read-only controls used to report
the camera device mounting position and orientation respectively.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

Commit 926645d upstream

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Add an helper function to parse common device properties in the same
way as v4l2_fwnode_endpoint_parse() parses common endpoint properties.

Parse the 'rotation' and 'orientation' properties from the firmware
interface.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

Commit 344897e upstream

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Add an helper function to v4l2-ctrls to register controls associated
with a device property.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

Commit e0a3606 upstream

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Parse device properties and register controls for them using the V4L2
fwnode properties helpers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Parse device properties and register controls for them using the newly
introduced helpers.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

Commit ad3a44c upstream

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Parse device properties and register controls for them using the V4L2
fwnode properties helpers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Copy link
Contributor

@pelwell pelwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few very minor niggles with the overlays.

arch/arm/boot/dts/overlays/README Outdated Show resolved Hide resolved
arch/arm/boot/dts/overlays/ov5647-overlay.dts Show resolved Hide resolved
arch/arm/boot/dts/overlays/README Outdated Show resolved Hide resolved
arch/arm/boot/dts/overlays/README Outdated Show resolved Hide resolved
@6by9
Copy link
Contributor

6by9 commented Jul 15, 2020

I'm good with the patchset, so it's only Phil's comments to address.

Add a rotation DT overlay parameter to allow specifying the camera
module mounting rotation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Add a rotation DT overlay parameter to allow specifying the camera
module mounting rotation. Set the default rotation to 180 as the module
is typically mounted upside-down.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Add a rotation DT overlay parameter to allow specifying the camera
module mounting rotation. Set the default rotation to 180 as the module
is typically mounted upside-down.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
@pinchartl
Copy link
Contributor Author

Comments addressed, branch updated. Please merge whenever convenient, I'll then push the corresponding libcamera changes.

@pelwell pelwell merged commit 2c8ec3b into raspberrypi:rpi-5.4.y Jul 16, 2020
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jul 17, 2020
See: raspberrypi/linux#3730

kernel: drm/vc4: Add DRM_MODE_FLAG_DBLCLK support to vc4-fkms
See: raspberrypi/linux#3725

kernel: raspberrypi: Report sensor orientation through DT
See: raspberrypi/linux#3723

kernel: correct SND_SOC_DAILINK_DEFS
See: raspberrypi/linux#3722

kernel: ARM: dts: Select the actpwr LED trigger on Zeroes

kernel: staging: vc04_services: isp: Rework lens shading to take a dmabuf
See: raspberrypi/linux#3715

kernel: unicam clock changes
See: raspberrypi/linux#3609

firmware: IL: camera: Fix stereoscopic pool allocations

firmware: arm_loader: Add support for double clock/pixel_rep for FKMS
See: raspberrypi/linux#3725

firmware: scalerlib: Set the default chroma location for YUV10 to match 8bit
firmware: scalerlib: Set chroma_vrep correctly for YUV10COL

firmware: isp: check the hi-res resize filter mode when the input crop changes
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Jul 17, 2020
See: raspberrypi/linux#3730

kernel: drm/vc4: Add DRM_MODE_FLAG_DBLCLK support to vc4-fkms
See: raspberrypi/linux#3725

kernel: raspberrypi: Report sensor orientation through DT
See: raspberrypi/linux#3723

kernel: correct SND_SOC_DAILINK_DEFS
See: raspberrypi/linux#3722

kernel: ARM: dts: Select the actpwr LED trigger on Zeroes

kernel: staging: vc04_services: isp: Rework lens shading to take a dmabuf
See: raspberrypi/linux#3715

kernel: unicam clock changes
See: raspberrypi/linux#3609

firmware: IL: camera: Fix stereoscopic pool allocations

firmware: arm_loader: Add support for double clock/pixel_rep for FKMS
See: raspberrypi/linux#3725

firmware: scalerlib: Set the default chroma location for YUV10 to match 8bit
firmware: scalerlib: Set chroma_vrep correctly for YUV10COL

firmware: isp: check the hi-res resize filter mode when the input crop changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants