Skip to content
  1. Feb 19, 2021
  2. Feb 18, 2021
    • Imre Deak's avatar
      drm/dp_mst: Tune down the WARN modesetting a port with full_pbn=0 · f0297cc0
      Imre Deak authored
      
      
      It's possible to modeset a connector/mst port that has a 0 full_pbn
      value: if the sink on the port deasserts its HPD and a branch device
      reports this via a CSN with the port's ddps=0 and pdt!=NONE the driver
      clears full_pbn, but the corresponding connector can be still
      modesetted.
      
      This happened on a DELL U2719D monitor as the branch device and an LG
      27UL650-W daisy-chained to it, the LG monitor generating a long HPD
      pulse (doing this for some reason always when waking up from some power
      saving state).
      
      Tune down the WARN about this scenario to a debug message.
      
      v2: Use the correct atomic debug message level. (Lyude)
      
      References: https://gitlab.freedesktop.org/drm/intel/-/issues/1917
      Cc: Lyude Paul <lyude@redhat.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210216123448.410545-1-imre.deak@intel.com
      f0297cc0
    • Sebastian Andrzej Siewior's avatar
      video: fbdev: amba-clcd: Always use msleep() for waiting · 1b588c82
      Sebastian Andrzej Siewior authored
      
      
      The driver uses in_atomic() to distinguish between mdelay() and msleep().
      
      The usage of in_interrupt() in drivers is phased out and Linus clearly
      requested that code which changes behaviour depending on context should
      either be separated or the context be conveyed in an argument passed by the
      caller, which usually knows the context.
      
      I traced the usage of in_interrupt() back to its initial merge:
          bfe694f833643 ("[ARM] Add ARM AMBA CLCD framebuffer driver.")
          https://git.kernel.org/history/history/c/bfe694f833643
      
      The driver has been removed and added back in the meantime.
      I've been looking for the IRQ context as described in the comment and
      couldn't find it. The functions calling clcdfb_sleep() also call
      conditionally backlight_update_status() which acquires a mutex. If it is
      okay to acquire a mutex then it is okay to use msleep() since both
      functions must be used in preemptible context.
      
      Replace clcdfb_sleep() with msleep().
      
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210208223810.388502-4-bigeasy@linutronix.de
      1b588c82
    • Ahmed S. Darwish's avatar
      video: omapfb: Remove WARN_ON(in_interrupt()). · 51be84fc
      Ahmed S. Darwish authored
      
      
      dsi_sync_vc() uses in_interrupt() to create a warning if the function is
      used in non-preemptible context.
      
      The usage of in_interrupt() in drivers is phased out and Linus clearly
      requested that code which changes behaviour depending on context should
      either be separated or the context be conveyed in an argument passed by the
      caller, which usually knows the context.
      
      The wait_for_completion() function (used in dsi_sync_vc_vp() and
      dsi_sync_vc_l4() has already a check if it is invoked from proper
      context.
      
      Remove WARN_ON(in_interrupt()) from the driver.
      
      Cc: linux-omap@vger.kernel.org
      Signed-off-by: default avatarAhmed S. Darwish <a.darwish@linutronix.de>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210208223810.388502-3-bigeasy@linutronix.de
      51be84fc
    • Ahmed S. Darwish's avatar
      video: omap: Remove in_interrupt() usage. · 6e4863db
      Ahmed S. Darwish authored
      
      
      alloc_req() uses in_interrupt() to detect if it is safe to use down().
      
      The usage of in_interrupt() in drivers is phased out and Linus clearly
      requested that code which changes behaviour depending on context should
      either be separated or the context be conveyed in an argument passed by the
      caller, which usually knows the context.
      
      The semaphore is used as a counting semaphore, initialized with the
      number of slots in the request pool minus IRQ_REQ_POOL_SIZE - which are
      reserved for the in_interrupt() user to ensure that a request is always
      available. The preemptible user will block on the semphore waiting for a
      request to become available in case there are no requests available.
      
      Replace in_interrupt() with a `can_sleep' argument to indicate if it is
      safe to block on the sempahore.
      
      Cc: linux-omap@vger.kernel.org
      Signed-off-by: default avatarAhmed S. Darwish <a.darwish@linutronix.de>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210208223810.388502-2-bigeasy@linutronix.de
      6e4863db
  3. Feb 17, 2021
  4. Feb 16, 2021
    • Marek Vasut's avatar
      drm/stm: Fix bus_flags handling · 99e36044
      Marek Vasut authored
      The drm_display_mode_to_videomode() does not populate DISPLAY_FLAGS_DE_LOW
      or DISPLAY_FLAGS_PIXDATA_NEGEDGE flags in struct videomode. Therefore, no
      matter what polarity the next bridge or display might require, these flags
      are never set, and thus the LTDC GCR_DEPOL and GCR_PCPOL bits are never set
      and the LTDC behaves as if both DISPLAY_FLAGS_PIXDATA_POSEDGE and
      DISPLAY_FLAGS_DE_HIGH were always set.
      
      The fix for this problem is taken almost verbatim from MXSFB driver. In
      case there is a bridge attached to the LTDC, the bridge might have extra
      polarity requirements, so extract bus_flags from the bridge and use them
      for LTDC configuration. Otherwise, extract bus_flags from the connector,
      which is the display.
      
      Fixes: b759012c
      
       ("drm/stm: Add STM32 LTDC driver")
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Signed-off-by: default avatarYannick Fertre <yannick.fertre@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Cc: Antonio Borneo <antonio.borneo@st.com>
      Cc: Benjamin Gaignard <benjamin.gaignard@st.com>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      Cc: Philippe Cornu <philippe.cornu@st.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Vincent Abriou <vincent.abriou@st.com>
      Cc: Yannick Fertre <yannick.fertre@st.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-stm32@st-md-mailman.stormreply.com
      To: dri-devel@lists.freedesktop.org
      Tested-by: default avatarYannick Fertre <yannick.fertre@foss.st.com>
      Signed-off-by: default avatarPhilippe Cornu <philippe.cornu@foss.st.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210127110756.125570-1-marex@denx.de
      99e36044
  5. Feb 15, 2021
  6. Feb 12, 2021
  7. Feb 11, 2021
  8. Feb 10, 2021
    • Julia Lawall's avatar
      drm: use getter/setter functions · 5dd331d4
      Julia Lawall authored
      
      
      Use getter and setter functions, for platform_device structures and a
      mipi_dsi_device structure.
      
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@inria.fr>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210209211304.1261740-1-Julia.Lawall@inria.fr
      5dd331d4
    • Daniel Vetter's avatar
      drm/vblank: Document drm_crtc_vblank_restore constraints · f66aaab8
      Daniel Vetter authored
      
      
      I got real badly confused when trying to review a fix from Ville for
      this. Let's try to document better what's required for this, and check
      the minimal settings at runtime - we can't check ofc that there's
      indeed no races in the driver callback.
      
      Also noticed that the drm_vblank_restore version is unused, so lets
      unexport that while at it.
      
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210209101523.2954281-1-daniel.vetter@ffwll.ch
      f66aaab8
    • Roman Stratiienko's avatar
      drm/sun4i: Add alpha property for sun8i and sun50i VI layer · c0f6f0c4
      Roman Stratiienko authored
      
      
      DE3.0 VI layers supports plane-global alpha channel.
      DE2.0 FCC block have GLOBAL_ALPHA register that can be used as alpha source
      for blender.
      
      Add alpha property to the DRM plane and connect it to the
      corresponding registers in the mixer.
      
      Do not add alpha property for V3s SOC that have DE2.0 and 2 VI planes.
      
      Signed-off-by: default avatarRoman Stratiienko <r.stratiienko@gmail.com>
      Reviewed-by: default avatarJernej Skrabec <jernej.skrabec@siol.net>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210128113940.347013-3-r.stratiienko@gmail.com
      c0f6f0c4
    • Roman Stratiienko's avatar
      drm/sun4i: Add alpha property for sun8i UI layer · 0ee29373
      Roman Stratiienko authored
      
      
      DE2.0 and DE3.0 UI layers supports plane-global alpha channel.
      Add alpha property to the DRM plane and connect it to the
      corresponding registers in mixer.
      
      Signed-off-by: default avatarRoman Stratiienko <r.stratiienko@gmail.com>
      Reviewed-by: default avatarJernej Skrabec <jernej.skrabec@siol.net>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210128113940.347013-2-r.stratiienko@gmail.com
      0ee29373
    • Joel Stanley's avatar
      drm/aspeed: Use dt matching for default register values · bce724fa
      Joel Stanley authored
      
      
      There are minor differences in the values for the threshold value and
      the scan line size between families of ASPEED SoC. Additionally the SCU
      registers for the output control and scratch registers differ between
      families.
      
      This adds device tree matching to parameterise these values, allowing us
      to add support for the AST2400 now, and in the future the AST2600.
      
      Reviewed-by: default avatarJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210209123734.130483-3-joel@jms.id.au
      bce724fa
    • Joel Stanley's avatar
      drm/aspeed: Look up syscon by phandle · 92614ad5
      Joel Stanley authored
      
      
      This scales better to multiple families of SoC. The lookup by compatible
      can be removed in a future change.
      
      The fallback path is for the ast2500 platform only. Other platforms will
      be added with the new style, so they won't need fallback paths.
      
      Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
      Reviewed-by: default avatarAndrew Jeffery <andrew@aj.id.au>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210209123734.130483-2-joel@jms.id.au
      92614ad5
    • Quanyang Wang's avatar
      drm/tilcdc: send vblank event when disabling crtc · f1a75f4d
      Quanyang Wang authored
      When run xrandr to change resolution on Beaglebone Black board, it will
      print the error information:
      
      root@beaglebone:~# xrandr -display :0 --output HDMI-1 --mode 720x400
      [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out
      [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:32:tilcdc crtc] commit wait timed out
      [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out
      [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:34:HDMI-A-1] commit wait timed out
      [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out
      [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:31:plane-0] commit wait timed out
      tilcdc 4830e000.lcdc: already pending page flip!
      
      This is because there is operation sequence as below:
      
      drm_atomic_connector_commit_dpms(mode is DRM_MODE_DPMS_OFF):
          ...
          drm_atomic_helper_setup_commit <- init_completion(commit_A->flip_done)
          drm_atomic_helper_commit_tail
              tilcdc_crtc_atomic_disable
              tilcdc_plane_atomic_update <- drm_crtc_send_vblank_event in tilcdc_crtc_irq
                                            is skipped since tilcdc_crtc->enabled is 0
              tilcdc_crtc_atomic_flush   <- drm_crtc_send_vblank_event is skipped since
                                            crtc->state->event is set to be NULL in
                                            tilcdc_plane_atomic_update
      drm_mode_setcrtc:
          ...
          drm_atomic_helper_setup_commit <- init_completion(commit_B->flip_done)
          drm_atomic_helper_wait_for_dependencies
              drm_crtc_commit_wait   <- wait for commit_A->flip_done completing
      
      Just as shown above, the steps which could complete commit_A->flip_done
      are all skipped and commit_A->flip_done will never be completed. This will
      result a time-out ERROR when drm_crtc_commit_wait check the commit_A->flip_done.
      So add drm_crtc_send_vblank_event in tilcdc_crtc_atomic_disable to
      complete commit_A->flip_done.
      
      Fixes: cb345dec
      
       ("drm/tilcdc: Use standard drm_atomic_helper_commit")
      Signed-off-by: default avatarQuanyang Wang <quanyang.wang@windriver.com>
      Reviewed-by: default avatarJyri Sarha <jyri.sarha@iki.fi>
      Tested-by: default avatarJyri Sarha <jyri.sarha@iki.fi>
      Signed-off-by: default avatarJyri Sarha <jyri.sarha@iki.fi>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210209082415.382602-1-quanyang.wang@windriver.com
      f1a75f4d
    • Christian König's avatar
      drm/ttm: drop sysfs directory · ed89fff9
      Christian König authored
      
      
      Not used any more.
      
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210208133226.36955-3-christian.koenig@amd.com
      ed89fff9
    • Christian König's avatar
      drm/ttm: move memory accounting into vmwgfx v4 · f07069da
      Christian König authored
      
      
      This is just another feature which is only used by VMWGFX, so move
      it into the driver instead.
      
      I've tried to add the accounting sysfs file to the kobject of the drm
      minor, but I'm not 100% sure if this works as expected.
      
      v2: fix typo in KFD and avoid 64bit divide
      v3: fix init order in VMWGFX
      v4: use pdev sysfs reference instead of drm
      
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: Zack Rusin <zackr@vmware.com> (v3)
      Tested-by: default avatarNirmoy Das <nirmoy.das@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210208133226.36955-2-christian.koenig@amd.com
      f07069da
    • Christian König's avatar
      drm/ttm: rework ttm_tt page limit v4 · d4bd7776
      Christian König authored
      
      
      TTM implements a rather extensive accounting of allocated memory.
      
      There are two reasons for this:
      1. It tries to block userspace allocating a huge number of very small
         BOs without accounting for the kmalloced memory.
      
      2. Make sure we don't over allocate and run into an OOM situation
         during swapout while trying to handle the memory shortage.
      
      This is only partially a good idea. First of all it is perfectly
      valid for an application to use all of system memory, limiting it to
      50% is not really acceptable.
      
      What we need to take care of is that the application is held
      accountable for the memory it allocated. This is what control
      mechanisms like memcg and the normal Linux page accounting already do.
      
      Making sure that we don't run into an OOM situation while trying to
      cope with a memory shortage is still a good idea, but this is also
      not very well implemented since it means another opportunity of
      recursion from the driver back into TTM.
      
      So start to rework all of this by implementing a shrinker callback which
      allows for TT object to be swapped out if necessary.
      
      v2: Switch from limit to shrinker callback.
      v3: fix gfp mask handling, use atomic for swapable_pages, add debugfs
      v4: drop the extra gfp_mask checks
      
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210208133226.36955-1-christian.koenig@amd.com
      d4bd7776
  9. Feb 09, 2021