<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Oct 22, 2013 at 9:15 PM, Inki Dae <span dir="ltr"><<a href="mailto:inki.dae@samsung.com" target="_blank">inki.dae@samsung.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">2013/10/23 Stéphane Marchesin <<a href="mailto:stephane.marchesin@gmail.com">stephane.marchesin@gmail.com</a>>:<br>


><br>
><br>
><br>
> On Tue, Oct 22, 2013 at 8:38 PM, Inki Dae <<a href="mailto:inki.dae@samsung.com">inki.dae@samsung.com</a>> wrote:<br>
>><br>
>> 2013/10/23 Stéphane Marchesin <<a href="mailto:stephane.marchesin@gmail.com">stephane.marchesin@gmail.com</a>>:<br>
>> ><br>
>> ><br>
>> ><br>
>> > On Tue, Oct 22, 2013 at 7:28 PM, Inki Dae <<a href="mailto:inki.dae@samsung.com">inki.dae@samsung.com</a>> wrote:<br>
>> >><br>
>> >> 2013/10/22 Sean Paul <<a href="mailto:seanpaul@chromium.org">seanpaul@chromium.org</a>>:<br>
>> >> > On Tue, Oct 22, 2013 at 1:30 AM, Inki Dae <<a href="mailto:inki.dae@samsung.com">inki.dae@samsung.com</a>><br>
>> >> > wrote:<br>
>> >> >><br>
>> >> >><br>
>> >> >>> -----Original Message-----<br>
>> >> >>> From: Sean Paul [mailto:<a href="mailto:seanpaul@chromium.org">seanpaul@chromium.org</a>]<br>
>> >> >>> Sent: Tuesday, October 22, 2013 6:18 AM<br>
>> >> >>> To: Inki Dae<br>
>> >> >>> Cc: dri-devel; Dave Airlie; Tomasz Figa; Stéphane Marchesin<br>
>> >> >>> Subject: Re: [PATCH v2 12/26] drm/exynos: Split<br>
>> >> >>> manager/display/subdrv<br>
>> >> >>><br>
>> >> >>> On Mon, Oct 21, 2013 at 10:46 AM, Sean Paul <<a href="mailto:seanpaul@chromium.org">seanpaul@chromium.org</a>><br>
>> >> >>> wrote:<br>
>> >> >>> > On Thu, Oct 17, 2013 at 10:31 PM, Inki Dae <<a href="mailto:inki.dae@samsung.com">inki.dae@samsung.com</a>><br>
>> >> >>> > wrote:<br>
>> >> >>> >><br>
>> >> >>> >><br>
>> >> >>> >>> -----Original Message-----<br>
>> >> >>> >>> From: Sean Paul [mailto:<a href="mailto:seanpaul@chromium.org">seanpaul@chromium.org</a>]<br>
>> >> >>> >>> Sent: Thursday, October 17, 2013 11:37 PM<br>
>> >> >>> >>> To: Inki Dae<br>
>> >> >>> >>> Cc: dri-devel; Dave Airlie; Tomasz Figa; Stéphane Marchesin<br>
>> >> >>> >>> Subject: Re: [PATCH v2 12/26] drm/exynos: Split<br>
>> >> >>> >>> manager/display/subdrv<br>
>> >> >>> >>><br>
>> >> >>> >>> On Thu, Oct 17, 2013 at 4:21 AM, Inki Dae<br>
>> >> >>> >>> <<a href="mailto:inki.dae@samsung.com">inki.dae@samsung.com</a>><br>
>> >> >> wrote:<br>
>> >> >>> >>> ><br>
>> >> >>> >>> ><br>
>> >> >>> >>> >> -----Original Message-----<br>
>> >> >>> >>> >> From: Sean Paul [mailto:<a href="mailto:seanpaul@chromium.org">seanpaul@chromium.org</a>]<br>
>> >> >>> >>> >> Sent: Thursday, October 17, 2013 4:27 AM<br>
>> >> >>> >>> >> To: <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a>; <a href="mailto:inki.dae@samsung.com">inki.dae@samsung.com</a><br>
>> >> >>> >>> >> Cc: <a href="mailto:airlied@linux.ie">airlied@linux.ie</a>; <a href="mailto:tomasz.figa@gmail.com">tomasz.figa@gmail.com</a>;<br>
>> >> >>> >>> >> <a href="mailto:marcheu@chromium.org">marcheu@chromium.org</a>;<br>
>> >> >>> Sean<br>
>> >> >>> >>> >> Paul<br>
>> >> >>> >>> >> Subject: [PATCH v2 12/26] drm/exynos: Split<br>
>> >> >>> >>> >> manager/display/subdrv<br>
>> >> >>> >>> >><br>
>> >> >>> >>> >> This patch splits display and manager from subdrv. The<br>
>> >> >>> >>> >> result<br>
>> >> >>> >>> >> is<br>
>> >> >>> that<br>
>> >> >>> >>> >> crtc functions can directly call into manager callbacks and<br>
>> >> >>> >>> >> encoder<br>
>> >> >>> >>> >> functions can directly call into display callbacks. This<br>
>> >> >>> >>> >> will<br>
>> >> >>> >>> >> allow<br>
>> >> >>> >>> >> us to remove the exynos_drm_hdmi shim and support mixer/hdmi<br>
>> >> >>> >>> >> &<br>
>> >> >>> fimd/dp<br>
>> >> >>> >>> >> with common code.<br>
>> >> >>> >>> >><br>
>> >> >>> >>> >> Signed-off-by: Sean Paul <<a href="mailto:seanpaul@chromium.org">seanpaul@chromium.org</a>><br>
>> >> >>> >>> >> ---<br>
>> >> >>> >>> >><br>
>> >> >>> >>> >> Changes in v2:<br>
>> >> >>> >>> >>       - Pass display into display_ops instead of context<br>
>> >> >>> >>> ><br>
>> >> >>> >>> > Sorry but it seems like more reasonable to pass device object<br>
>> >> >>> >>> > into<br>
>> >> >>> >>> > display_ops and manager_ops.<br>
>> >> >>> >>> ><br>
>> >> >>> >>><br>
>> >> >>> >>><br>
>> >> >>> >>> So you've changed your mind from when you said the following?<br>
>> >> >>> >>><br>
>> >> >>> >>> >>> manager->ops->xxx(manager, ...);<br>
>> >> >>> >>> >>> display->ops->xxx(display, ...);<br>
>> >> >>> >>> >>><br>
>> >> >>> >>> >>> Agree.<br>
>> >> >>> >>><br>
>> >> >>> >><br>
>> >> >>> >><br>
>> >> >>> >> True. Before that, My comment was to pass device object into<br>
>> >> >>> display_ops and<br>
>> >> >>> >> manager_ops, and then you said the good solution is to pass<br>
>> >> >>> >> manager<br>
>> >> >>> >> and<br>
>> >> >>> >> display to each driver. At that time, I thought no matter how<br>
>> >> >>> >> the<br>
>> >> >>> callback<br>
>> >> >>> >> is called if the framework doesn't call callbacks of each driver<br>
>> >> >>> >> with<br>
>> >> >>> ctx.<br>
>> >> >>> >> So I agreed.<br>
>> >> >>> >><br>
>> >> >>> >><br>
>> >> >>> >>> It would have been nice if you had changed your mind *before* I<br>
>> >> >>> >>> reworked everything. At any rate, I think it's still the right<br>
>> >> >>> >>> thing<br>
>> >> >>> >>> to do.<br>
>> >> >>> >><br>
>> >> >>> >> Really sorry about that. And I will add new patch for it so you<br>
>> >> >>> >> don't<br>
>> >> >>> need<br>
>> >> >>> >> to concern about that.<br>
>> >> >>> >><br>
>> >> >>> >>><br>
>> >> >>> >>><br>
>> >> >>> >>> > I'm not sure but display_ops could be implemented in other<br>
>> >> >>> >>> > framework<br>
>> >> >>> >>> based<br>
>> >> >>> >>> > driver such as CDF based lcd panel driver. So if you pass<br>
>> >> >>> >>> > display -<br>
>> >> >>> it's<br>
>> >> >>> >>> > specific to exynos drm framework - into display_ops, the<br>
>> >> >>> >>> > other<br>
>> >> >>> framework<br>
>> >> >>> >>> > based driver should include specific exynos drm header.<br>
>> >> >>> >>> ><br>
>> >> >>> >>><br>
>> >> >>> >>> AFAIK, CDF will not land in its current separate-from-drm form,<br>
>> >> >>> >>> we<br>
>> >> >>> >>> don't need to worry about this. Furthermore, these ops should<br>
>> >> >>> >>> just<br>
>> >> >>> >>> go<br>
>> >> >>> >>> away and become drm_crtc/drm_encoder/drm_connector funcs<br>
>> >> >>> >>> anyways.<br>
>> >> >>> >>><br>
>> >> >>> >><br>
>> >> >>> >> Can you assure the display_ops never implemented in other<br>
>> >> >>> >> framework<br>
>> >> >>> based<br>
>> >> >>> >> driver, not CDF? At any rate, I think all possibilities should<br>
>> >> >>> >> be<br>
>> >> >>> opened.<br>
>> >> >>> >><br>
>> >> >>> ><br>
>> >> >>> > I don't think we should let an RFC framework make the code more<br>
>> >> >>> > complicated for unclear benefit. By removing manager/display<br>
>> >> >>> > entirely,<br>
>> >> >>> > we can get rid of a *lot* of other code that is basically just<br>
>> >> >>> > plumbing drm hooks (exynos_drm_connector is a good example).<br>
>> >> >>> ><br>
>> >> >>><br>
>> >> >>> I hacked this up today to prove it out. Check out the top 5 commits<br>
>> >> >>> in<br>
>> >> >>><br>
>> >> >>><br>
>> >> >>> <a href="https://github.com/crseanpaul/exynos-drm-next/commits/linux-next-exynos-" target="_blank">https://github.com/crseanpaul/exynos-drm-next/commits/linux-next-exynos-</a><br>
>> >> >>> staging.<br>
>> >> >>> It removes exynos_drm_connector in favor of just implementing<br>
>> >> >>> drm_connector directly. This same treatment should be done for<br>
>> >> >>> exynos_drm_encoder and exynos_drm_crtc, but I didn't get around to<br>
>> >> >>> doing this.<br>
>> >> >>><br>
>> >> >>> As you can see, it cuts out a lot of code and removes an entire<br>
>> >> >>> abstraction layer. Much nicer :)<br>
>> >> >>><br>
>> >> >><br>
>> >> >> It seems that you implements connector in each device driver. Can't<br>
>> >> >> they be<br>
>> >> >> combined as common spot, exynos_connector, again to avoid codes from<br>
>> >> >> duplicated? :)<br>
>> >> ><br>
>> >> > There's nothing of substance being duplicated.<br>
>> >><br>
>> >> Not true. xxx_create_connector is duplicated.<br>
>> >><br>
>> >> > In fact, by getting rid<br>
>> >> > of the exynos_drm_connector layer, we deleted 150 lines. If you<br>
>> >> > really<br>
>> >> > take a look at exynos_drm_connector, it's not doing anything useful.<br>
>> >><br>
>> >> No, That is for each driver has no any dependency of drm framework.<br>
>> >><br>
>> >> > All it does is translate the drm callbacks into display callbacks, so<br>
>> >> > I think it's much better to just implement the drm callbacks<br>
>> >> > directly.<br>
>> >> ><br>
>> >><br>
>> >> No, It has strongly dependency of drm framework. Assume that we<br>
>> >> implemented the drm callbacks directly, and then some features are<br>
>> >> added to drm framework, drm_connector side. At this time, we will have<br>
>> >> to take care of each device driver according to the change. That is<br>
>> >> really not good. Why device drivers should have dependency of drm<br>
>> >> framework? Just to reduce line counts?<br>
>> ><br>
>> ><br>
>> ><br>
>> > You seem to miss the point here and elsewhere in the discussion.<br>
>> > drm/exynos is a drm driver, and as such it should use the drm<br>
>> > framework,<br>
>><br>
>> Hm.. you seem to miss something. Exynos drm based drivers are based on<br>
>> exynos drm framework, not drm framework directly. So I mean that<br>
>> Exynos drm framework based drivers should include only Exynos drm<br>
>> headers, _not drm header_ directly.<br>
><br>
><br>
> Well, I think everyone sees that exynos is different. But my point still<br>
> remains: why is the exynos driver in drm/ if it wants to use a different<br>
> framework? Right now it is blocking work on a proper drm driver...<br>
><br>
<br>
</div></div>Noooooo. It's not to use a different framework. It's to use a wrapper instead.<br></blockquote><div><br></div><div>Ok, if you want to call it a wrapper, then what is the point of doing this wrapping given that it prevents a proper drm-style implementation?</div>

<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
><br>
>><br>
>><br>
>> > especially if this reduces the line count and the code<br>
>> > complexity (as is the case for this patch series). If you don't want<br>
>> > to maintain a drm driver, it simply should be moved away from drm/,<br>
>> > and it should be replaced by a real drm driver in my opinion.<br>
>><br>
>> So those drivers should be in drm/exynos. Isn't that you really mean<br>
>> those drivers should be driver/gpu/drm?<br>
><br>
><br>
> I don't understand this sentence, sorry.<br>
<br>
</div>Sorry, again, you mean Exynos drm based drivers should be in<br>
drivers/gpu/drm, not drivers/gpu/drm/exynos?<br>
<br></blockquote><div>Is the exynos drm useful in its current shape at all? My recommendation would be to fork off a real drm driver in gpu/drm/exynos with the current code as a base.</div><div><br></div><div>Stéphane</div>

<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks,<br>
Inki Dae<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Stéphane<br>
><br>
><br>
>><br>
>> If so, That would really be<br>
>> horrible. :(<br>
>><br>
><br>
><br>
>><br>
>> Please, know that only Exynos drm framework, _not device drivers_, has<br>
>> all dependencies of drm framework, and also I know that other ARM<br>
>> based drm drivers are using same way.<br>
>><br>
>> Thanks,<br>
>> Inki Dae<br>
>><br>
>> ><br>
>> > Stéphane<br>
>> ><br>
>> >><br>
>> >><br>
>> >> > There are a bunch of real bugs that we've found as a result of having<br>
>> >> > these abstraction layers. Take, for example, dpms. Before this<br>
>> >> > patchset, dpms for fimd was being tracked separately in fimd driver,<br>
>> >> > exynos_drm_encoder, exynos_drm_crtc, and exynos_drm_connector.<br>
>> >> > Furthermore, during suspend, only fimd driver's dpms state was<br>
>> >> > updated, so the others were incorrect. There was also this weird<br>
>> >> > gymnastics that had to happen when dpms was changed in the encoder<br>
>> >> > since it had to walk up to the connector level to change its dpms<br>
>> >> > state. If fimd just directly implemented<br>
>> >> > drm_crtc/drm_encoder/drm_connector (before dp was moved in), this<br>
>> >> > problem wouldn't exist. The same goes for HDMI/mixer.<br>
>> >> ><br>
>> >><br>
>> >> That is a issue we should take care of by using the independent layer.<br>
>> >> Then, aren't you take care of that well with the re-factoring patch<br>
>> >> set? :)  It seems that you are outside real point.<br>
>> >><br>
>> >> > Take a look at exynos_drm_encoder.c  in my tree<br>
>> >> ><br>
>> >> ><br>
>> >> > (<a href="https://github.com/crseanpaul/exynos-drm-next/blob/linux-next-exynos-staging/drivers/gpu/drm/exynos/exynos_drm_encoder.c" target="_blank">https://github.com/crseanpaul/exynos-drm-next/blob/linux-next-exynos-staging/drivers/gpu/drm/exynos/exynos_drm_encoder.c</a>),<br>


>> >> > what does it do that's useful to abstract? All that it does is just<br>
>> >> > call display ops, it's completely useless. The same is true for<br>
>> >> > exynos_drm_connector, it's just dead weight. There is some useful<br>
>> >> > stuff in exynos_drm_crtc for page flipping, that would be better<br>
>> >> > served as a helper library, though.<br>
>> >> ><br>
>> >> >> The abstraction layer you mentioned also means a common spot.<br>
>> >> >> Another one, you patch also makes each sub driver have strongly<br>
>> >> >> dependency<br>
>> >> >> of drm framework. So how we can support existing backlight and lcd<br>
>> >> >> class<br>
>> >> >> based lcd panel drivers if the connector is implemented in each<br>
>> >> >> device<br>
>> >> >> driver later?  the drm header files should be included in<br>
>> >> >> drivers/video/backlight/xxx_lcd.c?<br>
>> >> >><br>
>> >> ><br>
>> >> > drm_bridge or drm_panel seem like good candidates for this.<br>
>> >> ><br>
>> >><br>
>> >> Yes, exynos_drm_display could be replaced with drm_panel later if the<br>
>> >> drm_panel can be merged to mainline.<br>
>> >><br>
>> >> ><br>
>> >> >> And, I will introduce a new framework to support existing lcd panel<br>
>> >> >> drivers<br>
>> >> >> and display bus drivers soon; as of now for Exynos drm, and the<br>
>> >> >> framework is<br>
>> >> >> being tested internally. With this framework, encoder and connector<br>
>> >> >> will be<br>
>> >> >> created when lcd panel or display bus driver such as eDP is probed:<br>
>> >> >> it<br>
>> >> >> doesn’t really need to create encoder and connector in advance if<br>
>> >> >> lcd<br>
>> >> >> panel<br>
>> >> >> or display bus driver isn't probed yet. Regardless of crtc, and<br>
>> >> >> encoder<br>
>> >> >> and<br>
>> >> >> connector creation order, when last one is created, crtc and<br>
>> >> >> connector<br>
>> >> >> will<br>
>> >> >> be connected each other. And exynos_drm_display could be implemented<br>
>> >> >> in<br>
>> >> >> other frameworks if we have common structure for display device<br>
>> >> >> driver.<br>
>> >> >> And<br>
>> >> >> also the framework will support lvds driver according to Linux<br>
>> >> >> device<br>
>> >> >> driver<br>
>> >> >> model.<br>
>> >> >><br>
>> >> ><br>
>> >> > I don't really follow what you're trying to do here, but I think we<br>
>> >> > should be moving in the direction of fewer abstractions in the exynos<br>
>> >> > driver, not more :)<br>
>> >> ><br>
>> >><br>
>> >> Not abstraction layer, just a bridge for connecting crtc and its<br>
>> >> corresponding encoder/connector, and lvds regardless of creation<br>
>> >> order, and for connecting drm connector and other framework based<br>
>> >> display ops such as drm_panel later.<br>
>> >><br>
>> >> > Sean<br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> >> Thanks,<br>
>> >> >> Inki Dae<br>
>> >> >><br>
>> >> >>> Sean<br>
>> >> >>><br>
>> >> >>> >>><br>
>> >> >>> >>> > And another one, the patch 6 passes manager object to<br>
>> >> >>> >>> > manager_ops,<br>
>> >> >>> and<br>
>> >> >>> >>> for<br>
>> >> >>> >>> > this, you made the manager object to be set to driver data;<br>
>> >> >>> >>> > platform_set_drvdata(pdev, &manager). That isn't reasonable.<br>
>> >> >>> Generally,<br>
>> >> >>> >>> > driver_data would point to device driver's context object.<br>
>> >> >>> >>> ><br>
>> >> >>> >>><br>
>> >> >>> >>> I'm not sure why this isn't reasonable, but it's a moot point.<br>
>> >> >>> >>> The<br>
>> >> >>> >>> driver data is only used up until we get rid of the pm ops, it<br>
>> >> >>> >>> needn't<br>
>> >> >>> >>> be set at all once things go through dpms.<br>
>> >> >>> >>><br>
>> >> >>> >><br>
>> >> >>> >> Generally, device drivers can call its own internal functions,<br>
>> >> >>> >> and<br>
>> >> >>> >> they<br>
>> >> >>> will<br>
>> >> >>> >> call that functions with ctx. However, if you set manager to<br>
>> >> >>> driver_data<br>
>> >> >>> >> then that functions should be called with manager object and<br>
>> >> >>> >> also<br>
>> >> >>> internally<br>
>> >> >>> >> that functions should get ctx from the manager object. What is<br>
>> >> >>> >> the<br>
>> >> >>> purpose<br>
>> >> >>> >> of manager? Do you think it's reasonable?<br>
>> >> >>> >><br>
>> >> >>> ><br>
>> >> >>> > So, to avoid setting the manager as the drvdata, we could<br>
>> >> >>> > implement<br>
>> >> >>> > something like fimd_dpms_ctx(ctx, mode) that takes ctx and the<br>
>> >> >>> > manager<br>
>> >> >>> > callback calls it fimd_dpms(mgr, mode) { ctx = mgr->ctx;<br>
>> >> >>> > fimd_dpms_ctx(ctx, mode); }. Alternatively, you can save a<br>
>> >> >>> > pointer<br>
>> >> >>> > to<br>
>> >> >>> > mgr in ctx, but that creates a circular link between the two.<br>
>> >> >>> > IMO,<br>
>> >> >>> > both of those solutions suck :)<br>
>> >> >>> ><br>
>> >> >>> > I'd much rather just set drvdata to the manager and call the hook<br>
>> >> >>> > directly. Like I said earlier, this is just a temporary step<br>
>> >> >>> > since<br>
>> >> >>> > we<br>
>> >> >>> > remove these pm ops later in the patch series.<br>
>> >> >>> ><br>
>> >> >>> > Sean<br>
>> >> >>> ><br>
>> >> >>> ><br>
>> >> >>> >> Anyway, I'd like to say really sorry about inconvenient again.<br>
>> >> >>> >> So I<br>
>> >> >>> will fix<br>
>> >> >>> >> it.<br>
>> >> >>> >><br>
>> >> >>> >> Thanks,<br>
>> >> >>> >> Inki Dae<br>
>> >> >>> >><br>
>> >> >>> >>> Sean<br>
>> >> >>> >>><br>
>> >> >>> >>><br>
>> >> >>> >>> > Thanks,<br>
>> >> >>> >>> > Inki Dae<br>
>> >> >>> >>> ><br>
>> >> >>> >><br>
>> >> >><br>
>> >> > _______________________________________________<br>
>> >> > dri-devel mailing list<br>
>> >> > <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
>> >> > <a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
>> >> _______________________________________________<br>
>> >> dri-devel mailing list<br>
>> >> <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
>> >> <a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
>> ><br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > dri-devel mailing list<br>
>> > <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
>> > <a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
>> ><br>
><br>
><br>
><br>
> _______________________________________________<br>
> dri-devel mailing list<br>
> <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
><br>
</div></div></blockquote></div><br></div></div>