1. 17 Jan, 2024 6 commits
  2. 16 Jan, 2024 1 commit
  3. 15 Jan, 2024 5 commits
  4. 12 Jan, 2024 10 commits
  5. 11 Jan, 2024 4 commits
    • Maíra Canal's avatar
      drm/v3d: Show the memory-management stats on debugfs · 502756e2
      Maíra Canal authored
      Dump the contents of the DRM MM allocator of the V3D driver. This will
      help us to debug the VA ranges allocated.
      Signed-off-by: default avatarMaíra Canal <mcanal@igalia.com>
      Reviewed-by: default avatarMelissa Wen <mwen@igalia.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240105145851.193492-1-mcanal@igalia.com
      502756e2
    • Karolina Stolarek's avatar
    • Maíra Canal's avatar
      drm/vc4: don't check if plane->state->fb == state->fb · 5ee0d47d
      Maíra Canal authored
      Currently, when using non-blocking commits, we can see the following
      kernel warning:
      
      [  110.908514] ------------[ cut here ]------------
      [  110.908529] refcount_t: underflow; use-after-free.
      [  110.908620] WARNING: CPU: 0 PID: 1866 at lib/refcount.c:87 refcount_dec_not_one+0xb8/0xc0
      [  110.908664] Modules linked in: rfcomm snd_seq_dummy snd_hrtimer snd_seq snd_seq_device cmac algif_hash aes_arm64 aes_generic algif_skcipher af_alg bnep hid_logitech_hidpp vc4 brcmfmac hci_uart btbcm brcmutil bluetooth snd_soc_hdmi_codec cfg80211 cec drm_display_helper drm_dma_helper drm_kms_helper snd_soc_core snd_compress snd_pcm_dmaengine fb_sys_fops sysimgblt syscopyarea sysfillrect raspberrypi_hwmon ecdh_generic ecc rfkill libaes i2c_bcm2835 binfmt_misc joydev snd_bcm2835(C) bcm2835_codec(C) bcm2835_isp(C) v4l2_mem2mem videobuf2_dma_contig snd_pcm bcm2835_v4l2(C) raspberrypi_gpiomem bcm2835_mmal_vchiq(C) videobuf2_v4l2 snd_timer videobuf2_vmalloc videobuf2_memops videobuf2_common snd videodev vc_sm_cma(C) mc hid_logitech_dj uio_pdrv_genirq uio i2c_dev drm fuse dm_mod drm_panel_orientation_quirks backlight ip_tables x_tables ipv6
      [  110.909086] CPU: 0 PID: 1866 Comm: kodi.bin Tainted: G         C         6.1.66-v8+ #32
      [  110.909104] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT)
      [  110.909114] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      [  110.909132] pc : refcount_dec_not_one+0xb8/0xc0
      [  110.909152] lr : refcount_dec_not_one+0xb4/0xc0
      [  110.909170] sp : ffffffc00913b9c0
      [  110.909177] x29: ffffffc00913b9c0 x28: 000000556969bbb0 x27: 000000556990df60
      [  110.909205] x26: 0000000000000002 x25: 0000000000000004 x24: ffffff8004448480
      [  110.909230] x23: ffffff800570b500 x22: ffffff802e03a7bc x21: ffffffecfca68c78
      [  110.909257] x20: ffffff8002b42000 x19: ffffff802e03a600 x18: 0000000000000000
      [  110.909283] x17: 0000000000000011 x16: ffffffffffffffff x15: 0000000000000004
      [  110.909308] x14: 0000000000000fff x13: ffffffed577e47e0 x12: 0000000000000003
      [  110.909333] x11: 0000000000000000 x10: 0000000000000027 x9 : c912d0d083728c00
      [  110.909359] x8 : c912d0d083728c00 x7 : 65646e75203a745f x6 : 746e756f63666572
      [  110.909384] x5 : ffffffed579f62ee x4 : ffffffed579eb01e x3 : 0000000000000000
      [  110.909409] x2 : 0000000000000000 x1 : ffffffc00913b750 x0 : 0000000000000001
      [  110.909434] Call trace:
      [  110.909441]  refcount_dec_not_one+0xb8/0xc0
      [  110.909461]  vc4_bo_dec_usecnt+0x4c/0x1b0 [vc4]
      [  110.909903]  vc4_cleanup_fb+0x44/0x50 [vc4]
      [  110.910315]  drm_atomic_helper_cleanup_planes+0x88/0xa4 [drm_kms_helper]
      [  110.910669]  vc4_atomic_commit_tail+0x390/0x9dc [vc4]
      [  110.911079]  commit_tail+0xb0/0x164 [drm_kms_helper]
      [  110.911397]  drm_atomic_helper_commit+0x1d0/0x1f0 [drm_kms_helper]
      [  110.911716]  drm_atomic_commit+0xb0/0xdc [drm]
      [  110.912569]  drm_mode_atomic_ioctl+0x348/0x4b8 [drm]
      [  110.913330]  drm_ioctl_kernel+0xec/0x15c [drm]
      [  110.914091]  drm_ioctl+0x24c/0x3b0 [drm]
      [  110.914850]  __arm64_sys_ioctl+0x9c/0xd4
      [  110.914873]  invoke_syscall+0x4c/0x114
      [  110.914897]  el0_svc_common+0xd0/0x118
      [  110.914917]  do_el0_svc+0x38/0xd0
      [  110.914936]  el0_svc+0x30/0x8c
      [  110.914958]  el0t_64_sync_handler+0x84/0xf0
      [  110.914979]  el0t_64_sync+0x18c/0x190
      [  110.914996] ---[ end trace 0000000000000000 ]---
      
      This happens because, although `prepare_fb` and `cleanup_fb` are
      perfectly balanced, we cannot guarantee consistency in the check
      plane->state->fb == state->fb. This means that sometimes we can increase
      the refcount in `prepare_fb` and don't decrease it in `cleanup_fb`. The
      opposite can also be true.
      
      In fact, the struct drm_plane .state shouldn't be accessed directly
      but instead, the `drm_atomic_get_new_plane_state()` helper function should
      be used. So, we could stick to this check, but using
      `drm_atomic_get_new_plane_state()`. But actually, this check is not really
      needed. We can increase and decrease the refcount symmetrically without
      problems.
      
      This is going to make the code more simple and consistent.
      Signed-off-by: default avatarMaíra Canal <mcanal@igalia.com>
      Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240105175908.242000-1-mcanal@igalia.com
      5ee0d47d
    • chenxuebing's avatar
      drm/edid: Clean up errors in drm_edid.c · cbe7cea7
      chenxuebing authored
      Fix the following errors reported by checkpatch:
      
      ERROR: do not use assignment in if condition
      Signed-off-by: default avatarchenxuebing <chenxb_99091@126.com>
      Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240111063921.8701-1-chenxb_99091@126.com
      cbe7cea7
  6. 10 Jan, 2024 3 commits
  7. 09 Jan, 2024 5 commits
  8. 08 Jan, 2024 6 commits
    • Hsin-Yi Wang's avatar
      drm/panel-edp: use put_sync in unprepare · 49ddab08
      Hsin-Yi Wang authored
      Some edp panel requires T10 (Delay from end of valid video data transmitted
      by the Source device to power-off) less than 500ms. Using autosuspend with
      delay set as 1000 violates this requirement.
      
      Use put_sync_suspend in unprepare to meet the spec. For other cases (such
      as getting EDID), it still uses autosuspend.
      Suggested-by: default avatarDouglas Anderson <dianders@chromium.org>
      Fixes: 3235b0f2 ("drm/panel: panel-simple: Use runtime pm to avoid excessive unprepare / prepare")
      Signed-off-by: default avatarHsin-Yi Wang <hsinyi@chromium.org>
      Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20231220221418.2610185-1-hsinyi@chromium.org
      49ddab08
    • Vegard Nossum's avatar
      drm/nouveau: uapi: fix kerneldoc warnings · 251ba458
      Vegard Nossum authored
      As of commit b77fdd6a ("scripts/kernel-doc: restore warning for
      Excess struct/union"), we see the following warnings when running 'make
      htmldocs':
      
        ./include/uapi/drm/nouveau_drm.h:292: warning: Excess struct member 'DRM_NOUVEAU_VM_BIND_OP_MAP' description in 'drm_nouveau_vm_bind_op'
        ./include/uapi/drm/nouveau_drm.h:292: warning: Excess struct member 'DRM_NOUVEAU_VM_BIND_OP_UNMAP' description in 'drm_nouveau_vm_bind_op'
        ./include/uapi/drm/nouveau_drm.h:292: warning: Excess struct member 'DRM_NOUVEAU_VM_BIND_SPARSE' description in 'drm_nouveau_vm_bind_op'
        ./include/uapi/drm/nouveau_drm.h:336: warning: Excess struct member 'DRM_NOUVEAU_VM_BIND_RUN_ASYNC' description in 'drm_nouveau_vm_bind'
      
      The problem is that these values are #define constants, but had kerneldoc
      comments attached to them as if they were actual struct members.
      
      There are a number of ways we could fix this, but I chose to draw
      inspiration from include/uapi/drm/i915_drm.h, which pulls them into the
      corresponding kerneldoc comment for the struct member that they are
      intended to be used with.
      
      To keep the diff readable, there are a number of things I _didn't_ do in
      this patch, but which we should also consider:
      
      - This is pretty good documentation, but it ends up in gpu/driver-uapi,
        which is part of subsystem-apis/ when it really ought to display under
        userspace-api/ (the "Linux kernel user-space API guide" book of the
        documentation).
      
      - More generally, we might want a warning if include/uapi/ files are
        kerneldoc'd outside userspace-api/.
      
      - I'd consider it cleaner if the #defines appeared between the kerneldoc
        for the member and the member itself (which is something other DRM-
        related UAPI docs do).
      
      - The %IDENTIFIER kerneldoc syntax is intended for "constants", and is
        more appropriate in this context than ``IDENTIFIER`` or &IDENTIFIER.
        The DRM docs aren't very consistent on this.
      
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
      Reviewed-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarDanilo Krummrich <dakr@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20231225065145.3060754-1-vegard.nossum@oracle.com
      251ba458
    • Randy Dunlap's avatar
      drm/nouveau/volt/gk20a: don't misuse kernel-doc comments · eeb8e8d9
      Randy Dunlap authored
      Change kernel-doc "/**" comments to common "/*" comments to prevent
      kernel-doc warnings:
      
      gk20a.c:49: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
       * cvb_mv = ((c2 * speedo / s_scale + c1) * speedo / s_scale + c0)
      gk20a.c:49: warning: missing initial short description on line:
       * cvb_mv = ((c2 * speedo / s_scale + c1) * speedo / s_scale + c0)
      gk20a.c:62: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
       * cvb_t_mv =
      gk20a.c:62: warning: missing initial short description on line:
       * cvb_t_mv =
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Karol Herbst <kherbst@redhat.com>
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: Danilo Krummrich <dakr@redhat.com>
      Cc: nouveau@lists.freedesktop.org
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Signed-off-by: default avatarDanilo Krummrich <dakr@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20231231233633.6596-4-rdunlap@infradead.org
      eeb8e8d9
    • Randy Dunlap's avatar
      drm/nouveau/gr/gf100: don't misuse kernel-doc comments · ce6106ff
      Randy Dunlap authored
      Change kernel-doc "/**" comments to common "/*" comments to prevent
      kernel-doc warnings:
      
      gf100.c:1044: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
       * Wait until GR goes idle. GR is considered idle if it is disabled by the
      gf100.c:1044: warning: missing initial short description on line:
       * Wait until GR goes idle. GR is considered idle if it is disabled by the
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Karol Herbst <kherbst@redhat.com>
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: Danilo Krummrich <dakr@redhat.com>
      Cc: nouveau@lists.freedesktop.org
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Signed-off-by: default avatarDanilo Krummrich <dakr@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20231231233633.6596-3-rdunlap@infradead.org
      ce6106ff
    • Randy Dunlap's avatar
      drm/nouveau: don't misuse kernel-doc comments · 607a9b29
      Randy Dunlap authored
      Change kernel-doc "/**" comments to common "/*" comments to prevent
      kernel-doc warnings:
      
      nouveau_ioc32.c:2: warning: Cannot understand  * \file mga_ioc32.c
       on line 2 - I thought it was a doc line
      nouveau_ioc32.c:52: warning: Function parameter or member 'filp' not described in 'nouveau_compat_ioctl'
      nouveau_ioc32.c:52: warning: Function parameter or member 'cmd' not described in 'nouveau_compat_ioctl'
      nouveau_ioc32.c:52: warning: Function parameter or member 'arg' not described in 'nouveau_compat_ioctl'
      nouveau_ioc32.c:52: warning: expecting prototype for Called whenever a 32-bit process running under a 64(). Prototype was for nouveau_compat_ioctl() instead
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Karol Herbst <kherbst@redhat.com>
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: Danilo Krummrich <dakr@redhat.com>
      Cc: nouveau@lists.freedesktop.org
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Signed-off-by: default avatarDanilo Krummrich <dakr@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20231231233633.6596-2-rdunlap@infradead.org
      607a9b29
    • Randy Dunlap's avatar
      drm/nouveau/disp: don't misuse kernel-doc comments · 648c3814
      Randy Dunlap authored
      Change kernel-doc "/**" comments to common "/*" comments to prevent
      kernel-doc warnings:
      
      crtc.c:453: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
       * Sets up registers for the given mode/adjusted_mode pair.
      crtc.c:453: warning: missing initial short description on line:
       * Sets up registers for the given mode/adjusted_mode pair.
      crtc.c:629: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
       * Sets up registers for the given mode/adjusted_mode pair.
      crtc.c:629: warning: missing initial short description on line:
       * Sets up registers for the given mode/adjusted_mode pair.
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Karol Herbst <kherbst@redhat.com>
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: Danilo Krummrich <dakr@redhat.com>
      Cc: nouveau@lists.freedesktop.org
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Signed-off-by: default avatarDanilo Krummrich <dakr@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20231231233633.6596-1-rdunlap@infradead.org
      648c3814