tree: git://linuxtv.org/media_tree.git master head: 201b56737f4ea59ee840ebdb88a9970ea6d49cf1 commit: 57868acc369ab73ec8f6b43a0c6749077376b189 [3281/3294] media: videobuf2: Add new uAPI for DVB streaming I/O config: i386-randconfig-s1-201752 (attached as .config) compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026 reproduce: git checkout 57868acc369ab73ec8f6b43a0c6749077376b189 # save the attached .config to linux build tree make ARCH=i386 Note: the linuxtv-media/master HEAD 201b56737f4ea59ee840ebdb88a9970ea6d49cf1 builds fine. It only hurts bisectibility. All errors (new ones prefixed by >>): drivers/media/dvb-core/dvb_vb2.o: In function `dvb_vb2_init': drivers/media/dvb-core/dvb_vb2.c:170: undefined reference to `vb2_vmalloc_memops' >> drivers/media/dvb-core/dvb_vb2.c:173: undefined reference to `vb2_core_queue_init' drivers/media/dvb-core/dvb_vb2.o: In function `dvb_vb2_release': >> drivers/media/dvb-core/dvb_vb2.c:198: undefined reference to `vb2_core_queue_release' drivers/media/dvb-core/dvb_vb2.o: In function `dvb_vb2_stream_on': >> drivers/media/dvb-core/dvb_vb2.c:211: undefined reference to `vb2_core_streamon' drivers/media/dvb-core/dvb_vb2.o: In function `dvb_vb2_stream_off': >> drivers/media/dvb-core/dvb_vb2.c:238: undefined reference to `vb2_buffer_done' >> drivers/media/dvb-core/dvb_vb2.c:242: undefined reference to `vb2_core_streamoff' drivers/media/dvb-core/dvb_vb2.o: In function `dvb_vb2_fill_buffer': drivers/media/dvb-core/dvb_vb2.c:294: undefined reference to `vb2_buffer_done' >> drivers/media/dvb-core/dvb_vb2.c:301: undefined reference to `vb2_plane_vaddr' drivers/media/dvb-core/dvb_vb2.c:310: undefined reference to `vb2_buffer_done' drivers/media/dvb-core/dvb_vb2.c:317: undefined reference to `vb2_buffer_done' drivers/media/dvb-core/dvb_vb2.o: In function `dvb_vb2_reqbufs': >> drivers/media/dvb-core/dvb_vb2.c:336: undefined reference to `vb2_core_reqbufs' drivers/media/dvb-core/dvb_vb2.o: In function `dvb_vb2_querybuf': >> drivers/media/dvb-core/dvb_vb2.c:352: undefined reference to `vb2_core_querybuf' drivers/media/dvb-core/dvb_vb2.o: In function `dvb_vb2_expbuf': >> drivers/media/dvb-core/dvb_vb2.c:362: undefined reference to `vb2_core_expbuf' drivers/media/dvb-core/dvb_vb2.o: In function `dvb_vb2_qbuf': >> drivers/media/dvb-core/dvb_vb2.c:378: undefined reference to `vb2_core_qbuf' drivers/media/dvb-core/dvb_vb2.o: In function `dvb_vb2_dqbuf': >> drivers/media/dvb-core/dvb_vb2.c:393: undefined reference to `vb2_core_dqbuf' drivers/media/dvb-core/dvb_vb2.o: In function `dvb_vb2_mmap': >> drivers/media/dvb-core/dvb_vb2.c:407: undefined reference to `vb2_mmap' drivers/media/dvb-core/dvb_vb2.o: In function `dvb_vb2_poll': >> drivers/media/dvb-core/dvb_vb2.c:421: undefined reference to `vb2_core_poll' vim +173 drivers/media/dvb-core/dvb_vb2.c 151 152 /* 153 * Videobuf operations 154 */ 155 int dvb_vb2_init(struct dvb_vb2_ctx *ctx, const char *name, int nonblocking) 156 { 157 struct vb2_queue *q = &ctx->vb_q; 158 int ret; 159 160 memset(ctx, 0, sizeof(struct dvb_vb2_ctx)); 161 q->type = DVB_BUF_TYPE_CAPTURE; 162 /**capture type*/ 163 q->is_output = 0; 164 /**only mmap is supported currently*/ 165 q->io_modes = VB2_MMAP; 166 q->drv_priv = ctx; 167 q->buf_struct_size = sizeof(struct dvb_buffer); 168 q->min_buffers_needed = 1; 169 q->ops = &dvb_vb2_qops; > 170 q->mem_ops = &vb2_vmalloc_memops; 171 q->buf_ops = &dvb_vb2_buf_ops; 172 q->num_buffers = 0; > 173 ret = vb2_core_queue_init(q); 174 if (ret) { 175 ctx->state = DVB_VB2_STATE_NONE; 176 dprintk(1, "[%s] errno=%d\n", ctx->name, ret); 177 return ret; 178 } 179 180 mutex_init(&ctx->mutex); 181 spin_lock_init(&ctx->slock); 182 INIT_LIST_HEAD(&ctx->dvb_q); 183 184 strncpy(ctx->name, name, DVB_VB2_NAME_MAX); 185 ctx->nonblocking = nonblocking; 186 ctx->state = DVB_VB2_STATE_INIT; 187 188 dprintk(3, "[%s]\n", ctx->name); 189 190 return 0; 191 } 192 193 int dvb_vb2_release(struct dvb_vb2_ctx *ctx) 194 { 195 struct vb2_queue *q = (struct vb2_queue *)&ctx->vb_q; 196 197 if (ctx->state & DVB_VB2_STATE_INIT) > 198 vb2_core_queue_release(q); 199 200 ctx->state = DVB_VB2_STATE_NONE; 201 dprintk(3, "[%s]\n", ctx->name); 202 203 return 0; 204 } 205 206 int dvb_vb2_stream_on(struct dvb_vb2_ctx *ctx) 207 { 208 struct vb2_queue *q = &ctx->vb_q; 209 int ret; 210 > 211 ret = vb2_core_streamon(q, q->type); 212 if (ret) { 213 ctx->state = DVB_VB2_STATE_NONE; 214 dprintk(1, "[%s] errno=%d\n", ctx->name, ret); 215 return ret; 216 } 217 ctx->state |= DVB_VB2_STATE_STREAMON; 218 dprintk(3, "[%s]\n", ctx->name); 219 220 return 0; 221 } 222 223 int dvb_vb2_stream_off(struct dvb_vb2_ctx *ctx) 224 { 225 struct vb2_queue *q = (struct vb2_queue *)&ctx->vb_q; 226 int ret; 227 unsigned long flags = 0; 228 229 ctx->state &= ~DVB_VB2_STATE_STREAMON; 230 spin_lock_irqsave(&ctx->slock, flags); 231 while (!list_empty(&ctx->dvb_q)) { 232 struct dvb_buffer *buf; 233 234 buf = list_entry(ctx->dvb_q.next, 235 struct dvb_buffer, list); 236 list_del(&buf->list); 237 spin_unlock_irqrestore(&ctx->slock, flags); > 238 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR); 239 spin_lock_irqsave(&ctx->slock, flags); 240 } 241 spin_unlock_irqrestore(&ctx->slock, flags); > 242 ret = vb2_core_streamoff(q, q->type); 243 if (ret) { 244 ctx->state = DVB_VB2_STATE_NONE; 245 dprintk(1, "[%s] errno=%d\n", ctx->name, ret); 246 return ret; 247 } 248 dprintk(3, "[%s]\n", ctx->name); 249 250 return 0; 251 } 252 253 int dvb_vb2_is_streaming(struct dvb_vb2_ctx *ctx) 254 { 255 return (ctx->state & DVB_VB2_STATE_STREAMON); 256 } 257 258 int dvb_vb2_fill_buffer(struct dvb_vb2_ctx *ctx, 259 const unsigned char *src, int len) 260 { 261 unsigned long flags = 0; 262 void *vbuf = NULL; 263 int todo = len; 264 unsigned char *psrc = (unsigned char *)src; 265 int ll = 0; 266 267 dprintk(3, "[%s] %d bytes are rcvd\n", ctx->name, len); 268 if (!src) { 269 dprintk(3, "[%s]:NULL pointer src\n", ctx->name); 270 /**normal case: This func is called twice from demux driver 271 * once with valid src pointer, second time with NULL pointer 272 */ 273 return 0; 274 } 275 while (todo) { 276 if (!ctx->buf) { 277 spin_lock_irqsave(&ctx->slock, flags); 278 if (list_empty(&ctx->dvb_q)) { 279 spin_unlock_irqrestore(&ctx->slock, flags); 280 dprintk(3, "[%s] Buffer overflow!!!\n", 281 ctx->name); 282 break; 283 } 284 285 ctx->buf = list_entry(ctx->dvb_q.next, 286 struct dvb_buffer, list); 287 list_del(&ctx->buf->list); 288 spin_unlock_irqrestore(&ctx->slock, flags); 289 ctx->remain = vb2_plane_size(&ctx->buf->vb, 0); 290 ctx->offset = 0; 291 } 292 293 if (!dvb_vb2_is_streaming(ctx)) { > 294 vb2_buffer_done(&ctx->buf->vb, VB2_BUF_STATE_ERROR); 295 ctx->buf = NULL; 296 break; 297 } 298 299 /* Fill buffer */ 300 ll = min(todo, ctx->remain); > 301 vbuf = vb2_plane_vaddr(&ctx->buf->vb, 0); 302 memcpy(vbuf + ctx->offset, psrc, ll); 303 todo -= ll; 304 psrc += ll; 305 306 ctx->remain -= ll; 307 ctx->offset += ll; 308 309 if (ctx->remain == 0) { > 310 vb2_buffer_done(&ctx->buf->vb, VB2_BUF_STATE_DONE); 311 ctx->buf = NULL; 312 } 313 } 314 315 if (ctx->nonblocking && ctx->buf) { 316 vb2_set_plane_payload(&ctx->buf->vb, 0, ll); 317 vb2_buffer_done(&ctx->buf->vb, VB2_BUF_STATE_DONE); 318 ctx->buf = NULL; 319 } 320 321 if (todo) 322 dprintk(1, "[%s] %d bytes are dropped.\n", ctx->name, todo); 323 else 324 dprintk(3, "[%s]\n", ctx->name); 325 326 dprintk(3, "[%s] %d bytes are copied\n", ctx->name, len - todo); 327 return (len - todo); 328 } 329 330 int dvb_vb2_reqbufs(struct dvb_vb2_ctx *ctx, struct dmx_requestbuffers *req) 331 { 332 int ret; 333 334 ctx->buf_siz = req->size; 335 ctx->buf_cnt = req->count; > 336 ret = vb2_core_reqbufs(&ctx->vb_q, VB2_MEMORY_MMAP, &req->count); 337 if (ret) { 338 ctx->state = DVB_VB2_STATE_NONE; 339 dprintk(1, "[%s] count=%d size=%d errno=%d\n", ctx->name, 340 ctx->buf_cnt, ctx->buf_siz, ret); 341 return ret; 342 } 343 ctx->state |= DVB_VB2_STATE_REQBUFS; 344 dprintk(3, "[%s] count=%d size=%d\n", ctx->name, 345 ctx->buf_cnt, ctx->buf_siz); 346 347 return 0; 348 } 349 350 int dvb_vb2_querybuf(struct dvb_vb2_ctx *ctx, struct dmx_buffer *b) 351 { > 352 vb2_core_querybuf(&ctx->vb_q, b->index, b); 353 dprintk(3, "[%s] index=%d\n", ctx->name, b->index); 354 return 0; 355 } 356 357 int dvb_vb2_expbuf(struct dvb_vb2_ctx *ctx, struct dmx_exportbuffer *exp) 358 { 359 struct vb2_queue *q = &ctx->vb_q; 360 int ret; 361 > 362 ret = vb2_core_expbuf(&ctx->vb_q, &exp->fd, q->type, exp->index, 363 0, exp->flags); 364 if (ret) { 365 dprintk(1, "[%s] index=%d errno=%d\n", ctx->name, 366 exp->index, ret); 367 return ret; 368 } 369 dprintk(3, "[%s] index=%d fd=%d\n", ctx->name, exp->index, exp->fd); 370 371 return 0; 372 } 373 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip