1. 27 7月, 2022 1 次提交
  2. 15 12月, 2020 9 次提交
  3. 10 11月, 2020 1 次提交
  4. 03 11月, 2020 1 次提交
  5. 02 11月, 2020 2 次提交
    • M
      drm/atomic: Pass the full state to CRTC atomic begin and flush · f6ebe9f9
      Maxime Ripard 提交于
      The current atomic helpers have either their object state being passed as
      an argument or the full atomic state.
      
      The former is the pattern that was done at first, before switching to the
      latter for new hooks or when it was needed.
      
      Let's start convert all the remaining helpers to provide a consistent
      interface, starting with the CRTC's atomic_begin and atomic_flush.
      
      The conversion was done using the coccinelle script below, built tested on
      all the drivers and actually tested on vc4.
      
      virtual report
      
      @@
      struct drm_crtc_helper_funcs *FUNCS;
      identifier old_crtc_state, old_state;
      identifier crtc;
      identifier f;
      @@
      
       f(struct drm_crtc_state *old_crtc_state)
       {
      	...
       	struct drm_atomic_state *old_state = old_crtc_state->state;
      	<...
      -	FUNCS->atomic_begin(crtc, old_crtc_state);
      +	FUNCS->atomic_begin(crtc, old_state);
      	...>
       }
      
      @@
      struct drm_crtc_helper_funcs *FUNCS;
      identifier old_crtc_state, old_state;
      identifier crtc;
      identifier f;
      @@
      
       f(struct drm_crtc_state *old_crtc_state)
       {
      	...
       	struct drm_atomic_state *old_state = old_crtc_state->state;
      	<...
      -	FUNCS->atomic_flush(crtc, old_crtc_state);
      +	FUNCS->atomic_flush(crtc, old_state);
      	...>
       }
      
      @@
      struct drm_crtc_helper_funcs *FUNCS;
      struct drm_crtc *crtc;
      struct drm_crtc_state *crtc_state;
      identifier dev, state;
      identifier f;
      @@
      
       f(struct drm_device *dev, struct drm_atomic_state *state, ...)
       {
      	<...
      -	FUNCS->atomic_begin(crtc, crtc_state);
      +	FUNCS->atomic_begin(crtc, state);
      	...>
       }
      
      @@
      struct drm_crtc_helper_funcs *FUNCS;
      struct drm_crtc *crtc;
      struct drm_crtc_state *crtc_state;
      identifier dev, state;
      identifier f;
      @@
      
       f(struct drm_device *dev, struct drm_atomic_state *state, ...)
       {
      	<...
      -	FUNCS->atomic_flush(crtc, crtc_state);
      +	FUNCS->atomic_flush(crtc, state);
      	...>
       }
      
      @@
      identifier crtc, old_state;
      @@
      
       struct drm_crtc_helper_funcs {
      	...
      -	void (*atomic_begin)(struct drm_crtc *crtc, struct drm_crtc_state *old_state);
      +	void (*atomic_begin)(struct drm_crtc *crtc, struct drm_atomic_state *state);
      	...
      -	void (*atomic_flush)(struct drm_crtc *crtc, struct drm_crtc_state *old_state);
      +	void (*atomic_flush)(struct drm_crtc *crtc, struct drm_atomic_state *state);
      	...
      }
      
      @ crtc_atomic_func @
      identifier helpers;
      identifier func;
      @@
      
      (
      static struct drm_crtc_helper_funcs helpers = {
      	...,
      	.atomic_begin = func,
      	...,
      };
      |
      static struct drm_crtc_helper_funcs helpers = {
      	...,
      	.atomic_flush = func,
      	...,
      };
      )
      
      @ ignores_old_state @
      identifier crtc_atomic_func.func;
      identifier crtc, old_state;
      @@
      
      void func(struct drm_crtc *crtc,
      		struct drm_crtc_state *old_state)
      {
      	... when != old_state
      }
      
      @ adds_old_state depends on crtc_atomic_func && !ignores_old_state @
      identifier crtc_atomic_func.func;
      identifier crtc, old_state;
      @@
      
      void func(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
      {
      +	struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, crtc);
      	...
      }
      
      @ depends on crtc_atomic_func @
      identifier crtc_atomic_func.func;
      expression E;
      type T;
      @@
      
      void func(...)
      {
      	...
      -	T state = E;
      +	T crtc_state = E;
      	<+...
      -	state
      +	crtc_state
      	...+>
      
      }
      
      @ depends on crtc_atomic_func @
      identifier crtc_atomic_func.func;
      type T;
      @@
      
      void func(...)
      {
      	...
      -	T state;
      +	T crtc_state;
      	<+...
      -	state
      +	crtc_state
      	...+>
      
      }
      
      @@
      identifier old_state;
      identifier crtc;
      @@
      
       void vc4_hvs_atomic_flush(struct drm_crtc *crtc,
      -			   struct drm_crtc_state *old_state
      +			   struct drm_atomic_state *state
      			   )
      {
      +	struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, crtc);
      	...
      }
      
      @@
      identifier old_state;
      identifier crtc;
      @@
      
       void vc4_hvs_atomic_flush(struct drm_crtc *crtc,
      -			   struct drm_crtc_state *old_state
      +			   struct drm_atomic_state *state
      			   );
      
      @@
      identifier old_state;
      identifier crtc;
      @@
      
       void vmw_du_crtc_atomic_begin(struct drm_crtc *crtc,
      -			   struct drm_crtc_state *old_state
      +			   struct drm_atomic_state *state
      			   )
      {
      	...
      }
      
      @@
      identifier old_state;
      identifier crtc;
      @@
      
       void vmw_du_crtc_atomic_begin(struct drm_crtc *crtc,
      -			   struct drm_crtc_state *old_state
      +			   struct drm_atomic_state *state
      			   );
      
      @@
      identifier old_state;
      identifier crtc;
      @@
      
       void vmw_du_crtc_atomic_flush(struct drm_crtc *crtc,
      -			   struct drm_crtc_state *old_state
      +			   struct drm_atomic_state *state
      			   )
      {
      	...
      }
      
      @@
      identifier old_state;
      identifier crtc;
      @@
      
       void vmw_du_crtc_atomic_flush(struct drm_crtc *crtc,
      -			   struct drm_crtc_state *old_state
      +			   struct drm_atomic_state *state
      			   );
      
      @ depends on crtc_atomic_func @
      identifier crtc_atomic_func.func;
      identifier old_state;
      identifier crtc;
      @@
      
      void func(struct drm_crtc *crtc,
      -	       struct drm_crtc_state *old_state
      +	       struct drm_atomic_state *state
      	       )
      		{ ... }
      
      @ include depends on adds_old_state @
      @@
      
       #include <drm/drm_atomic.h>
      
      @ no_include depends on !include && adds_old_state @
      @@
      
      + #include <drm/drm_atomic.h>
        #include <drm/...>
      Signed-off-by: NMaxime Ripard <maxime@cerno.tech>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Acked-by: NThomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201028123222.1732139-2-maxime@cerno.tech
      f6ebe9f9
    • M
      drm/atomic: Pass the full state to CRTC atomic_check · 29b77ad7
      Maxime Ripard 提交于
      The current atomic helpers have either their object state being passed as
      an argument or the full atomic state.
      
      The former is the pattern that was done at first, before switching to the
      latter for new hooks or when it was needed.
      
      Let's start convert all the remaining helpers to provide a consistent
      interface, starting with the CRTC's atomic_check.
      
      The conversion was done using the coccinelle script below,
      built tested on all the drivers and actually tested on vc4.
      
      virtual report
      
      @@
      struct drm_crtc_helper_funcs *FUNCS;
      struct drm_crtc *crtc;
      struct drm_crtc_state *crtc_state;
      identifier dev, state;
      identifier ret, f;
      @@
      
       f(struct drm_device *dev, struct drm_atomic_state *state)
       {
      	<...
      -	ret = FUNCS->atomic_check(crtc, crtc_state);
      +	ret = FUNCS->atomic_check(crtc, state);
      	...>
       }
      
      @@
      identifier crtc, new_state;
      @@
      
       struct drm_crtc_helper_funcs {
       	...
      -	int (*atomic_check)(struct drm_crtc *crtc, struct drm_crtc_state *new_state);
      +	int (*atomic_check)(struct drm_crtc *crtc, struct drm_atomic_state *state);
       	...
      }
      
      @ crtc_atomic_func @
      identifier helpers;
      identifier func;
      @@
      
      static struct drm_crtc_helper_funcs helpers = {
      	...,
      	.atomic_check = func,
      	...,
      };
      
      @ ignores_new_state @
      identifier crtc_atomic_func.func;
      identifier crtc, new_state;
      @@
      
       int func(struct drm_crtc *crtc,
      		struct drm_crtc_state *new_state)
       {
      	... when != new_state
       }
      
      @ adds_new_state depends on crtc_atomic_func && !ignores_new_state @
      identifier crtc_atomic_func.func;
      identifier crtc, new_state;
      @@
      
       int func(struct drm_crtc *crtc, struct drm_crtc_state *new_state)
       {
      +	struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state, crtc);
       	...
       }
      
      @ depends on crtc_atomic_func @
      identifier crtc_atomic_func.func;
      expression E;
      type T;
      @@
      
       int func(...)
       {
      	...
      -	T state = E;
      +	T crtc_state = E;
       	<+...
      -	state
      +	crtc_state
       	...+>
       }
      
      @ depends on crtc_atomic_func @
      identifier crtc_atomic_func.func;
      type T;
      @@
      
       int func(...)
       {
       	...
      -	T state;
      +	T crtc_state;
       	<+...
      -	state
      +	crtc_state
       	...+>
       }
      
      @ depends on crtc_atomic_func @
      identifier crtc_atomic_func.func;
      identifier new_state;
      identifier crtc;
      @@
      
       int func(struct drm_crtc *crtc,
      -	       struct drm_crtc_state *new_state
      +	       struct drm_atomic_state *state
      	       )
       { ... }
      
      @@
      identifier new_state;
      identifier crtc;
      @@
      
       int vmw_du_crtc_atomic_check(struct drm_crtc *crtc,
      -                             struct drm_crtc_state *new_state
      +                             struct drm_atomic_state *state
                     )
       {
      +       struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state, crtc);
      	...
       }
      
      @@
      identifier new_state;
      identifier crtc;
      @@
      
       int vmw_du_crtc_atomic_check(struct drm_crtc *crtc,
      -                             struct drm_crtc_state *new_state
      +                             struct drm_atomic_state *state
                     );
      
      @ include depends on adds_new_state @
      @@
      
       #include <drm/drm_atomic.h>
      
      @ no_include depends on !include && adds_new_state @
      @@
      
      + #include <drm/drm_atomic.h>
        #include <drm/...>
      Signed-off-by: NMaxime Ripard <maxime@cerno.tech>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Acked-by: NThomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201028123222.1732139-1-maxime@cerno.tech
      29b77ad7
  6. 09 10月, 2020 1 次提交
    • M
      drm/atomic: Pass the full state to CRTC atomic enable/disable · 351f950d
      Maxime Ripard 提交于
      If the CRTC driver ever needs to access the full DRM state, it can't do so
      at atomic_enable / atomic_disable time since drm_atomic_helper_swap_state
      will have cleared the pointer from the struct drm_crtc_state to the struct
      drm_atomic_state before calling those hooks.
      
      In order to allow that, let's pass the full DRM state to atomic_enable and
      atomic_disable. The conversion was done using the coccinelle script below,
      built tested on all the drivers and actually tested on vc4.
      
      virtual report
      
      @@
      struct drm_crtc_helper_funcs *FUNCS;
      identifier dev, state;
      identifier crtc, crtc_state;
      @@
      
       disable_outputs(struct drm_device *dev, struct drm_atomic_state *state)
       {
       	<...
      -	FUNCS->atomic_disable(crtc, crtc_state);
      +	FUNCS->atomic_disable(crtc, state);
       	...>
       }
      
      @@
      struct drm_crtc_helper_funcs *FUNCS;
      identifier dev, state;
      identifier crtc, crtc_state;
      @@
      
       drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, struct drm_atomic_state *state)
       {
       	<...
      -	FUNCS->atomic_enable(crtc, crtc_state);
      +	FUNCS->atomic_enable(crtc, state);
       	...>
       }
      
      @@
      identifier crtc, old_state;
      @@
      
       struct drm_crtc_helper_funcs {
      	...
      -	void (*atomic_enable)(struct drm_crtc *crtc, struct drm_crtc_state *old_state);
      +	void (*atomic_enable)(struct drm_crtc *crtc, struct drm_atomic_state *state);
      	...
      -	void (*atomic_disable)(struct drm_crtc *crtc, struct drm_crtc_state *old_state);
      +	void (*atomic_disable)(struct drm_crtc *crtc, struct drm_atomic_state *state);
      	...
      }
      
      @ crtc_atomic_func @
      identifier helpers;
      identifier func;
      @@
      
      (
      static struct drm_crtc_helper_funcs helpers = {
      	...,
      	.atomic_enable = func,
      	...,
      };
      |
      static struct drm_crtc_helper_funcs helpers = {
      	...,
      	.atomic_disable = func,
      	...,
      };
      )
      
      @ ignores_old_state @
      identifier crtc_atomic_func.func;
      identifier crtc, old_state;
      @@
      
      void func(struct drm_crtc *crtc,
      		struct drm_crtc_state *old_state)
      {
      	... when != old_state
      }
      
      @ adds_old_state depends on crtc_atomic_func && !ignores_old_state @
      identifier crtc_atomic_func.func;
      identifier crtc, old_state;
      @@
      
      void func(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
      {
      +	struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, crtc);
      	...
      }
      
      @ depends on crtc_atomic_func @
      identifier crtc_atomic_func.func;
      expression E;
      type T;
      @@
      
      void func(...)
      {
      	...
      -	T state = E;
      +	T crtc_state = E;
      	<+...
      -	state
      +	crtc_state
      	...+>
      
      }
      
      @ depends on crtc_atomic_func @
      identifier crtc_atomic_func.func;
      type T;
      @@
      
      void func(...)
      {
      	...
      -	T state;
      +	T crtc_state;
      	<+...
      -	state
      +	crtc_state
      	...+>
      
      }
      
      @ depends on crtc_atomic_func @
      identifier crtc_atomic_func.func;
      identifier old_state;
      identifier crtc;
      @@
      
      void func(struct drm_crtc *crtc,
      -	       struct drm_crtc_state *old_state
      +	       struct drm_atomic_state *state
      	       )
      		{ ... }
      
      @ include depends on adds_old_state @
      @@
      
       #include <drm/drm_atomic.h>
      
      @ no_include depends on !include && adds_old_state @
      @@
      
      + #include <drm/drm_atomic.h>
        #include <drm/...>
      Signed-off-by: NMaxime Ripard <maxime@cerno.tech>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/845aa10ef171fc0ea060495efef142a0c13f7870.1602161031.git-series.maxime@cerno.tech
      351f950d
  7. 25 8月, 2020 1 次提交
    • T
      drm/omap: fix incorrect lock state · 7fd5b254
      Tomi Valkeinen 提交于
      After commit 92cc68e3 ("drm/vblank: Use
      spin_(un)lock_irq() in drm_crtc_vblank_on()") omapdrm locking is broken:
      
      WARNING: inconsistent lock state
      5.8.0-rc2-00483-g92cc68e3 #13 Tainted: G        W
      --------------------------------
      inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
      swapper/0/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
      ea98222c (&dev->event_lock#2){?.+.}-{2:2}, at: drm_handle_vblank+0x4c/0x520 [drm]
      {HARDIRQ-ON-W} state was registered at:
        trace_hardirqs_on+0x9c/0x1ec
        _raw_spin_unlock_irq+0x20/0x58
        omap_crtc_atomic_enable+0x54/0xa0 [omapdrm]
        drm_atomic_helper_commit_modeset_enables+0x218/0x270 [drm_kms_helper]
        omap_atomic_commit_tail+0x48/0xc4 [omapdrm]
        commit_tail+0x9c/0x190 [drm_kms_helper]
        drm_atomic_helper_commit+0x154/0x188 [drm_kms_helper]
        drm_client_modeset_commit_atomic+0x228/0x268 [drm]
        drm_client_modeset_commit_locked+0x60/0x1d0 [drm]
        drm_client_modeset_commit+0x24/0x40 [drm]
        drm_fb_helper_restore_fbdev_mode_unlocked+0x54/0xa8 [drm_kms_helper]
        drm_fb_helper_set_par+0x2c/0x5c [drm_kms_helper]
        drm_fb_helper_hotplug_event.part.0+0xa0/0xbc [drm_kms_helper]
        drm_kms_helper_hotplug_event+0x24/0x30 [drm_kms_helper]
        output_poll_execute+0x1a8/0x1c0 [drm_kms_helper]
        process_one_work+0x268/0x800
        worker_thread+0x30/0x4e0
        kthread+0x164/0x190
        ret_from_fork+0x14/0x20
      
      The reason for this is that omapdrm calls drm_crtc_vblank_on() while
      holding event_lock taken with spin_lock_irq().
      
      It is not clear why drm_crtc_vblank_on() and drm_crtc_vblank_get() are
      called while holding event_lock. I don't see any problem with moving
      those calls outside the lock, which is what this patch does.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200819103021.440288-1-tomi.valkeinen@ti.comReviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      7fd5b254
  8. 03 7月, 2020 1 次提交
    • D
      drm/atomic-helper: reset vblank on crtc reset · 51f644b4
      Daniel Vetter 提交于
      Only when vblanks are supported ofc.
      
      Some drivers do this already, but most unfortunately missed it. This
      opens up bugs after driver load, before the crtc is enabled for the
      first time. syzbot spotted this when loading vkms as a secondary
      output. Given how many drivers are buggy it's best to solve this once
      and for all in shared helper code.
      
      Aside from moving the few existing calls to drm_crtc_vblank_reset into
      helpers (i915 doesn't use helpers, so keeps its own) I think the
      regression risk is minimal: atomic helpers already rely on drivers
      calling drm_crtc_vblank_on/off correctly in their hooks when they
      support vblanks. And driver that's failing to handle vblanks after
      this is missing those calls already, and vblanks could only work by
      accident when enabling a CRTC for the first time right after boot.
      
      Big thanks to Tetsuo for helping track down what's going wrong here.
      
      There's only a few drivers which already had the necessary call and
      needed some updating:
      - komeda, atmel and tidss also needed to be changed to call
        __drm_atomic_helper_crtc_reset() intead of open coding it
      - tegra and msm even had it in the same place already, just code
        motion, and malidp already uses __drm_atomic_helper_crtc_reset().
      - Laurent noticed that rcar-du and omap open-code their crtc reset and
        hence would actually be broken by this patch now. So fix them up by
        reusing the helpers, which brings the drm_crtc_vblank_reset() back.
      
      Only call left is in i915, which doesn't use drm_mode_config_reset,
      but has its own fastboot infrastructure. So that's the only case where
      we actually want this in the driver still.
      
      I've also reviewed all other drivers which set up vblank support with
      drm_vblank_init. After the previous patch fixing mxsfb all atomic
      drivers do call drm_crtc_vblank_on/off as they should, the remaining
      drivers are either legacy kms or legacy dri1 drivers, so not affected
      by this change to atomic helpers.
      
      v2: Use the drm_dev_has_vblank() helper.
      
      v3: Laurent pointed out that omap and rcar-du used drm_crtc_vblank_off
      instead of drm_crtc_vblank_reset. Adjust them too.
      
      v4: Laurent noticed that rcar-du and omap open-code their crtc reset
      and hence would actually be broken by this patch now. So fix them up
      by reusing the helpers, which brings the drm_crtc_vblank_reset() back.
      
      v5: also mention rcar-du and ompadrm in the proper commit message
      above (Laurent).
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Acked-by: NMaxime Ripard <mripard@kernel.org>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
      Acked-by: NLiviu Dudau <liviu.dudau@arm.com>
      Acked-by: NThierry Reding <treding@nvidia.com>
      Link: https://syzkaller.appspot.com/bug?id=0ba17d70d062b2595e1f061231474800f076c7cbReported-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Reported-by: syzbot+0871b14ca2e2fb64f6e3@syzkaller.appspotmail.com
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: "James (Qian) Wang" <james.qian.wang@arm.com>
      Cc: Liviu Dudau <liviu.dudau@arm.com>
      Cc: Mihail Atanassov <mihail.atanassov@arm.com>
      Cc: Brian Starkey <brian.starkey@arm.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Boris Brezillon <bbrezillon@kernel.org>
      Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Jonathan Hunter <jonathanh@nvidia.com>
      Cc: Jyri Sarha <jsarha@ti.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: Brian Masney <masneyb@onstation.org>
      Cc: Emil Velikov <emil.velikov@collabora.com>
      Cc: zhengbin <zhengbin13@huawei.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-tegra@vger.kernel.org
      Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-renesas-soc@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200612160056.2082681-1-daniel.vetter@ffwll.ch
      51f644b4
  9. 11 2月, 2020 1 次提交
  10. 17 7月, 2019 1 次提交
  11. 19 6月, 2019 1 次提交
  12. 10 6月, 2019 3 次提交
  13. 18 3月, 2019 3 次提交
  14. 24 1月, 2019 1 次提交
  15. 10 1月, 2019 1 次提交
  16. 12 11月, 2018 1 次提交
    • L
      drm/omap: Move DISPC runtime PM handling to omapdrm · 24ec84e8
      Laurent Pinchart 提交于
      The internal encoders (DSI, HDMI4, HDMI5 and VENC) runtime PM handlers
      attempt to manage the runtime PM state of the connected DISPC, based on
      the rationale that the DISPC providing data to the encoders requires
      ensuring that the display is active whenever the encoders are active.
      
      While the DISPC provides data to the encoders, it doesn't as such
      constitute a resource that encoders require in order to be taken out
      of suspend, contrary to for instance a functional clock or a power
      supply. Encoders registers can be accessed without the DISPC being
      active, and while the encoders will not output any video stream without
      being fed by the DISPC, the DISPC PM state doesn't influence the
      encoders PM state.
      
      For this reason the DISPC PM state is better managed from the omapdrm
      driver, in the CRTC enable and disable operations. This allows the
      encoders PM state to be handled separately from the DISPC, and in
      particular at times when the DISPC may not be available (for instance at
      probe due to the DSS probe being deferred, or at remove time du to the
      DISPC being already removed).
      
      Fixes: edb715df ("drm/omap: dss: dsi: Move initialization code from bind to probe")
      Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181110111654.4387-5-laurent.pinchart@ideasonboard.com
      24ec84e8
  17. 03 9月, 2018 11 次提交