linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: linux-media@vger.kernel.org
Cc: s.nawrocki@samsung.com, andrzej.p@samsung.com,
	Jacek Anaszewski <j.anaszewski@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: [PATCH v2 4/9] s5p-jpeg: fix g_selection op
Date: Fri, 11 Jul 2014 17:19:45 +0200	[thread overview]
Message-ID: <1405091990-28567-5-git-send-email-j.anaszewski@samsung.com> (raw)
In-Reply-To: <1405091990-28567-1-git-send-email-j.anaszewski@samsung.com>

V4L2_SEL_TGT_COMPOSE_DEFAULT switch case should select whole
available area of the image and V4L2_SEL_TGT_COMPOSE
should apply user settings.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/media/platform/s5p-jpeg/jpeg-core.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 0854f37..09b59d3 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1505,21 +1505,23 @@ static int s5p_jpeg_g_selection(struct file *file, void *priv,
 	case V4L2_SEL_TGT_CROP:
 	case V4L2_SEL_TGT_CROP_BOUNDS:
 	case V4L2_SEL_TGT_CROP_DEFAULT:
-	case V4L2_SEL_TGT_COMPOSE:
 	case V4L2_SEL_TGT_COMPOSE_DEFAULT:
 		s->r.width = ctx->out_q.w;
 		s->r.height = ctx->out_q.h;
+		s->r.left = 0;
+		s->r.top = 0;
 		break;
+	case V4L2_SEL_TGT_COMPOSE:
 	case V4L2_SEL_TGT_COMPOSE_BOUNDS:
 	case V4L2_SEL_TGT_COMPOSE_PADDED:
-		s->r.width = ctx->cap_q.w;
-		s->r.height = ctx->cap_q.h;
+		s->r.width = ctx->crop_rect.width;
+		s->r.height =  ctx->crop_rect.height;
+		s->r.left = ctx->crop_rect.left;
+		s->r.top = ctx->crop_rect.top;
 		break;
 	default:
 		return -EINVAL;
 	}
-	s->r.left = 0;
-	s->r.top = 0;
 	return 0;
 }
 
-- 
1.7.9.5


  parent reply	other threads:[~2014-07-11 15:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11 15:19 [PATCH v2 0/9] Add support for Exynos3250 SoC to the s5p-jpeg driver Jacek Anaszewski
2014-07-11 15:19 ` [PATCH v2 1/9] s5p-jpeg: Add support for Exynos3250 SoC Jacek Anaszewski
2014-07-11 15:19 ` [PATCH v2 2/9] s5p-jpeg: return error immediately after get_byte fails Jacek Anaszewski
2014-07-11 15:19 ` [PATCH v2 3/9] s5p-jpeg: Adjust jpeg_bound_align_image to Exynos3250 needs Jacek Anaszewski
2014-07-11 15:19 ` Jacek Anaszewski [this message]
2014-07-11 15:19 ` [PATCH v2 5/9] s5p-jpeg: Assure proper crop rectangle initialization Jacek Anaszewski
2014-07-11 15:19 ` [PATCH v2 6/9] s5p-jpeg: Prevent erroneous downscaling for Exynos3250 SoC Jacek Anaszewski
2014-07-11 15:19 ` [PATCH v2 7/9] s5p-jpeg: add chroma subsampling adjustment for Exynos3250 Jacek Anaszewski
2014-07-11 15:19 ` [PATCH v2 8/9] Documentation: devicetree: Document sclk-jpeg clock for exynos3250 SoC Jacek Anaszewski
2014-07-14  9:56   ` Mark Rutland
2014-07-22 11:42     ` Sylwester Nawrocki
2014-07-22 11:48       ` Arnd Bergmann
2014-07-22 14:18         ` Sylwester Nawrocki
2014-07-22 14:44           ` Arnd Bergmann
2014-07-22 14:55             ` Sylwester Nawrocki
2014-07-11 15:19 ` [PATCH v2 9/9] ARM: dts: exynos3250: add JPEG codec device node Jacek Anaszewski
2014-07-11 16:40 ` [PATCH v2 0/9] Add support for Exynos3250 SoC to the s5p-jpeg driver Sylwester Nawrocki

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=1405091990-28567-5-git-send-email-j.anaszewski@samsung.com \
    --to=j.anaszewski@samsung.com \
    --cc=andrzej.p@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=s.nawrocki@samsung.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;
as well as URLs for NNTP newsgroup(s).