Re: [PATCH 2/2] dma: xilinx: Add driver for Video Framebuffer IP

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

 



On 01/10/2018 12:53 PM, Vishal Sagar wrote:
[..]
>>
>>> The client driver would want to
>>> know what are the video formats supported and set the format
>> accordingly.
>>> For this there are APIs exposed by this driver.
>>
>> You are *not* the first driver to support these kind of use cases.
> 
> Ok. We discussed internally about this. Instead of using custom APIs we could use 
> device_config() in the client and send custom data by wrapping it around the struct dma_slave_config.
> =====================================================================
> enum {
>     UNKNOWN,
>     XFRMBUF,
> } xdma_type;
> 
> struct xilinx_dma_config {
> 	struct dma_slave_config config;
> 	enum xdma_type type; 
> 	union {
> 	 struct framebuffer_config;
> 	   /* Other future dma configs here */
> 	} xdma_config; 
> };
> 
> enum {
>     UNKNOWN,
>     V4L2,
>     DRM
> } framework_type;
> 
> struct framebuffer_config {
> 	video_format;  /* input param */
> 	enum framework_type fwtype;
> 	supported_v4l2_video_formats[];   /* output param */
> 	supported_drm_video_formats[];  /* output param */
> }
> =====================================================================
> First time client sets type = UNKNOWN and calls device_config(). 
> The driver sets the type back as XFRMBUF and populates the supported v4l2 and drm video formats and returns.
> Client calls it second time with type = XFRMBUF and video_format and fwtype set to one of the supported formats.
> This will help framebuffer driver correctly configure the video format.

Maybe just make this a non DMAengine driver. DMAengine is a generic
framework for general purpose DMAs that can be used by generic clients.

You are overloading the API though, your driver is not compliant with the
DMAengine API. This means any client that wants to your driver needs to know
that it is connecting to your driver and it can't connect to any other
DMAengine drivers that are actually API compliant. This completely defeats
the purpose of a standard API. You gain nothing, but add additional complexity.

For all it is worth you could implement this driver using the GPIO API and
the result would be the same.

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



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux