All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Ceresoli <luca@lucaceresoli.net>
To: linux-media@vger.kernel.org
Cc: Luca Ceresoli <luca@lucaceresoli.net>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Leon Luo <leonl@leopardimaging.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v4 0/8] media: imx274: cleanups, improvements and SELECTION API support
Date: Mon, 11 Jun 2018 13:35:31 +0200	[thread overview]
Message-ID: <1528716939-17015-1-git-send-email-luca@lucaceresoli.net> (raw)

Hi,

this patchset introduces cropping support for the Sony IMX274 sensor
using the SELECTION API.

With respect to v3, this version uses the SELECTION API with taget
V4L2_SEL_TGT_COMPOSE to change the output resolution. This is the
recommended API for cropping + downscaling. However for backward
compatibility the set_format callback is still supported and is
equivalent to setting the compose rect as far as resolutions are
concerned.

Patches 1-5 are overall improvements and restructuring, mostly useful
to implement the SELECTION API in a clean way.

Patch 6 introduces a helper to allow setting many registers computed
at runtime in a straightforward way. This would not have been very
useful before because all long register write sequences came from
const tables, but it's definitely a must for the cropping code where
several register values are computed at runtime.

Patch 7 is new in this series, it's a trivial typo fix that can be
applied independently.

Patch 8 implements the set_selection pad operation for cropping
(V4L2_SEL_TGT_CROP) and binning (V4L2_SEL_TGT_COMPOSE). The most
tricky part was respecting all the device constraints on the
horizontal crop.

Usage examples:

 * Capture the entire 4K area, downscaled to 1080p with 2:1 binning:
   media-ctl -V '"IMX274":0[crop:(0,0)/3840x2160]'
   media-ctl -V '"IMX274":0[compose:(0,0)/1920x1080]'

 * Capture the central 1080p area (no binning):
   media-ctl -V '"IMX274":0[crop:(960,540)/1920x1080]'
   (this also sets the compose and fmt rects to 1920x1080)

Regards,
Luca


Luca Ceresoli (8):
  media: imx274: initialize format before v4l2 controls
  media: imx274: consolidate per-mode data in imx274_frmfmt
  media: imx274: get rid of mode_index
  media: imx274: actually use IMX274_DEFAULT_MODE
  media: imx274: simplify imx274_write_table()
  media: imx274: add helper function to fill a reg_8 table chunk
  media: imx274: fix typo
  media: imx274: add SELECTION support for cropping

 drivers/media/i2c/imx274.c | 686 ++++++++++++++++++++++++++++++---------------
 1 file changed, 461 insertions(+), 225 deletions(-)

-- 
2.7.4

             reply	other threads:[~2018-06-11 11:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-11 11:35 Luca Ceresoli [this message]
2018-06-11 11:35 ` [PATCH v4 1/8] media: imx274: initialize format before v4l2 controls Luca Ceresoli
2018-06-11 11:35 ` [PATCH v4 2/8] media: imx274: consolidate per-mode data in imx274_frmfmt Luca Ceresoli
2018-06-11 11:35 ` [PATCH v4 3/8] media: imx274: get rid of mode_index Luca Ceresoli
2018-06-11 11:35 ` [PATCH v4 4/8] media: imx274: actually use IMX274_DEFAULT_MODE Luca Ceresoli
2018-06-11 11:35 ` [PATCH v4 5/8] media: imx274: simplify imx274_write_table() Luca Ceresoli
2018-06-11 11:35 ` [PATCH v4 6/8] media: imx274: add helper function to fill a reg_8 table chunk Luca Ceresoli
2018-06-26 12:20   ` Sakari Ailus
2018-06-27  8:13     ` Luca Ceresoli
2018-06-27  9:30       ` Sakari Ailus
2018-06-27  9:50         ` Luca Ceresoli
2018-06-11 11:35 ` [PATCH v4 7/8] media: imx274: fix typo Luca Ceresoli
2018-06-11 11:35 ` [PATCH v4 8/8] media: imx274: add SELECTION support for cropping Luca Ceresoli
2018-06-29  8:04   ` Sakari Ailus
2018-06-29  9:21     ` Luca Ceresoli
2018-06-26 12:19 ` [PATCH v4 0/8] media: imx274: cleanups, improvements and SELECTION API support Sakari Ailus
2018-06-26 21:15   ` Luca Ceresoli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1528716939-17015-1-git-send-email-luca@lucaceresoli.net \
    --to=luca@lucaceresoli.net \
    --cc=leonl@leopardimaging.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.