Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357387
b: refs/heads/master
c: 3fdfeda
h: refs/heads/master
i:
  357385: 600fdac
  357383: 31db925
v: v3
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed Feb 5, 2013
1 parent d1fa775 commit 4623eaf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a82a45f65377b05fe8cd3167c7b0a70c508356b8
refs/heads/master: 3fdfedaaa7f243f3347084231c64f6c1be0ba131
40 changes: 21 additions & 19 deletions trunk/drivers/media/platform/omap3isp/isppreview.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ static struct omap3isp_prev_csc flr_prev_csc = {
* The preview engine crops several rows and columns internally depending on
* which filters are enabled. To avoid format changes when the filters are
* enabled or disabled (which would prevent them from being turned on or off
* during streaming), the driver assumes all the filters are enabled when
* computing sink crop and source format limits.
* during streaming), the driver assumes all filters that can be configured
* during streaming are enabled when computing sink crop and source format
* limits.
*
* If a filter is disabled, additional cropping is automatically added at the
* preview engine input by the driver to avoid overflow at line and frame end.
Expand All @@ -92,25 +93,23 @@ static struct omap3isp_prev_csc flr_prev_csc = {
* Median filter 4 pixels
* Noise filter,
* Faulty pixels correction 4 pixels, 4 lines
* CFA filter 4 pixels, 4 lines in Bayer mode
* 2 lines in other modes
* Color suppression 2 pixels
* or luma enhancement
* -------------------------------------------------------------
* Maximum total 14 pixels, 8 lines
* Maximum total 10 pixels, 4 lines
*
* The color suppression and luma enhancement filters are applied after bayer to
* YUV conversion. They thus can crop one pixel on the left and one pixel on the
* right side of the image without changing the color pattern. When both those
* filters are disabled, the driver must crop the two pixels on the same side of
* the image to avoid changing the bayer pattern. The left margin is thus set to
* 8 pixels and the right margin to 6 pixels.
* 6 pixels and the right margin to 4 pixels.
*/

#define PREV_MARGIN_LEFT 8
#define PREV_MARGIN_RIGHT 6
#define PREV_MARGIN_TOP 4
#define PREV_MARGIN_BOTTOM 4
#define PREV_MARGIN_LEFT 6
#define PREV_MARGIN_RIGHT 4
#define PREV_MARGIN_TOP 2
#define PREV_MARGIN_BOTTOM 2

#define PREV_MIN_IN_WIDTH 64
#define PREV_MIN_IN_HEIGHT 8
Expand Down Expand Up @@ -1080,22 +1079,13 @@ static void preview_config_input_format(struct isp_prev_device *prev,
*/
static void preview_config_input_size(struct isp_prev_device *prev, u32 active)
{
const struct v4l2_mbus_framefmt *format = &prev->formats[PREV_PAD_SINK];
struct isp_device *isp = to_isp_device(prev);
unsigned int sph = prev->crop.left;
unsigned int eph = prev->crop.left + prev->crop.width - 1;
unsigned int slv = prev->crop.top;
unsigned int elv = prev->crop.top + prev->crop.height - 1;
u32 features;

if (format->code != V4L2_MBUS_FMT_Y8_1X8 &&
format->code != V4L2_MBUS_FMT_Y10_1X10) {
sph -= 2;
eph += 2;
slv -= 2;
elv += 2;
}

features = (prev->params.params[0].features & active)
| (prev->params.params[1].features & ~active);

Expand Down Expand Up @@ -1849,6 +1839,18 @@ static void preview_try_crop(struct isp_prev_device *prev,
right -= 2;
}

/* The CFA filter crops 4 lines and 4 columns in Bayer mode, and 2 lines
* and no columns in other modes. Increase the margins based on the sink
* format.
*/
if (sink->code != V4L2_MBUS_FMT_Y8_1X8 &&
sink->code != V4L2_MBUS_FMT_Y10_1X10) {
left += 2;
right -= 2;
top += 2;
bottom -= 2;
}

/* Restrict left/top to even values to keep the Bayer pattern. */
crop->left &= ~1;
crop->top &= ~1;
Expand Down

0 comments on commit 4623eaf

Please sign in to comment.