unsigned int width;
unsigned int height;
unsigned int sizeimage;
- struct bcm2835_isp_fmt *fmt;
+ const struct bcm2835_isp_fmt *fmt;
};
/*
struct bcm2835_isp_node *node)
{
struct bcm2835_isp_fmt_list *fmts = &node->supported_fmts;
- struct bcm2835_isp_fmt *fmt;
+ const struct bcm2835_isp_fmt *fmt;
unsigned int i;
for (i = 0; i < fmts->num_entries; i++) {
- fmt = &fmts->list[i];
+ fmt = fmts->list[i];
if (fmt->fourcc == fourcc)
return fmt;
}
return NULL;
}
-static struct bcm2835_isp_fmt *find_format(struct v4l2_format *f,
- struct bcm2835_isp_node *node)
+static const
+struct bcm2835_isp_fmt *find_format(struct v4l2_format *f,
+ struct bcm2835_isp_node *node)
{
return find_format_by_fourcc(node_is_stats(node) ?
f->fmt.meta.dataformat :
.stop_streaming = bcm2835_isp_node_stop_streaming,
};
-static struct bcm2835_isp_fmt *get_default_format(struct bcm2835_isp_node *node)
+static const
+struct bcm2835_isp_fmt *get_default_format(struct bcm2835_isp_node *node)
{
- return &node->supported_fmts.list[0];
+ return node->supported_fmts.list[0];
}
static inline unsigned int get_bytesperline(int width,
- struct bcm2835_isp_fmt *fmt)
+ const struct bcm2835_isp_fmt *fmt)
{
return ALIGN((width * fmt->depth) >> 3, fmt->bytesperline_align);
}
static inline unsigned int get_sizeimage(int bpl, int width, int height,
- struct bcm2835_isp_fmt *fmt)
+ const struct bcm2835_isp_fmt *fmt)
{
return (bpl * height * fmt->size_multiplier_x2) >> 1;
}
if (f->index < fmts->num_entries) {
/* Format found */
- f->pixelformat = fmts->list[f->index].fourcc;
- f->flags = fmts->list[f->index].flags;
+ f->pixelformat = fmts->list[f->index]->fourcc;
+ f->flags = fmts->list[f->index]->flags;
return 0;
}
{
struct bcm2835_isp_node *node = video_drvdata(file);
struct bcm2835_isp_dev *dev = node_get_dev(node);
- struct bcm2835_isp_fmt *fmt;
+ const struct bcm2835_isp_fmt *fmt;
if (node_is_stats(node) || fsize->index)
return -EINVAL;
struct v4l2_format *f)
{
struct bcm2835_isp_node *node = video_drvdata(file);
- struct bcm2835_isp_fmt *fmt;
+ const struct bcm2835_isp_fmt *fmt;
if (f->type != node->queue.type)
return -EINVAL;
static int bcm2835_isp_get_supported_fmts(struct bcm2835_isp_node *node)
{
struct bcm2835_isp_dev *dev = node_get_dev(node);
- struct bcm2835_isp_fmt *list;
+ struct bcm2835_isp_fmt const **list;
unsigned int i, j, num_encodings;
u32 fourccs[MAX_SUPPORTED_ENCODINGS];
u32 param_size = sizeof(fourccs);
* Any that aren't supported will waste a very small amount of memory.
*/
list = devm_kzalloc(dev->dev,
- sizeof(struct bcm2835_isp_fmt) * num_encodings,
+ sizeof(struct bcm2835_isp_fmt *) * num_encodings,
GFP_KERNEL);
if (!list)
return -ENOMEM;
const struct bcm2835_isp_fmt *fmt = get_fmt(fourccs[i]);
if (fmt) {
- list[j] = *fmt;
+ list[j] = fmt;
j++;
}
}