public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Shobhit Kumar <shobhit.kumar@intel.com>
Cc: vijayakumar.balakrishnan@intel.com,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	yogesh.mohan.marimuthu@intel.com
Subject: Re: [PATCH 1/4] drm/i915: Add more dev ops for MIPI sub encoder
Date: Tue, 22 Oct 2013 14:53:32 +0300	[thread overview]
Message-ID: <87iowp34jn.fsf@intel.com> (raw)
In-Reply-To: <526647B6.9000903@intel.com>

On Tue, 22 Oct 2013, Shobhit Kumar <shobhit.kumar@intel.com> wrote:
> On 10/21/2013 6:57 PM, Jani Nikula wrote:
>>
>> Hi Shobhit -
>>
>> On Mon, 21 Oct 2013, Shobhit Kumar <shobhit.kumar@intel.com> wrote:
>>> Also add new fields in intel_dsi to have all dphy related parameters.
>>> These will be useful even when we go for pure generic MIPI design
>>
>> I feel like we have a different idea of what the ideal generic design
>> is. For me, the goal is that we change the struct intel_dsi_device to
>> struct drm_bridge, and those drm_bridge drivers are all about the panel,
>> and have as few details about i915 or our hardware as possible. Having
>> the bridge drivers fill in register values to be written by the core DSI
>> code does not fit that. Yes, I had some of those in my bridge conversion
>> patches too, but I did not intend we'd keep adding more.
>>
>> I'd rather we provide generic helpers the bridge driver can call.
>
> Yeah, look like our ideas are different. In your goal with drm_bridge
> architecture, we will still end up having multiple bridge drivers for
> each different panel. But my goal is to have a single driver which can
> work for multiple panels.

I'm trying to look one or two steps further, and what it will mean to
the driver. Here's the long term goal in upstream as I see it: There
will be a framework in place that allows one to write a (DSI) panel
driver once, using generic APIs, and use that panel driver with any SoC
(that implements the other side of the framework).

We are obviously far away from that goal at the moment. But IMHO we
should keep that in mind as a guide to what we are doing now. Moving
towards a model with a clearly defined API between the DSI core and the
panels, where the panel specific things are abstracted away from the
core, or towards a model where the core and panel driver depend on the
implementation of each other, communicating via variables.

> Since we already have enabled some panels with sub-encoder
> architecture for completeness I was planning to maintain generic
> driver as one sub-encoder.

Nothing prevents you from doing that, as long as the separation between
the core and the panel drivers remains clear.

> But actually we can do away with all sub-encoder and do not need even
> drm_bridge and all implementation will be in intel_dsi.c. Panel
> specific configurations or sequences will come from VBT which I have
> tried to convert as parameters.

With this model it is all too easy to forget what is the panel driver
and what is the SoC driver. They *are* two separate things, and should
not be mixed. It will be all too easy to keep adding new parameters and
conditions in the code as new panel drivers appear to need them. It will
lead to code that is very difficult to understand and maintain.

A model similar to what I'm proposing has also been tried and tested,
with several panels: drivers/video/omap2/. It's not DRM, and the control
is in the panel drivers, but the separation is extremely clear (panel
drivers are separate kernel modules).

No doubt the clear separation between the core and the panel drivers
will be harder and more work in the short term, but it will pay off in
the long term. And it doesn't all have to happen at once, as long as we
work *towards* that goal, not away from it.


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center

  reply	other threads:[~2013-10-22 11:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-21 12:21 [PATCH 0/4] drm/i915: Baytrail MIPI DSI support Updated Shobhit Kumar
2013-10-21 12:21 ` [PATCH 1/4] drm/i915: Add more dev ops for MIPI sub encoder Shobhit Kumar
2013-10-21 13:27   ` Jani Nikula
2013-10-22  9:39     ` Shobhit Kumar
2013-10-22 11:53       ` Jani Nikula [this message]
2013-10-23 12:52         ` Shobhit Kumar
2013-10-23 14:22           ` Jani Nikula
2013-10-24  8:01             ` Shobhit Kumar
2013-10-24  8:24               ` Jani Nikula
2013-10-24 12:13                 ` Shobhit Kumar
2013-10-21 12:21 ` [PATCH 2/4] drm/i915: Use FLISDSI interface for band gap reset Shobhit Kumar
2013-10-21 13:30   ` Jani Nikula
2013-10-21 12:21 ` [PATCH 3/4] drm/i915: Compute dsi_clk from pixel clock Shobhit Kumar
2013-10-21 13:28   ` Ville Syrjälä
2013-10-22  9:15     ` Shobhit Kumar
2013-10-21 13:44   ` Jani Nikula
2013-10-22  9:25     ` Shobhit Kumar
2013-10-21 12:21 ` [PATCH 4/4] drm/i915: Parameterize the MIPI enabling sequnece and adjust the sequence Shobhit Kumar
2013-10-21 13:23   ` Ville Syrjälä
2013-10-22  9:06     ` Shobhit Kumar
2013-10-22 10:49       ` Ville Syrjälä
2013-10-23 12:57         ` Shobhit Kumar

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=87iowp34jn.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=shobhit.kumar@intel.com \
    --cc=vijayakumar.balakrishnan@intel.com \
    --cc=yogesh.mohan.marimuthu@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox