From: Hans de Goede <hdegoede@redhat.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
Tsuchiya Yuto <kitakar@gmail.com>,
Andy Shevchenko <andy@kernel.org>,
Yury Luneff <yury.lunev@gmail.com>,
Nable <nable.maininbox@googlemail.com>,
andrey.i.trufanov@gmail.com, Fabio Aiuto <fabioaiuto83@gmail.com>,
linux-media@vger.kernel.org, linux-staging@lists.linux.dev
Subject: [PATCH 20/20] media: atomisp_ov2680: Fix 1280x720 -> 1296x736 resolution
Date: Sun, 20 Nov 2022 23:41:01 +0100 [thread overview]
Message-ID: <20221120224101.746199-21-hdegoede@redhat.com> (raw)
In-Reply-To: <20221120224101.746199-1-hdegoede@redhat.com>
The ov2680_720p_30fps register init list used for the 1296x736 resolution
sets the hsize register to 1296 and the vsize register to 736.
This is actually the right thing to do when combined with the atomISP2
because the ISP requires 16 bytes padding leaving userspace to see
1280x720.
But the resolution list entries for this was incorrectly reporting
the resolution being send to the ISP as already being 1280x720,
leaving usespace to see 1274x704 as resolution.
Worse then userspace seeing a weird resolution selecting the
1280x720 sensor resolution (which in reality is sending 1296x736
to the ISP was causing the ISP to hang on Cherry Trail based tablets
(Bay Trail works fine for some reason).
This commit also adds a bunch of comments annotating what
the various register writes in the init lists are doing.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/staging/media/atomisp/i2c/ov2680.h | 46 +++++++++++-----------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/drivers/staging/media/atomisp/i2c/ov2680.h b/drivers/staging/media/atomisp/i2c/ov2680.h
index 4e351196fe34..7ab337b859ad 100644
--- a/drivers/staging/media/atomisp/i2c/ov2680.h
+++ b/drivers/staging/media/atomisp/i2c/ov2680.h
@@ -485,19 +485,19 @@ static struct ov2680_reg const ov2680_720x592_30fps[] = {
static struct ov2680_reg const ov2680_800x600_30fps[] = {
{0x3086, 0x01},
{0x370a, 0x23},
- {0x3801, 0x00},
+ {0x3801, 0x00}, /* hstart 0 */
{0x3802, 0x00},
- {0x3803, 0x00},
+ {0x3803, 0x00}, /* vstart 0 */
{0x3804, 0x06},
- {0x3805, 0x4f},
+ {0x3805, 0x4f}, /* hend 1615 */
{0x3806, 0x04},
- {0x3807, 0xbf},
+ {0x3807, 0xbf}, /* vend 1215 */
{0x3808, 0x03},
- {0x3809, 0x20},
+ {0x3809, 0x20}, /* hsize 800 */
{0x380a, 0x02},
- {0x380b, 0x58},
+ {0x380b, 0x58}, /* vsize 600 */
{0x380c, 0x06},
- {0x380d, 0xac},
+ {0x380d, 0xac}, /* htotal 1708 */
{0x3810, 0x00},
{0x3811, 0x00},
{0x3812, 0x00},
@@ -524,19 +524,19 @@ static struct ov2680_reg const ov2680_800x600_30fps[] = {
static struct ov2680_reg const ov2680_720p_30fps[] = {
{0x3086, 0x00},
{0x370a, 0x21},
- {0x3801, 0xa0},
+ {0x3801, 0xa0}, /* hstart 160 */
{0x3802, 0x00},
- {0x3803, 0xf2},
+ {0x3803, 0xf2}, /* vstart 242 */
{0x3804, 0x05},
- {0x3805, 0xbf},
+ {0x3805, 0xbf}, /* hend 1471 */
{0x3806, 0x03},
- {0x3807, 0xdd},
+ {0x3807, 0xdd}, /* vend 989 */
{0x3808, 0x05},
- {0x3809, 0x10},
+ {0x3809, 0x10}, /* hsize 1296 */
{0x380a, 0x02},
- {0x380b, 0xe0},
+ {0x380b, 0xe0}, /* vsize 736 */
{0x380c, 0x06},
- {0x380d, 0xa8},
+ {0x380d, 0xa8}, /* htotal 1704 */
{0x3810, 0x00},
{0x3811, 0x08},
{0x3812, 0x00},
@@ -563,19 +563,19 @@ static struct ov2680_reg const ov2680_720p_30fps[] = {
static struct ov2680_reg const ov2680_1296x976_30fps[] = {
{0x3086, 0x00},
{0x370a, 0x21},
- {0x3801, 0xa0},
+ {0x3801, 0xa0}, /* hstart 160 */
{0x3802, 0x00},
- {0x3803, 0x78},
+ {0x3803, 0x78}, /* vstart 120 */
{0x3804, 0x05},
- {0x3805, 0xbf},
+ {0x3805, 0xbf}, /* hend 1471 */
{0x3806, 0x04},
- {0x3807, 0x57},
+ {0x3807, 0x57}, /* vend 1111 */
{0x3808, 0x05},
- {0x3809, 0x10},
+ {0x3809, 0x10}, /* hsize 1296 */
{0x380a, 0x03},
- {0x380b, 0xd0},
+ {0x380b, 0xd0}, /* vsize 976 */
{0x380c, 0x06},
- {0x380d, 0xa8},
+ {0x380d, 0xa8}, /* htotal 1704 */
{0x3810, 0x00},
{0x3811, 0x08},
{0x3812, 0x00},
@@ -820,8 +820,8 @@ static struct ov2680_resolution ov2680_res_preview[] = {
.regs = ov2680_1296x976_30fps,
},
{
- .width = 1280,
- .height = 720,
+ .width = 1296,
+ .height = 736,
.fps = 60,
.pix_clk_freq = 66,
.pixels_per_line = 1698,//1704,
--
2.38.1
next prev parent reply other threads:[~2022-11-20 22:41 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-20 22:40 [PATCH 00/20] media: atomisp: Misc. cleanups / fixes Hans de Goede
2022-11-20 22:40 ` [PATCH 01/20] media: atomisp: Silence: 'atomisp_q_one_s3a_buffer: drop one s3a stat which has exp_id xx' log messages Hans de Goede
2022-11-21 8:54 ` Andy Shevchenko
2022-11-21 12:27 ` Hans de Goede
2022-11-20 22:40 ` [PATCH 02/20] media: atomisp: Remove accelerator pipe creation code Hans de Goede
2022-11-20 22:40 ` [PATCH 03/20] media: atomisp: Remove unused QOS defines / structure member Hans de Goede
2022-11-20 22:40 ` [PATCH 04/20] media: atomisp: Flush queue on atomisp_css_start() error Hans de Goede
2022-11-20 22:40 ` [PATCH 05/20] media: atomisp: Log an error on failing to alloc private-mem Hans de Goede
2022-11-21 8:58 ` Andy Shevchenko
2022-11-21 12:29 ` Hans de Goede
2022-11-20 22:40 ` [PATCH 06/20] media: atomisp: Fix deadlock when the /dev/video# node is closed while still streaming Hans de Goede
2022-11-20 22:40 ` [PATCH 07/20] media: atomisp: Remove 2 unused accelerator mode related functions Hans de Goede
2022-11-20 22:40 ` [PATCH 08/20] media: atomisp: Remove atomisp_css_yuvpp_configure_viewfinder() function Hans de Goede
2022-11-20 22:40 ` [PATCH 09/20] media: atomisp: Remove unused ia_css_frame_*() functions Hans de Goede
2022-11-20 22:40 ` [PATCH 10/20] media: atomisp: Drop userptr support from hmm Hans de Goede
2022-11-21 9:01 ` Andy Shevchenko
2022-11-21 12:31 ` Hans de Goede
2022-11-20 22:40 ` [PATCH 11/20] media: atomisp: Remove double atomisp_mrfld_power_down()/_up() calls from atomisp_reset() Hans de Goede
2022-11-20 22:40 ` [PATCH 12/20] media: atomisp: Remove atomisp_mrfld_power_down()/_up() Hans de Goede
2022-11-20 22:40 ` [PATCH 13/20] media: atomisp: Remove clearing of config from atomisp_css_uninit() Hans de Goede
2022-11-20 22:40 ` [PATCH 14/20] media: atomisp: Remove atomisp_css_suspend()/_resume() Hans de Goede
2022-11-20 22:40 ` [PATCH 15/20] media: atomisp: Remove sw_contex.power_state checks Hans de Goede
2022-11-21 9:09 ` Andy Shevchenko
2022-11-21 9:16 ` Andy Shevchenko
2022-11-20 22:40 ` [PATCH 16/20] media: atomisp: Remove duplication between runtime-pm and normal-pm code Hans de Goede
2022-11-20 22:40 ` [PATCH 17/20] media: atomisp: Move calling of css_[un]init() to power_on()/_off() Hans de Goede
2022-11-21 9:14 ` Andy Shevchenko
2022-11-21 12:33 ` Hans de Goede
2022-11-20 22:40 ` [PATCH 18/20] media: atomisp: Remove atomisp_ospm_dphy_down() call from probe error path Hans de Goede
2022-11-20 22:41 ` [PATCH 19/20] media: atomisp: Remove atomisp_ospm_dphy_up()/_down() functions Hans de Goede
2022-11-20 22:41 ` Hans de Goede [this message]
2022-11-21 9:20 ` [PATCH 00/20] media: atomisp: Misc. cleanups / fixes Andy Shevchenko
2022-11-21 12:40 ` Hans de Goede
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=20221120224101.746199-21-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=andrey.i.trufanov@gmail.com \
--cc=andy@kernel.org \
--cc=fabioaiuto83@gmail.com \
--cc=kitakar@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=nable.maininbox@googlemail.com \
--cc=sakari.ailus@linux.intel.com \
--cc=yury.lunev@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox