[Bug 208913] amdgpu: RIP: 0010:amdgpu_dm_atomic_commit_tail+0x1cce/0x1de0

2020-08-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=208913

Alexander Tsoy (alexan...@tsoy.me) changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |MOVED

--- Comment #2 from Alexander Tsoy (alexan...@tsoy.me) ---
Migrated to gitlab:
https://gitlab.freedesktop.org/drm/amd/-/issues/1263

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 208913] amdgpu: RIP: 0010:amdgpu_dm_atomic_commit_tail+0x1cce/0x1de0

2020-08-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=208913

--- Comment #1 from Alexander Tsoy (alexan...@tsoy.me) ---
Created attachment 290915
  --> https://bugzilla.kernel.org/attachment.cgi?id=290915=edit
Xorg.1.log

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 208913] New: amdgpu: RIP: 0010:amdgpu_dm_atomic_commit_tail+0x1cce/0x1de0

2020-08-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=208913

Bug ID: 208913
   Summary: amdgpu: RIP:
0010:amdgpu_dm_atomic_commit_tail+0x1cce/0x1de0
   Product: Drivers
   Version: 2.5
Kernel Version: 5.4.58
  Hardware: All
OS: Linux
  Tree: Mainline
Status: NEW
  Severity: normal
  Priority: P1
 Component: Video(DRI - non Intel)
  Assignee: drivers_video-...@kernel-bugs.osdl.org
  Reporter: alexan...@tsoy.me
Regression: No

Created attachment 290913
  --> https://bugzilla.kernel.org/attachment.cgi?id=290913=edit
dmesg

I'm using 5.4.x kernels for quite some time. And recently X server started to
hang sometimes after switching users. It starts using 100% CPU and killing it
with sigkill is the only thing I can do. I'm using GNOME, so each user has its
own X server.

I believe this is caused by the following patch that was included in 5.4.56:

"drm/amd/display: Clear dm_state for fast updates"

But since the issue is not 100% reproducible, I need some time to confirm it.


>From dmesg:

[99448.103350] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR*
[CRTC:47:crtc-0] flip_done timed out
[99458.343984] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR*
[PLANE:45:plane-5] flip_done timed out
[99458.353716] [ cut here ]
[99458.358491] WARNING: CPU: 1 PID: 2240 at
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5883
amdgpu_dm_atomic_commit_tail+0x1cce/0x1de0 [amdgpu]
[99458.372659] Modules linked in: ebtable_filter ebtables netconsole bridge stp
llc wireguard curve25519_x86_64 libchacha20poly1305 ip6_udp_tunnel udp_tunnel
libblake2s blake2s_x86_64 libcurve25519_generic libblake2s_generic xt_limit
xt_comment xt_recent xt_MASQUERADE xt_multiport iptable_nat nf_nat
nf_conntrack_netbios_ns nf_conntrack_broadcast xt_CT iptable_raw ip6table_raw
snd_seq_midi snd_seq_midi_event uvcvideo videobuf2_vmalloc videobuf2_memops
videobuf2_v4l2 videodev amd64_edac_mod snd_usb_audio kvm_amd videobuf2_common
kvm snd_usbmidi_lib snd_rawmidi joydev snd_hda_codec_hdmi irqbypass pcspkr
snd_hda_intel snd_intel_nhlt snd_hda_codec snd_hwdep sp5100_tco e1000e
snd_hda_core snd_pcm tcp_yeah tcp_vegas sch_fq_codel nfsd amdgpu crc32c_intel
mgag200 drm_vram_helper gpu_sched ttm vhost_scsi target_core_mod configfs
vhost_net tun tap vhost vhba(O) jc42 ipmi_si ipmi_devintf ipmi_msghandler fuse
eeprom
[99458.452852] CPU: 1 PID: 2240 Comm: X Tainted: G   OT
5.4.58-gentoo #1
[99458.460345] Hardware name: Supermicro H8SCM/H8SCM, BIOS 3.5b  
03/18/2016
[99458.467620] RIP: 0010:amdgpu_dm_atomic_commit_tail+0x1cce/0x1de0 [amdgpu]
[99458.474412] Code: 70 fb ff ff 41 8b 4c 24 60 48 c7 c2 c0 92 59 c0 bf 02 00
00 00 48 c7 c6 28 69 5f c0 e8 0b a0 32 ca 49 8b 57 08 e9 09 e5 ff ff <0f> 0b e9
c3 f0 ff ff 0f 0b 0f 0b e9 d9 f0 ff ff 48 8b 85 38 fd ff
[99458.493248] RSP: 0018:9b20c277b840 EFLAGS: 00010002
[99458.498473] RAX: 0002 RBX: 04d6 RCX:

[99458.505634] RDX: 0001 RSI: 0206 RDI:

[99458.512792] RBP: 9b20c277bb70 R08: 9b20c277b7a4 R09:

[99458.519941] R10: 0001 R11:  R12:
0286
[99458.527100] R13: 8f41ba0b8c00 R14: 8f4585fc R15:
8f4588b57000
[99458.534254] FS:  7fc7988b2dc0() GS:8f4696a4()
knlGS:
[99458.542364] CS:  0010 DS:  ES:  CR0: 80050033
[99458.548129] CR2: 7f8a3e4eb950 CR3: 000811b4c000 CR4:
000406e0
[99458.555287] Call Trace:
[99458.557750]  ? __switch_to_asm+0x40/0x70
[99458.561689]  ? commit_tail+0x8f/0x110
[99458.565402]  commit_tail+0x8f/0x110
[99458.568899]  drm_atomic_helper_commit+0xb9/0x130
[99458.573519]  drm_atomic_helper_set_config+0x75/0x90
[99458.578407]  drm_mode_setcrtc+0x1f5/0x730
[99458.582433]  ? drm_mode_getcrtc+0x180/0x180
[99458.586621]  drm_ioctl_kernel+0xb0/0x100
[99458.590551]  drm_ioctl+0x20d/0x370
[99458.593963]  ? drm_mode_getcrtc+0x180/0x180
[99458.598225]  amdgpu_drm_ioctl+0x44/0x80 [amdgpu]
[99458.602849]  do_vfs_ioctl+0x46c/0x710
[99458.606522]  ? __fget+0x6c/0xa0
[99458.609667]  ksys_ioctl+0x5b/0x90
[99458.612986]  __x64_sys_ioctl+0x15/0x20
[99458.616741]  do_syscall_64+0x46/0xf0
[99458.620323]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[99458.625433] RIP: 0033:0x7fc798138d87
[99458.629013] Code: 00 00 90 48 8b 05 f9 40 0c 00 64 c7 00 26 00 00 00 48 c7
c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01
f0 ff ff 73 01 c3 48 8b 0d c9 40 0c 00 f7 d8 64 89 01 48
[99458.647862] RSP: 002b:7fff6e3bf348 EFLAGS: 0246 ORIG_RAX:
0010
[99458.655447] RAX: ffda RBX: 7fff6e3bf380 RCX:
7fc798138d87
[99458.662606] RDX: 7fff6e3bf380 RSI: c06864a2 RDI:
000c
[99458.669764] RBP: c06864a2 R08:  

Re: [Freedreno] [PATCH v10 3/5] drm/msm/dp: add support for DP PLL driver

2020-08-15 Thread Rob Clark
On Sat, Aug 15, 2020 at 2:21 PM Jonathan Marek  wrote:
>
> On 8/15/20 4:20 PM, Rob Clark wrote:
> > On Fri, Aug 14, 2020 at 10:05 AM Dmitry Baryshkov
> >  wrote:
> >>
> >>
> >> On 12/08/2020 07:42, Tanmay Shah wrote:
> >>   > From: Chandan Uddaraju 
> >>   >
> >>   > Add the needed DP PLL specific files to support
> >>   > display port interface on msm targets.
> >>
> >> [skipped]
> >>
> >>   > diff --git a/drivers/gpu/drm/msm/dp/dp_pll_private.h
> >> b/drivers/gpu/drm/msm/dp/dp_pll_private.h
> >>   > new file mode 100644
> >>   > index ..475ba6ed59ab
> >>   > --- /dev/null
> >>   > +++ b/drivers/gpu/drm/msm/dp/dp_pll_private.h
> >>   > @@ -0,0 +1,98 @@
> >>   > +/* SPDX-License-Identifier: GPL-2.0-only */
> >>   > +/*
> >>   > + * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
> >>   > + */
> >>   > +
> >>   > +#ifndef __DP_PLL_10NM_H
> >>   > +#define __DP_PLL_10NM_H
> >>   > +
> >>   > +#include "dp_pll.h"
> >>   > +#include "dp_reg.h"
> >>   > +
> >>   > +#define DP_VCO_HSCLK_RATE_1620MHZDIV1000162UL
> >>   > +#define DP_VCO_HSCLK_RATE_2700MHZDIV1000270UL
> >>   > +#define DP_VCO_HSCLK_RATE_5400MHZDIV1000540UL
> >>   > +#define DP_VCO_HSCLK_RATE_8100MHZDIV1000810UL
> >>   > +
> >>   > +#define NUM_DP_CLOCKS_MAX6
> >>   > +
> >>   > +#define DP_PHY_PLL_POLL_SLEEP_US500
> >>   > +#define DP_PHY_PLL_POLL_TIMEOUT_US1
> >>   > +
> >>   > +#define DP_VCO_RATE_8100MHZDIV1000810UL
> >>   > +#define DP_VCO_RATE_9720MHZDIV1000972UL
> >>   > +#define DP_VCO_RATE_10800MHZDIV10001080UL
> >>   > +
> >>   > +struct dp_pll_vco_clk {
> >>   > +struct clk_hw hw;
> >>   > +unsigned longrate;/* current vco rate */
> >>   > +u64min_rate;/* min vco rate */
> >>   > +u64max_rate;/* max vco rate */
> >>   > +void*priv;
> >>   > +};
> >>   > +
> >>   > +struct dp_pll_db {
> >>
> >> This struct should probably go into dp_pll_10nm.c. dp_pll_7nm.c, for
> >> example, will use slightly different structure.
> >
> > Note that sboyd has a WIP series to move all of the pll code out to a
> > phy driver.  If there is work already happening on 7nm support, it
> > might be better to go with the separate phy driver approach?  I'm
> > still a bit undecided about whether to land the dp code initially with
> > the pll stuff in drm, and then continue refactoring to move to
> > separate phy driver upstream, or to strip out the pll code from the
> > beginning.  If you/someone is working on 7nm support, then feedback
> > about which approach is easier is welcome.
> >
> > https://lore.kernel.org/dri-devel/20200611091919.108018-1-swb...@chromium.org/
> >
>
> I have a sm8150/sm8250 (7nm) upstream kernel stack with DP enabled, and
> I have done something similar, with the PLL driver in the QMP phy,
> although not based on sboyd's series (along with some typec changes to
> negotiate the DP alt mode and get HPD events, etc.). I don't think
> having PLL in drm/msm makes sense, the drm/msm DP driver shouldn't need
> to be aware of the DP PLL/PHY driver, it only needs to set the
> link/pixel clock rates which are in dispcc (and those then have the PLL
> clocks as a parent).

yeah, in the dp case, having phy split out makes a ton of sense.. it
would maybe be a nice cleanup in other cases (dsi, hdmi) but the
combination of usb+dp makes burying this in drm not so great..

It would be good if you could work w/ sboyd on this.. based on what
I've seen on previous gens, it is probably a different phy driver for
7nm vs 10nm, but I think where we want to end up upstream is with phy
split out of drm.

> FYI, since it sounds you are considering landing this: it is completely
> broken, for example:
> - ioremap()'s to #define'd addresses in the PLL driver
> - main DP driver reading/writing to registers in the PHY region, but
> getting the base address from devicetree was removed since earlier
> revisions, so it just fails completely. Look at usb3_dp_com (for
> example), which in dp_catalog_ctrl_usb_reset() would be used to
> overwrite registers already being driven by the qmp phy driver - but now
> the usb3_dp_com.base is never initialized.

Yeah, the idea to land dp isn't that it is perfect (or even not
broken), so much as having something upstream gives a common base for
others to work against.. maybe we should make the dp parts 'depends on
STAGING'?

I could keep a separate msm-next-dp branch that I rebase, to give a
common point for folks working dp support for various different gens
to coordinate work on.. that kinda sounds like a bunch of extra work
for me, so might as well land what we have somehow and work together
from there ;-)

But it does sound like you are making the case for including the patch
to drop the pll stuff and use phy framework as part of what initially
goes upstream.

BR,
-R

>
> -Jonathan
>
> > BR,
> > -R
> > 

Re: [PATCH 3/3] drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel

2020-08-15 Thread Guido Günther
Hi Sam,
On Sat, Aug 15, 2020 at 11:32:26AM +0200, Sam Ravnborg wrote:
> Hi Guido.
> 
> On Fri, Aug 14, 2020 at 03:36:23PM +0200, Guido Günther wrote:
> > The panel uses a Focaltech FT8006p, the touch part is handled by the
> > already existing edt-ft5x06.
> > 
> > Signed-off-by: Guido Günther 
> 
> Looks good.
> A few notes in the following, nothing major.

Thanks. I've added your suggestions to v2.
 -- Guido
> 
>   Sam
> 
> > ---
> >  MAINTAINERS   |   7 +
> >  drivers/gpu/drm/panel/Kconfig |  11 +
> >  drivers/gpu/drm/panel/Makefile|   1 +
> >  .../gpu/drm/panel/panel-mantix-mlaf057we51.c  | 362 ++
> >  4 files changed, 381 insertions(+)
> >  create mode 100644 drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
> > 
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 83ba7b62651f7..7dfe4cc3d4ec8 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -5474,6 +5474,13 @@ S:   Maintained
> >  F: drivers/gpu/drm/panel/panel-lvds.c
> >  F: Documentation/devicetree/bindings/display/panel/lvds.yaml
> >  
> > +DRM DRIVER FOR MANTIX MLAF057WE51 PANELS
> > +M: Guido Günther 
> > +R: Purism Kernel Team 
> > +S: Maintained
> > +F: 
> > Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> > +F: drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
> > +
> >  DRM DRIVER FOR MATROX G200/G400 GRAPHICS CARDS
> >  S: Orphan / Obsolete
> >  F: drivers/gpu/drm/mga/
> > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> > index de2f2a452be55..8d97d07c58713 100644
> > --- a/drivers/gpu/drm/panel/Kconfig
> > +++ b/drivers/gpu/drm/panel/Kconfig
> > @@ -217,6 +217,17 @@ config DRM_PANEL_NOVATEK_NT39016
> >   Say Y here if you want to enable support for the panels built
> >   around the Novatek NT39016 display controller.
> >  
> > +config DRM_PANEL_MANTIX_MLAF057WE51
> > +   tristate "Mantix MLAF057WE51-X MIPI-DSI LCD panel"
> > +   depends on OF
> > +   depends on DRM_MIPI_DSI
> > +   depends on BACKLIGHT_CLASS_DEVICE
> > +   help
> > + Say Y here if you want to enable support for the Mantix
> > + MLAF057WE51-X MIPI DSI panel as e.g. used in the Librem 5. It
> > + has a resolution of 720x1440 pixels, a built in backlight and touch
> > + controller.
> > +
> >  config DRM_PANEL_OLIMEX_LCD_OLINUXINO
> > tristate "Olimex LCD-OLinuXino panel"
> > depends on OF
> > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> > index e45ceac6286fd..15a4e77529514 100644
> > --- a/drivers/gpu/drm/panel/Makefile
> > +++ b/drivers/gpu/drm/panel/Makefile
> > @@ -20,6 +20,7 @@ obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
> >  obj-$(CONFIG_DRM_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o
> >  obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35510) += panel-novatek-nt35510.o
> >  obj-$(CONFIG_DRM_PANEL_NOVATEK_NT39016) += panel-novatek-nt39016.o
> > +obj-$(CONFIG_DRM_PANEL_MANTIX_MLAF057WE51) += panel-mantix-mlaf057we51.o
> >  obj-$(CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO) += 
> > panel-olimex-lcd-olinuxino.o
> >  obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) += panel-orisetech-otm8009a.o
> >  obj-$(CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS) += 
> > panel-osd-osd101t2587-53ts.o
> > diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c 
> > b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
> > new file mode 100644
> > index 0..6c07bcdb75937
> > --- /dev/null
> > +++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
> > @@ -0,0 +1,362 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Mantix MLAF057WE51 5.7" MIPI-DSI panel driver
> > + *
> > + * Copyright (C) Purism SPC 2020
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> Include not needed.
> 
> > +#include 
> > +#include 
> > +
> > +#include 
> I do not think this include is needed
> 
> > +#include 
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#define DRV_NAME "panel-mantix-mlaf057we51"
> > +
> > +/* Manufacturer specific Commands send via DSI */
> > +#define MANTIX_CMD_OTP_STOP_RELOAD_MIPI 0x41
> > +#define MANTIX_CMD_INT_CANCEL   0x4C
> > +
> > +struct mantix {
> > +   struct device *dev;
> > +   struct drm_panel panel;
> > +   struct gpio_desc *reset_gpio;
> > +
> > +   struct regulator *avdd;
> > +   struct regulator *avee;
> > +   struct regulator *vddi;
> > +};
> > +
> > +static inline struct mantix *panel_to_mantix(struct drm_panel *panel)
> > +{
> > +   return container_of(panel, struct mantix, panel);
> > +}
> > +
> > +#define dsi_generic_write_seq(dsi, seq...) do {
> > \
> > +   static const u8 d[] = { seq };  \
> > +   int ret;\
> > +   ret = mipi_dsi_generic_write(dsi, d, ARRAY_SIZE(d));\
> > +   if (ret < 0)\
> > +   return 

Re: [PATCH v2 1/3] dt-bindings: vendor-prefixes: Add mantix vendor prefix

2020-08-15 Thread Sam Ravnborg
On Sat, Aug 15, 2020 at 11:16:20PM +0200, Guido Günther wrote:
> Add prefix for Mantix Display Technology Co.,Ltd.
> 
> Signed-off-by: Guido Günther 
Acked-by: Sam Ravnborg 
> ---
>  Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml 
> b/Documentation/devicetree/bindings/vendor-prefixes.yaml
> index 2baee2c817c1a..59d4c8b068c4d 100644
> --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
> +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
> @@ -611,6 +611,8 @@ patternProperties:
>  description: Linux Automation GmbH
>"^macnica,.*":
>  description: Macnica Americas
> +  "^mantix,.*":
> +description: Mantix Display Technology Co.,Ltd.
>"^mapleboard,.*":
>  description: Mapleboard.org
>"^marvell,.*":
> -- 
> 2.26.2
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 2/3] dt-bindings: Add Mantix MLAF057WE51-X panel bindings

2020-08-15 Thread Sam Ravnborg
On Sat, Aug 15, 2020 at 11:16:21PM +0200, Guido Günther wrote:
> The panel uses a Focaltech FT8006p, the touch part is handled by the
> already existing edt-ft5x06.
> 
> Signed-off-by: Guido Günther 
Reviewed-by: Sam Ravnborg 

I assume you will apply yourself, otherwise I will do so when we have
seen a backmerge.

Sam

> ---
>  .../display/panel/mantix,mlaf057we51-x.yaml   | 70 +++
>  1 file changed, 70 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> 
> diff --git 
> a/Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml 
> b/Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> new file mode 100644
> index 0..937323cc9aaac
> --- /dev/null
> +++ 
> b/Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> @@ -0,0 +1,70 @@
> +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/panel/mantix,mlaf057we51-x.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Mantix MLAF057WE51-X 5.7" 720x1440 TFT LCD panel
> +
> +maintainers:
> +  - Guido Günther 
> +
> +description:
> +  Mantix MLAF057WE51 X is a 720x1440 TFT LCD panel connected using
> +  a MIPI-DSI video interface.
> +
> +allOf:
> +  - $ref: panel-common.yaml#
> +
> +properties:
> +  compatible:
> +enum:
> +  - mantix,mlaf057we51-x
> +
> +  port: true
> +  reg:
> +maxItems: 1
> +description: DSI virtual channel
> +
> +  avdd-supply:
> +description: Positive analog power supply
> +
> +  avee-supply:
> +description: Negative analog power supply
> +
> +  vddi-supply:
> +description: 1.8V I/O voltage supply
> +
> +  reset-gpios: true
> +
> +  backlight: true
> +
> +required:
> +  - compatible
> +  - reg
> +  - avdd-supply
> +  - avee-supply
> +  - vddi-supply
> +  - reset-gpios
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +#include 
> +
> +dsi {
> +#address-cells = <1>;
> +#size-cells = <0>;
> +panel@0 {
> +compatible = "mantix,mlaf057we51-x";
> +reg = <0>;
> +avdd-supply = <_avdd>;
> +avee-supply = <_avee>;
> +vddi-supply = <_1v8_p>;
> +reset-gpios = < 29 GPIO_ACTIVE_LOW>;
> +backlight = <>;
> +};
> +};
> +
> +...
> -- 
> 2.26.2
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 3/8] dt-bindings: display: mxsfb: Add a bus-width endpoint property

2020-08-15 Thread Guido Günther
Hi Laurent,
On Thu, Aug 13, 2020 at 04:29:05AM +0300, Laurent Pinchart wrote:
> When the PCB routes the display data signals in an unconventional way,
> the output bus width may differ from the bus width of the connected
> panel or encoder. For instance, when a 18-bit RGB panel has its R[5:0],
> G[5:0] and B[5:0] signals connected to LCD_DATA[7:2], LCD_DATA[15:10]
> and LCD_DATA[23:18], the output bus width is 24 instead of 18 when the
> signals are routed to LCD_DATA[5:0], LCD_DATA[11:6] and LCD_DATA[17:12].
> 
> Add a bus-width property to describe this data routing.
> 
> Signed-off-by: Laurent Pinchart 
> ---
>  Documentation/devicetree/bindings/display/mxsfb.yaml | 12 
>  1 file changed, 12 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/display/mxsfb.yaml 
> b/Documentation/devicetree/bindings/display/mxsfb.yaml
> index ec6533b1d4a3..d15bb8edc29f 100644
> --- a/Documentation/devicetree/bindings/display/mxsfb.yaml
> +++ b/Documentation/devicetree/bindings/display/mxsfb.yaml
> @@ -58,6 +58,18 @@ properties:
>  type: object
>  
>  properties:
> +  data-shift:
Shouldn't that be bus-width ?
 -- Guido

> +enum: [16, 18, 24]
> +description: |
> +  The output bus width. This value overrides the configuration
> +  derived from the connected device (encoder or panel). It should
> +  only be specified when PCB routing of the data signals require 
> a
> +  different bus width on the LCDIF and the connected device. For
> +  instance, when a 18-bit RGB panel has its R[5:0], G[5:0] and
> +  B[5:0] signals connected to LCD_DATA[7:2], LCD_DATA[15:10] and
> +  LCD_DATA[23:18] instead of LCD_DATA[5:0], LCD_DATA[11:6] and
> +  LCD_DATA[17:12], bus-width should be set to 24.
> +
>remote-endpoint:
>  $ref: /schemas/types.yaml#/definitions/phandle
>  
> -- 
> Regards,
> 
> Laurent Pinchart
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 3/3] drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel

2020-08-15 Thread Sam Ravnborg
Hi Guido.

On Sat, Aug 15, 2020 at 11:16:22PM +0200, Guido Günther wrote:
> The panel uses a Focaltech FT8006p, the touch part is handled by the
> already existing edt-ft5x06.
> 
> Signed-off-by: Guido Günther 

Two small nits - otherwise looks good.
Reviewed-by: Sam Ravnborg 

I can fix while applying or you can send a new revision,
but I cannot apply until drm-misc-next have seen a backmerge
due to dev_err_probe() usage.

Did you have commit rights yet?
If yes, then please apply yourself.

Sam

> ---
>  MAINTAINERS   |   7 +
>  drivers/gpu/drm/panel/Kconfig |  11 +
>  drivers/gpu/drm/panel/Makefile|   1 +
>  .../gpu/drm/panel/panel-mantix-mlaf057we51.c  | 328 ++
>  4 files changed, 347 insertions(+)
>  create mode 100644 drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 83ba7b62651f7..7dfe4cc3d4ec8 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -5474,6 +5474,13 @@ S: Maintained
>  F:   drivers/gpu/drm/panel/panel-lvds.c
>  F:   Documentation/devicetree/bindings/display/panel/lvds.yaml
>  
> +DRM DRIVER FOR MANTIX MLAF057WE51 PANELS
> +M:   Guido Günther 
> +R:   Purism Kernel Team 
> +S:   Maintained
> +F:   
> Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> +F:   drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
> +
>  DRM DRIVER FOR MATROX G200/G400 GRAPHICS CARDS
>  S:   Orphan / Obsolete
>  F:   drivers/gpu/drm/mga/
> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> index de2f2a452be55..8d97d07c58713 100644
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -217,6 +217,17 @@ config DRM_PANEL_NOVATEK_NT39016
> Say Y here if you want to enable support for the panels built
> around the Novatek NT39016 display controller.
>  
> +config DRM_PANEL_MANTIX_MLAF057WE51
> + tristate "Mantix MLAF057WE51-X MIPI-DSI LCD panel"
> + depends on OF
> + depends on DRM_MIPI_DSI
> + depends on BACKLIGHT_CLASS_DEVICE
> + help
> +   Say Y here if you want to enable support for the Mantix
> +   MLAF057WE51-X MIPI DSI panel as e.g. used in the Librem 5. It
> +   has a resolution of 720x1440 pixels, a built in backlight and touch
> +   controller.
> +
>  config DRM_PANEL_OLIMEX_LCD_OLINUXINO
>   tristate "Olimex LCD-OLinuXino panel"
>   depends on OF
> diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> index e45ceac6286fd..15a4e77529514 100644
> --- a/drivers/gpu/drm/panel/Makefile
> +++ b/drivers/gpu/drm/panel/Makefile
> @@ -20,6 +20,7 @@ obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
>  obj-$(CONFIG_DRM_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o
>  obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35510) += panel-novatek-nt35510.o
>  obj-$(CONFIG_DRM_PANEL_NOVATEK_NT39016) += panel-novatek-nt39016.o
> +obj-$(CONFIG_DRM_PANEL_MANTIX_MLAF057WE51) += panel-mantix-mlaf057we51.o
>  obj-$(CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO) += panel-olimex-lcd-olinuxino.o
>  obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) += panel-orisetech-otm8009a.o
>  obj-$(CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS) += panel-osd-osd101t2587-53ts.o
> diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c 
> b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
> new file mode 100644
> index 0..cd5424d5bdb63
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
> @@ -0,0 +1,328 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Mantix MLAF057WE51 5.7" MIPI-DSI panel driver
> + *
> + * Copyright (C) Purism SPC 2020
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
drm_print.h is no longer used - drop.

> +
> +#define DRV_NAME "panel-mantix-mlaf057we51"
> +
> +/* Manufacturer specific Commands send via DSI */
> +#define MANTIX_CMD_OTP_STOP_RELOAD_MIPI 0x41
> +#define MANTIX_CMD_INT_CANCEL   0x4C
> +
> +struct mantix {
> + struct device *dev;
> + struct drm_panel panel;
> + struct gpio_desc *reset_gpio;
> +
> + struct regulator *avdd;
> + struct regulator *avee;
> + struct regulator *vddi;
> +};
> +
> +static inline struct mantix *panel_to_mantix(struct drm_panel *panel)
> +{
> + return container_of(panel, struct mantix, panel);
> +}
> +
> +#define dsi_generic_write_seq(dsi, seq...) do {  
> \
> + static const u8 d[] = { seq };  \
> + int ret;\
> + ret = mipi_dsi_generic_write(dsi, d, ARRAY_SIZE(d));\
> + if (ret < 0)\
> + return ret; \
> + } while (0)
> +
> +static int mantix_init_sequence(struct mantix *ctx)
> +{
> + struct 

Re: [PATCH v1 0/5] drm/panel: Use dev_ based logging

2020-08-15 Thread Guido Günther
Hi,
On Sat, Aug 15, 2020 at 02:54:01PM +0200, Sam Ravnborg wrote:
> The drm/panel drivers uses a mixture of DRM_ and dev_ based logging.
> With this patchset all panel drivers are migrated to use dev_ based
> logging as the DRM_ based logging did not add any extra info.
> 
> Drop the now unused include of drm_print.h.
> 
> With this change new panel drivers will be requires to change to dev_
> based logging - so some of the in-flight panel drivers will need trivial
> updates before they are accepted.
> 
> Patch divided in smaller bites to ease review. There is no dependencies
> between the patches.
> 
> Copied a few people that may have input to the move away from DRM_ based
> logging (Daniel (presumeably on vacation), Jani).

Looks good to me and after applying to next-20200824 i couldn't spot any
DRM_ style logging leftovers:

Reviewed-by: Guido Günther 

Cheers,
 -- Guido

> 
>   Sam
> 
> Sam Ravnborg (5):
>   drm/panel: samsung: Use dev_ based logging
>   drm/panel: leadtek: Use dev_ based logging
>   drm/panel: raydium: Use dev_ based logging
>   drm/panel: sitronix: Use dev_ based logging
>   drm/panel: Use dev_ based logging
> 
>  drivers/gpu/drm/panel/panel-boe-himax8279d.c   | 44 
>  drivers/gpu/drm/panel/panel-elida-kd35t133.c   | 51 +-
>  drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c  | 19 +++--
>  .../gpu/drm/panel/panel-feiyang-fy07024di26a30d.c  | 21 +++---
>  drivers/gpu/drm/panel/panel-ilitek-ili9322.c   |  3 +-
>  drivers/gpu/drm/panel/panel-innolux-p079zca.c  | 31 +++--
>  drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c | 33 -
>  drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 58 ++--
>  drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c | 49 +
>  drivers/gpu/drm/panel/panel-novatek-nt35510.c  | 40 ---
>  drivers/gpu/drm/panel/panel-orisetech-otm8009a.c   | 13 ++--
>  drivers/gpu/drm/panel/panel-raydium-rm67191.c  | 33 -
>  drivers/gpu/drm/panel/panel-raydium-rm68200.c  | 18 +++--
>  drivers/gpu/drm/panel/panel-ronbo-rb070d30.c   | 16 ++---
>  drivers/gpu/drm/panel/panel-samsung-ld9040.c   |  3 +-
>  drivers/gpu/drm/panel/panel-samsung-s6d16d0.c  | 23 +++---
>  drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c  |  3 +-
>  drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c   |  3 +-
>  drivers/gpu/drm/panel/panel-samsung-s6e63m0.c  | 22 +++---
>  drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c  |  3 +-
>  drivers/gpu/drm/panel/panel-sitronix-st7701.c  | 10 ++-
>  drivers/gpu/drm/panel/panel-sitronix-st7703.c  | 61 ++--
>  drivers/gpu/drm/panel/panel-sony-acx424akp.c   | 81 
> --
>  drivers/gpu/drm/panel/panel-tpo-tpg110.c   | 38 +-
>  drivers/gpu/drm/panel/panel-truly-nt35597.c| 63 ++---
>  drivers/gpu/drm/panel/panel-visionox-rm69299.c | 41 ---
>  drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c   | 51 +-
>  27 files changed, 308 insertions(+), 523 deletions(-)
> 
> 
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 2/3] dt-bindings: Add Mantix MLAF057WE51-X panel bindings

2020-08-15 Thread Guido Günther
The panel uses a Focaltech FT8006p, the touch part is handled by the
already existing edt-ft5x06.

Signed-off-by: Guido Günther 
---
 .../display/panel/mantix,mlaf057we51-x.yaml   | 70 +++
 1 file changed, 70 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml

diff --git 
a/Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml 
b/Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
new file mode 100644
index 0..937323cc9aaac
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
@@ -0,0 +1,70 @@
+# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/mantix,mlaf057we51-x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mantix MLAF057WE51-X 5.7" 720x1440 TFT LCD panel
+
+maintainers:
+  - Guido Günther 
+
+description:
+  Mantix MLAF057WE51 X is a 720x1440 TFT LCD panel connected using
+  a MIPI-DSI video interface.
+
+allOf:
+  - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+enum:
+  - mantix,mlaf057we51-x
+
+  port: true
+  reg:
+maxItems: 1
+description: DSI virtual channel
+
+  avdd-supply:
+description: Positive analog power supply
+
+  avee-supply:
+description: Negative analog power supply
+
+  vddi-supply:
+description: 1.8V I/O voltage supply
+
+  reset-gpios: true
+
+  backlight: true
+
+required:
+  - compatible
+  - reg
+  - avdd-supply
+  - avee-supply
+  - vddi-supply
+  - reset-gpios
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+
+dsi {
+#address-cells = <1>;
+#size-cells = <0>;
+panel@0 {
+compatible = "mantix,mlaf057we51-x";
+reg = <0>;
+avdd-supply = <_avdd>;
+avee-supply = <_avee>;
+vddi-supply = <_1v8_p>;
+reset-gpios = < 29 GPIO_ACTIVE_LOW>;
+backlight = <>;
+};
+};
+
+...
-- 
2.26.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 1/3] dt-bindings: vendor-prefixes: Add mantix vendor prefix

2020-08-15 Thread Guido Günther
Add prefix for Mantix Display Technology Co.,Ltd.

Signed-off-by: Guido Günther 
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml 
b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 2baee2c817c1a..59d4c8b068c4d 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -611,6 +611,8 @@ patternProperties:
 description: Linux Automation GmbH
   "^macnica,.*":
 description: Macnica Americas
+  "^mantix,.*":
+description: Mantix Display Technology Co.,Ltd.
   "^mapleboard,.*":
 description: Mapleboard.org
   "^marvell,.*":
-- 
2.26.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 0/3] drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel

2020-08-15 Thread Guido Günther

The panel uses a Focaltech FT8006p, the touch part is handled by the already
existing edt-ft5x06. It can be found in e.g. the Librem 5.

Changes from v1:
- Due to review comments by Sam Ravnborg, thanks!
  https://lore.kernel.org/dri-devel/20200815083917.ga993...@ravnborg.org/
  - Don't preserve newlines with '|' in description
  - Use reset-gpios and backlight from panel-common.yaml
  - Reindent example
  https://lore.kernel.org/dri-devel/20200815093226.gb993...@ravnborg.org/
  - Drop unused includes
  - Use dev_* instead of DRM_* for printing
  - Turn off regulators in reverse order from enable
  - Silence errors in mantix_{shutdown,remove}
  - Drop duplicate mipi_dsi_dcs_enter_sleep_mode()
  https://lore.kernel.org/dri-devel/20200815100230.ga1002...@ravnborg.org/
  - Use dev_err_probe()
- Add delays when turning off panel as suggested by the data sheet

This series is against next-20200814.

Guido Günther (3):
  dt-bindings: vendor-prefixes: Add mantix vendor prefix
  dt-bindings: Add Mantix MLAF057WE51-X panel bindings
  drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel

 .../display/panel/mantix,mlaf057we51-x.yaml   |  70 
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 MAINTAINERS   |   7 +
 drivers/gpu/drm/panel/Kconfig |  11 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-mantix-mlaf057we51.c  | 328 ++
 6 files changed, 419 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
 create mode 100644 drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c

-- 
2.26.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 3/3] drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel

2020-08-15 Thread Guido Günther
The panel uses a Focaltech FT8006p, the touch part is handled by the
already existing edt-ft5x06.

Signed-off-by: Guido Günther 
---
 MAINTAINERS   |   7 +
 drivers/gpu/drm/panel/Kconfig |  11 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-mantix-mlaf057we51.c  | 328 ++
 4 files changed, 347 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 83ba7b62651f7..7dfe4cc3d4ec8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5474,6 +5474,13 @@ S:   Maintained
 F: drivers/gpu/drm/panel/panel-lvds.c
 F: Documentation/devicetree/bindings/display/panel/lvds.yaml
 
+DRM DRIVER FOR MANTIX MLAF057WE51 PANELS
+M: Guido Günther 
+R: Purism Kernel Team 
+S: Maintained
+F: 
Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
+F: drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
+
 DRM DRIVER FOR MATROX G200/G400 GRAPHICS CARDS
 S: Orphan / Obsolete
 F: drivers/gpu/drm/mga/
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index de2f2a452be55..8d97d07c58713 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -217,6 +217,17 @@ config DRM_PANEL_NOVATEK_NT39016
  Say Y here if you want to enable support for the panels built
  around the Novatek NT39016 display controller.
 
+config DRM_PANEL_MANTIX_MLAF057WE51
+   tristate "Mantix MLAF057WE51-X MIPI-DSI LCD panel"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   depends on BACKLIGHT_CLASS_DEVICE
+   help
+ Say Y here if you want to enable support for the Mantix
+ MLAF057WE51-X MIPI DSI panel as e.g. used in the Librem 5. It
+ has a resolution of 720x1440 pixels, a built in backlight and touch
+ controller.
+
 config DRM_PANEL_OLIMEX_LCD_OLINUXINO
tristate "Olimex LCD-OLinuXino panel"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index e45ceac6286fd..15a4e77529514 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
 obj-$(CONFIG_DRM_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o
 obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35510) += panel-novatek-nt35510.o
 obj-$(CONFIG_DRM_PANEL_NOVATEK_NT39016) += panel-novatek-nt39016.o
+obj-$(CONFIG_DRM_PANEL_MANTIX_MLAF057WE51) += panel-mantix-mlaf057we51.o
 obj-$(CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO) += panel-olimex-lcd-olinuxino.o
 obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) += panel-orisetech-otm8009a.o
 obj-$(CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS) += panel-osd-osd101t2587-53ts.o
diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c 
b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
new file mode 100644
index 0..cd5424d5bdb63
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
@@ -0,0 +1,328 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Mantix MLAF057WE51 5.7" MIPI-DSI panel driver
+ *
+ * Copyright (C) Purism SPC 2020
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#define DRV_NAME "panel-mantix-mlaf057we51"
+
+/* Manufacturer specific Commands send via DSI */
+#define MANTIX_CMD_OTP_STOP_RELOAD_MIPI 0x41
+#define MANTIX_CMD_INT_CANCEL   0x4C
+
+struct mantix {
+   struct device *dev;
+   struct drm_panel panel;
+   struct gpio_desc *reset_gpio;
+
+   struct regulator *avdd;
+   struct regulator *avee;
+   struct regulator *vddi;
+};
+
+static inline struct mantix *panel_to_mantix(struct drm_panel *panel)
+{
+   return container_of(panel, struct mantix, panel);
+}
+
+#define dsi_generic_write_seq(dsi, seq...) do {
\
+   static const u8 d[] = { seq };  \
+   int ret;\
+   ret = mipi_dsi_generic_write(dsi, d, ARRAY_SIZE(d));\
+   if (ret < 0)\
+   return ret; \
+   } while (0)
+
+static int mantix_init_sequence(struct mantix *ctx)
+{
+   struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
+   struct device *dev = ctx->dev;
+
+   /*
+* Init sequence was supplied by the panel vendor.
+*/
+   dsi_generic_write_seq(dsi, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A);
+
+   dsi_generic_write_seq(dsi, MANTIX_CMD_INT_CANCEL, 0x03);
+   dsi_generic_write_seq(dsi, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A, 0x03);
+   dsi_generic_write_seq(dsi, 0x80, 0xA9, 0x00);
+
+   dsi_generic_write_seq(dsi, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A, 0x09);
+   dsi_generic_write_seq(dsi, 0x80, 0x64, 0x00, 

Re: [PATCH v1 1/5] drm/panel: samsung: Use dev_ based logging

2020-08-15 Thread Sam Ravnborg
On Sat, Aug 15, 2020 at 09:23:59PM +0200, Linus Walleij wrote:
> On Sat, Aug 15, 2020 at 2:54 PM Sam Ravnborg  wrote:
> 
> > Standardize on the dev_ based logging and drop the include of drm_print.h.
> > Fix a few cases where "x@" was used when printing the mode.
> >
> > Signed-off-by: Sam Ravnborg 
> > Cc: Thierry Reding 
> > Cc: Sam Ravnborg 
> > Cc: Guido Günther 
> > Cc: Linus Walleij 
> > Cc: Laurent Pinchart 
> 
> At one point I was told to not use dev_* but use DRM_DEV*
> macros instead. "OK the DRM people want it this way, no
> big deal."
That could have been me, sorry!

> But I'd rather do it like this so:
> Reviewed-by: Linus Walleij 

Thanks!

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 2/3] dt-bindings: Add Mantix MLAF057WE51-X panel bindings

2020-08-15 Thread Sam Ravnborg
Hi Guido.

On Sat, Aug 15, 2020 at 06:47:37PM +0200, Guido Günther wrote:
> Hi Sam,
> On Sat, Aug 15, 2020 at 10:39:17AM +0200, Sam Ravnborg wrote:
> > Hi Guido.
> > 
> > On Fri, Aug 14, 2020 at 03:36:22PM +0200, Guido Günther wrote:
> > > The panel uses a Focaltech FT8006p, the touch part is handled by the
> > > already existing edt-ft5x06.
> > > 
> > > Signed-off-by: Guido Günther 
> > 
> > A few trivialities.
> 
> Thanks for having a look. One remark inline:
> 
> > 
> > > ---
> > >  .../display/panel/mantix,mlaf057we51-x.yaml   | 73 +++
> > >  1 file changed, 73 insertions(+)
> > >  create mode 100644 
> > > Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> > > 
> > > diff --git 
> > > a/Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> > >  
> > > b/Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> > > new file mode 100644
> > > index 0..349f3380ac940
> > > --- /dev/null
> > > +++ 
> > > b/Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> > > @@ -0,0 +1,73 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: 
> > > http://devicetree.org/schemas/display/panel/mantix,mlaf057we51-x.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Mantix MLAF057WE51-X 5.7" 720x1440 TFT LCD panel
> > > +
> > > +maintainers:
> > > +  - Guido Günther 
> > > +
> > > +description: |
> > > + Mantix MLAF057WE51 X is a 720x1440 TFT LCD panel
> > > + connected using a MIPI-DSI video interface.
> > Indent text with two spaces only.
> > And I have learned that '|' is only needed to preserve formatting - so
> > it can be dropped.
> > 
> > > +
> > > +allOf:
> > > +  - $ref: panel-common.yaml#
> > > +
> > > +properties:
> > > +  compatible:
> > > +enum:
> > > +  - mantix,mlaf057we51-x
> > This is a list - so needs an extra 2 spaces indent.
> > See 
> > https://lore.kernel.org/linux-devicetree/f1963eb9-283f-e903-2a3a-4f324d71d...@lucaceresoli.net/T/#m65900317fb948f6c40e8fb521f2201fba3c301a7
> > for examples where Rob fixes this.
> 
> Doesn't this only apply if the 'outer element' is a list too so e.g.:
> 
>- enum
>  - foo
> 
> trips up yamllint but
> 
>enum
>  - foo
> 
> doesn't. Since yamllint was happy i kept it as is (looking at your
> reference suggests that too).

You are right, I missed that this was not a list (no '-' in front of
enum).
I would not be able to do this right without tool assistance.

Sam

> 
> All the rest made sense and i fixed that for the upcoming v2.
> Thanks for having a look!
>  -- Guido
> 
> > 
> > > +
> > > +  port: true
> > > +  reg:
> > > +maxItems: 1
> > > +description: DSI virtual channel
> > > +
> > > +  avdd-supply:
> > > +description: Positive analog power supply
> > > +
> > > +  avee-supply:
> > > +description: Negative analog power supply
> > > +
> > > +  vddi-supply:
> > > +description: 1.8V I/O voltage supply
> > > +
> > > +  reset-gpios:
> > > +description: GPIO used for the reset pin
> > > +maxItems: 1
> > Use reset-gpios: true as we already have it in panel-common.yaml
> > 
> > > +
> > > +  backlight:
> > > +description: Backlight used by the panel
> > > +$ref: "/schemas/types.yaml#/definitions/phandle"
> > Use backlight from panel-common.yaml.
> > 
> > > +
> > > +required:
> > > +  - compatible
> > > +  - reg
> > > +  - avdd-supply
> > > +  - avee-supply
> > > +  - vddi-supply
> > > +  - reset-gpios
> > > +
> > > +additionalProperties: false
> > > +
> > > +examples:
> > > +  - |
> > > +#include 
> > > +
> > > +dsi {
> > My personal preference is indent with 4 spaces in examples but there are
> > no rules so feel free to ignore.
> > > +  #address-cells = <1>;
> > > +  #size-cells = <0>;
> > > +  panel@0 {
> > > +compatible = "mantix,mlaf057we51-x";
> > > +reg = <0>;
> > > +avdd-supply = <_avdd>;
> > > +avee-supply = <_avee>;
> > > +vddi-supply = <_1v8_p>;
> > > +reset-gpios = < 29 GPIO_ACTIVE_LOW>;
> > > +backlight = <>;
> > > +  };
> > > +};
> > I think we need an ampty line here.
> > > +...
> > > -- 
> > > 2.26.2
> > > 
> > > ___
> > > 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


Re: [PATCH v10 3/5] drm/msm/dp: add support for DP PLL driver

2020-08-15 Thread Rob Clark
On Fri, Aug 14, 2020 at 10:05 AM Dmitry Baryshkov
 wrote:
>
>
> On 12/08/2020 07:42, Tanmay Shah wrote:
>  > From: Chandan Uddaraju 
>  >
>  > Add the needed DP PLL specific files to support
>  > display port interface on msm targets.
>
> [skipped]
>
>  > diff --git a/drivers/gpu/drm/msm/dp/dp_pll_private.h
> b/drivers/gpu/drm/msm/dp/dp_pll_private.h
>  > new file mode 100644
>  > index ..475ba6ed59ab
>  > --- /dev/null
>  > +++ b/drivers/gpu/drm/msm/dp/dp_pll_private.h
>  > @@ -0,0 +1,98 @@
>  > +/* SPDX-License-Identifier: GPL-2.0-only */
>  > +/*
>  > + * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
>  > + */
>  > +
>  > +#ifndef __DP_PLL_10NM_H
>  > +#define __DP_PLL_10NM_H
>  > +
>  > +#include "dp_pll.h"
>  > +#include "dp_reg.h"
>  > +
>  > +#define DP_VCO_HSCLK_RATE_1620MHZDIV1000162UL
>  > +#define DP_VCO_HSCLK_RATE_2700MHZDIV1000270UL
>  > +#define DP_VCO_HSCLK_RATE_5400MHZDIV1000540UL
>  > +#define DP_VCO_HSCLK_RATE_8100MHZDIV1000810UL
>  > +
>  > +#define NUM_DP_CLOCKS_MAX6
>  > +
>  > +#define DP_PHY_PLL_POLL_SLEEP_US500
>  > +#define DP_PHY_PLL_POLL_TIMEOUT_US1
>  > +
>  > +#define DP_VCO_RATE_8100MHZDIV1000810UL
>  > +#define DP_VCO_RATE_9720MHZDIV1000972UL
>  > +#define DP_VCO_RATE_10800MHZDIV10001080UL
>  > +
>  > +struct dp_pll_vco_clk {
>  > +struct clk_hw hw;
>  > +unsigned longrate;/* current vco rate */
>  > +u64min_rate;/* min vco rate */
>  > +u64max_rate;/* max vco rate */
>  > +void*priv;
>  > +};
>  > +
>  > +struct dp_pll_db {
>
> This struct should probably go into dp_pll_10nm.c. dp_pll_7nm.c, for
> example, will use slightly different structure.

Note that sboyd has a WIP series to move all of the pll code out to a
phy driver.  If there is work already happening on 7nm support, it
might be better to go with the separate phy driver approach?  I'm
still a bit undecided about whether to land the dp code initially with
the pll stuff in drm, and then continue refactoring to move to
separate phy driver upstream, or to strip out the pll code from the
beginning.  If you/someone is working on 7nm support, then feedback
about which approach is easier is welcome.

https://lore.kernel.org/dri-devel/20200611091919.108018-1-swb...@chromium.org/

BR,
-R
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v1 1/5] drm/panel: samsung: Use dev_ based logging

2020-08-15 Thread Linus Walleij
On Sat, Aug 15, 2020 at 2:54 PM Sam Ravnborg  wrote:

> Standardize on the dev_ based logging and drop the include of drm_print.h.
> Fix a few cases where "x@" was used when printing the mode.
>
> Signed-off-by: Sam Ravnborg 
> Cc: Thierry Reding 
> Cc: Sam Ravnborg 
> Cc: Guido Günther 
> Cc: Linus Walleij 
> Cc: Laurent Pinchart 

At one point I was told to not use dev_* but use DRM_DEV*
macros instead. "OK the DRM people want it this way, no
big deal." But I'd rather do it like this so:
Reviewed-by: Linus Walleij 

Yours,
Linus Walleij
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 2/3] dt-bindings: Add Mantix MLAF057WE51-X panel bindings

2020-08-15 Thread Guido Günther
Hi Sam,
On Sat, Aug 15, 2020 at 10:39:17AM +0200, Sam Ravnborg wrote:
> Hi Guido.
> 
> On Fri, Aug 14, 2020 at 03:36:22PM +0200, Guido Günther wrote:
> > The panel uses a Focaltech FT8006p, the touch part is handled by the
> > already existing edt-ft5x06.
> > 
> > Signed-off-by: Guido Günther 
> 
> A few trivialities.

Thanks for having a look. One remark inline:

> 
> > ---
> >  .../display/panel/mantix,mlaf057we51-x.yaml   | 73 +++
> >  1 file changed, 73 insertions(+)
> >  create mode 100644 
> > Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> > 
> > diff --git 
> > a/Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml 
> > b/Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> > new file mode 100644
> > index 0..349f3380ac940
> > --- /dev/null
> > +++ 
> > b/Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> > @@ -0,0 +1,73 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/display/panel/mantix,mlaf057we51-x.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Mantix MLAF057WE51-X 5.7" 720x1440 TFT LCD panel
> > +
> > +maintainers:
> > +  - Guido Günther 
> > +
> > +description: |
> > + Mantix MLAF057WE51 X is a 720x1440 TFT LCD panel
> > + connected using a MIPI-DSI video interface.
> Indent text with two spaces only.
> And I have learned that '|' is only needed to preserve formatting - so
> it can be dropped.
> 
> > +
> > +allOf:
> > +  - $ref: panel-common.yaml#
> > +
> > +properties:
> > +  compatible:
> > +enum:
> > +  - mantix,mlaf057we51-x
> This is a list - so needs an extra 2 spaces indent.
> See 
> https://lore.kernel.org/linux-devicetree/f1963eb9-283f-e903-2a3a-4f324d71d...@lucaceresoli.net/T/#m65900317fb948f6c40e8fb521f2201fba3c301a7
> for examples where Rob fixes this.

Doesn't this only apply if the 'outer element' is a list too so e.g.:

   - enum
 - foo

trips up yamllint but

   enum
 - foo

doesn't. Since yamllint was happy i kept it as is (looking at your
reference suggests that too).

All the rest made sense and i fixed that for the upcoming v2.
Thanks for having a look!
 -- Guido

> 
> > +
> > +  port: true
> > +  reg:
> > +maxItems: 1
> > +description: DSI virtual channel
> > +
> > +  avdd-supply:
> > +description: Positive analog power supply
> > +
> > +  avee-supply:
> > +description: Negative analog power supply
> > +
> > +  vddi-supply:
> > +description: 1.8V I/O voltage supply
> > +
> > +  reset-gpios:
> > +description: GPIO used for the reset pin
> > +maxItems: 1
> Use reset-gpios: true as we already have it in panel-common.yaml
> 
> > +
> > +  backlight:
> > +description: Backlight used by the panel
> > +$ref: "/schemas/types.yaml#/definitions/phandle"
> Use backlight from panel-common.yaml.
> 
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - avdd-supply
> > +  - avee-supply
> > +  - vddi-supply
> > +  - reset-gpios
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +#include 
> > +
> > +dsi {
> My personal preference is indent with 4 spaces in examples but there are
> no rules so feel free to ignore.
> > +  #address-cells = <1>;
> > +  #size-cells = <0>;
> > +  panel@0 {
> > +compatible = "mantix,mlaf057we51-x";
> > +reg = <0>;
> > +avdd-supply = <_avdd>;
> > +avee-supply = <_avee>;
> > +vddi-supply = <_1v8_p>;
> > +reset-gpios = < 29 GPIO_ACTIVE_LOW>;
> > +backlight = <>;
> > +  };
> > +};
> I think we need an ampty line here.
> > +...
> > -- 
> > 2.26.2
> > 
> > ___
> > 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


Re: [PATCH 3/3] drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel

2020-08-15 Thread Guido Günther
Hi,
On Sat, Aug 15, 2020 at 12:46:51PM +0200, Sam Ravnborg wrote:
> On Sat, Aug 15, 2020 at 12:40:22PM +0200, Guido Günther wrote:
> > Hi Sam,
> > On Sat, Aug 15, 2020 at 12:02:30PM +0200, Sam Ravnborg wrote:
> > > Hi Guido.
> > > 
> > > > +static int mantix_probe(struct mipi_dsi_device *dsi)
> > > > +{
> > > > +   struct device *dev = >dev;
> > > > +   struct mantix *ctx;
> > > > +   int ret;
> > > > +
> > > > +   ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
> > > > +   if (!ctx)
> > > > +   return -ENOMEM;
> > > > +
> > > > +   ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
> > > > +   if (IS_ERR(ctx->reset_gpio)) {
> > > > +   DRM_DEV_ERROR(dev, "cannot get reset gpio\n");
> > > > +   return PTR_ERR(ctx->reset_gpio);
> > > > +   }
> > > > +
> > > > +   mipi_dsi_set_drvdata(dsi, ctx);
> > > > +   ctx->dev = dev;
> > > > +
> > > > +   dsi->lanes = 4;
> > > > +   dsi->format = MIPI_DSI_FMT_RGB888;
> > > > +   dsi->mode_flags = MIPI_DSI_MODE_VIDEO |
> > > > +   MIPI_DSI_MODE_VIDEO_BURST | 
> > > > MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
> > > > +
> > > > +   ctx->avdd = devm_regulator_get(dev, "avdd");
> > > > +   if (IS_ERR(ctx->avdd)) {
> > > > +   ret = PTR_ERR(ctx->avdd);
> > > > +   if (ret != -EPROBE_DEFER)
> > > > +   DRM_DEV_ERROR(dev,
> > > > + "Failed to request avdd 
> > > > regulator: %d\n",
> > > > + ret);
> > > > +   return ret;
> > > > +   }
> > > 
> > > Consider to use the recently added dev_err_probe() here and below.
> > > Note: Not part of drm-misc-next yet - but hopefully after -rc1
> > > when a backmerge is done.
> > 
> > In fact I did decided against it since i was told that missing dev_* and
> > DRM_* logging shouldn't be done. So is that o.k. nowadays?
> s/missing/mixing/
> 
> I often request that logging is consistent - so I recognize the
> argument.
> 
> For panel/* I have not made up my mind what I think is the best
> approach. The DRM_DEV_* and DRM_* logging do not add much value.
> So I have been tempted several times to convert all logging in
> panel/ to dev_* and pr_* (when no struct device * is available).
> That would also avoid that we mix up logging.
> 
> We have drm_* logging - but they require a valid drm_device * which we
> do not have in the the panel drivers. So they are ruled out here.
> 
> Do you have any opinions/comments on this?

I think for panel drivers DRM_* does not give any bonus so moving to
{dev,pr}_* sounds good. I just wonder if other drm parts don't need
`dev_drm_err_probe()` (or similar) anyway. But then maybe dyn_debug
is enough nowadays to not need DRM_DEV_DEBUG_* either?
Cheers,
 -- Guido

> 
>   Sam
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 204609] amdgpu: powerplay failed send message

2020-08-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204609

--- Comment #10 from w...@hllmnn.de ---
Created attachment 290911
  --> https://bugzilla.kernel.org/attachment.cgi?id=290911=edit
journalctl output

Adding journalctl output

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 204609] amdgpu: powerplay failed send message

2020-08-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204609

w...@hllmnn.de changed:

   What|Removed |Added

 CC||w...@hllmnn.de

--- Comment #9 from w...@hllmnn.de ---
I can reproduce this bug with kernel 5.7.0 from Debian bullseye (5.7.0-2-amd64)
when using a dual monitor setup. If I boot with only one monitor connected and
connect the second one later, everything seems to work fine. Both monitors are
connected via DisplayPort, but it does not change anything if I connect one of
them via HDMI.

The significant errors in dmesg read:

Aug 15 17:15:03 dino kernel: failed send message: TransferTableSmu2Dram (18)   
 param: 0x0006 response 0xffc2
Aug 15 17:15:03 dino kernel: Failed to export SMU metrics table!
Aug 15 17:15:05 dino kernel: Msg issuing pre-check failed and SMU may be not in
the right state!
Aug 15 17:15:05 dino kernel: [drm:amdgpu_dpm_enable_uvd [amdgpu]] *ERROR* Dpm
enable uvd failed, ret = -62. 
Aug 15 17:15:06 dino kernel: amdgpu :09:00.0: [drm:amdgpu_ib_ring_tests
[amdgpu]] *ERROR* IB test failed on vcn_enc0 (-110).
Aug 15 17:15:07 dino kernel: amdgpu :09:00.0: [drm:amdgpu_ib_ring_tests
[amdgpu]] *ERROR* IB test failed on vcn_enc1 (-110).
Aug 15 17:15:08 dino kernel: Msg issuing pre-check failed and SMU may be not in
the right state!
Aug 15 17:15:08 dino kernel: Failed to export SMU metrics table!
Aug 15 17:15:11 dino kernel: Msg issuing pre-check failed and SMU may be not in
the right state!
Aug 15 17:15:11 dino kernel: [drm:jpeg_v2_0_set_powergating_state [amdgpu]]
*ERROR* Dpm enable jpeg failed, ret = -62. 
Aug 15 17:15:11 dino kernel: [drm:process_one_work] *ERROR* ib ring test failed
(-110).

I am using the firmware files from that commit:
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=49e9ea898f870ae09b91ccd3dd1c45d520fcb0c3
(commit date: 2020-08-07)

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 0/4] Add support for Feixin K101-IM2BYL02 panel

2020-08-15 Thread Sam Ravnborg
Hi Icenowy

On Mon, Jul 20, 2020 at 01:04:06AM +0800, Icenowy Zheng wrote:
> The controller chip of Feixin K101-IM2BA02 is going to be discontinued,
> so Feixin start to provide K101-IM2BYL02 panel as a replacement, which
> utilizes Ilitek ILI9881C controller.
> 
> Add support for K101-IM2BYL02 panel.
> 
> By the way, is there a way that can try both kind of panels in the same
> kernel/DTB combo? K101-IM2BYL02 has the same pinout with K101-IM2BA02,
> and PineTab schedule to switch to it w/o modifying the mainboard.
> 
> Icenowy Zheng (4):
>   drm/panel: ilitek-ili9881c: prepare for adding support for extra
> panels
>   dt-bindings: ili9881c: add compatible string for Feixin K101-IM2BYL02
>   drm/panel: ilitek-ili9881c: add support for Feixin K101-IM2BYL02 panel
Thanks, applied the above patches to drm-misc-next.

Sam

>   [DO NOT MERGE] arm64: allwinner: dts: a64: enable K101-IM2BYL02 panel
> for PineTab
> 
>  .../display/panel/ilitek,ili9881c.yaml|   1 +
>  .../boot/dts/allwinner/sun50i-a64-pinetab.dts |  10 +
>  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 273 --
>  3 files changed, 265 insertions(+), 19 deletions(-)
> 
> -- 
> 2.27.0
> ___
> 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


Re: [PATCH 0/5] drm/panel: A few cleanups and improvements

2020-08-15 Thread Sam Ravnborg
Hi Paul.

On Tue, Aug 11, 2020 at 02:22:35AM +0200, Paul Cercueil wrote:
> Hi list,
> 
> Here's a list of 5 patches that bring some cleanups and improvements.
> 
> Patches 1-2 clean up the novatek,nt39016 code to remove custom handling
> of the backlight and to add the missing carriage returns on error
> messages.
> 
> Patches 3-5 updates the modes list of the sharp,ls020b1dd01d panel, to
> make it use 'struct drm_display_mode' instead of 'struct
> display_timing', modify the timings to get a perfect 60.00 Hz rate, and
> add a 50 Hz mode.

While touching logging stuff in panle/ I made the same fix adding
newlines. Glad to see you did it so I can drop one of my patches.

All patches applied to drm-misc-next.

Sam

> 
> Cheers,
> -Paul
> 
> Paul Cercueil (5):
>   drm/panel: novatek,nt39016: Handle backlight the standard way
>   drm/panel: novatek,nt39016: Add missing CR to error messages
>   drm/panel: simple: Convert sharp,ls020b1dd01d from timings to
> videomode
>   drm/panel: simple: Tweak timings of sharp,ls020b1dd01d for perfect
> 60Hz
>   drm/panel: simple: Add 50Hz mode for sharp,ls020b1dd01d
> 
>  drivers/gpu/drm/panel/panel-novatek-nt39016.c | 34 ++--
>  drivers/gpu/drm/panel/panel-simple.c  | 40 +--
>  2 files changed, 40 insertions(+), 34 deletions(-)
> 
> -- 
> 2.28.0
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 3/3] drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel

2020-08-15 Thread Sam Ravnborg
Hi Guido.

> > In fact I did decided against it since i was told that missing dev_* and
> > DRM_* logging shouldn't be done. So is that o.k. nowadays?
> s/missing/mixing/
> 
> I often request that logging is consistent - so I recognize the
> argument.
> 
> For panel/* I have not made up my mind what I think is the best
> approach. The DRM_DEV_* and DRM_* logging do not add much value.
> So I have been tempted several times to convert all logging in
> panel/ to dev_* and pr_* (when no struct device * is available).
> That would also avoid that we mix up logging.
> 
> We have drm_* logging - but they require a valid drm_device * which we
> do not have in the the panel drivers. So they are ruled out here.
> 
> Do you have any opinions/comments on this?
I went ahead and dropped the DRM_ logging in drm/panel, you are copied
on the patchset. Feedback on the patches would be nice.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 0/5] drm/panel: Use dev_ based logging

2020-08-15 Thread Sam Ravnborg
The drm/panel drivers uses a mixture of DRM_ and dev_ based logging.
With this patchset all panel drivers are migrated to use dev_ based
logging as the DRM_ based logging did not add any extra info.

Drop the now unused include of drm_print.h.

With this change new panel drivers will be requires to change to dev_
based logging - so some of the in-flight panel drivers will need trivial
updates before they are accepted.

Patch divided in smaller bites to ease review. There is no dependencies
between the patches.

Copied a few people that may have input to the move away from DRM_ based
logging (Daniel (presumeably on vacation), Jani).

Sam

Sam Ravnborg (5):
  drm/panel: samsung: Use dev_ based logging
  drm/panel: leadtek: Use dev_ based logging
  drm/panel: raydium: Use dev_ based logging
  drm/panel: sitronix: Use dev_ based logging
  drm/panel: Use dev_ based logging

 drivers/gpu/drm/panel/panel-boe-himax8279d.c   | 44 
 drivers/gpu/drm/panel/panel-elida-kd35t133.c   | 51 +-
 drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c  | 19 +++--
 .../gpu/drm/panel/panel-feiyang-fy07024di26a30d.c  | 21 +++---
 drivers/gpu/drm/panel/panel-ilitek-ili9322.c   |  3 +-
 drivers/gpu/drm/panel/panel-innolux-p079zca.c  | 31 +++--
 drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c | 33 -
 drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 58 ++--
 drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c | 49 +
 drivers/gpu/drm/panel/panel-novatek-nt35510.c  | 40 ---
 drivers/gpu/drm/panel/panel-orisetech-otm8009a.c   | 13 ++--
 drivers/gpu/drm/panel/panel-raydium-rm67191.c  | 33 -
 drivers/gpu/drm/panel/panel-raydium-rm68200.c  | 18 +++--
 drivers/gpu/drm/panel/panel-ronbo-rb070d30.c   | 16 ++---
 drivers/gpu/drm/panel/panel-samsung-ld9040.c   |  3 +-
 drivers/gpu/drm/panel/panel-samsung-s6d16d0.c  | 23 +++---
 drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c  |  3 +-
 drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c   |  3 +-
 drivers/gpu/drm/panel/panel-samsung-s6e63m0.c  | 22 +++---
 drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c  |  3 +-
 drivers/gpu/drm/panel/panel-sitronix-st7701.c  | 10 ++-
 drivers/gpu/drm/panel/panel-sitronix-st7703.c  | 61 ++--
 drivers/gpu/drm/panel/panel-sony-acx424akp.c   | 81 --
 drivers/gpu/drm/panel/panel-tpo-tpg110.c   | 38 +-
 drivers/gpu/drm/panel/panel-truly-nt35597.c| 63 ++---
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 41 ---
 drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c   | 51 +-
 27 files changed, 308 insertions(+), 523 deletions(-)



___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 4/5] drm/panel: sitronix: Use dev_ based logging

2020-08-15 Thread Sam Ravnborg
Standardize on the dev_ based logging and drop the include of drm_print.h.
Fix a few cases where "x@" was used when printing the mode.

Signed-off-by: Sam Ravnborg 
Cc: Jagan Teki 
Cc: Thierry Reding 
Cc: Sam Ravnborg 
Cc: Guido Günther 
Cc: Linus Walleij 
Cc: Laurent Pinchart 
---
 drivers/gpu/drm/panel/panel-sitronix-st7701.c | 10 ++-
 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 61 +++
 2 files changed, 27 insertions(+), 44 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c 
b/drivers/gpu/drm/panel/panel-sitronix-st7701.c
index 12462114a52d..4d2a149b202c 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c
@@ -7,7 +7,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -269,10 +268,9 @@ static int st7701_get_modes(struct drm_panel *panel,
 
mode = drm_mode_duplicate(connector->dev, desc_mode);
if (!mode) {
-   DRM_DEV_ERROR(>dsi->dev,
- "failed to add mode %ux%ux@%u\n",
- desc_mode->hdisplay, desc_mode->vdisplay,
- drm_mode_vrefresh(desc_mode));
+   dev_err(>dsi->dev, "failed to add mode %ux%u@%u\n",
+   desc_mode->hdisplay, desc_mode->vdisplay,
+   drm_mode_vrefresh(desc_mode));
return -ENOMEM;
}
 
@@ -358,7 +356,7 @@ static int st7701_dsi_probe(struct mipi_dsi_device *dsi)
 
st7701->reset = devm_gpiod_get(>dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(st7701->reset)) {
-   DRM_DEV_ERROR(>dev, "Couldn't get our reset GPIO\n");
+   dev_err(>dev, "Couldn't get our reset GPIO\n");
return PTR_ERR(st7701->reset);
}
 
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c 
b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
index 8996ced2b721..c22e7c49e077 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define DRV_NAME "panel-sitronix-st7703"
 
@@ -364,8 +363,7 @@ static int st7703_enable(struct drm_panel *panel)
 
ret = ctx->desc->init_sequence(ctx);
if (ret < 0) {
-   DRM_DEV_ERROR(ctx->dev, "Panel init sequence failed: %d\n",
- ret);
+   dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret);
return ret;
}
 
@@ -373,7 +371,7 @@ static int st7703_enable(struct drm_panel *panel)
 
ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
if (ret < 0) {
-   DRM_DEV_ERROR(ctx->dev, "Failed to exit sleep mode: %d\n", ret);
+   dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret);
return ret;
}
 
@@ -384,7 +382,7 @@ static int st7703_enable(struct drm_panel *panel)
if (ret)
return ret;
 
-   DRM_DEV_DEBUG_DRIVER(ctx->dev, "Panel init sequence done\n");
+   dev_dbg(ctx->dev, "Panel init sequence done\n");
 
return 0;
 }
@@ -397,13 +395,11 @@ static int st7703_disable(struct drm_panel *panel)
 
ret = mipi_dsi_dcs_set_display_off(dsi);
if (ret < 0)
-   DRM_DEV_ERROR(ctx->dev,
- "Failed to turn off the display: %d\n", ret);
+   dev_err(ctx->dev, "Failed to turn off the display: %d\n", ret);
 
ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
if (ret < 0)
-   DRM_DEV_ERROR(ctx->dev,
- "Failed to enter sleep mode: %d\n", ret);
+   dev_err(ctx->dev, "Failed to enter sleep mode: %d\n", ret);
 
return 0;
 }
@@ -431,17 +427,15 @@ static int st7703_prepare(struct drm_panel *panel)
if (ctx->prepared)
return 0;
 
-   DRM_DEV_DEBUG_DRIVER(ctx->dev, "Resetting the panel\n");
+   dev_dbg(ctx->dev, "Resetting the panel\n");
ret = regulator_enable(ctx->vcc);
if (ret < 0) {
-   DRM_DEV_ERROR(ctx->dev,
- "Failed to enable vcc supply: %d\n", ret);
+   dev_err(ctx->dev, "Failed to enable vcc supply: %d\n", ret);
return ret;
}
ret = regulator_enable(ctx->iovcc);
if (ret < 0) {
-   DRM_DEV_ERROR(ctx->dev,
- "Failed to enable iovcc supply: %d\n", ret);
+   dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret);
goto disable_vcc;
}
 
@@ -467,9 +461,9 @@ static int st7703_get_modes(struct drm_panel *panel,
 
mode = drm_mode_duplicate(connector->dev, ctx->desc->mode);
if (!mode) {
-   DRM_DEV_ERROR(ctx->dev, "Failed to add mode %ux%u@%u\n",
- ctx->desc->mode->hdisplay, 
ctx->desc->mode->vdisplay,
- 

[PATCH v1 3/5] drm/panel: raydium: Use dev_ based logging

2020-08-15 Thread Sam Ravnborg
Standardize on the dev_ based logging and drop the include of drm_print.h.
Fix a few cases where "x@" was used when printing the mode.

Signed-off-by: Sam Ravnborg 
Cc: Robert Chiras 
Cc: Thierry Reding 
Cc: Sam Ravnborg 
Cc: Guido Günther 
Cc: Linus Walleij 
Cc: Laurent Pinchart 
---
 drivers/gpu/drm/panel/panel-raydium-rm67191.c | 33 +--
 drivers/gpu/drm/panel/panel-raydium-rm68200.c | 18 +-
 2 files changed, 23 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-raydium-rm67191.c 
b/drivers/gpu/drm/panel/panel-raydium-rm67191.c
index 2ef322582133..23b62081e951 100644
--- a/drivers/gpu/drm/panel/panel-raydium-rm67191.c
+++ b/drivers/gpu/drm/panel/panel-raydium-rm67191.c
@@ -19,7 +19,6 @@
 #include 
 #include 
 #include 
-#include 
 
 /* Panel specific color-format bits */
 #define COL_FMT_16BPP 0x55
@@ -329,7 +328,7 @@ static int rad_panel_enable(struct drm_panel *panel)
 
ret = rad_panel_push_cmd_list(dsi);
if (ret < 0) {
-   DRM_DEV_ERROR(dev, "Failed to send MCS (%d)\n", ret);
+   dev_err(dev, "Failed to send MCS (%d)\n", ret);
goto fail;
}
 
@@ -341,7 +340,7 @@ static int rad_panel_enable(struct drm_panel *panel)
/* Software reset */
ret = mipi_dsi_dcs_soft_reset(dsi);
if (ret < 0) {
-   DRM_DEV_ERROR(dev, "Failed to do Software Reset (%d)\n", ret);
+   dev_err(dev, "Failed to do Software Reset (%d)\n", ret);
goto fail;
}
 
@@ -350,33 +349,32 @@ static int rad_panel_enable(struct drm_panel *panel)
/* Set DSI mode */
ret = mipi_dsi_generic_write(dsi, (u8[]){ 0xC2, 0x0B }, 2);
if (ret < 0) {
-   DRM_DEV_ERROR(dev, "Failed to set DSI mode (%d)\n", ret);
+   dev_err(dev, "Failed to set DSI mode (%d)\n", ret);
goto fail;
}
/* Set tear ON */
ret = mipi_dsi_dcs_set_tear_on(dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
if (ret < 0) {
-   DRM_DEV_ERROR(dev, "Failed to set tear ON (%d)\n", ret);
+   dev_err(dev, "Failed to set tear ON (%d)\n", ret);
goto fail;
}
/* Set tear scanline */
ret = mipi_dsi_dcs_set_tear_scanline(dsi, 0x380);
if (ret < 0) {
-   DRM_DEV_ERROR(dev, "Failed to set tear scanline (%d)\n", ret);
+   dev_err(dev, "Failed to set tear scanline (%d)\n", ret);
goto fail;
}
/* Set pixel format */
ret = mipi_dsi_dcs_set_pixel_format(dsi, color_format);
-   DRM_DEV_DEBUG_DRIVER(dev, "Interface color format set to 0x%x\n",
-color_format);
+   dev_dbg(dev, "Interface color format set to 0x%x\n", color_format);
if (ret < 0) {
-   DRM_DEV_ERROR(dev, "Failed to set pixel format (%d)\n", ret);
+   dev_err(dev, "Failed to set pixel format (%d)\n", ret);
goto fail;
}
/* Exit sleep mode */
ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
if (ret < 0) {
-   DRM_DEV_ERROR(dev, "Failed to exit sleep mode (%d)\n", ret);
+   dev_err(dev, "Failed to exit sleep mode (%d)\n", ret);
goto fail;
}
 
@@ -384,7 +382,7 @@ static int rad_panel_enable(struct drm_panel *panel)
 
ret = mipi_dsi_dcs_set_display_on(dsi);
if (ret < 0) {
-   DRM_DEV_ERROR(dev, "Failed to set display ON (%d)\n", ret);
+   dev_err(dev, "Failed to set display ON (%d)\n", ret);
goto fail;
}
 
@@ -418,7 +416,7 @@ static int rad_panel_disable(struct drm_panel *panel)
 
ret = mipi_dsi_dcs_set_display_off(dsi);
if (ret < 0) {
-   DRM_DEV_ERROR(dev, "Failed to set display OFF (%d)\n", ret);
+   dev_err(dev, "Failed to set display OFF (%d)\n", ret);
return ret;
}
 
@@ -426,7 +424,7 @@ static int rad_panel_disable(struct drm_panel *panel)
 
ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
if (ret < 0) {
-   DRM_DEV_ERROR(dev, "Failed to enter sleep mode (%d)\n", ret);
+   dev_err(dev, "Failed to enter sleep mode (%d)\n", ret);
return ret;
}
 
@@ -442,9 +440,9 @@ static int rad_panel_get_modes(struct drm_panel *panel,
 
mode = drm_mode_duplicate(connector->dev, _mode);
if (!mode) {
-   DRM_DEV_ERROR(panel->dev, "failed to add mode %ux%ux@%u\n",
- default_mode.hdisplay, default_mode.vdisplay,
- drm_mode_vrefresh(_mode));
+   dev_err(panel->dev, "failed to add mode %ux%u@%u\n",
+   default_mode.hdisplay, default_mode.vdisplay,
+   drm_mode_vrefresh(_mode));
return -ENOMEM;
}
 
@@ -626,8 +624,7 @@ static int rad_panel_remove(struct mipi_dsi_device *dsi)
 
ret = 

[PATCH v1 1/5] drm/panel: samsung: Use dev_ based logging

2020-08-15 Thread Sam Ravnborg
Standardize on the dev_ based logging and drop the include of drm_print.h.
Fix a few cases where "x@" was used when printing the mode.

Signed-off-by: Sam Ravnborg 
Cc: Thierry Reding 
Cc: Sam Ravnborg 
Cc: Guido Günther 
Cc: Linus Walleij 
Cc: Laurent Pinchart 
---
 drivers/gpu/drm/panel/panel-samsung-ld9040.c  |  3 +--
 drivers/gpu/drm/panel/panel-samsung-s6d16d0.c | 23 +++
 drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c |  3 +--
 .../gpu/drm/panel/panel-samsung-s6e63j0x03.c  |  3 +--
 drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 22 --
 drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c |  3 +--
 6 files changed, 21 insertions(+), 36 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-samsung-ld9040.c 
b/drivers/gpu/drm/panel/panel-samsung-ld9040.c
index 358168ed8355..f484147fc3a6 100644
--- a/drivers/gpu/drm/panel/panel-samsung-ld9040.c
+++ b/drivers/gpu/drm/panel/panel-samsung-ld9040.c
@@ -21,7 +21,6 @@
 
 #include 
 #include 
-#include 
 
 /* Manufacturer Command Set */
 #define MCS_MANPWR 0xb0
@@ -269,7 +268,7 @@ static int ld9040_get_modes(struct drm_panel *panel,
 
mode = drm_mode_create(connector->dev);
if (!mode) {
-   DRM_ERROR("failed to create a new display mode\n");
+   dev_err(panel->dev, "failed to create a new display mode\n");
return 0;
}
 
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c 
b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c
index e88af6f8bf60..4aac0d1573dd 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c
@@ -7,7 +7,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -55,8 +54,7 @@ static int s6d16d0_unprepare(struct drm_panel *panel)
/* Enter sleep mode */
ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
if (ret) {
-   DRM_DEV_ERROR(s6->dev, "failed to enter sleep mode (%d)\n",
- ret);
+   dev_err(s6->dev, "failed to enter sleep mode (%d)\n", ret);
return ret;
}
 
@@ -75,7 +73,7 @@ static int s6d16d0_prepare(struct drm_panel *panel)
 
ret = regulator_enable(s6->supply);
if (ret) {
-   DRM_DEV_ERROR(s6->dev, "failed to enable supply (%d)\n", ret);
+   dev_err(s6->dev, "failed to enable supply (%d)\n", ret);
return ret;
}
 
@@ -90,15 +88,13 @@ static int s6d16d0_prepare(struct drm_panel *panel)
ret = mipi_dsi_dcs_set_tear_on(dsi,
   MIPI_DSI_DCS_TEAR_MODE_VBLANK);
if (ret) {
-   DRM_DEV_ERROR(s6->dev, "failed to enable vblank TE (%d)\n",
- ret);
+   dev_err(s6->dev, "failed to enable vblank TE (%d)\n", ret);
return ret;
}
/* Exit sleep mode and power on */
ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
if (ret) {
-   DRM_DEV_ERROR(s6->dev, "failed to exit sleep mode (%d)\n",
- ret);
+   dev_err(s6->dev, "failed to exit sleep mode (%d)\n", ret);
return ret;
}
 
@@ -113,8 +109,7 @@ static int s6d16d0_enable(struct drm_panel *panel)
 
ret = mipi_dsi_dcs_set_display_on(dsi);
if (ret) {
-   DRM_DEV_ERROR(s6->dev, "failed to turn display on (%d)\n",
- ret);
+   dev_err(s6->dev, "failed to turn display on (%d)\n", ret);
return ret;
}
 
@@ -129,8 +124,7 @@ static int s6d16d0_disable(struct drm_panel *panel)
 
ret = mipi_dsi_dcs_set_display_off(dsi);
if (ret) {
-   DRM_DEV_ERROR(s6->dev, "failed to turn display off (%d)\n",
- ret);
+   dev_err(s6->dev, "failed to turn display off (%d)\n", ret);
return ret;
}
 
@@ -144,7 +138,7 @@ static int s6d16d0_get_modes(struct drm_panel *panel,
 
mode = drm_mode_duplicate(connector->dev, _s6d16d0_mode);
if (!mode) {
-   DRM_ERROR("bad mode or failed to add mode\n");
+   dev_err(panel->dev, "bad mode or failed to add mode\n");
return -EINVAL;
}
drm_mode_set_name(mode);
@@ -204,8 +198,7 @@ static int s6d16d0_probe(struct mipi_dsi_device *dsi)
if (IS_ERR(s6->reset_gpio)) {
ret = PTR_ERR(s6->reset_gpio);
if (ret != -EPROBE_DEFER)
-   DRM_DEV_ERROR(dev, "failed to request GPIO (%d)\n",
- ret);
+   dev_err(dev, "failed to request GPIO (%d)\n", ret);
return ret;
}
 
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c 
b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
index 2c84036c6a65..1d1c79a18613 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
+++ 

[PATCH v1 5/5] drm/panel: Use dev_ based logging

2020-08-15 Thread Sam Ravnborg
Standardize on the dev_ based logging and drop the include of drm_print.h.
Fix a few cases where "x@" was used when printing the mode.

Signed-off-by: Sam Ravnborg 
Cc: Jerry Han 
Cc: Thierry Reding 
Cc: Sam Ravnborg 
Cc: Icenowy Zheng 
Cc: Jagan Teki 
Cc: Linus Walleij 
Cc: Guido Günther 
Cc: Laurent Pinchart 
---
 drivers/gpu/drm/panel/panel-boe-himax8279d.c  | 44 --
 drivers/gpu/drm/panel/panel-elida-kd35t133.c  | 51 +---
 .../gpu/drm/panel/panel-feixin-k101-im2ba02.c | 19 ++---
 .../drm/panel/panel-feiyang-fy07024di26a30d.c | 21 +++--
 drivers/gpu/drm/panel/panel-ilitek-ili9322.c  |  3 +-
 drivers/gpu/drm/panel/panel-innolux-p079zca.c | 31 +++
 .../drm/panel/panel-kingdisplay-kd097d04.c| 33 +++-
 drivers/gpu/drm/panel/panel-novatek-nt35510.c | 40 -
 .../gpu/drm/panel/panel-orisetech-otm8009a.c  | 13 ++-
 drivers/gpu/drm/panel/panel-ronbo-rb070d30.c  | 16 ++--
 drivers/gpu/drm/panel/panel-sony-acx424akp.c  | 81 +++
 drivers/gpu/drm/panel/panel-tpo-tpg110.c  | 38 -
 drivers/gpu/drm/panel/panel-truly-nt35597.c   | 63 +--
 .../gpu/drm/panel/panel-visionox-rm69299.c| 41 +++---
 .../gpu/drm/panel/panel-xinpeng-xpp055c272.c  | 51 +---
 15 files changed, 200 insertions(+), 345 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
index d676b4c2a8fa..42854bd37fd5 100644
--- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -19,7 +19,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
@@ -93,8 +92,7 @@ static int boe_panel_disable(struct drm_panel *panel)
 
err = mipi_dsi_dcs_set_display_off(pinfo->link);
if (err < 0) {
-   DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n",
- err);
+   dev_err(panel->dev, "failed to set display off: %d\n", err);
return err;
}
 
@@ -113,13 +111,11 @@ static int boe_panel_unprepare(struct drm_panel *panel)
 
err = mipi_dsi_dcs_set_display_off(pinfo->link);
if (err < 0)
-   DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n",
- err);
+   dev_err(panel->dev, "failed to set display off: %d\n", err);
 
err = mipi_dsi_dcs_enter_sleep_mode(pinfo->link);
if (err < 0)
-   DRM_DEV_ERROR(panel->dev, "failed to enter sleep mode: %d\n",
- err);
+   dev_err(panel->dev, "failed to enter sleep mode: %d\n", err);
 
/* sleep_mode_delay: 1ms - 2ms */
usleep_range(1000, 2000);
@@ -163,15 +159,13 @@ static int boe_panel_prepare(struct drm_panel *panel)
/* send init code */
err = send_mipi_cmds(panel, pinfo->desc->on_cmds);
if (err < 0) {
-   DRM_DEV_ERROR(panel->dev, "failed to send DCS Init Code: %d\n",
- err);
+   dev_err(panel->dev, "failed to send DCS Init Code: %d\n", err);
goto poweroff;
}
 
err = mipi_dsi_dcs_exit_sleep_mode(pinfo->link);
if (err < 0) {
-   DRM_DEV_ERROR(panel->dev, "failed to exit sleep mode: %d\n",
- err);
+   dev_err(panel->dev, "failed to exit sleep mode: %d\n", err);
goto poweroff;
}
 
@@ -180,8 +174,7 @@ static int boe_panel_prepare(struct drm_panel *panel)
 
err = mipi_dsi_dcs_set_display_on(pinfo->link);
if (err < 0) {
-   DRM_DEV_ERROR(panel->dev, "failed to set display on: %d\n",
- err);
+   dev_err(panel->dev, "failed to set display on: %d\n", err);
goto poweroff;
}
 
@@ -209,8 +202,7 @@ static int boe_panel_enable(struct drm_panel *panel)
 
ret = mipi_dsi_dcs_set_display_on(pinfo->link);
if (ret < 0) {
-   DRM_DEV_ERROR(panel->dev, "failed to set display on: %d\n",
- ret);
+   dev_err(panel->dev, "failed to set display on: %d\n", ret);
return ret;
}
 
@@ -228,8 +220,8 @@ static int boe_panel_get_modes(struct drm_panel *panel,
 
mode = drm_mode_duplicate(connector->dev, m);
if (!mode) {
-   DRM_DEV_ERROR(pinfo->base.dev, "failed to add mode %ux%u@%u\n",
- m->hdisplay, m->vdisplay, drm_mode_vrefresh(m));
+   dev_err(pinfo->base.dev, "failed to add mode %ux%u@%u\n",
+   m->hdisplay, m->vdisplay, drm_mode_vrefresh(m));
return -ENOMEM;
}
 
@@ -865,8 +857,7 @@ static int panel_add(struct panel_info *pinfo)
if (IS_ERR(pinfo->pp18_gpio)) {
ret = PTR_ERR(pinfo->pp18_gpio);
if (ret != -EPROBE_DEFER)
-   DRM_DEV_ERROR(dev, "failed to get pp18 gpio: %d\n",
-

[PATCH v1 2/5] drm/panel: leadtek: Use dev_ based logging

2020-08-15 Thread Sam Ravnborg
Standardize on the dev_ based logging and drop the include of drm_print.h.
Fix a few cases where "x@" was used when printing the mode.

Signed-off-by: Sam Ravnborg 
Cc: Thierry Reding 
Cc: Sam Ravnborg 
Cc: Guido Günther 
Cc: Linus Walleij 
Cc: Laurent Pinchart 
---
 .../drm/panel/panel-leadtek-ltk050h3146w.c| 58 +++
 .../drm/panel/panel-leadtek-ltk500hd1829.c| 49 ++--
 2 files changed, 37 insertions(+), 70 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c 
b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
index eaa9da3ebbea..ed0d5f959037 100644
--- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
+++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
@@ -17,7 +17,6 @@
 #include 
 #include 
 #include 
-#include 
 
 struct ltk050h3146w_cmd {
char cmd;
@@ -314,8 +313,7 @@ static int ltk050h3146w_init_sequence(struct ltk050h3146w 
*ctx)
 
ret = mipi_dsi_dcs_set_tear_on(dsi, 1);
if (ret < 0) {
-   DRM_DEV_ERROR(ctx->dev, "failed to set tear on: %d\n",
- ret);
+   dev_err(ctx->dev, "failed to set tear on: %d\n", ret);
return ret;
}
 
@@ -360,8 +358,7 @@ static int ltk050h3146w_a2_write_page(struct ltk050h3146w 
*ctx, int page,
 
ret = ltk050h3146w_a2_select_page(ctx, page);
if (ret < 0) {
-   DRM_DEV_ERROR(ctx->dev, "failed to select page %d: %d\n",
- page, ret);
+   dev_err(ctx->dev, "failed to select page %d: %d\n", page, ret);
return ret;
}
 
@@ -369,9 +366,7 @@ static int ltk050h3146w_a2_write_page(struct ltk050h3146w 
*ctx, int page,
ret = mipi_dsi_generic_write(dsi, [i],
 sizeof(struct ltk050h3146w_cmd));
if (ret < 0) {
-   DRM_DEV_ERROR(ctx->dev,
- "failed to write page %d init cmds: %d\n",
-  page, ret);
+   dev_err(ctx->dev, "failed to write page %d init cmds: 
%d\n", page, ret);
return ret;
}
}
@@ -405,15 +400,14 @@ static int ltk050h3146w_a2_init_sequence(struct 
ltk050h3146w *ctx)
 
ret = ltk050h3146w_a2_select_page(ctx, 0);
if (ret < 0) {
-   DRM_DEV_ERROR(ctx->dev, "failed to select page 0: %d\n", ret);
+   dev_err(ctx->dev, "failed to select page 0: %d\n", ret);
return ret;
}
 
/* vendor code called this without param, where there should be one */
ret = mipi_dsi_dcs_set_tear_on(dsi, 0);
if (ret < 0) {
-   DRM_DEV_ERROR(ctx->dev, "failed to set tear on: %d\n",
- ret);
+   dev_err(ctx->dev, "failed to set tear on: %d\n", ret);
return ret;
}
 
@@ -452,15 +446,13 @@ static int ltk050h3146w_unprepare(struct drm_panel *panel)
 
ret = mipi_dsi_dcs_set_display_off(dsi);
if (ret < 0) {
-   DRM_DEV_ERROR(ctx->dev, "failed to set display off: %d\n",
- ret);
+   dev_err(ctx->dev, "failed to set display off: %d\n", ret);
return ret;
}
 
mipi_dsi_dcs_enter_sleep_mode(dsi);
if (ret < 0) {
-   DRM_DEV_ERROR(ctx->dev, "failed to enter sleep mode: %d\n",
- ret);
+   dev_err(ctx->dev, "failed to enter sleep mode: %d\n", ret);
return ret;
}
 
@@ -481,17 +473,15 @@ static int ltk050h3146w_prepare(struct drm_panel *panel)
if (ctx->prepared)
return 0;
 
-   DRM_DEV_DEBUG_DRIVER(ctx->dev, "Resetting the panel\n");
+   dev_dbg(ctx->dev, "Resetting the panel\n");
ret = regulator_enable(ctx->vci);
if (ret < 0) {
-   DRM_DEV_ERROR(ctx->dev,
- "Failed to enable vci supply: %d\n", ret);
+   dev_err(ctx->dev, "Failed to enable vci supply: %d\n", ret);
return ret;
}
ret = regulator_enable(ctx->iovcc);
if (ret < 0) {
-   DRM_DEV_ERROR(ctx->dev,
- "Failed to enable iovcc supply: %d\n", ret);
+   dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret);
goto disable_vci;
}
 
@@ -502,14 +492,13 @@ static int ltk050h3146w_prepare(struct drm_panel *panel)
 
ret = ctx->panel_desc->init(ctx);
if (ret < 0) {
-   DRM_DEV_ERROR(ctx->dev, "Panel init sequence failed: %d\n",
- ret);
+   dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret);
goto disable_iovcc;
}
 
ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
if (ret < 0) {
-   DRM_DEV_ERROR(ctx->dev, "Failed to exit sleep 

Re: [PATCH 3/3] drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel

2020-08-15 Thread Sam Ravnborg
On Sat, Aug 15, 2020 at 12:40:22PM +0200, Guido Günther wrote:
> Hi Sam,
> On Sat, Aug 15, 2020 at 12:02:30PM +0200, Sam Ravnborg wrote:
> > Hi Guido.
> > 
> > > +static int mantix_probe(struct mipi_dsi_device *dsi)
> > > +{
> > > + struct device *dev = >dev;
> > > + struct mantix *ctx;
> > > + int ret;
> > > +
> > > + ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
> > > + if (!ctx)
> > > + return -ENOMEM;
> > > +
> > > + ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
> > > + if (IS_ERR(ctx->reset_gpio)) {
> > > + DRM_DEV_ERROR(dev, "cannot get reset gpio\n");
> > > + return PTR_ERR(ctx->reset_gpio);
> > > + }
> > > +
> > > + mipi_dsi_set_drvdata(dsi, ctx);
> > > + ctx->dev = dev;
> > > +
> > > + dsi->lanes = 4;
> > > + dsi->format = MIPI_DSI_FMT_RGB888;
> > > + dsi->mode_flags = MIPI_DSI_MODE_VIDEO |
> > > + MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
> > > +
> > > + ctx->avdd = devm_regulator_get(dev, "avdd");
> > > + if (IS_ERR(ctx->avdd)) {
> > > + ret = PTR_ERR(ctx->avdd);
> > > + if (ret != -EPROBE_DEFER)
> > > + DRM_DEV_ERROR(dev,
> > > +   "Failed to request avdd regulator: %d\n",
> > > +   ret);
> > > + return ret;
> > > + }
> > 
> > Consider to use the recently added dev_err_probe() here and below.
> > Note: Not part of drm-misc-next yet - but hopefully after -rc1
> > when a backmerge is done.
> 
> In fact I did decided against it since i was told that missing dev_* and
> DRM_* logging shouldn't be done. So is that o.k. nowadays?
s/missing/mixing/

I often request that logging is consistent - so I recognize the
argument.

For panel/* I have not made up my mind what I think is the best
approach. The DRM_DEV_* and DRM_* logging do not add much value.
So I have been tempted several times to convert all logging in
panel/ to dev_* and pr_* (when no struct device * is available).
That would also avoid that we mix up logging.

We have drm_* logging - but they require a valid drm_device * which we
do not have in the the panel drivers. So they are ruled out here.

Do you have any opinions/comments on this?

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 3/3] drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel

2020-08-15 Thread Guido Günther
Hi Sam,
On Sat, Aug 15, 2020 at 12:02:30PM +0200, Sam Ravnborg wrote:
> Hi Guido.
> 
> > +static int mantix_probe(struct mipi_dsi_device *dsi)
> > +{
> > +   struct device *dev = >dev;
> > +   struct mantix *ctx;
> > +   int ret;
> > +
> > +   ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
> > +   if (!ctx)
> > +   return -ENOMEM;
> > +
> > +   ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
> > +   if (IS_ERR(ctx->reset_gpio)) {
> > +   DRM_DEV_ERROR(dev, "cannot get reset gpio\n");
> > +   return PTR_ERR(ctx->reset_gpio);
> > +   }
> > +
> > +   mipi_dsi_set_drvdata(dsi, ctx);
> > +   ctx->dev = dev;
> > +
> > +   dsi->lanes = 4;
> > +   dsi->format = MIPI_DSI_FMT_RGB888;
> > +   dsi->mode_flags = MIPI_DSI_MODE_VIDEO |
> > +   MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
> > +
> > +   ctx->avdd = devm_regulator_get(dev, "avdd");
> > +   if (IS_ERR(ctx->avdd)) {
> > +   ret = PTR_ERR(ctx->avdd);
> > +   if (ret != -EPROBE_DEFER)
> > +   DRM_DEV_ERROR(dev,
> > + "Failed to request avdd regulator: %d\n",
> > + ret);
> > +   return ret;
> > +   }
> 
> Consider to use the recently added dev_err_probe() here and below.
> Note: Not part of drm-misc-next yet - but hopefully after -rc1
> when a backmerge is done.

In fact I did decided against it since i was told that missing dev_* and
DRM_* logging shouldn't be done. So is that o.k. nowadays?
Cheers,
 -- Guido

> 
>   Sam
> 
> > +   ctx->avee = devm_regulator_get(dev, "avee");
> > +   if (IS_ERR(ctx->avee)) {
> > +   ret = PTR_ERR(ctx->avee);
> > +   if (ret != -EPROBE_DEFER)
> > +   DRM_DEV_ERROR(dev,
> > + "Failed to request avee regulator: %d\n",
> > + ret);
> > +   return ret;
> > +   }
> > +   ctx->vddi = devm_regulator_get(dev, "vddi");
> > +   if (IS_ERR(ctx->vddi)) {
> > +   ret = PTR_ERR(ctx->vddi);
> > +   if (ret != -EPROBE_DEFER)
> > +   DRM_DEV_ERROR(dev,
> > + "Failed to request vddi regulator: %d\n",
> > + ret);
> > +   return ret;
> > +   }
> > +
> > +   drm_panel_init(>panel, dev, _drm_funcs,
> > +  DRM_MODE_CONNECTOR_DSI);
> > +
> > +   ret = drm_panel_of_backlight(>panel);
> > +   if (ret)
> > +   return ret;
> > +   drm_panel_add(>panel);
> > +
> > +   ret = mipi_dsi_attach(dsi);
> > +   if (ret < 0) {
> > +   DRM_DEV_ERROR(dev,
> > + "mipi_dsi_attach failed (%d). Is host ready?\n",
> > + ret);
> > +   drm_panel_remove(>panel);
> > +   return ret;
> > +   }
> > +
> > +   DRM_DEV_INFO(dev, "%ux%u@%u %ubpp dsi %udl - ready\n",
> > +default_mode.hdisplay, default_mode.vdisplay,
> > +drm_mode_vrefresh(_mode),
> > +mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes);
> > +
> > +   return 0;
> > +}
> > +
> > +static void mantix_shutdown(struct mipi_dsi_device *dsi)
> > +{
> > +   struct mantix *ctx = mipi_dsi_get_drvdata(dsi);
> > +   int ret;
> > +
> > +   ret = drm_panel_unprepare(>panel);
> > +   if (ret < 0)
> > +   DRM_DEV_ERROR(>dev, "Failed to unprepare panel: %d\n",
> > + ret);
> > +
> > +   ret = drm_panel_disable(>panel);
> > +   if (ret < 0)
> > +   DRM_DEV_ERROR(>dev, "Failed to disable panel: %d\n",
> > + ret);
> > +}
> > +
> > +static int mantix_remove(struct mipi_dsi_device *dsi)
> > +{
> > +   struct mantix *ctx = mipi_dsi_get_drvdata(dsi);
> > +   int ret;
> > +
> > +   mantix_shutdown(dsi);
> > +
> > +   ret = mipi_dsi_detach(dsi);
> > +   if (ret < 0)
> > +   DRM_DEV_ERROR(>dev, "Failed to detach from DSI host: %d\n",
> > + ret);
> > +
> > +   drm_panel_remove(>panel);
> > +
> > +   return 0;
> > +}
> > +
> > +static const struct of_device_id mantix_of_match[] = {
> > +   { .compatible = "mantix,mlaf057we51-x" },
> > +   { /* sentinel */ }
> > +};
> > +MODULE_DEVICE_TABLE(of, mantix_of_match);
> > +
> > +static struct mipi_dsi_driver mantix_driver = {
> > +   .probe  = mantix_probe,
> > +   .remove = mantix_remove,
> > +   .shutdown = mantix_shutdown,
> > +   .driver = {
> > +   .name = DRV_NAME,
> > +   .of_match_table = mantix_of_match,
> > +   },
> > +};
> > +module_mipi_dsi_driver(mantix_driver);
> > +
> > +MODULE_AUTHOR("Guido Günther ");
> > +MODULE_DESCRIPTION("DRM driver for Mantix MLAF057WE51-X MIPI DSI panel");
> > +MODULE_LICENSE("GPL v2");
> > -- 
> > 2.26.2
> > 
> > ___
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
___

Re: [PATCH 3/3] drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel

2020-08-15 Thread Sam Ravnborg
Hi Guido.

> +static int mantix_probe(struct mipi_dsi_device *dsi)
> +{
> + struct device *dev = >dev;
> + struct mantix *ctx;
> + int ret;
> +
> + ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
> + if (!ctx)
> + return -ENOMEM;
> +
> + ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
> + if (IS_ERR(ctx->reset_gpio)) {
> + DRM_DEV_ERROR(dev, "cannot get reset gpio\n");
> + return PTR_ERR(ctx->reset_gpio);
> + }
> +
> + mipi_dsi_set_drvdata(dsi, ctx);
> + ctx->dev = dev;
> +
> + dsi->lanes = 4;
> + dsi->format = MIPI_DSI_FMT_RGB888;
> + dsi->mode_flags = MIPI_DSI_MODE_VIDEO |
> + MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
> +
> + ctx->avdd = devm_regulator_get(dev, "avdd");
> + if (IS_ERR(ctx->avdd)) {
> + ret = PTR_ERR(ctx->avdd);
> + if (ret != -EPROBE_DEFER)
> + DRM_DEV_ERROR(dev,
> +   "Failed to request avdd regulator: %d\n",
> +   ret);
> + return ret;
> + }

Consider to use the recently added dev_err_probe() here and below.
Note: Not part of drm-misc-next yet - but hopefully after -rc1
when a backmerge is done.

Sam

> + ctx->avee = devm_regulator_get(dev, "avee");
> + if (IS_ERR(ctx->avee)) {
> + ret = PTR_ERR(ctx->avee);
> + if (ret != -EPROBE_DEFER)
> + DRM_DEV_ERROR(dev,
> +   "Failed to request avee regulator: %d\n",
> +   ret);
> + return ret;
> + }
> + ctx->vddi = devm_regulator_get(dev, "vddi");
> + if (IS_ERR(ctx->vddi)) {
> + ret = PTR_ERR(ctx->vddi);
> + if (ret != -EPROBE_DEFER)
> + DRM_DEV_ERROR(dev,
> +   "Failed to request vddi regulator: %d\n",
> +   ret);
> + return ret;
> + }
> +
> + drm_panel_init(>panel, dev, _drm_funcs,
> +DRM_MODE_CONNECTOR_DSI);
> +
> + ret = drm_panel_of_backlight(>panel);
> + if (ret)
> + return ret;
> + drm_panel_add(>panel);
> +
> + ret = mipi_dsi_attach(dsi);
> + if (ret < 0) {
> + DRM_DEV_ERROR(dev,
> +   "mipi_dsi_attach failed (%d). Is host ready?\n",
> +   ret);
> + drm_panel_remove(>panel);
> + return ret;
> + }
> +
> + DRM_DEV_INFO(dev, "%ux%u@%u %ubpp dsi %udl - ready\n",
> +  default_mode.hdisplay, default_mode.vdisplay,
> +  drm_mode_vrefresh(_mode),
> +  mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes);
> +
> + return 0;
> +}
> +
> +static void mantix_shutdown(struct mipi_dsi_device *dsi)
> +{
> + struct mantix *ctx = mipi_dsi_get_drvdata(dsi);
> + int ret;
> +
> + ret = drm_panel_unprepare(>panel);
> + if (ret < 0)
> + DRM_DEV_ERROR(>dev, "Failed to unprepare panel: %d\n",
> +   ret);
> +
> + ret = drm_panel_disable(>panel);
> + if (ret < 0)
> + DRM_DEV_ERROR(>dev, "Failed to disable panel: %d\n",
> +   ret);
> +}
> +
> +static int mantix_remove(struct mipi_dsi_device *dsi)
> +{
> + struct mantix *ctx = mipi_dsi_get_drvdata(dsi);
> + int ret;
> +
> + mantix_shutdown(dsi);
> +
> + ret = mipi_dsi_detach(dsi);
> + if (ret < 0)
> + DRM_DEV_ERROR(>dev, "Failed to detach from DSI host: %d\n",
> +   ret);
> +
> + drm_panel_remove(>panel);
> +
> + return 0;
> +}
> +
> +static const struct of_device_id mantix_of_match[] = {
> + { .compatible = "mantix,mlaf057we51-x" },
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, mantix_of_match);
> +
> +static struct mipi_dsi_driver mantix_driver = {
> + .probe  = mantix_probe,
> + .remove = mantix_remove,
> + .shutdown = mantix_shutdown,
> + .driver = {
> + .name = DRV_NAME,
> + .of_match_table = mantix_of_match,
> + },
> +};
> +module_mipi_dsi_driver(mantix_driver);
> +
> +MODULE_AUTHOR("Guido Günther ");
> +MODULE_DESCRIPTION("DRM driver for Mantix MLAF057WE51-X MIPI DSI panel");
> +MODULE_LICENSE("GPL v2");
> -- 
> 2.26.2
> 
> ___
> 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


Re: [PATCH 3/3] drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel

2020-08-15 Thread Sam Ravnborg
Hi Guido.

On Fri, Aug 14, 2020 at 03:36:23PM +0200, Guido Günther wrote:
> The panel uses a Focaltech FT8006p, the touch part is handled by the
> already existing edt-ft5x06.
> 
> Signed-off-by: Guido Günther 

Looks good.
A few notes in the following, nothing major.

Sam

> ---
>  MAINTAINERS   |   7 +
>  drivers/gpu/drm/panel/Kconfig |  11 +
>  drivers/gpu/drm/panel/Makefile|   1 +
>  .../gpu/drm/panel/panel-mantix-mlaf057we51.c  | 362 ++
>  4 files changed, 381 insertions(+)
>  create mode 100644 drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 83ba7b62651f7..7dfe4cc3d4ec8 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -5474,6 +5474,13 @@ S: Maintained
>  F:   drivers/gpu/drm/panel/panel-lvds.c
>  F:   Documentation/devicetree/bindings/display/panel/lvds.yaml
>  
> +DRM DRIVER FOR MANTIX MLAF057WE51 PANELS
> +M:   Guido Günther 
> +R:   Purism Kernel Team 
> +S:   Maintained
> +F:   
> Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> +F:   drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
> +
>  DRM DRIVER FOR MATROX G200/G400 GRAPHICS CARDS
>  S:   Orphan / Obsolete
>  F:   drivers/gpu/drm/mga/
> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> index de2f2a452be55..8d97d07c58713 100644
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -217,6 +217,17 @@ config DRM_PANEL_NOVATEK_NT39016
> Say Y here if you want to enable support for the panels built
> around the Novatek NT39016 display controller.
>  
> +config DRM_PANEL_MANTIX_MLAF057WE51
> + tristate "Mantix MLAF057WE51-X MIPI-DSI LCD panel"
> + depends on OF
> + depends on DRM_MIPI_DSI
> + depends on BACKLIGHT_CLASS_DEVICE
> + help
> +   Say Y here if you want to enable support for the Mantix
> +   MLAF057WE51-X MIPI DSI panel as e.g. used in the Librem 5. It
> +   has a resolution of 720x1440 pixels, a built in backlight and touch
> +   controller.
> +
>  config DRM_PANEL_OLIMEX_LCD_OLINUXINO
>   tristate "Olimex LCD-OLinuXino panel"
>   depends on OF
> diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> index e45ceac6286fd..15a4e77529514 100644
> --- a/drivers/gpu/drm/panel/Makefile
> +++ b/drivers/gpu/drm/panel/Makefile
> @@ -20,6 +20,7 @@ obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
>  obj-$(CONFIG_DRM_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o
>  obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35510) += panel-novatek-nt35510.o
>  obj-$(CONFIG_DRM_PANEL_NOVATEK_NT39016) += panel-novatek-nt39016.o
> +obj-$(CONFIG_DRM_PANEL_MANTIX_MLAF057WE51) += panel-mantix-mlaf057we51.o
>  obj-$(CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO) += panel-olimex-lcd-olinuxino.o
>  obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) += panel-orisetech-otm8009a.o
>  obj-$(CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS) += panel-osd-osd101t2587-53ts.o
> diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c 
> b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
> new file mode 100644
> index 0..6c07bcdb75937
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
> @@ -0,0 +1,362 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Mantix MLAF057WE51 5.7" MIPI-DSI panel driver
> + *
> + * Copyright (C) Purism SPC 2020
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
Include not needed.

> +#include 
> +#include 
> +
> +#include 
I do not think this include is needed

> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define DRV_NAME "panel-mantix-mlaf057we51"
> +
> +/* Manufacturer specific Commands send via DSI */
> +#define MANTIX_CMD_OTP_STOP_RELOAD_MIPI 0x41
> +#define MANTIX_CMD_INT_CANCEL   0x4C
> +
> +struct mantix {
> + struct device *dev;
> + struct drm_panel panel;
> + struct gpio_desc *reset_gpio;
> +
> + struct regulator *avdd;
> + struct regulator *avee;
> + struct regulator *vddi;
> +};
> +
> +static inline struct mantix *panel_to_mantix(struct drm_panel *panel)
> +{
> + return container_of(panel, struct mantix, panel);
> +}
> +
> +#define dsi_generic_write_seq(dsi, seq...) do {  
> \
> + static const u8 d[] = { seq };  \
> + int ret;\
> + ret = mipi_dsi_generic_write(dsi, d, ARRAY_SIZE(d));\
> + if (ret < 0)\
> + return ret; \
> + } while (0)
> +
> +static int mantix_init_sequence(struct mantix *ctx)
> +{
> + struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
> + struct device *dev = ctx->dev;
> +
> + /*
> +  * Init sequence was supplied by the panel vendor.
> +  */
> + 

Re: [PATCH 2/3] dt-bindings: Add Mantix MLAF057WE51-X panel bindings

2020-08-15 Thread Sam Ravnborg
Hi Guido.

On Fri, Aug 14, 2020 at 03:36:22PM +0200, Guido Günther wrote:
> The panel uses a Focaltech FT8006p, the touch part is handled by the
> already existing edt-ft5x06.
> 
> Signed-off-by: Guido Günther 

A few trivialities.

> ---
>  .../display/panel/mantix,mlaf057we51-x.yaml   | 73 +++
>  1 file changed, 73 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> 
> diff --git 
> a/Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml 
> b/Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> new file mode 100644
> index 0..349f3380ac940
> --- /dev/null
> +++ 
> b/Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
> @@ -0,0 +1,73 @@
> +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/panel/mantix,mlaf057we51-x.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Mantix MLAF057WE51-X 5.7" 720x1440 TFT LCD panel
> +
> +maintainers:
> +  - Guido Günther 
> +
> +description: |
> + Mantix MLAF057WE51 X is a 720x1440 TFT LCD panel
> + connected using a MIPI-DSI video interface.
Indent text with two spaces only.
And I have learned that '|' is only needed to preserve formatting - so
it can be dropped.

> +
> +allOf:
> +  - $ref: panel-common.yaml#
> +
> +properties:
> +  compatible:
> +enum:
> +  - mantix,mlaf057we51-x
This is a list - so needs an extra 2 spaces indent.
See 
https://lore.kernel.org/linux-devicetree/f1963eb9-283f-e903-2a3a-4f324d71d...@lucaceresoli.net/T/#m65900317fb948f6c40e8fb521f2201fba3c301a7
for examples where Rob fixes this.

> +
> +  port: true
> +  reg:
> +maxItems: 1
> +description: DSI virtual channel
> +
> +  avdd-supply:
> +description: Positive analog power supply
> +
> +  avee-supply:
> +description: Negative analog power supply
> +
> +  vddi-supply:
> +description: 1.8V I/O voltage supply
> +
> +  reset-gpios:
> +description: GPIO used for the reset pin
> +maxItems: 1
Use reset-gpios: true as we already have it in panel-common.yaml

> +
> +  backlight:
> +description: Backlight used by the panel
> +$ref: "/schemas/types.yaml#/definitions/phandle"
Use backlight from panel-common.yaml.

> +
> +required:
> +  - compatible
> +  - reg
> +  - avdd-supply
> +  - avee-supply
> +  - vddi-supply
> +  - reset-gpios
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +#include 
> +
> +dsi {
My personal preference is indent with 4 spaces in examples but there are
no rules so feel free to ignore.
> +  #address-cells = <1>;
> +  #size-cells = <0>;
> +  panel@0 {
> +compatible = "mantix,mlaf057we51-x";
> +reg = <0>;
> +avdd-supply = <_avdd>;
> +avee-supply = <_avee>;
> +vddi-supply = <_1v8_p>;
> +reset-gpios = < 29 GPIO_ACTIVE_LOW>;
> +backlight = <>;
> +  };
> +};
I think we need an ampty line here.
> +...
> -- 
> 2.26.2
> 
> ___
> 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


Re: [PATCH v2] drm/mcde: Retry DSI read/write transactions

2020-08-15 Thread Stephan Gerhold
On Fri, Aug 14, 2020 at 09:44:51PM +0200, Linus Walleij wrote:
> The vendor driver makes a few retries on read DSI
> transactions, something that is needed especially in
> case of read (such as reading the panel MTP ID) while
> the panel is running in video mode. This happens on
> the Samsung s6e63m0 panel on the Golden device.
> 
> Retry reads and writes alike three times.
> 
> Cc: Stephan Gerhold 
> Signed-off-by: Linus Walleij 
> ---
> ChangeLog v1->v2:
> - Retry three times.
> - Only retry the actual command transmission like the vendor
>   driver does, no need to set up all registers and do checks
>   all over. Break out a part of the mcde_dsi_host_transfer()
>   function to achieve this.
> ---
>  drivers/gpu/drm/mcde/mcde_dsi.c | 158 +++-
>  1 file changed, 92 insertions(+), 66 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c
> index 4ce8cc5f0be2..b3c5d3cbda92 100644
> --- a/drivers/gpu/drm/mcde/mcde_dsi.c
> +++ b/drivers/gpu/drm/mcde/mcde_dsi.c
> @@ -208,79 +208,16 @@ static int mcde_dsi_host_detach(struct mipi_dsi_host 
> *host,
>(type == MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM) || \
>(type == MIPI_DSI_DCS_READ))
>  
> -static ssize_t mcde_dsi_host_transfer(struct mipi_dsi_host *host,
> -   const struct mipi_dsi_msg *msg)
> +static int mcde_dsi_execute_transfer(struct mcde_dsi *d,
> +  const struct mipi_dsi_msg *msg)
>  {
> - struct mcde_dsi *d = host_to_mcde_dsi(host);
>   const u32 loop_delay_us = 10; /* us */
> - const u8 *tx = msg->tx_buf;
>   u32 loop_counter;
>   size_t txlen = msg->tx_len;
>   size_t rxlen = msg->rx_len;
> + int i;
>   u32 val;
>   int ret;
> - int i;
> -
> - if (txlen > 16) {
> - dev_err(d->dev,
> - "dunno how to write more than 16 bytes yet\n");
> - return -EIO;
> - }
> - if (rxlen > 4) {
> - dev_err(d->dev,
> - "dunno how to read more than 4 bytes yet\n");
> - return -EIO;
> - }
> -
> - dev_dbg(d->dev,
> - "message to channel %d, write %zd bytes read %zd bytes\n",
> - msg->channel, txlen, rxlen);
> -
> - /* Command "nature" */
> - if (MCDE_DSI_HOST_IS_READ(msg->type))
> - /* MCTL_MAIN_DATA_CTL already set up */
> - val = DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_NAT_READ;
> - else
> - val = DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_NAT_WRITE;
> - /*
> -  * More than 2 bytes will not fit in a single packet, so it's
> -  * time to set the "long not short" bit. One byte is used by
> -  * the MIPI DCS command leaving just one byte for the payload
> -  * in a short package.
> -  */
> - if (mipi_dsi_packet_format_is_long(msg->type))
> - val |= DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_LONGNOTSHORT;
> - val |= 0 << DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_ID_SHIFT;
> - val |= txlen << DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_SIZE_SHIFT;
> - val |= DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_LP_EN;
> - val |= msg->type << DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_HEAD_SHIFT;
> - writel(val, d->regs + DSI_DIRECT_CMD_MAIN_SETTINGS);
> -
> - /* MIPI DCS command is part of the data */
> - if (txlen > 0) {
> - val = 0;
> - for (i = 0; i < 4 && i < txlen; i++)
> - val |= tx[i] << (i * 8);
> - }
> - writel(val, d->regs + DSI_DIRECT_CMD_WRDAT0);
> - if (txlen > 4) {
> - val = 0;
> - for (i = 0; i < 4 && (i + 4) < txlen; i++)
> - val |= tx[i + 4] << (i * 8);
> - writel(val, d->regs + DSI_DIRECT_CMD_WRDAT1);
> - }
> - if (txlen > 8) {
> - val = 0;
> - for (i = 0; i < 4 && (i + 8) < txlen; i++)
> - val |= tx[i + 8] << (i * 8);
> - writel(val, d->regs + DSI_DIRECT_CMD_WRDAT2);
> - }
> - if (txlen > 12) {
> - val = 0;
> - for (i = 0; i < 4 && (i + 12) < txlen; i++)
> - val |= tx[i + 12] << (i * 8);
> - writel(val, d->regs + DSI_DIRECT_CMD_WRDAT3);
> - }
>  
>   writel(~0, d->regs + DSI_DIRECT_CMD_STS_CLR);
>   writel(~0, d->regs + DSI_CMD_MODE_STS_CLR);
> @@ -297,6 +234,7 @@ static ssize_t mcde_dsi_host_transfer(struct 
> mipi_dsi_host *host,
>   usleep_range(loop_delay_us, (loop_delay_us * 3) / 2);
>   if (!loop_counter) {
>   dev_err(d->dev, "DSI read timeout!\n");
> + /* Set exit code and retry */
>   return -ETIME;
>   }
>   } else {
> @@ -307,6 +245,7 @@ static ssize_t mcde_dsi_host_transfer(struct 
> mipi_dsi_host *host,
>   usleep_range(loop_delay_us, (loop_delay_us * 3) / 2);
>  
>   if (!loop_counter) {
> + 

[Bug 208909] New: amdgpu Ryzen 7 4700U NULL pointer dereference multi monitor with rotation

2020-08-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=208909

Bug ID: 208909
   Summary: amdgpu Ryzen 7 4700U NULL pointer dereference multi
monitor with rotation
   Product: Drivers
   Version: 2.5
Kernel Version: 5.8.0-050800-generic
  Hardware: x86-64
OS: Linux
  Tree: Mainline
Status: NEW
  Severity: normal
  Priority: P1
 Component: Video(DRI - non Intel)
  Assignee: drivers_video-...@kernel-bugs.osdl.org
  Reporter: ker...@890.at
Regression: No

Created attachment 290909
  --> https://bugzilla.kernel.org/attachment.cgi?id=290909=edit
dmesg output

Hi,

I have a lenovo E15 gen2 laptop running, with a Ryzen 7 4700U renoir Vega 7, on
a 5.8 ubuntu mainline kernel including the latest firmware files (git).

System seems stable so far when running 2 monitors (internal display, and
external display on DP).

When adding a third monitor on the HDMI output and rotating this monitor, the
system crashes with a null pointer dereference.


any help would be appreciated

cheers

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel