Re: [RFC PATCH] vb2: Stop allocating 'alloc_ctx', just set the device instead

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

 



Hi Hans,

On Monday 14 December 2015 15:36:04 Hans Verkuil wrote:
> (Before I post this as the 'final' patch and CC all the driver developers
> that are affected, I'd like to do an RFC post first. I always hated the
> alloc context for obfuscating what is really going on, but let's see what
> others think).
> 
> 
> Instead of allocating a struct that contains just a single device pointer,
> just pass that device pointer around. This avoids having to check for
> memory allocation errors and is much easier to understand since it makes
> explicit what was hidden in an opaque handle before.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@xxxxxxxxx>

As most devices use the same allocation context for all planes, wouldn't it 
make sense to just store the struct device pointer in the queue structure ? 
The oddball driver that requires different allocation contexts (I'm thinking 
about s5p-mfc here, there might be a couple more) would have to set the 
allocation contexts properly in the queue_setup handler, but for all other 
devices you could just remove that code completely.

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux