Commit 29464216 authored by Mikhail Karpenko's avatar Mikhail Karpenko

Add command to change frame dimentions

parent 5ce0a999
...@@ -692,6 +692,8 @@ loff_t circbuf_lseek(struct file *file, loff_t offset, int orig) ...@@ -692,6 +692,8 @@ loff_t circbuf_lseek(struct file *file, loff_t offset, int orig)
* @return number of bytes read form \e buf * @return number of bytes read form \e buf
*/ */
unsigned short circbuf_quality = 100; unsigned short circbuf_quality = 100;
unsigned short circbuf_height = 1936;
unsigned short circbuf_width = 2592;
ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t *off) ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t *off)
{ {
unsigned long p; unsigned long p;
...@@ -746,6 +748,17 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t * ...@@ -746,6 +748,17 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t *
} }
} }
break; break;
case 6:
{
unsigned int w, h;
int res = sscanf(&buf[2], "%u:%u", &w, &h);
if (res == 2) {
circbuf_width = w;
circbuf_height = h;
dev_dbg(g_dev_ptr, "set image size %u x %u\n", w, h);
}
}
break;
} }
/* debug code end */ /* debug code end */
......
...@@ -44,6 +44,8 @@ extern struct circbuf_priv_t *circbuf_priv_ptr; ...@@ -44,6 +44,8 @@ extern struct circbuf_priv_t *circbuf_priv_ptr;
/* debug code follows */ /* debug code follows */
extern unsigned short circbuf_quality; extern unsigned short circbuf_quality;
extern unsigned short circbuf_height;
extern unsigned short circbuf_width;
/* end of debug code */ /* end of debug code */
#endif /* _CIRCBUF_H */ #endif /* _CIRCBUF_H */
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
* - interrupts handling * - interrupts handling
* - tasklets * - tasklets
* - device driver that includes waiting for the next frame regardless of compression * - device driver that includes waiting for the next frame regardless of compression
* */
* Copyright (C) 2016 Elphel, Inc.
/* Copyright (C) 2016 Elphel, Inc.
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -82,7 +83,7 @@ ...@@ -82,7 +83,7 @@
#define IMAGEACQ_DRIVER_NAME "Elphel (R) Model 393 Image Acquisition device driver" #define IMAGEACQ_DRIVER_NAME "Elphel (R) Model 393 Image Acquisition device driver"
/** @brief The size in bytes of L2 cache invalidation area. This size must be aligned to cache line size. /** @brief The size in bytes of L2 cache invalidation area. This size must be aligned to cache line size.
* 16 kbytes seems to be good starting point. */ * 16 kbytes seems to be good starting point. */
#define L2_INVAL_SIZE (16 * 1024) #define L2_INVAL_SIZE (32 * 1024)
/**@struct jpeg_ptr_t /**@struct jpeg_ptr_t
* @brief \e jpeg_ptr_t structure contains read and write pointers along with * @brief \e jpeg_ptr_t structure contains read and write pointers along with
...@@ -358,8 +359,10 @@ inline void updateIRQFocus(struct jpeg_ptr_t *jptr) ...@@ -358,8 +359,10 @@ inline void updateIRQFocus(struct jpeg_ptr_t *jptr)
inline static void set_default_interframe(struct interframe_params_t *params) inline static void set_default_interframe(struct interframe_params_t *params)
{ {
params->height = 1936; // params->height = 1936;
params->width = 2592; // params->width = 2592;
params->height = circbuf_height;
params->width = circbuf_width;
params->byrshift = 3; params->byrshift = 3;
params->color = 0; params->color = 0;
params->quality2 = circbuf_quality; params->quality2 = circbuf_quality;
...@@ -543,7 +546,7 @@ static irqreturn_t frame_sync_irq_handler(int irq, void *dev_id) ...@@ -543,7 +546,7 @@ static irqreturn_t frame_sync_irq_handler(int irq, void *dev_id)
* flag meaning that interrupts are enabled during processing. Such behavior is recommended in LDD3. * flag meaning that interrupts are enabled during processing. Such behavior is recommended in LDD3.
* @param[in] irq interrupt number * @param[in] irq interrupt number
* @param[in] dev_id pointer to driver's private data structure #jpeg_ptr_t corresponding to * @param[in] dev_id pointer to driver's private data structure #jpeg_ptr_t corresponding to
* the channel which raise interrupt * the channel which raised interrupt
* @return \e IRQ_HANDLED if interrupt was processed and \e IRQ_NONE otherwise * @return \e IRQ_HANDLED if interrupt was processed and \e IRQ_NONE otherwise
*/ */
static irqreturn_t compressor_irq_handler(int irq, void *dev_id) static irqreturn_t compressor_irq_handler(int irq, void *dev_id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment