Re: [RFCv2 PATCH 4/9] v4l: add buffer exporting via dmabuf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tomasz,

On Friday 23 March 2012 12:33:24 Tomasz Stanislawski wrote:
> On 03/22/2012 12:16 PM, Laurent Pinchart wrote:
> > On Tuesday 13 March 2012 11:17:02 Tomasz Stanislawski wrote:

[snip]

> >> +	case VIDIOC_EXPBUF:
> >> +	{
> >> +		struct v4l2_exportbuffer *p = arg;
> >> +
> >> +		if (!ops->vidioc_expbuf)
> >> +			break;
> >> +
> >> +		ret = ops->vidioc_expbuf(file, fh, p);
> > 
> > You can pass arg to ops->vidioc_expbuf() directly, there's no need to
> > create a struct v4l2_exportbuffer *p variable.
> 
> No problem. I tried to follow style of other ioctls.
> Notice that adding this temporary variable provides some form of type
> checking. I mean using a proper structure for a proper callback.

It makes sure that the argument passed to video_expbuf is indeed a 
v4l2_exportbuffer, but it doesn't check that the arg pointer you assign to p 
points to the right type, so it's a bit pointless in my opinion.

This construct makes sense if you need to access field of the arg pointer here 
before or after calling the operation.

> >> +		break;
> >> +	}

-- 
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux