Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1423112 > unrolled thread

[PATCH v5 0/3] Add support for ARM Mali Display Processors

Started byLiviu Dudau <Liviu.Dudau@arm.com>
First post2016-06-15 17:00 +0200
Last post2016-06-16 10:00 +0200
Articles 15 — 5 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v5 0/3] Add support for ARM Mali Display Processors Liviu Dudau <Liviu.Dudau@arm.com> - 2016-06-15 17:00 +0200
    [PATCH v5 3/3] MAINTAINERS: Add entry for Mali-DP driver Liviu Dudau <Liviu.Dudau@arm.com> - 2016-06-15 17:00 +0200
      Re: [PATCH v5 3/3] MAINTAINERS: Add entry for Mali-DP driver Eric Engestrom <eric.engestrom@imgtec.com> - 2016-06-15 17:40 +0200
        Re: [PATCH v5 3/3] MAINTAINERS: Add entry for Mali-DP driver Daniel Vetter <daniel@ffwll.ch> - 2016-06-15 18:20 +0200
          Re: [PATCH v5 3/3] MAINTAINERS: Add entry for Mali-DP driver Liviu Dudau <Liviu.Dudau@arm.com> - 2016-06-15 18:30 +0200
    Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors Daniel Vetter <daniel@ffwll.ch> - 2016-06-15 19:20 +0200
      Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors Daniel Vetter <daniel@ffwll.ch> - 2016-06-15 19:20 +0200
      Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors Liviu Dudau <Liviu.Dudau@arm.com> - 2016-06-15 19:30 +0200
        Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors Chris Wilson <chris@chris-wilson.co.uk> - 2016-06-15 19:40 +0200
          Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors Liviu Dudau <Liviu.Dudau@arm.com> - 2016-06-15 19:50 +0200
        Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors Daniel Vetter <daniel@ffwll.ch> - 2016-06-15 21:30 +0200
          Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-06-15 22:10 +0200
            Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors Daniel Vetter <daniel@ffwll.ch> - 2016-06-15 22:40 +0200
        Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-06-15 22:20 +0200
          Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors Liviu Dudau <Liviu.Dudau@arm.com> - 2016-06-16 10:00 +0200

#1423112 — [PATCH v5 0/3] Add support for ARM Mali Display Processors

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2016-06-15 17:00 +0200
Subject[PATCH v5 0/3] Add support for ARM Mali Display Processors
Message-ID<rKksp-3QZ-21@gated-at.bofh.it>
Hello,

This is the fifth revision of the driver for the Mali Display Processors (Mali DP).
Currently, the driver supports the Display Engine found in Mali DP500, DP550
and DP650, with up to 3 planes that can be rotated by the hardware. There are
features that the hardware supports that are not currently implemented in the
driver, but in the current form it is capable of supporting X11 using fbdev
emulation as well as Wayland with pixman rendering.

A copy of the patchset has been published here:

git://linux-arm.org/linux-ld.git for-upstream/mali-dp

Daniel's non-blocking series is now on drm-misc so this branch is based on that
(tag topic/drm-misc-2016-06-14). Correct functionality of the driver depends on
two other patches from Daniel [1][2].

I will add my branch to linux-next soon.

Changes in v5:
 - Call drm_atomic_helper_commit_planes() with active_only = true, rather than false.
 - Add missing drm_crtc_vblank_{on,off} calls in malidp_crtc_{enable,disable}

Changes in v4:
 - Removed check for active crtc in malidp_crtc_disable() as this was unnecessary
 - Moved the dispatching of state events from malidp_crtc_atomic_flush() into the
   malidp_atomic_commit_hw_done() function where we can guarantee the GO status bit
   has been raised by the HW.
 - Used gem_free_object_unlocked hook instead of gem_free_object one.
 - Introduce a malidp_state structure to track per plane->state data related to the
   rotation memory usage so as not to break the TEST_ONLY atomic commits.

Changes in v3:
 - rebased on top of Daniel Vetter's drm/stuff branch that implements non-blocking
   atomic commits.
 - Addressed comments from Emil Velikov's review
 - Re-ordered the malidp_hw_regmap struct to eliminate the un-needed padding
 - Lots more functions made static if they are not shared
 - Planes are now allocated with vanilla kzalloc() rather than devm_kzalloc() and
   freed in malidp_de_planes_destroy()

Changes in v2 vs initial RFC:
 - merged malidp_crtc_mode_set_nofb into malidp_crtc_enable and removed the
   mode_set hooks. This removed the need for a custom destroy hook as well,
   switched to using drm_crtc_cleanup for that.
 - implemented proper async support for atomic page flip.
 - removed un-necessary checks and empty hooks.
 - clarifications in the bindings document for the use of interrupt-names.
 - removed the MALIDP_HW_FEATURE_DS (display split) from this version pending
   further development
 - Renamed module from malidp to mali-dp.
 - Added MAINTAINERS update

Many thanks,
Liviu

[1] https://lists.freedesktop.org/archives/dri-devel/2016-June/110855.html
[2] https://lists.freedesktop.org/archives/dri-devel/2016-June/110922.html


Liviu Dudau (3):
  dt/bindings: display: Add DT bindings for Mali Display Processors.
  drm/arm: Add support for Mali Display Processors
  MAINTAINERS: Add entry for Mali-DP driver

 .../devicetree/bindings/display/arm,malidp.txt     |  65 ++
 MAINTAINERS                                        |  10 +-
 drivers/gpu/drm/arm/Kconfig                        |  16 +
 drivers/gpu/drm/arm/Makefile                       |   2 +
 drivers/gpu/drm/arm/malidp_crtc.c                  | 216 +++++++
 drivers/gpu/drm/arm/malidp_drv.c                   | 512 +++++++++++++++
 drivers/gpu/drm/arm/malidp_drv.h                   |  54 ++
 drivers/gpu/drm/arm/malidp_hw.c                    | 691 +++++++++++++++++++++
 drivers/gpu/drm/arm/malidp_hw.h                    | 241 +++++++
 drivers/gpu/drm/arm/malidp_planes.c                | 298 +++++++++
 drivers/gpu/drm/arm/malidp_regs.h                  | 172 +++++
 11 files changed, 2276 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/display/arm,malidp.txt
 create mode 100644 drivers/gpu/drm/arm/malidp_crtc.c
 create mode 100644 drivers/gpu/drm/arm/malidp_drv.c
 create mode 100644 drivers/gpu/drm/arm/malidp_drv.h
 create mode 100644 drivers/gpu/drm/arm/malidp_hw.c
 create mode 100644 drivers/gpu/drm/arm/malidp_hw.h
 create mode 100644 drivers/gpu/drm/arm/malidp_planes.c
 create mode 100644 drivers/gpu/drm/arm/malidp_regs.h

-- 
2.8.2

[toc] | [next] | [standalone]


#1423116 — [PATCH v5 3/3] MAINTAINERS: Add entry for Mali-DP driver

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2016-06-15 17:00 +0200
Subject[PATCH v5 3/3] MAINTAINERS: Add entry for Mali-DP driver
Message-ID<rKksq-3QZ-43@gated-at.bofh.it>
In reply to#1423112
Add MAINTAINERS entry for ARM Mali-DP driver and update the
HDLCD file matching pattern to cover only HDLCD rather than
the whole drivers/gpu/drm/arm directory.

Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
---
 MAINTAINERS | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 0bf119c..16deb07 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -865,9 +865,17 @@ F:	Documentation/devicetree/bindings/display/snps,arcpgu.txt
 ARM HDLCD DRM DRIVER
 M:	Liviu Dudau <liviu.dudau@arm.com>
 S:	Supported
-F:	drivers/gpu/drm/arm/
+F:	drivers/gpu/drm/arm/hdlcd_*
 F:	Documentation/devicetree/bindings/display/arm,hdlcd.txt
 
+ARM MALI-DP DRM DRIVER
+M:	Liviu Dudau <liviu.dudau@arm.com>
+M:	Brian Starkey <brian.starkey@arm.com>
+M:	Mali DP Maintainers <malidp@foss.arm.com>
+S:	Supported
+F:	drivers/gpu/drm/arm/
+F:	Documentation/devicetree/bindings/display/arm,malidp.txt
+
 ARM MFM AND FLOPPY DRIVERS
 M:	Ian Molton <spyro@f2s.com>
 S:	Maintained
-- 
2.8.2

[toc] | [prev] | [next] | [standalone]


#1423145 — Re: [PATCH v5 3/3] MAINTAINERS: Add entry for Mali-DP driver

FromEric Engestrom <eric.engestrom@imgtec.com>
Date2016-06-15 17:40 +0200
SubjectRe: [PATCH v5 3/3] MAINTAINERS: Add entry for Mali-DP driver
Message-ID<rKl58-4l9-31@gated-at.bofh.it>
In reply to#1423116
On Wed, Jun 15, 2016 at 03:51:35PM +0100, Liviu Dudau wrote:
> Add MAINTAINERS entry for ARM Mali-DP driver and update the
> HDLCD file matching pattern to cover only HDLCD rather than
> the whole drivers/gpu/drm/arm directory.
> 
> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
> ---
>  MAINTAINERS | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 0bf119c..16deb07 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -865,9 +865,17 @@ F:	Documentation/devicetree/bindings/display/snps,arcpgu.txt
>  ARM HDLCD DRM DRIVER
>  M:	Liviu Dudau <liviu.dudau@arm.com>
>  S:	Supported
> -F:	drivers/gpu/drm/arm/
> +F:	drivers/gpu/drm/arm/hdlcd_*
>  F:	Documentation/devicetree/bindings/display/arm,hdlcd.txt
>  
> +ARM MALI-DP DRM DRIVER
> +M:	Liviu Dudau <liviu.dudau@arm.com>
> +M:	Brian Starkey <brian.starkey@arm.com>
> +M:	Mali DP Maintainers <malidp@foss.arm.com>
> +S:	Supported
> +F:	drivers/gpu/drm/arm/

IIUC this will also catch `drivers/gpu/drm/arm/hdlcd_*`.
Did you mean `drivers/gpu/drm/arm/malidp_*` ?

> +F:	Documentation/devicetree/bindings/display/arm,malidp.txt
> +
>  ARM MFM AND FLOPPY DRIVERS
>  M:	Ian Molton <spyro@f2s.com>
>  S:	Maintained
> -- 
> 2.8.2

[toc] | [prev] | [next] | [standalone]


#1423198 — Re: [PATCH v5 3/3] MAINTAINERS: Add entry for Mali-DP driver

FromDaniel Vetter <daniel@ffwll.ch>
Date2016-06-15 18:20 +0200
SubjectRe: [PATCH v5 3/3] MAINTAINERS: Add entry for Mali-DP driver
Message-ID<rKlHP-4PC-5@gated-at.bofh.it>
In reply to#1423145
On Wed, Jun 15, 2016 at 04:35:24PM +0100, Eric Engestrom wrote:
> On Wed, Jun 15, 2016 at 03:51:35PM +0100, Liviu Dudau wrote:
> > Add MAINTAINERS entry for ARM Mali-DP driver and update the
> > HDLCD file matching pattern to cover only HDLCD rather than
> > the whole drivers/gpu/drm/arm directory.
> > 
> > Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
> > ---
> >  MAINTAINERS | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> > 
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 0bf119c..16deb07 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -865,9 +865,17 @@ F:	Documentation/devicetree/bindings/display/snps,arcpgu.txt
> >  ARM HDLCD DRM DRIVER
> >  M:	Liviu Dudau <liviu.dudau@arm.com>
> >  S:	Supported
> > -F:	drivers/gpu/drm/arm/
> > +F:	drivers/gpu/drm/arm/hdlcd_*
> >  F:	Documentation/devicetree/bindings/display/arm,hdlcd.txt
> >  
> > +ARM MALI-DP DRM DRIVER
> > +M:	Liviu Dudau <liviu.dudau@arm.com>
> > +M:	Brian Starkey <brian.starkey@arm.com>
> > +M:	Mali DP Maintainers <malidp@foss.arm.com>
> > +S:	Supported
> > +F:	drivers/gpu/drm/arm/
> 
> IIUC this will also catch `drivers/gpu/drm/arm/hdlcd_*`.
> Did you mean `drivers/gpu/drm/arm/malidp_*` ?

Or just merge it and create one entry for all ARM drm drivers?
-Daniel

> 
> > +F:	Documentation/devicetree/bindings/display/arm,malidp.txt
> > +
> >  ARM MFM AND FLOPPY DRIVERS
> >  M:	Ian Molton <spyro@f2s.com>
> >  S:	Maintained
> > -- 
> > 2.8.2

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

[toc] | [prev] | [next] | [standalone]


#1423206 — Re: [PATCH v5 3/3] MAINTAINERS: Add entry for Mali-DP driver

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2016-06-15 18:30 +0200
SubjectRe: [PATCH v5 3/3] MAINTAINERS: Add entry for Mali-DP driver
Message-ID<rKlRw-4SQ-7@gated-at.bofh.it>
In reply to#1423198
On Wed, Jun 15, 2016 at 06:12:08PM +0200, Daniel Vetter wrote:
> On Wed, Jun 15, 2016 at 04:35:24PM +0100, Eric Engestrom wrote:
> > On Wed, Jun 15, 2016 at 03:51:35PM +0100, Liviu Dudau wrote:
> > > Add MAINTAINERS entry for ARM Mali-DP driver and update the
> > > HDLCD file matching pattern to cover only HDLCD rather than
> > > the whole drivers/gpu/drm/arm directory.
> > > 
> > > Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
> > > ---
> > >  MAINTAINERS | 10 +++++++++-
> > >  1 file changed, 9 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/MAINTAINERS b/MAINTAINERS
> > > index 0bf119c..16deb07 100644
> > > --- a/MAINTAINERS
> > > +++ b/MAINTAINERS
> > > @@ -865,9 +865,17 @@ F:	Documentation/devicetree/bindings/display/snps,arcpgu.txt
> > >  ARM HDLCD DRM DRIVER
> > >  M:	Liviu Dudau <liviu.dudau@arm.com>
> > >  S:	Supported
> > > -F:	drivers/gpu/drm/arm/
> > > +F:	drivers/gpu/drm/arm/hdlcd_*
> > >  F:	Documentation/devicetree/bindings/display/arm,hdlcd.txt
> > >  
> > > +ARM MALI-DP DRM DRIVER
> > > +M:	Liviu Dudau <liviu.dudau@arm.com>
> > > +M:	Brian Starkey <brian.starkey@arm.com>
> > > +M:	Mali DP Maintainers <malidp@foss.arm.com>
> > > +S:	Supported
> > > +F:	drivers/gpu/drm/arm/
> > 
> > IIUC this will also catch `drivers/gpu/drm/arm/hdlcd_*`.
> > Did you mean `drivers/gpu/drm/arm/malidp_*` ?

Emil Velikov commented on this as well on the v2 version.

Because the HDLCD comes first it will catch the hdlcd_* ones (note that path is updated
as well).

> 
> Or just merge it and create one entry for all ARM drm drivers?

It might happen in the end, but I would like to reduce the burden on the rest
of the team with a driver where I have most of the knowledge.

Best regards,
Liviu

> -Daniel
> 
> > 
> > > +F:	Documentation/devicetree/bindings/display/arm,malidp.txt
> > > +
> > >  ARM MFM AND FLOPPY DRIVERS
> > >  M:	Ian Molton <spyro@f2s.com>
> > >  S:	Maintained
> > > -- 
> > > 2.8.2
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

[toc] | [prev] | [next] | [standalone]


#1423248 — Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors

FromDaniel Vetter <daniel@ffwll.ch>
Date2016-06-15 19:20 +0200
SubjectRe: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors
Message-ID<rKmDU-5r2-7@gated-at.bofh.it>
In reply to#1423112
On Wed, Jun 15, 2016 at 6:17 PM, Liviu Dudau <Liviu.Dudau@arm.com> wrote:
> On Wed, Jun 15, 2016 at 05:23:10PM +0200, Daniel Vetter wrote:
>> On Wed, Jun 15, 2016 at 03:51:34PM +0100, Liviu Dudau wrote:
>> > Add support for the new family of Display Processors from ARM Ltd.
>> > This commit adds basic support for Mali DP500, DP550 and DP650
>> > parts, with only the display engine being supported at the moment.
>> >
>> > Cc: David Brown <David.Brown@arm.com>
>> > Cc: Brian Starkey <Brian.Starkey@arm.com>
>> >
>> > Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
>>
>> Small thing I noticed: drm_dev_register/connector_register_all should be
>> the last step in your init code, and unregister the first. Atm it's
>> somewhere in the middle. But perfectly fine to do that as a follow-up.
>
> I've tried that, but the connector and encoder that gets registered as part
> of the component_bind_all() fails if there is no drm dev registered. You did
> comment on the v4 version about that and I did test your idea, sorry for
> forgeting to update you on that.

Why does it fail? That shouldn't happen ... we need to be able to set
up everything first, before we register.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

[toc] | [prev] | [next] | [standalone]


#1423251 — Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors

FromDaniel Vetter <daniel@ffwll.ch>
Date2016-06-15 19:20 +0200
SubjectRe: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors
Message-ID<rKmDU-5r2-37@gated-at.bofh.it>
In reply to#1423248
On Wed, Jun 15, 2016 at 7:13 PM, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, Jun 15, 2016 at 6:17 PM, Liviu Dudau <Liviu.Dudau@arm.com> wrote:
>> On Wed, Jun 15, 2016 at 05:23:10PM +0200, Daniel Vetter wrote:
>>> On Wed, Jun 15, 2016 at 03:51:34PM +0100, Liviu Dudau wrote:
>>> > Add support for the new family of Display Processors from ARM Ltd.
>>> > This commit adds basic support for Mali DP500, DP550 and DP650
>>> > parts, with only the display engine being supported at the moment.
>>> >
>>> > Cc: David Brown <David.Brown@arm.com>
>>> > Cc: Brian Starkey <Brian.Starkey@arm.com>
>>> >
>>> > Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
>>>
>>> Small thing I noticed: drm_dev_register/connector_register_all should be
>>> the last step in your init code, and unregister the first. Atm it's
>>> somewhere in the middle. But perfectly fine to do that as a follow-up.
>>
>> I've tried that, but the connector and encoder that gets registered as part
>> of the component_bind_all() fails if there is no drm dev registered. You did
>> comment on the v4 version about that and I did test your idea, sorry for
>> forgeting to update you on that.
>
> Why does it fail? That shouldn't happen ... we need to be able to set
> up everything first, before we register.

To clarify: As soon as drm_dev_register completes userspace can access
the drm_device instance. If you add/init anything like crtc, planes or
encoders later on it can blow up, since drm doesn't support hot-adding
those at all. Therefore you _must_ delay the registering until all
components are set up.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

[toc] | [prev] | [next] | [standalone]


#1423254 — Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2016-06-15 19:30 +0200
SubjectRe: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors
Message-ID<rKmNz-5ul-27@gated-at.bofh.it>
In reply to#1423248
On Wed, Jun 15, 2016 at 07:13:15PM +0200, Daniel Vetter wrote:
> On Wed, Jun 15, 2016 at 6:17 PM, Liviu Dudau <Liviu.Dudau@arm.com> wrote:
> > On Wed, Jun 15, 2016 at 05:23:10PM +0200, Daniel Vetter wrote:
> >> On Wed, Jun 15, 2016 at 03:51:34PM +0100, Liviu Dudau wrote:
> >> > Add support for the new family of Display Processors from ARM Ltd.
> >> > This commit adds basic support for Mali DP500, DP550 and DP650
> >> > parts, with only the display engine being supported at the moment.
> >> >
> >> > Cc: David Brown <David.Brown@arm.com>
> >> > Cc: Brian Starkey <Brian.Starkey@arm.com>
> >> >
> >> > Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
> >>
> >> Small thing I noticed: drm_dev_register/connector_register_all should be
> >> the last step in your init code, and unregister the first. Atm it's
> >> somewhere in the middle. But perfectly fine to do that as a follow-up.
> >
> > I've tried that, but the connector and encoder that gets registered as part
> > of the component_bind_all() fails if there is no drm dev registered. You did
> > comment on the v4 version about that and I did test your idea, sorry for
> > forgeting to update you on that.
> 
> Why does it fail? That shouldn't happen ... we need to be able to set
> up everything first, before we register.

Could be the tda998x_drv fault, but I'm getting this splat:

[    1.347687] kobject_add_internal failed for card0-HDMI-A-1 (error: -2 parent: card0)
[    1.355420] ------------[ cut here ]------------
[    1.360015] WARNING: CPU: 3 PID: 1 at /work/repositories/kernel/lib/kobject.c:244 kobject_add_internal+0xd8/0x290
[    1.370202] Modules linked in:
[    1.373238]
[    1.374724] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.7.0-rc2+ #2
[    1.380941] Hardware name: ARM Juno development board (r0) (DT)
[    1.386816] task: ffffffc976ca0000 ti: ffffffc976ca8000 task.ti: ffffffc976ca8000
[    1.394251] PC is at kobject_add_internal+0xd8/0x290
[    1.399179] LR is at kobject_add_internal+0xd8/0x290
[    1.404107] pc : [<ffffff8008344730>] lr : [<ffffff8008344730>] pstate: 60000045
[    1.411452] sp : ffffffc976cab7f0
[    1.414742] x29: ffffffc976cab7f0 x28: ffffff8008c5bbb8
[    1.420022] x27: ffffffc0799c3810 x26: ffffff80089f8a10
[    1.425302] x25: 0000000000000000 x24: ffffffc0799c2000
[    1.430582] x23: ffffff8008bddc78 x22: ffffffc0799c2000
[    1.435861] x21: ffffffc0799c2010 x20: 00000000fffffffe
[    1.441139] x19: ffffffc0799c3810 x18: 0000000000000010
[    1.446418] x17: 0000000000000000 x16: 0000000000000000
[    1.451697] x15: ffffff8088c35c87 x14: 6163203a746e6572
[    1.456976] x13: 617020322d203a72 x12: 6f7272652820312d
[    1.462255] x11: 412d494d44482d30 x10: 6472616320726f66
[    1.467533] x9 : 2064656c69616620 x8 : 00000000000000a1
[    1.472812] x7 : 5f6464615f746365 x6 : 000000000000000a
[    1.478091] x5 : ffffffc976453c18 x4 : 0000000000000000
[    1.483370] x3 : 0000000000000000 x2 : ffffff8008baa7b8
[    1.488649] x1 : ffffffc976ca8000 x0 : 0000000000000048
[    1.493927]
[    1.495421] ---[ end trace b193c9c9e93296f4 ]---
[    1.500002] Call trace:
[    1.502434] Exception stack(0xffffffc976cab630 to 0xffffffc976cab750)
[    1.508827] b620:                                   ffffffc0799c3810 00000000fffffffe
[    1.516608] b640: ffffffc976cab7f0 ffffff8008344730 ffffffc976cab670 ffffff80080f81dc
[    1.524389] b660: ffffff80089b7570 0000000108c35000 ffffffc976cab710 ffffff80080f8500
[    1.532170] b680: ffffffc0799c3810 00000000fffffffe ffffffc0799c2010 ffffffc0799c2000
[    1.539951] b6a0: ffffff8008bddc78 ffffffc0799c2000 0000000000000000 ffffff80089f8a10
[    1.547731] b6c0: ffffffc0799c3810 ffffff8008c5bbb8 0000000000000048 ffffffc976ca8000
[    1.555511] b6e0: ffffff8008baa7b8 0000000000000000 0000000000000000 ffffffc976453c18
[    1.563292] b700: 000000000000000a 5f6464615f746365 00000000000000a1 2064656c69616620
[    1.571073] b720: 6472616320726f66 412d494d44482d30 6f7272652820312d 617020322d203a72
[    1.578851] b740: 6163203a746e6572 ffffff8088c35c87
[    1.583695] [<ffffff8008344730>] kobject_add_internal+0xd8/0x290
[    1.589658] [<ffffff800834496c>] kobject_add+0x84/0xd0
[    1.594763] [<ffffff8008484e94>] device_add+0xc4/0x548
[    1.599867] [<ffffff8008485568>] device_create_groups_vargs+0x108/0x118
[    1.606432] [<ffffff8008485644>] device_create_with_groups+0x3c/0x48
[    1.612742] [<ffffff80084630cc>] drm_sysfs_connector_add+0x5c/0xd0
[    1.618880] [<ffffff80084671f0>] drm_connector_register+0x18/0xa0
[    1.624930] [<ffffff80084809b8>] tda998x_bind+0x5f8/0x6c0
[    1.630292] [<ffffff8008482f94>] component_bind_all+0xfc/0x258
[    1.636083] [<ffffff800847d1a4>] malidp_bind+0x3b4/0x528
[    1.641357] [<ffffff8008482be8>] try_to_bring_up_master+0x140/0x1a0
[    1.647579] [<ffffff8008482ce0>] component_add+0x98/0x170
[    1.652940] [<ffffff800847fc18>] tda998x_probe+0x18/0x20
[    1.658216] [<ffffff80085f087c>] i2c_device_probe+0x164/0x228
[    1.663921] [<ffffff8008488124>] driver_probe_device+0x204/0x2b0
[    1.669884] [<ffffff800848827c>] __driver_attach+0xac/0xb0
[    1.675330] [<ffffff80084860d8>] bus_for_each_dev+0x60/0xa0
[    1.680862] [<ffffff80084878b0>] driver_attach+0x20/0x28
[    1.686135] [<ffffff80084874a8>] bus_add_driver+0x1d0/0x238
[    1.691668] [<ffffff8008488a40>] driver_register+0x60/0xf8
[    1.697116] [<ffffff80085f19e0>] i2c_register_driver+0x38/0x88
[    1.702909] [<ffffff8008ad6a4c>] tda998x_driver_init+0x18/0x20
[    1.708701] [<ffffff8008081a10>] do_one_initcall+0x38/0x128
[    1.714234] [<ffffff8008ab0cc0>] kernel_init_freeable+0x14c/0x1f0
[    1.720286] [<ffffff8008782b08>] kernel_init+0x10/0x100
[    1.725475] [<ffffff8008084e10>] ret_from_fork+0x10/0x40
[    1.730771] [drm:drm_sysfs_connector_add] *ERROR* failed to register connector device: -2
[    1.745136] mali-dp 6f200000.malidp: failed to bind 1-0070 (ops tda998x_ops): -2
[    1.752506] [drm:malidp_bind] *ERROR* Failed to bind all components

Best regards,
Liviu


> -Daniel
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

[toc] | [prev] | [next] | [standalone]


#1423256 — Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors

FromChris Wilson <chris@chris-wilson.co.uk>
Date2016-06-15 19:40 +0200
SubjectRe: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors
Message-ID<rKmXf-5xA-5@gated-at.bofh.it>
In reply to#1423254
On Wed, Jun 15, 2016 at 06:21:04PM +0100, Liviu Dudau wrote:
> On Wed, Jun 15, 2016 at 07:13:15PM +0200, Daniel Vetter wrote:
> > On Wed, Jun 15, 2016 at 6:17 PM, Liviu Dudau <Liviu.Dudau@arm.com> wrote:
> > > On Wed, Jun 15, 2016 at 05:23:10PM +0200, Daniel Vetter wrote:
> > >> On Wed, Jun 15, 2016 at 03:51:34PM +0100, Liviu Dudau wrote:
> > >> > Add support for the new family of Display Processors from ARM Ltd.
> > >> > This commit adds basic support for Mali DP500, DP550 and DP650
> > >> > parts, with only the display engine being supported at the moment.
> > >> >
> > >> > Cc: David Brown <David.Brown@arm.com>
> > >> > Cc: Brian Starkey <Brian.Starkey@arm.com>
> > >> >
> > >> > Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
> > >>
> > >> Small thing I noticed: drm_dev_register/connector_register_all should be
> > >> the last step in your init code, and unregister the first. Atm it's
> > >> somewhere in the middle. But perfectly fine to do that as a follow-up.
> > >
> > > I've tried that, but the connector and encoder that gets registered as part
> > > of the component_bind_all() fails if there is no drm dev registered. You did
> > > comment on the v4 version about that and I did test your idea, sorry for
> > > forgeting to update you on that.
> > 
> > Why does it fail? That shouldn't happen ... we need to be able to set
> > up everything first, before we register.
> 
> Could be the tda998x_drv fault, but I'm getting this splat:
> 
> [    1.347687] kobject_add_internal failed for card0-HDMI-A-1 (error: -2 parent: card0)
> [    1.355420] ------------[ cut here ]------------
> [    1.360015] WARNING: CPU: 3 PID: 1 at /work/repositories/kernel/lib/kobject.c:244 kobject_add_internal+0xd8/0x290
> [    1.370202] Modules linked in:
> [    1.373238]
> [    1.374724] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.7.0-rc2+ #2
> [    1.380941] Hardware name: ARM Juno development board (r0) (DT)
> [    1.386816] task: ffffffc976ca0000 ti: ffffffc976ca8000 task.ti: ffffffc976ca8000
> [    1.394251] PC is at kobject_add_internal+0xd8/0x290
> [    1.399179] LR is at kobject_add_internal+0xd8/0x290
> [    1.404107] pc : [<ffffff8008344730>] lr : [<ffffff8008344730>] pstate: 60000045
> [    1.411452] sp : ffffffc976cab7f0
> [    1.414742] x29: ffffffc976cab7f0 x28: ffffff8008c5bbb8
> [    1.420022] x27: ffffffc0799c3810 x26: ffffff80089f8a10
> [    1.425302] x25: 0000000000000000 x24: ffffffc0799c2000
> [    1.430582] x23: ffffff8008bddc78 x22: ffffffc0799c2000
> [    1.435861] x21: ffffffc0799c2010 x20: 00000000fffffffe
> [    1.441139] x19: ffffffc0799c3810 x18: 0000000000000010
> [    1.446418] x17: 0000000000000000 x16: 0000000000000000
> [    1.451697] x15: ffffff8088c35c87 x14: 6163203a746e6572
> [    1.456976] x13: 617020322d203a72 x12: 6f7272652820312d
> [    1.462255] x11: 412d494d44482d30 x10: 6472616320726f66
> [    1.467533] x9 : 2064656c69616620 x8 : 00000000000000a1
> [    1.472812] x7 : 5f6464615f746365 x6 : 000000000000000a
> [    1.478091] x5 : ffffffc976453c18 x4 : 0000000000000000
> [    1.483370] x3 : 0000000000000000 x2 : ffffff8008baa7b8
> [    1.488649] x1 : ffffffc976ca8000 x0 : 0000000000000048
> [    1.493927]
> [    1.495421] ---[ end trace b193c9c9e93296f4 ]---
> [    1.500002] Call trace:
> [    1.502434] Exception stack(0xffffffc976cab630 to 0xffffffc976cab750)
> [    1.508827] b620:                                   ffffffc0799c3810 00000000fffffffe
> [    1.516608] b640: ffffffc976cab7f0 ffffff8008344730 ffffffc976cab670 ffffff80080f81dc
> [    1.524389] b660: ffffff80089b7570 0000000108c35000 ffffffc976cab710 ffffff80080f8500
> [    1.532170] b680: ffffffc0799c3810 00000000fffffffe ffffffc0799c2010 ffffffc0799c2000
> [    1.539951] b6a0: ffffff8008bddc78 ffffffc0799c2000 0000000000000000 ffffff80089f8a10
> [    1.547731] b6c0: ffffffc0799c3810 ffffff8008c5bbb8 0000000000000048 ffffffc976ca8000
> [    1.555511] b6e0: ffffff8008baa7b8 0000000000000000 0000000000000000 ffffffc976453c18
> [    1.563292] b700: 000000000000000a 5f6464615f746365 00000000000000a1 2064656c69616620
> [    1.571073] b720: 6472616320726f66 412d494d44482d30 6f7272652820312d 617020322d203a72
> [    1.578851] b740: 6163203a746e6572 ffffff8088c35c87
> [    1.583695] [<ffffff8008344730>] kobject_add_internal+0xd8/0x290
> [    1.589658] [<ffffff800834496c>] kobject_add+0x84/0xd0
> [    1.594763] [<ffffff8008484e94>] device_add+0xc4/0x548
> [    1.599867] [<ffffff8008485568>] device_create_groups_vargs+0x108/0x118
> [    1.606432] [<ffffff8008485644>] device_create_with_groups+0x3c/0x48
> [    1.612742] [<ffffff80084630cc>] drm_sysfs_connector_add+0x5c/0xd0
> [    1.618880] [<ffffff80084671f0>] drm_connector_register+0x18/0xa0
> [    1.624930] [<ffffff80084809b8>] tda998x_bind+0x5f8/0x6c0
> [    1.630292] [<ffffff8008482f94>] component_bind_all+0xfc/0x258
> [    1.636083] [<ffffff800847d1a4>] malidp_bind+0x3b4/0x528
> [    1.641357] [<ffffff8008482be8>] try_to_bring_up_master+0x140/0x1a0
> [    1.647579] [<ffffff8008482ce0>] component_add+0x98/0x170
> [    1.652940] [<ffffff800847fc18>] tda998x_probe+0x18/0x20
> [    1.658216] [<ffffff80085f087c>] i2c_device_probe+0x164/0x228
> [    1.663921] [<ffffff8008488124>] driver_probe_device+0x204/0x2b0
> [    1.669884] [<ffffff800848827c>] __driver_attach+0xac/0xb0
> [    1.675330] [<ffffff80084860d8>] bus_for_each_dev+0x60/0xa0
> [    1.680862] [<ffffff80084878b0>] driver_attach+0x20/0x28
> [    1.686135] [<ffffff80084874a8>] bus_add_driver+0x1d0/0x238
> [    1.691668] [<ffffff8008488a40>] driver_register+0x60/0xf8
> [    1.697116] [<ffffff80085f19e0>] i2c_register_driver+0x38/0x88
> [    1.702909] [<ffffff8008ad6a4c>] tda998x_driver_init+0x18/0x20
> [    1.708701] [<ffffff8008081a10>] do_one_initcall+0x38/0x128
> [    1.714234] [<ffffff8008ab0cc0>] kernel_init_freeable+0x14c/0x1f0
> [    1.720286] [<ffffff8008782b08>] kernel_init+0x10/0x100
> [    1.725475] [<ffffff8008084e10>] ret_from_fork+0x10/0x40
> [    1.730771] [drm:drm_sysfs_connector_add] *ERROR* failed to register connector device: -2
> [    1.745136] mali-dp 6f200000.malidp: failed to bind 1-0070 (ops tda998x_ops): -2
> [    1.752506] [drm:malidp_bind] *ERROR* Failed to bind all components

Something like

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index f55bd9602462..0baf5cebb3b5 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -995,6 +995,10 @@ int drm_connector_register(struct drm_connector *connector)
        if (connector->registered)
                return 0;
 
+       /* Silently fail to register before the device itself is ready. */
+       if (!connector->dev->registered)
+               return 0;
+
        ret = drm_sysfs_connector_add(connector);
        if (ret)
                return ret;
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 13b4c9c0fe36..048733006dbb 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -789,6 +789,8 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
        if (ret)
                goto err_minors;
 
+       dev->registered = true;
+
        if (dev->driver->load) {
                ret = dev->driver->load(dev, flags);
                if (ret)
@@ -840,6 +842,8 @@ void drm_dev_unregister(struct drm_device *dev)
        list_for_each_entry_safe(r_list, list_temp, &dev->maplist, head)
                drm_legacy_rmmap(dev, r_list->map);
 
+       dev->registered = false;
+
        drm_minor_unregister(dev, DRM_MINOR_LEGACY);
        drm_minor_unregister(dev, DRM_MINOR_RENDER);
        drm_minor_unregister(dev, DRM_MINOR_CONTROL);
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 057b6ccdbe8e..4a14e5bfcbda 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -867,6 +867,8 @@ struct drm_device {
        struct drm_vma_offset_manager *vma_offset_manager;
        /*@} */
        int switch_power_state;
+
+       bool registered;
 };
 
 #define DRM_SWITCH_POWER_ON 0


after "drm: Automatically register/unregister all connectors"?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

[toc] | [prev] | [next] | [standalone]


#1423267 — Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2016-06-15 19:50 +0200
SubjectRe: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors
Message-ID<rKn6W-5AD-13@gated-at.bofh.it>
In reply to#1423256
On Wed, Jun 15, 2016 at 06:35:37PM +0100, Chris Wilson wrote:
> On Wed, Jun 15, 2016 at 06:21:04PM +0100, Liviu Dudau wrote:
> > On Wed, Jun 15, 2016 at 07:13:15PM +0200, Daniel Vetter wrote:
> > > On Wed, Jun 15, 2016 at 6:17 PM, Liviu Dudau <Liviu.Dudau@arm.com> wrote:
> > > > On Wed, Jun 15, 2016 at 05:23:10PM +0200, Daniel Vetter wrote:
> > > >> On Wed, Jun 15, 2016 at 03:51:34PM +0100, Liviu Dudau wrote:
> > > >> > Add support for the new family of Display Processors from ARM Ltd.
> > > >> > This commit adds basic support for Mali DP500, DP550 and DP650
> > > >> > parts, with only the display engine being supported at the moment.
> > > >> >
> > > >> > Cc: David Brown <David.Brown@arm.com>
> > > >> > Cc: Brian Starkey <Brian.Starkey@arm.com>
> > > >> >
> > > >> > Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
> > > >>
> > > >> Small thing I noticed: drm_dev_register/connector_register_all should be
> > > >> the last step in your init code, and unregister the first. Atm it's
> > > >> somewhere in the middle. But perfectly fine to do that as a follow-up.
> > > >
> > > > I've tried that, but the connector and encoder that gets registered as part
> > > > of the component_bind_all() fails if there is no drm dev registered. You did
> > > > comment on the v4 version about that and I did test your idea, sorry for
> > > > forgeting to update you on that.
> > > 
> > > Why does it fail? That shouldn't happen ... we need to be able to set
> > > up everything first, before we register.
> > 
> > Could be the tda998x_drv fault, but I'm getting this splat:
> > 
> > [    1.347687] kobject_add_internal failed for card0-HDMI-A-1 (error: -2 parent: card0)
> > [    1.355420] ------------[ cut here ]------------
> > [    1.360015] WARNING: CPU: 3 PID: 1 at /work/repositories/kernel/lib/kobject.c:244 kobject_add_internal+0xd8/0x290
> > [    1.370202] Modules linked in:
> > [    1.373238]
> > [    1.374724] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.7.0-rc2+ #2
> > [    1.380941] Hardware name: ARM Juno development board (r0) (DT)
> > [    1.386816] task: ffffffc976ca0000 ti: ffffffc976ca8000 task.ti: ffffffc976ca8000
> > [    1.394251] PC is at kobject_add_internal+0xd8/0x290
> > [    1.399179] LR is at kobject_add_internal+0xd8/0x290
> > [    1.404107] pc : [<ffffff8008344730>] lr : [<ffffff8008344730>] pstate: 60000045
> > [    1.411452] sp : ffffffc976cab7f0
> > [    1.414742] x29: ffffffc976cab7f0 x28: ffffff8008c5bbb8
> > [    1.420022] x27: ffffffc0799c3810 x26: ffffff80089f8a10
> > [    1.425302] x25: 0000000000000000 x24: ffffffc0799c2000
> > [    1.430582] x23: ffffff8008bddc78 x22: ffffffc0799c2000
> > [    1.435861] x21: ffffffc0799c2010 x20: 00000000fffffffe
> > [    1.441139] x19: ffffffc0799c3810 x18: 0000000000000010
> > [    1.446418] x17: 0000000000000000 x16: 0000000000000000
> > [    1.451697] x15: ffffff8088c35c87 x14: 6163203a746e6572
> > [    1.456976] x13: 617020322d203a72 x12: 6f7272652820312d
> > [    1.462255] x11: 412d494d44482d30 x10: 6472616320726f66
> > [    1.467533] x9 : 2064656c69616620 x8 : 00000000000000a1
> > [    1.472812] x7 : 5f6464615f746365 x6 : 000000000000000a
> > [    1.478091] x5 : ffffffc976453c18 x4 : 0000000000000000
> > [    1.483370] x3 : 0000000000000000 x2 : ffffff8008baa7b8
> > [    1.488649] x1 : ffffffc976ca8000 x0 : 0000000000000048
> > [    1.493927]
> > [    1.495421] ---[ end trace b193c9c9e93296f4 ]---
> > [    1.500002] Call trace:
> > [    1.502434] Exception stack(0xffffffc976cab630 to 0xffffffc976cab750)
> > [    1.508827] b620:                                   ffffffc0799c3810 00000000fffffffe
> > [    1.516608] b640: ffffffc976cab7f0 ffffff8008344730 ffffffc976cab670 ffffff80080f81dc
> > [    1.524389] b660: ffffff80089b7570 0000000108c35000 ffffffc976cab710 ffffff80080f8500
> > [    1.532170] b680: ffffffc0799c3810 00000000fffffffe ffffffc0799c2010 ffffffc0799c2000
> > [    1.539951] b6a0: ffffff8008bddc78 ffffffc0799c2000 0000000000000000 ffffff80089f8a10
> > [    1.547731] b6c0: ffffffc0799c3810 ffffff8008c5bbb8 0000000000000048 ffffffc976ca8000
> > [    1.555511] b6e0: ffffff8008baa7b8 0000000000000000 0000000000000000 ffffffc976453c18
> > [    1.563292] b700: 000000000000000a 5f6464615f746365 00000000000000a1 2064656c69616620
> > [    1.571073] b720: 6472616320726f66 412d494d44482d30 6f7272652820312d 617020322d203a72
> > [    1.578851] b740: 6163203a746e6572 ffffff8088c35c87
> > [    1.583695] [<ffffff8008344730>] kobject_add_internal+0xd8/0x290
> > [    1.589658] [<ffffff800834496c>] kobject_add+0x84/0xd0
> > [    1.594763] [<ffffff8008484e94>] device_add+0xc4/0x548
> > [    1.599867] [<ffffff8008485568>] device_create_groups_vargs+0x108/0x118
> > [    1.606432] [<ffffff8008485644>] device_create_with_groups+0x3c/0x48
> > [    1.612742] [<ffffff80084630cc>] drm_sysfs_connector_add+0x5c/0xd0
> > [    1.618880] [<ffffff80084671f0>] drm_connector_register+0x18/0xa0
> > [    1.624930] [<ffffff80084809b8>] tda998x_bind+0x5f8/0x6c0
> > [    1.630292] [<ffffff8008482f94>] component_bind_all+0xfc/0x258
> > [    1.636083] [<ffffff800847d1a4>] malidp_bind+0x3b4/0x528
> > [    1.641357] [<ffffff8008482be8>] try_to_bring_up_master+0x140/0x1a0
> > [    1.647579] [<ffffff8008482ce0>] component_add+0x98/0x170
> > [    1.652940] [<ffffff800847fc18>] tda998x_probe+0x18/0x20
> > [    1.658216] [<ffffff80085f087c>] i2c_device_probe+0x164/0x228
> > [    1.663921] [<ffffff8008488124>] driver_probe_device+0x204/0x2b0
> > [    1.669884] [<ffffff800848827c>] __driver_attach+0xac/0xb0
> > [    1.675330] [<ffffff80084860d8>] bus_for_each_dev+0x60/0xa0
> > [    1.680862] [<ffffff80084878b0>] driver_attach+0x20/0x28
> > [    1.686135] [<ffffff80084874a8>] bus_add_driver+0x1d0/0x238
> > [    1.691668] [<ffffff8008488a40>] driver_register+0x60/0xf8
> > [    1.697116] [<ffffff80085f19e0>] i2c_register_driver+0x38/0x88
> > [    1.702909] [<ffffff8008ad6a4c>] tda998x_driver_init+0x18/0x20
> > [    1.708701] [<ffffff8008081a10>] do_one_initcall+0x38/0x128
> > [    1.714234] [<ffffff8008ab0cc0>] kernel_init_freeable+0x14c/0x1f0
> > [    1.720286] [<ffffff8008782b08>] kernel_init+0x10/0x100
> > [    1.725475] [<ffffff8008084e10>] ret_from_fork+0x10/0x40
> > [    1.730771] [drm:drm_sysfs_connector_add] *ERROR* failed to register connector device: -2
> > [    1.745136] mali-dp 6f200000.malidp: failed to bind 1-0070 (ops tda998x_ops): -2
> > [    1.752506] [drm:malidp_bind] *ERROR* Failed to bind all components
> 
> Something like
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index f55bd9602462..0baf5cebb3b5 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -995,6 +995,10 @@ int drm_connector_register(struct drm_connector *connector)
>         if (connector->registered)
>                 return 0;
>  
> +       /* Silently fail to register before the device itself is ready. */
> +       if (!connector->dev->registered)
> +               return 0;
> +
>         ret = drm_sysfs_connector_add(connector);
>         if (ret)
>                 return ret;
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index 13b4c9c0fe36..048733006dbb 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -789,6 +789,8 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
>         if (ret)
>                 goto err_minors;
>  
> +       dev->registered = true;
> +
>         if (dev->driver->load) {
>                 ret = dev->driver->load(dev, flags);
>                 if (ret)
> @@ -840,6 +842,8 @@ void drm_dev_unregister(struct drm_device *dev)
>         list_for_each_entry_safe(r_list, list_temp, &dev->maplist, head)
>                 drm_legacy_rmmap(dev, r_list->map);
>  
> +       dev->registered = false;
> +
>         drm_minor_unregister(dev, DRM_MINOR_LEGACY);
>         drm_minor_unregister(dev, DRM_MINOR_RENDER);
>         drm_minor_unregister(dev, DRM_MINOR_CONTROL);
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 057b6ccdbe8e..4a14e5bfcbda 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -867,6 +867,8 @@ struct drm_device {
>         struct drm_vma_offset_manager *vma_offset_manager;
>         /*@} */
>         int switch_power_state;
> +
> +       bool registered;
>  };
>  
>  #define DRM_SWITCH_POWER_ON 0
> 
> 
> after "drm: Automatically register/unregister all connectors"?
> -Chris

Yes, possible. I wasn't carrying (or have tested) your series, Chris.

Best regards,
Liviu


> 
> -- 
> Chris Wilson, Intel Open Source Technology Centre
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

[toc] | [prev] | [next] | [standalone]


#1423342 — Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors

FromDaniel Vetter <daniel@ffwll.ch>
Date2016-06-15 21:30 +0200
SubjectRe: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors
Message-ID<rKoFH-6BZ-5@gated-at.bofh.it>
In reply to#1423254
On Wed, Jun 15, 2016 at 7:21 PM, Liviu Dudau <Liviu.Dudau@arm.com> wrote:
> On Wed, Jun 15, 2016 at 07:13:15PM +0200, Daniel Vetter wrote:
>> On Wed, Jun 15, 2016 at 6:17 PM, Liviu Dudau <Liviu.Dudau@arm.com> wrote:
>> > On Wed, Jun 15, 2016 at 05:23:10PM +0200, Daniel Vetter wrote:
>> >> On Wed, Jun 15, 2016 at 03:51:34PM +0100, Liviu Dudau wrote:
>> >> > Add support for the new family of Display Processors from ARM Ltd.
>> >> > This commit adds basic support for Mali DP500, DP550 and DP650
>> >> > parts, with only the display engine being supported at the moment.
>> >> >
>> >> > Cc: David Brown <David.Brown@arm.com>
>> >> > Cc: Brian Starkey <Brian.Starkey@arm.com>
>> >> >
>> >> > Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
>> >>
>> >> Small thing I noticed: drm_dev_register/connector_register_all should be
>> >> the last step in your init code, and unregister the first. Atm it's
>> >> somewhere in the middle. But perfectly fine to do that as a follow-up.
>> >
>> > I've tried that, but the connector and encoder that gets registered as part
>> > of the component_bind_all() fails if there is no drm dev registered. You did
>> > comment on the v4 version about that and I did test your idea, sorry for
>> > forgeting to update you on that.
>>
>> Why does it fail? That shouldn't happen ... we need to be able to set
>> up everything first, before we register.
>
> Could be the tda998x_drv fault, but I'm getting this splat:

Yeah, tda9998x needs to be fixed to _not_ register it's connector
before the overall (componentized) driver is ready. We need to make
sure first ofc that all users of that driver do register connectors,
but Chris' patch series will take care of that. But tda9998x needs to
be fixed either way.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

[toc] | [prev] | [next] | [standalone]


#1423361 — Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors

FromRussell King - ARM Linux <linux@armlinux.org.uk>
Date2016-06-15 22:10 +0200
SubjectRe: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors
Message-ID<rKpiq-74l-17@gated-at.bofh.it>
In reply to#1423342
On Wed, Jun 15, 2016 at 09:29:38PM +0200, Daniel Vetter wrote:
> On Wed, Jun 15, 2016 at 7:21 PM, Liviu Dudau <Liviu.Dudau@arm.com> wrote:
> > Could be the tda998x_drv fault, but I'm getting this splat:
> 
> Yeah, tda9998x needs to be fixed to _not_ register it's connector
> before the overall (componentized) driver is ready. We need to make
> sure first ofc that all users of that driver do register connectors,
> but Chris' patch series will take care of that. But tda9998x needs to
> be fixed either way.

Componentised drivers only get one bind callback, they don't get a
two-stage initialisation at bind time.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

[toc] | [prev] | [next] | [standalone]


#1423428 — Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors

FromDaniel Vetter <daniel@ffwll.ch>
Date2016-06-15 22:40 +0200
SubjectRe: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors
Message-ID<rKpLt-7fO-41@gated-at.bofh.it>
In reply to#1423361
On Wed, Jun 15, 2016 at 10:05 PM, Russell King - ARM Linux
<linux@armlinux.org.uk> wrote:
> On Wed, Jun 15, 2016 at 09:29:38PM +0200, Daniel Vetter wrote:
>> On Wed, Jun 15, 2016 at 7:21 PM, Liviu Dudau <Liviu.Dudau@arm.com> wrote:
>> > Could be the tda998x_drv fault, but I'm getting this splat:
>>
>> Yeah, tda9998x needs to be fixed to _not_ register it's connector
>> before the overall (componentized) driver is ready. We need to make
>> sure first ofc that all users of that driver do register connectors,
>> but Chris' patch series will take care of that. But tda9998x needs to
>> be fixed either way.
>
> Componentised drivers only get one bind callback, they don't get a
> two-stage initialisation at bind time.

We don't need two-stage init in the component framework. There's
patches in-flight to simplify this a lot (and provide callbacks to
register additional connector interfaces like backlight). But in
general components should not call drm_connector_register, instead the
master should call drm_connector_register_all at the very end. Yes
this is a change from how all the original kms drivers have done it,
but that way was also racy (since it exposed interfaces to userspace
before they're fully set up). We're gradually switching each driver
over, but for shared bits like tda9998x it's a bit more complicated -
all the drivers using it need to switch at the same time.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

[toc] | [prev] | [next] | [standalone]


#1423395 — Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors

FromRussell King - ARM Linux <linux@armlinux.org.uk>
Date2016-06-15 22:20 +0200
SubjectRe: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors
Message-ID<rKps6-77R-41@gated-at.bofh.it>
In reply to#1423254
On Wed, Jun 15, 2016 at 06:21:04PM +0100, Liviu Dudau wrote:
> Could be the tda998x_drv fault, but I'm getting this splat:
> 
> [    1.347687] kobject_add_internal failed for card0-HDMI-A-1 (error: -2 parent: card0)

Right, so this is -ENOENT - I expect that it's complaining that the
parent does not exist before a child is attempted to be added.

Hopefully, this isn't with -rc kernels, but is with -next.  I think
some folk need to Cc me with patches to tda998x, or at least talk to
me about what's changed in DRM so that tda998x can get fixed.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

[toc] | [prev] | [next] | [standalone]


#1423759 — Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2016-06-16 10:00 +0200
SubjectRe: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors
Message-ID<rKAnw-5uL-5@gated-at.bofh.it>
In reply to#1423395
Hi Russell,

On Wed, Jun 15, 2016 at 09:11:16PM +0100, Russell King - ARM Linux wrote:
> On Wed, Jun 15, 2016 at 06:21:04PM +0100, Liviu Dudau wrote:
> > Could be the tda998x_drv fault, but I'm getting this splat:
> > 
> > [    1.347687] kobject_add_internal failed for card0-HDMI-A-1 (error: -2 parent: card0)
> 
> Right, so this is -ENOENT - I expect that it's complaining that the
> parent does not exist before a child is attempted to be added.
> 
> Hopefully, this isn't with -rc kernels, but is with -next.  I think
> some folk need to Cc me with patches to tda998x, or at least talk to
> me about what's changed in DRM so that tda998x can get fixed.

This is with a new driver that just went into -next and I was trying a suggestion
from Daniel to re-order the initialisation steps in preparation of the
series that Chris Wilson is working on to make init time less racy.
It is not a normal run splat and I will make sure that we work with
you to get tda998x changed when we get there.

Other than the ticlcd driver that is (I think) being converted to atomic, do you
use any other DRM driver with tda998x?

Best regards,
Liviu

> 
> -- 
> RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
> FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
> according to speedtest.net.
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web