@@ -721,39 +721,14 @@ int vb2_verify_memory_type(struct vb2_queue *q,
721721}
722722EXPORT_SYMBOL (vb2_verify_memory_type );
723723
724- static void set_queue_consistency (struct vb2_queue * q , bool consistent_mem )
725- {
726- q -> dma_attrs &= ~DMA_ATTR_NON_CONSISTENT ;
727-
728- if (!vb2_queue_allows_cache_hints (q ))
729- return ;
730- if (!consistent_mem )
731- q -> dma_attrs |= DMA_ATTR_NON_CONSISTENT ;
732- }
733-
734- static bool verify_consistency_attr (struct vb2_queue * q , bool consistent_mem )
735- {
736- bool queue_is_consistent = !(q -> dma_attrs & DMA_ATTR_NON_CONSISTENT );
737-
738- if (consistent_mem != queue_is_consistent ) {
739- dprintk (q , 1 , "memory consistency model mismatch\n" );
740- return false;
741- }
742- return true;
743- }
744-
745724int vb2_core_reqbufs (struct vb2_queue * q , enum vb2_memory memory ,
746- unsigned int flags , unsigned int * count )
725+ unsigned int * count )
747726{
748727 unsigned int num_buffers , allocated_buffers , num_planes = 0 ;
749728 unsigned plane_sizes [VB2_MAX_PLANES ] = { };
750- bool consistent_mem = true;
751729 unsigned int i ;
752730 int ret ;
753731
754- if (flags & V4L2_FLAG_MEMORY_NON_CONSISTENT )
755- consistent_mem = false;
756-
757732 if (q -> streaming ) {
758733 dprintk (q , 1 , "streaming active\n" );
759734 return - EBUSY ;
@@ -765,8 +740,7 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
765740 }
766741
767742 if (* count == 0 || q -> num_buffers != 0 ||
768- (q -> memory != VB2_MEMORY_UNKNOWN && q -> memory != memory ) ||
769- !verify_consistency_attr (q , consistent_mem )) {
743+ (q -> memory != VB2_MEMORY_UNKNOWN && q -> memory != memory )) {
770744 /*
771745 * We already have buffers allocated, so first check if they
772746 * are not in use and can be freed.
@@ -803,7 +777,6 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
803777 num_buffers = min_t (unsigned int , num_buffers , VB2_MAX_FRAME );
804778 memset (q -> alloc_devs , 0 , sizeof (q -> alloc_devs ));
805779 q -> memory = memory ;
806- set_queue_consistency (q , consistent_mem );
807780
808781 /*
809782 * Ask the driver how many buffers and planes per buffer it requires.
@@ -888,18 +861,14 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
888861EXPORT_SYMBOL_GPL (vb2_core_reqbufs );
889862
890863int vb2_core_create_bufs (struct vb2_queue * q , enum vb2_memory memory ,
891- unsigned int flags , unsigned int * count ,
864+ unsigned int * count ,
892865 unsigned int requested_planes ,
893866 const unsigned int requested_sizes [])
894867{
895868 unsigned int num_planes = 0 , num_buffers , allocated_buffers ;
896869 unsigned plane_sizes [VB2_MAX_PLANES ] = { };
897- bool consistent_mem = true;
898870 int ret ;
899871
900- if (flags & V4L2_FLAG_MEMORY_NON_CONSISTENT )
901- consistent_mem = false;
902-
903872 if (q -> num_buffers == VB2_MAX_FRAME ) {
904873 dprintk (q , 1 , "maximum number of buffers already allocated\n" );
905874 return - ENOBUFS ;
@@ -912,15 +881,12 @@ int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory,
912881 }
913882 memset (q -> alloc_devs , 0 , sizeof (q -> alloc_devs ));
914883 q -> memory = memory ;
915- set_queue_consistency (q , consistent_mem );
916884 q -> waiting_for_buffers = !q -> is_output ;
917885 } else {
918886 if (q -> memory != memory ) {
919887 dprintk (q , 1 , "memory model mismatch\n" );
920888 return - EINVAL ;
921889 }
922- if (!verify_consistency_attr (q , consistent_mem ))
923- return - EINVAL ;
924890 }
925891
926892 num_buffers = min (* count , VB2_MAX_FRAME - q -> num_buffers );
@@ -2581,7 +2547,7 @@ static int __vb2_init_fileio(struct vb2_queue *q, int read)
25812547 fileio -> memory = VB2_MEMORY_MMAP ;
25822548 fileio -> type = q -> type ;
25832549 q -> fileio = fileio ;
2584- ret = vb2_core_reqbufs (q , fileio -> memory , 0 , & fileio -> count );
2550+ ret = vb2_core_reqbufs (q , fileio -> memory , & fileio -> count );
25852551 if (ret )
25862552 goto err_kfree ;
25872553
@@ -2638,7 +2604,7 @@ static int __vb2_init_fileio(struct vb2_queue *q, int read)
26382604
26392605err_reqbufs :
26402606 fileio -> count = 0 ;
2641- vb2_core_reqbufs (q , fileio -> memory , 0 , & fileio -> count );
2607+ vb2_core_reqbufs (q , fileio -> memory , & fileio -> count );
26422608
26432609err_kfree :
26442610 q -> fileio = NULL ;
@@ -2658,7 +2624,7 @@ static int __vb2_cleanup_fileio(struct vb2_queue *q)
26582624 vb2_core_streamoff (q , q -> type );
26592625 q -> fileio = NULL ;
26602626 fileio -> count = 0 ;
2661- vb2_core_reqbufs (q , fileio -> memory , 0 , & fileio -> count );
2627+ vb2_core_reqbufs (q , fileio -> memory , & fileio -> count );
26622628 kfree (fileio );
26632629 dprintk (q , 3 , "file io emulator closed\n" );
26642630 }
0 commit comments