Commit 03dc3b07 authored by Mikhail Karpenko's avatar Mikhail Karpenko

Add command to change byrshift in circbuf

parent 0a06b6ec
...@@ -694,6 +694,7 @@ loff_t circbuf_lseek(struct file *file, loff_t offset, int orig) ...@@ -694,6 +694,7 @@ loff_t circbuf_lseek(struct file *file, loff_t offset, int orig)
unsigned short circbuf_quality = 100; unsigned short circbuf_quality = 100;
unsigned short circbuf_height = 1936; unsigned short circbuf_height = 1936;
unsigned short circbuf_width = 2592; unsigned short circbuf_width = 2592;
unsigned char circbuf_byrshift = 3;
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;
...@@ -714,6 +715,7 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t * ...@@ -714,6 +715,7 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t *
camera_interrupts(1); camera_interrupts(1);
break; break;
case 3: case 3:
/* update image quality */
buf_copy[count - 1] = 0; buf_copy[count - 1] = 0;
ret = kstrtol(&buf_copy[2], 10, &val); ret = kstrtol(&buf_copy[2], 10, &val);
dev_dbg(g_dev_ptr, "ret: %d, buf[2]: %s\n", ret, &buf_copy[2]); dev_dbg(g_dev_ptr, "ret: %d, buf[2]: %s\n", ret, &buf_copy[2]);
...@@ -732,6 +734,7 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t * ...@@ -732,6 +734,7 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t *
dump_state(chn); dump_state(chn);
break; break;
case 5: case 5:
/* print debug statistics */
{ {
int j, cntr; int j, cntr;
long long res; long long res;
...@@ -749,6 +752,7 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t * ...@@ -749,6 +752,7 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t *
} }
break; break;
case 6: case 6:
/* update frame size */
{ {
unsigned int w, h; unsigned int w, h;
int res = sscanf(&buf[2], "%u:%u", &w, &h); int res = sscanf(&buf[2], "%u:%u", &w, &h);
...@@ -759,6 +763,17 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t * ...@@ -759,6 +763,17 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t *
} }
} }
break; break;
case 7:
/* update Bayer shift */
{
unsigned char val;
int res = sscanf(&buf[2], "%u", &val);
if (res == 1) {
circbuf_byrshift = val;
dev_dbg(g_dev_ptr, "set new bayer shift: %u\n", val);
}
}
break;
} }
/* debug code end */ /* debug code end */
......
...@@ -46,6 +46,7 @@ extern struct circbuf_priv_t *circbuf_priv_ptr; ...@@ -46,6 +46,7 @@ extern struct circbuf_priv_t *circbuf_priv_ptr;
extern unsigned short circbuf_quality; extern unsigned short circbuf_quality;
extern unsigned short circbuf_height; extern unsigned short circbuf_height;
extern unsigned short circbuf_width; extern unsigned short circbuf_width;
extern unsigned char circbuf_byrshift;
/* end of debug code */ /* end of debug code */
#endif /* _CIRCBUF_H */ #endif /* _CIRCBUF_H */
...@@ -363,7 +363,8 @@ inline static void set_default_interframe(struct interframe_params_t *params) ...@@ -363,7 +363,8 @@ inline static void set_default_interframe(struct interframe_params_t *params)
// params->width = 2592; // params->width = 2592;
params->height = circbuf_height; params->height = circbuf_height;
params->width = circbuf_width; params->width = circbuf_width;
params->byrshift = 3; // params->byrshift = 3;
params->byrshift = circbuf_byrshift;
params->color = 0; params->color = 0;
params->quality2 = circbuf_quality; params->quality2 = circbuf_quality;
//params->quality2 = 100; //params->quality2 = 100;
......
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