summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>2018-04-14 14:57:01 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-04-20 16:50:33 +0300
commit16cdb7d30ab8dda8155769269ccc102636413484 (patch)
treebdf54a808a1b01646d3d2af217978bbdf7107cb1 /drivers/media
parentbb3ed3fd66888f048cd99466751eeb98b031f676 (diff)
downloadlinux-16cdb7d30ab8dda8155769269ccc102636413484.tar.xz
media: rcar-vin: move max width and height information to chip information
On Gen3 the max supported width and height will be different from Gen2. Move the limits to the struct rvin_info to prepare for Gen3 support. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/rcar-vin/rcar-core.c6
-rw-r--r--drivers/media/platform/rcar-vin/rcar-v4l2.c6
-rw-r--r--drivers/media/platform/rcar-vin/rcar-vin.h5
3 files changed, 13 insertions, 4 deletions
diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c
index 71d66916ce1b..be49d8968f0a 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -243,14 +243,20 @@ static int rvin_digital_graph_init(struct rvin_dev *vin)
static const struct rvin_info rcar_info_h1 = {
.model = RCAR_H1,
+ .max_width = 2048,
+ .max_height = 2048,
};
static const struct rvin_info rcar_info_m1 = {
.model = RCAR_M1,
+ .max_width = 2048,
+ .max_height = 2048,
};
static const struct rvin_info rcar_info_gen2 = {
.model = RCAR_GEN2,
+ .max_width = 2048,
+ .max_height = 2048,
};
static const struct of_device_id rvin_of_id_table[] = {
diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 97baea8fb7e6..5af58e2787f8 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -23,8 +23,6 @@
#include "rcar-vin.h"
#define RVIN_DEFAULT_FORMAT V4L2_PIX_FMT_YUYV
-#define RVIN_MAX_WIDTH 2048
-#define RVIN_MAX_HEIGHT 2048
/* -----------------------------------------------------------------------------
* Format Conversions
@@ -258,8 +256,8 @@ static int __rvin_try_format(struct rvin_dev *vin,
walign = vin->format.pixelformat == V4L2_PIX_FMT_NV16 ? 5 : 1;
/* Limit to VIN capabilities */
- v4l_bound_align_image(&pix->width, 2, RVIN_MAX_WIDTH, walign,
- &pix->height, 4, RVIN_MAX_HEIGHT, 2, 0);
+ v4l_bound_align_image(&pix->width, 2, vin->info->max_width, walign,
+ &pix->height, 4, vin->info->max_height, 2, 0);
pix->bytesperline = max_t(u32, pix->bytesperline,
rvin_format_bytesperline(pix));
diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h b/drivers/media/platform/rcar-vin/rcar-vin.h
index b63c4fce68ad..8d135ed3f7ab 100644
--- a/drivers/media/platform/rcar-vin/rcar-vin.h
+++ b/drivers/media/platform/rcar-vin/rcar-vin.h
@@ -89,9 +89,14 @@ struct rvin_graph_entity {
/**
* struct rvin_info - Information about the particular VIN implementation
* @model: VIN model
+ * @max_width: max input width the VIN supports
+ * @max_height: max input height the VIN supports
*/
struct rvin_info {
enum model_id model;
+
+ unsigned int max_width;
+ unsigned int max_height;
};
/**