From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Andrey Smirnov <andrew.smirnov@gmail.com>,
<dri-devel@lists.freedesktop.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Cory Tusar <cory.tusar@zii.aero>, Chris Healy <cphealy@gmail.com>,
Lucas Stach <l.stach@pengutronix.de>,
<linux-kernel@vger.kernel.org>, Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [PATCH v3 2/2] drm/bridge: tc358767: Expose test mode functionality via debugfs
Date: Mon, 9 Dec 2019 11:38:39 +0200 [thread overview]
Message-ID: <45afdff8-4f91-f5be-a299-d0c7fed71ea7@ti.com> (raw)
In-Reply-To: <20191209050857.31624-3-andrew.smirnov@gmail.com>
(Cc'ing Daniel for the last paragraph)
On 09/12/2019 07:08, Andrey Smirnov wrote:
> Presently, the driver code artificially limits test pattern mode to a
> single pattern with fixed color selection. It being a kernel module
> parameter makes switching "test pattern" <-> "proper output" modes
> on-the-fly clunky and outright impossible if the driver is built into
> the kernel.
That's not correct, /sys/module/tc358767/parameters/test is there even if the driver is built-in.
I think the bigger problems are that there's just one value, even if there are multiple devices, and
that with kernel parameter the driver can't act on it dynamically (afaik).
> To improve the situation a bit, convert current test pattern code to
> use debugfs instead by exposing "TestCtl" register. This way old
> "tc_test_pattern=1" functionality can be emulated via:
>
> echo -n 0x78146302 > tstctl
>
> and switch back to regular mode can be done with:
>
> echo -n 0x78146300 > tstctl
In the comment in the code you have 0 as return-to-regular-mode.
With my setup, enabling test mode seems to work, but when I return to regular mode, the first echo
results in black display, but echoing 0 a second time will restore the display.
Hmm, actually, just echoing 0 to tstctl multiple times, it makes the screen go black and then
restores it with every other echo.
> + debugfs = debugfs_create_dir(dev_name(dev), NULL);
> + if (!IS_ERR(debugfs)) {
> + debugfs_create_file_unsafe("tstctl", 0200, debugfs, tc,
> + &tc_tstctl_fops);
> + devm_add_action_or_reset(dev, tc_remove_debugfs, debugfs);
> + }
> +
For me this creates debugfs/3-000f/tstctl. I don't think that's a clear or usable path, and could
even cause a name conflict in the worst case.
Not sure what's a good solution here, but only two semi-good ones come to mind: have it in sysfs
under the device's dir, or debugfs/dri/something. The latter probably needs some thought and common
agreement on how to handle bridge and panel debugfs files. But that would be a good thing to have,
as I'm sure there are other similar cases (at least I have a few).
Tomi
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
next prev parent reply other threads:[~2019-12-09 9:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-09 5:08 [PATCH v3 0/2] tc358767 test mode Andrey Smirnov
2019-12-09 5:08 ` [PATCH v3 1/2] drm/bridge: tc358767: Introduce __tc_bridge_enable/disable() Andrey Smirnov
2019-12-09 5:08 ` [PATCH v3 2/2] drm/bridge: tc358767: Expose test mode functionality via debugfs Andrey Smirnov
2019-12-09 9:38 ` Tomi Valkeinen [this message]
2019-12-09 14:38 ` Andrey Smirnov
2019-12-09 15:05 ` Tomi Valkeinen
2019-12-09 15:24 ` Andrey Smirnov
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=45afdff8-4f91-f5be-a299-d0c7fed71ea7@ti.com \
--to=tomi.valkeinen@ti.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=a.hajda@samsung.com \
--cc=andrew.smirnov@gmail.com \
--cc=cory.tusar@zii.aero \
--cc=cphealy@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=l.stach@pengutronix.de \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®