Lines Matching +full:2 +full:f
16 struct v4l2_pix_format *f = &dev->tch_format; in touch_cap_queue_setup() local
17 unsigned int size = f->sizeimage; in touch_cap_queue_setup()
33 struct v4l2_pix_format *f = &dev->tch_format; in touch_cap_buf_prepare() local
34 unsigned int size = f->sizeimage; in touch_cap_buf_prepare()
117 int vivid_enum_fmt_tch(struct file *file, void *priv, struct v4l2_fmtdesc *f) in vivid_enum_fmt_tch() argument
119 if (f->index) in vivid_enum_fmt_tch()
122 f->pixelformat = V4L2_TCH_FMT_DELTA_TD16; in vivid_enum_fmt_tch()
126 int vivid_g_fmt_tch(struct file *file, void *priv, struct v4l2_format *f) in vivid_g_fmt_tch() argument
132 f->fmt.pix = dev->tch_format; in vivid_g_fmt_tch()
136 int vivid_g_fmt_tch_mplane(struct file *file, void *priv, struct v4l2_format *f) in vivid_g_fmt_tch_mplane() argument
145 fmt_sp2mp(&sp_fmt, f); in vivid_g_fmt_tch_mplane()
184 struct v4l2_pix_format *f = &dev->tch_format; in vivid_set_touch() local
189 f->pixelformat = V4L2_TCH_FMT_DELTA_TD16; in vivid_set_touch()
190 f->width = VIVID_TCH_WIDTH; in vivid_set_touch()
191 f->height = VIVID_TCH_HEIGHT; in vivid_set_touch()
192 f->field = V4L2_FIELD_NONE; in vivid_set_touch()
193 f->colorspace = V4L2_COLORSPACE_RAW; in vivid_set_touch()
194 f->bytesperline = f->width * sizeof(s16); in vivid_set_touch()
195 f->sizeimage = f->width * f->height * sizeof(s16); in vivid_set_touch()
224 static void vivid_tch_buf_set(struct v4l2_pix_format *f, in vivid_tch_buf_set() argument
228 unsigned int x = index % f->width; in vivid_tch_buf_set()
229 unsigned int y = index / f->width; in vivid_tch_buf_set()
233 offset /= 2; in vivid_tch_buf_set()
236 if (x < f->width - 1) in vivid_tch_buf_set()
239 tch_buf[index - f->width] = offset + get_random_pressure(); in vivid_tch_buf_set()
240 if (y < f->height - 1) in vivid_tch_buf_set()
241 tch_buf[index + f->width] = offset + get_random_pressure(); in vivid_tch_buf_set()
242 offset /= 2; in vivid_tch_buf_set()
244 tch_buf[index - 1 - f->width] = offset + get_random_pressure(); in vivid_tch_buf_set()
245 if (x < f->width - 1 && y) in vivid_tch_buf_set()
246 tch_buf[index + 1 - f->width] = offset + get_random_pressure(); in vivid_tch_buf_set()
247 if (x && y < f->height - 1) in vivid_tch_buf_set()
248 tch_buf[index - 1 + f->width] = offset + get_random_pressure(); in vivid_tch_buf_set()
249 if (x < f->width - 1 && y < f->height - 1) in vivid_tch_buf_set()
250 tch_buf[index + 1 + f->width] = offset + get_random_pressure(); in vivid_tch_buf_set()
255 struct v4l2_pix_format *f = &dev->tch_format; in vivid_fillbuff_tch() local
256 int size = f->width * f->height; in vivid_fillbuff_tch()
277 if (test_pat_idx == 2) in vivid_fillbuff_tch()
278 vivid_tch_buf_set(f, tch_buf, rand % size); in vivid_fillbuff_tch()
281 if (test_pat_idx == 2 || test_pat_idx == 4) in vivid_fillbuff_tch()
282 vivid_tch_buf_set(f, tch_buf, rand % size); in vivid_fillbuff_tch()
285 if (test_pat_idx == 2 || test_pat_idx == 4 || test_pat_idx == 6) in vivid_fillbuff_tch()
286 vivid_tch_buf_set(f, tch_buf, rand % size); in vivid_fillbuff_tch()
289 vivid_tch_buf_set(f, tch_buf, in vivid_fillbuff_tch()
290 (rand % f->height) * f->width + in vivid_fillbuff_tch()
292 (f->width / TCH_PATTERN_COUNT)); in vivid_fillbuff_tch()
295 x = f->width / 2; in vivid_fillbuff_tch()
296 y = f->height / 2; in vivid_fillbuff_tch()
301 vivid_tch_buf_set(f, tch_buf, in vivid_fillbuff_tch()
302 (x - offset_x) + f->width * (y - offset_y)); in vivid_fillbuff_tch()
303 vivid_tch_buf_set(f, tch_buf, in vivid_fillbuff_tch()
304 (x + offset_x) + f->width * (y + offset_y)); in vivid_fillbuff_tch()
307 x = f->width / 2; in vivid_fillbuff_tch()
308 y = f->height / 2; in vivid_fillbuff_tch()
311 vivid_tch_buf_set(f, tch_buf, in vivid_fillbuff_tch()
312 (x - offset_x) + f->width * (y - offset_y)); in vivid_fillbuff_tch()
313 vivid_tch_buf_set(f, tch_buf, in vivid_fillbuff_tch()
314 (x + offset_x) + f->width * (y + offset_y)); in vivid_fillbuff_tch()
317 for (x = 0; x < f->width; x++) in vivid_fillbuff_tch()
318 for (y = f->height / 2; y < f->height; y++) in vivid_fillbuff_tch()
319 tch_buf[x + f->width * y] = VIVID_MIN_PRESSURE + in vivid_fillbuff_tch()
326 ystart = (y * f->height) / 4 + f->height / 8; in vivid_fillbuff_tch()
327 xstart = (x * f->width) / 4 + f->width / 8; in vivid_fillbuff_tch()
328 vivid_tch_buf_set(f, tch_buf, in vivid_fillbuff_tch()
329 ystart * f->width + xstart); in vivid_fillbuff_tch()