All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Ajay kumar <ajaynumb@gmail.com>
Cc: linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
	Jingoo Han <jg1.han@samsung.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	bhushan.r@samsung.com, Prashanth G <prashanth.g@samsung.com>,
	Ajay Kumar <ajaykumar.rs@samsung.com>
Subject: Re: [PATCH V7 03/12] drm/bridge: Add helper functions for drm_bridge
Date: Tue, 28 Oct 2014 15:19:36 +0100	[thread overview]
Message-ID: <CAKMK7uFX7rENLBmwE58rtCBXZ_pSF_uS5Poiuks7xfi+r=e9gw@mail.gmail.com> (raw)
In-Reply-To: <CAEC9eQNJb1TgK1ihvzvC0VjSJhm48WaFO5SVigPsqTOurK2UQw@mail.gmail.com>

On Tue, Oct 28, 2014 at 1:28 PM, Ajay kumar <ajaynumb@gmail.com> wrote:
> On Tue, Oct 28, 2014 at 3:31 PM, Daniel Vetter <daniel@ffwll.ch> wrote:
>> On Tue, Oct 28, 2014 at 10:21 AM, Ajay kumar <ajaynumb@gmail.com> wrote:
>>> Hi Daniel and Sean,
>>>
>>> Thanks for the comments!
>>>
>>> On Tue, Oct 28, 2014 at 1:28 AM, Sean Paul <seanpaul@chromium.org> wrote:
>>>> On Mon, Oct 27, 2014 at 3:01 PM, Daniel Vetter <daniel@ffwll.ch> wrote:
>>>>> So don't ask why but I accidentally ended up in a branch looking at this
>>>>> patch and didn't like it. So very quick&grumpy review.
>>>>>
>>>>> First, please make the patch subject more descriptive: I'd expect a helper
>>>>> function scaffolding like the various crtc/probe/dp ... helpers we already
>>>>> have. You instead add code to untangle the probe ordering. Please say so.
>>> Sure. I will reword it properly.
>>>
>>>>> More comments below.
>>>>>
>>>>> On Wed, Aug 27, 2014 at 07:59:37PM +0530, Ajay Kumar wrote:
>>>>>> A set of helper functions are defined in this patch to make
>>>>>> bridge driver probe independent of the drm flow.
>>>>>>
>>>>>> The bridge devices register themselves on a lookup table
>>>>>> when they get probed by calling "drm_bridge_add".
>>>>>>
>>>>>> The parent encoder driver waits till the bridge is available
>>>>>> in the lookup table(by calling "of_drm_find_bridge") and then
>>>>>> continues with its initialization.
>>>>>>
>>>>>> The encoder driver should also call "drm_bridge_attach" to pass
>>>>>> on the drm_device, encoder pointers to the bridge object.
>>>>>>
>>>>>> drm_bridge_attach inturn calls drm_bridge_init to register itself
>>>>>> with the drm core. Later, it calls "bridge->funcs->attach" so that
>>>>>> bridge can continue with other initializations.
>>>>>>
>>>>>> Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
>>>>>
>>>>> [snip]
>>>>>
>>>>>> @@ -660,8 +662,11 @@ struct drm_bridge_funcs {
>>>>>>   * @driver_private: pointer to the bridge driver's internal context
>>>>>>   */
>>>>>>  struct drm_bridge {
>>>>>> -     struct drm_device *dev;
>>>>>> +     struct device *dev;
>>>>>
>>>>> Please don't rename the ->dev pointer into drm. Because _all_ the other
>>>>> drm structures still call it ->dev. Also, can't we use struct device_node
>>>>> here like we do in the of helpers Russell added? See 7e435aad38083
>>>>>
>>>>
>>>> I think this is modeled after the naming in drm_panel,
>>> Right, The entire rework is based on how drm_panel framework is structured.
>>>
>>>> FWIW. However,
>>>> seems reasonable to keep the device_node instead.
>>> Yes, its visible that just device_node would be sufficient.
>>> This will save us from renaming drm_device as well.
>>>
>>>>>> +     struct drm_device *drm;
>>>>>> +     struct drm_encoder *encoder;
>>>>>
>>>>> This breaks bridge->bridge chaining (if we ever get there). It seems
>>>>> pretty much unused anyway except for an EBUSY check. Can't you use
>>>>> bridge->dev for that?
>>>>>
>>>>
>>>> Yeah, I'd prefer to pass drm_device directly into drm_bridge_attach
>>>> and leave it up to the caller to establish the proper chain.
>>> Ok. I will use drm_device pointer directly instead of passing encoder pointer.
>>
>> Hm, if you do this can you pls also update drm_panel accordingly? It
>> shouldn't be a lot of fuzz and would make things around drm+dt more
>> consistent.
> Are you talking about using struct device_node instead of struct device?
> I guess you have misplaced the comment under the wrong section!

Yeah, that should have been one up ;-)

>>>>>>       struct list_head head;
>>>>>> +     struct list_head list;
>>>>>
>>>>> These lists need better names. I know that the "head" is really awful,
>>>>> especially since it's actually not the head of the list but just an
>>>>> element.
>>>>
>>>> I think we can just rip bridge_list out of mode_config if we're going
>>>> to keep track of bridges elsewhere. So we can nuke "head" and keep
>>>> "list". This also means that bridge->destroy() goes away, but that's
>>>> probably Ok if everything converts to the standalone driver model
>>>> where we have driver->remove()
>>>>
>>>> Sean
>>> Great! Thierry actually mentioned about this once, and we have the
>>> confirmation now.
>>>
>>>>>>
>>>>>>       struct drm_mode_object base;
>>>>>
>>>>>
>>>>> Aside: I've noticed all this trying to update the kerneldoc for struct
>>>>> drm_bridge, which just showed that this patch makes inconsistent changes.
>>>>> Trying to write kerneldoc is a really great way to come up with better
>>>>> interfaces imo.
>>>>>
>>>>> Cheers, Daniel
>>> I din't get this actually. You want me to create Doc../drm_bridge.txt
>>> or something similar?
>>
>> If you want to document drm_bridge then I recomment to sprinkle proper
>> kerneldoc over drm_bridge.c and pull it all into the drm DocBook
>> template. That way all the drm documentation is in one place. I've
>> done that for drm_crtc.h in an unrelated patch series (but based upon
>> a branch with your patch here included) and there's struct drm_bridge*
>> in there. Hence why I've noticed.
> Can you send a link for that?
> And, is there any problem if the doc comes later?

Since quite a while we've asked for the kerneldoc polish as part of
each drm core patch series. It's just that drm_bridge/panel kinda have
flown under the radar of the people usually asking for docs ;-)
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2014-10-28 14:19 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 14:29 [PATCH V7 00/12] drm/exynos: few patches to enhance bridge chip support Ajay Kumar
2014-08-27 14:29 ` [PATCH V7 01/12] drm/bridge: ptn3460: Few trivial cleanups Ajay Kumar
2014-08-27 14:29 ` [PATCH V7 02/12] drm/bridge: do not pass drm_bridge_funcs to drm_bridge_init Ajay Kumar
2014-10-27 19:50   ` Sean Paul
2014-08-27 14:29 ` [PATCH V7 03/12] drm/bridge: Add helper functions for drm_bridge Ajay Kumar
2014-10-27 19:01   ` Daniel Vetter
2014-10-27 19:58     ` Sean Paul
2014-10-27 22:20       ` Daniel Vetter
2014-10-27 22:26         ` Daniel Vetter
2014-10-27 23:57           ` Russell King - ARM Linux
2014-11-04  9:22             ` Philipp Zabel
2014-10-28 14:35           ` Thierry Reding
2014-10-29  7:43             ` Daniel Vetter
2014-10-29  8:38               ` Thierry Reding
2014-10-29  8:57                 ` Daniel Vetter
2014-10-29  9:14                   ` Thierry Reding
2014-10-30 10:01                     ` Andrzej Hajda
2014-10-30 10:09                       ` Russell King - ARM Linux
2014-10-31 15:54                         ` Daniel Vetter
2014-10-31 15:51                     ` Daniel Vetter
2014-11-03  8:01                       ` Thierry Reding
2014-11-03  8:26                         ` Ajay kumar
2014-10-28 14:29         ` Thierry Reding
2014-10-29  7:51           ` Daniel Vetter
2014-10-29  9:16             ` Thierry Reding
2014-10-31 15:59               ` Daniel Vetter
2014-11-03  8:06                 ` Thierry Reding
2014-11-03  8:11                   ` Daniel Vetter
2014-10-28  9:21       ` Ajay kumar
2014-10-28 10:01         ` Daniel Vetter
2014-10-28 12:28           ` Ajay kumar
2014-10-28 14:19             ` Daniel Vetter [this message]
2014-10-28 14:28               ` Sean Paul
2014-10-28 14:41               ` Thierry Reding
2014-10-28 14:46                 ` Ajay kumar
2014-10-28 15:05                   ` Thierry Reding
2014-10-29  7:58                     ` Daniel Vetter
2014-10-29  9:09                       ` Andrzej Hajda
2014-10-31 16:03                         ` Daniel Vetter
2014-10-27 20:11   ` Sean Paul
2014-10-28  9:22     ` Ajay kumar
2014-10-28  9:26     ` Ajay kumar
2014-08-27 14:29 ` [PATCH V7 04/12] drm/bridge: ptn3460: Convert to i2c driver model Ajay Kumar
2014-08-27 14:29 ` [PATCH V7 05/12] drm/exynos: dp: support drm_bridge Ajay Kumar
2014-08-27 14:29 ` [PATCH V7 06/12] drm/bridge: ptn3460: support drm_panel Ajay Kumar
2014-08-27 14:29 ` [PATCH V7 07/12] drm/bridge: ptn3460: probe connector at the end of bridge attach Ajay Kumar
2014-08-27 14:29 ` [PATCH V7 08/12] drm/bridge: ptn3460: use gpiod interface Ajay Kumar
2014-08-27 14:29 ` [PATCH V7 12/12] drm/bridge: Add i2c based driver for ps8622/ps8625 bridge Ajay Kumar
2014-09-10 13:18 ` [PATCH V7 00/12] drm/exynos: few patches to enhance bridge chip support Ajay kumar
2014-09-16 12:44 ` Javier Martinez Canillas
2014-09-16 20:11   ` Laurent Pinchart
2014-09-17  9:32   ` Ajay kumar
2014-09-20 11:27     ` Ajay kumar
2014-09-22 10:18     ` Thierry Reding

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='CAKMK7uFX7rENLBmwE58rtCBXZ_pSF_uS5Poiuks7xfi+r=e9gw@mail.gmail.com' \
    --to=daniel@ffwll.ch \
    --cc=ajaykumar.rs@samsung.com \
    --cc=ajaynumb@gmail.com \
    --cc=bhushan.r@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jg1.han@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=prashanth.g@samsung.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.