All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Vishal Sagar <vsagar@xilinx.com>, Vinod Koul <vinod.koul@intel.com>
Cc: Vishal Sagar <vishal.sagar@xilinx.com>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	Dinesh Kumar <dineshk@xilinx.com>,
	"michal.simek@xilinx.com" <michal.simek@xilinx.com>,
	Jeff Mouroux <jmouroux@xilinx.com>,
	Radhey Shyam Pandey <radheys@xilinx.com>,
	Hyun Kwon <hyunk@xilinx.com>,
	Maurice Penners <mpenner@xilinx.com>,
	John Nichols <jnichol@xilinx.com>
Subject: [2/2] dma: xilinx: Add driver for Video Framebuffer IP
Date: Fri, 12 Jan 2018 14:36:39 +0100	[thread overview]
Message-ID: <5d9fa520-4c6c-280c-430e-46e708681278@metafoo.de> (raw)

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2018-01-12 13:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 13:36 Lars-Peter Clausen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-01-11  6:15 [2/2] dma: xilinx: Add driver for Video Framebuffer IP Vinod Koul
2018-01-10 11:53 Vishal Sagar
2017-12-22  9:55 Vinod Koul
2017-12-22  8:20 Vishal Sagar
2017-12-21  6:55 Philippe Ombredanne
2017-12-21  2:33 Vinod Koul
2017-12-20 18:27 Michal Simek
2017-12-20 17:05 Vinod Koul
2017-12-20  8:30 Vishal Sagar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d9fa520-4c6c-280c-430e-46e708681278@metafoo.de \
    --to=lars@metafoo.de \
    --cc=dineshk@xilinx.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=hyunk@xilinx.com \
    --cc=jmouroux@xilinx.com \
    --cc=jnichol@xilinx.com \
    --cc=michal.simek@xilinx.com \
    --cc=mpenner@xilinx.com \
    --cc=radheys@xilinx.com \
    --cc=vinod.koul@intel.com \
    --cc=vishal.sagar@xilinx.com \
    --cc=vsagar@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.