Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366960
b: refs/heads/master
c: 9c8399c
h: refs/heads/master
v: v3
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Apr 4, 2013
1 parent 94fe044 commit 7a98a4b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 29 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: 8cec74c60be850c33882a0cec16154082a551a26
refs/heads/master: 9c8399c86cbfce767fb32459f8e0eb33e087f910
35 changes: 14 additions & 21 deletions trunk/drivers/media/platform/exynos4-is/fimc-lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ static const struct fimc_fmt *fimc_lite_try_format(struct fimc_lite *fimc,
u32 *width, u32 *height,
u32 *code, u32 *fourcc, int pad)
{
struct flite_variant *variant = fimc->variant;
struct flite_drvdata *dd = fimc->dd;
const struct fimc_fmt *fmt;

fmt = fimc_lite_find_format(fourcc, code, 0);
Expand All @@ -541,12 +541,12 @@ static const struct fimc_fmt *fimc_lite_try_format(struct fimc_lite *fimc,
*fourcc = fmt->fourcc;

if (pad == FLITE_SD_PAD_SINK) {
v4l_bound_align_image(width, 8, variant->max_width,
ffs(variant->out_width_align) - 1,
height, 0, variant->max_height, 0, 0);
v4l_bound_align_image(width, 8, dd->max_width,
ffs(dd->out_width_align) - 1,
height, 0, dd->max_height, 0, 0);
} else {
v4l_bound_align_image(width, 8, fimc->inp_frame.rect.width,
ffs(variant->out_width_align) - 1,
ffs(dd->out_width_align) - 1,
height, 0, fimc->inp_frame.rect.height,
0, 0);
}
Expand All @@ -566,7 +566,7 @@ static void fimc_lite_try_crop(struct fimc_lite *fimc, struct v4l2_rect *r)

/* Adjust left/top if cropping rectangle got out of bounds */
r->left = clamp_t(u32, r->left, 0, frame->f_width - r->width);
r->left = round_down(r->left, fimc->variant->win_hor_offs_align);
r->left = round_down(r->left, fimc->dd->win_hor_offs_align);
r->top = clamp_t(u32, r->top, 0, frame->f_height - r->height);

v4l2_dbg(1, debug, &fimc->subdev, "(%d,%d)/%dx%d, sink fmt: %dx%d\n",
Expand All @@ -586,7 +586,7 @@ static void fimc_lite_try_compose(struct fimc_lite *fimc, struct v4l2_rect *r)

/* Adjust left/top if the composing rectangle got out of bounds */
r->left = clamp_t(u32, r->left, 0, frame->f_width - r->width);
r->left = round_down(r->left, fimc->variant->out_hor_offs_align);
r->left = round_down(r->left, fimc->dd->out_hor_offs_align);
r->top = clamp_t(u32, r->top, 0, fimc->out_frame.f_height - r->height);

v4l2_dbg(1, debug, &fimc->subdev, "(%d,%d)/%dx%d, source fmt: %dx%d\n",
Expand Down Expand Up @@ -647,18 +647,18 @@ static int fimc_lite_try_fmt(struct fimc_lite *fimc,
struct v4l2_pix_format_mplane *pixm,
const struct fimc_fmt **ffmt)
{
struct flite_variant *variant = fimc->variant;
u32 bpl = pixm->plane_fmt[0].bytesperline;
struct flite_drvdata *dd = fimc->dd;
const struct fimc_fmt *fmt;

fmt = fimc_lite_find_format(&pixm->pixelformat, NULL, 0);
if (WARN_ON(fmt == NULL))
return -EINVAL;
if (ffmt)
*ffmt = fmt;
v4l_bound_align_image(&pixm->width, 8, variant->max_width,
ffs(variant->out_width_align) - 1,
&pixm->height, 0, variant->max_height, 0, 0);
v4l_bound_align_image(&pixm->width, 8, dd->max_width,
ffs(dd->out_width_align) - 1,
&pixm->height, 0, dd->max_height, 0, 0);

if ((bpl == 0 || ((bpl * 8) / fmt->depth[0]) < pixm->width))
pixm->plane_fmt[0].bytesperline = (pixm->width *
Expand Down Expand Up @@ -1429,7 +1429,7 @@ static int fimc_lite_probe(struct platform_device *pdev)
if (!drv_data || fimc->index < 0 || fimc->index >= FIMC_LITE_MAX_DEVS)
return -EINVAL;

fimc->variant = drv_data->variant[fimc->index];
fimc->dd = drv_data;
fimc->pdev = pdev;

init_waitqueue_head(&fimc->irq_queue);
Expand Down Expand Up @@ -1577,22 +1577,15 @@ static const struct dev_pm_ops fimc_lite_pm_ops = {
NULL)
};

static struct flite_variant fimc_lite0_variant_exynos4 = {
/* EXYNOS4212, EXYNOS4412 */
static struct flite_drvdata fimc_lite_drvdata_exynos4 = {
.max_width = 8192,
.max_height = 8192,
.out_width_align = 8,
.win_hor_offs_align = 2,
.out_hor_offs_align = 8,
};

/* EXYNOS4212, EXYNOS4412 */
static struct flite_drvdata fimc_lite_drvdata_exynos4 = {
.variant = {
[0] = &fimc_lite0_variant_exynos4,
[1] = &fimc_lite0_variant_exynos4,
},
};

static struct platform_device_id fimc_lite_driver_ids[] = {
{
.name = "exynos-fimc-lite",
Expand Down
10 changes: 3 additions & 7 deletions trunk/drivers/media/platform/exynos4-is/fimc-lite.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,14 @@ enum {
#define FLITE_SD_PAD_SOURCE_ISP 2
#define FLITE_SD_PADS_NUM 3

struct flite_variant {
struct flite_drvdata {
unsigned short max_width;
unsigned short max_height;
unsigned short out_width_align;
unsigned short win_hor_offs_align;
unsigned short out_hor_offs_align;
};

struct flite_drvdata {
struct flite_variant *variant[FIMC_LITE_MAX_DEVS];
};

#define fimc_lite_get_drvdata(_pdev) \
((struct flite_drvdata *) platform_get_device_id(_pdev)->driver_data)

Expand Down Expand Up @@ -96,7 +92,7 @@ struct flite_buffer {
/**
* struct fimc_lite - fimc lite structure
* @pdev: pointer to FIMC-LITE platform device
* @variant: variant information for this IP
* @dd: SoC specific driver data structure
* @v4l2_dev: pointer to top the level v4l2_device
* @vfd: video device node
* @fh: v4l2 file handle
Expand Down Expand Up @@ -132,7 +128,7 @@ struct flite_buffer {
*/
struct fimc_lite {
struct platform_device *pdev;
struct flite_variant *variant;
struct flite_drvdata *dd;
struct v4l2_device *v4l2_dev;
struct video_device vfd;
struct v4l2_fh fh;
Expand Down

0 comments on commit 7a98a4b

Please sign in to comment.