public inbox for dri-devel@lists.freedesktop.org
 help / color / mirror / Atom feed
From: abhinavk@codeaurora.org
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: jeykumar@quicinc.com, linux-arm-msm@vger.kernel.org,
	dri-devel@lists.freedesktop.org, hoegsberg@google.com,
	freedreno@lists.freedesktop.org, chandanu@codeaurora.org
Subject: Re: [Freedreno] [DPU PATCH v2 2/2] drm/panel: add backlight control support for truly panel
Date: Tue, 17 Apr 2018 11:21:27 -0700	[thread overview]
Message-ID: <e220ca93282a7d942d4144ac2313efc0@codeaurora.org> (raw)
In-Reply-To: <20180417061356.GG10725@tuxbook-pro>

Hi Bjorn

Thanks for the comments.

Reply inline.

On 2018-04-16 23:13, Bjorn Andersson wrote:
> On Mon 16 Apr 15:45 PDT 2018, abhinavk@codeaurora.org wrote:
> 
>> Hi Bjorn
>> 
>> Thanks for the review.
>> 
>> Reply inline.
>> 
>> On 2018-04-16 09:41, Bjorn Andersson wrote:
>> > On Sat 14 Apr 00:25 PDT 2018, Abhinav Kumar wrote:
>> >
>> > > Register truly panel as a backlight led device and
>> > > provide methods to control its backlight operation.
>> > >
>> > > Changes in v2:
>> > > - Removed redundant NULL checks
>> > > - Arranged headers alphabetically
>> > > - Formatting fixes
>> >
>> > The change log goes below the "---" line.
>> >
>> [Abhinav] As sean mentioned, its quite common to list it to view it in 
>> the
>> log.
>> This practice has been followed by quite a few in DRM
>> Another reference here https://patchwork.freedesktop.org/patch/211361/
>> 
> 
> If that's the practice in DRM land, then that's what you should do.
> 
>> > >
>> > > Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
>> > > ---
>> > [..]
>> > > +static int truly_backlight_setup(struct truly_wqxga *ctx)
>> > > +{
>> > > +	struct backlight_properties props;
>> > > +	char bl_node_name[BL_NODE_NAME_SIZE];
>> > > +
>> > > +	if (!ctx->backlight) {
>> > > +		memset(&props, 0, sizeof(props));
>> > > +		props.type = BACKLIGHT_RAW;
>> > > +		props.power = FB_BLANK_UNBLANK;
>> > > +		props.max_brightness = 4096;
>> > > +
>> > > +		snprintf(bl_node_name, BL_NODE_NAME_SIZE, "panel%u-backlight",
>> > > +				 PRIM_DISPLAY_NODE);
>> > > +
>> > > +		ctx->backlight =  backlight_device_register(bl_node_name,
>> > > +				ctx->dev, ctx,
>> > > +				&truly_backlight_device_ops, &props);
>> > > +
>> > > +		if (IS_ERR_OR_NULL(ctx->backlight)) {
>> > > +			pr_err("Failed to register backlight\n");
>> > > +			ctx->backlight = NULL;
>> > > +			return -ENODEV;
>> > > +		}
>> > > +
>> > > +		/* Register with the LED driver interface */
>> > > +		led_trigger_register_simple("bkl-trigger", &ctx->wled);
>> > > +
>> > > +		if (!ctx->wled) {
>> > > +			pr_err("backlight led registration failed\n");
>> > > +			return -ENODEV;
>> > > +		}
>> >
>> > It seems like you're registering a backlight driver for the sake of
>> > invoking the LED backlight trigger to control the WLED.
>> >
>> > The WLED is a backlight driver, so all you should have to do is add the
>> > following line to your probe:
>> >
>> > 	ctx->backlight = devm_of_find_backlight(dev);
>> >
>> > and then add "backlight = <&wled>" to your dt node.
>> >
>> > Regards,
>> > Bjorn
>> [Abhinav] Thats not the only purpose of backlight_device_register().
>> We want to hook up our panel with the parent backlight driver in
>> drivers/video/backlight/backlight.c and also route all the
>> update_backlight_status()
>> calls through the sysfs of the newly registered node.
>> 
>> The of_find_backlight() method doesnt seem to allow us to register our 
>> own
>> sysfs method.
>> 
> 
> Are you saying that you want to be able to create an alias for the wled
> entry already in /sys/class/backlight named panel0-backlight?
> 
>> BTW, this isnt something which we are doing uniquely.
>> There are other panels which seem to be doing this :
>> 
>> drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
>> 
> 
> What seems to be going on in the s6e3ha2 driver is that the hardware 
> has
> some sort of builtin backlight control, so the driver is creating a
> backlight driver for the purpose of exposing those controls.
> 
>> Can you please comment on whether we can have our own sysfs without
>> the device_register()?
>> 
> 
> If the panel isn't actually a piece of backlight hardware then it 
> should
> not register a backlight device. Why do you need your own sysfs?
> 
> Regards,
> Bjorn
[Abhinav] This particular panel isnt a piece of backlight hardware.
But, we want to have our own sysfs to give flexibility to our userspace
to write and read stuff for its proprietary uses.
Thats how our downstream has been working so far and hence to maintain
the compatibility would like to have it.
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-04-17 18:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-14  7:25 [DPU PATCH v2 1/2] drm/panel: Add Truly NT35597 panel Abhinav Kumar
     [not found] ` <1523690713-22543-1-git-send-email-abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-04-14  7:25   ` [DPU PATCH v2 2/2] drm/panel: add backlight control support for truly panel Abhinav Kumar
     [not found]     ` <1523690713-22543-2-git-send-email-abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-04-16 16:41       ` Bjorn Andersson
2018-04-16 16:51         ` Sean Paul
2018-04-16 22:45         ` abhinavk-sgV2jX0FEOL9JmXXK+q4OQ
     [not found]           ` <d50c2a2dac7d6541d78eee60c2ff4739-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-04-17  6:13             ` Bjorn Andersson
2018-04-17 18:21               ` abhinavk [this message]
     [not found]                 ` <e220ca93282a7d942d4144ac2313efc0-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-04-17 18:57                   ` Sujeev Dias
2018-04-17 21:29                   ` Bjorn Andersson
2018-04-18  0:04                     ` abhinavk-sgV2jX0FEOL9JmXXK+q4OQ
2018-04-18  0:42                       ` [Freedreno] " abhinavk
2018-04-18 10:52                         ` Daniel Thompson
     [not found]                           ` <20180418105218.oja4gogmcx32ym5a-SoAo7ar8mTX/PtFMR13I2A@public.gmane.org>
2018-04-18 13:42                             ` Sean Paul
2018-04-18 22:08                               ` abhinavk-sgV2jX0FEOL9JmXXK+q4OQ
     [not found]                         ` <be0fa84101458da4cd6d77b963189baf-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-04-19  4:24                           ` Bjorn Andersson
2018-04-18 13:32                       ` [Freedreno] " Sean Paul
     [not found]                       ` <7cb250765fbf7b633fd54e4338cc433d-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-04-19  4:00                         ` Bjorn Andersson
2018-04-19  4:23                           ` abhinavk-sgV2jX0FEOL9JmXXK+q4OQ
     [not found]                             ` <b2e4e39d6911d4ab89fa753d194392b6-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-04-19  4:42                               ` Bjorn Andersson
2018-05-24  1:37                                 ` abhinavk-sgV2jX0FEOL9JmXXK+q4OQ
2018-04-19 17:44   ` [DPU PATCH v2 1/2] drm/panel: Add Truly NT35597 panel Archit Taneja
2018-05-24  1:28     ` abhinavk

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=e220ca93282a7d942d4144ac2313efc0@codeaurora.org \
    --to=abhinavk@codeaurora.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=chandanu@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=hoegsberg@google.com \
    --cc=jeykumar@quicinc.com \
    --cc=linux-arm-msm@vger.kernel.org \
    /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