1. 02 Oct, 2023 11 commits
  2. 30 Sep, 2023 2 commits
  3. 28 Sep, 2023 4 commits
  4. 27 Sep, 2023 5 commits
  5. 25 Sep, 2023 6 commits
  6. 22 Sep, 2023 8 commits
  7. 21 Sep, 2023 4 commits
    • Ville Syrjälä's avatar
      drm/edid: Fixup h/vsync_end instead of h/vtotal · 2682768b
      Ville Syrjälä authored
      There are some weird EDIDs floating around that have the sync
      pulse extending beyond the end of the blanking period.
      
      On the currently problemtic machine (HP Omni 120) EDID reports
      the following mode:
      "1600x900": 60 108000 1600 1780 1860 1800 900 910 913 1000 0x40 0x5
      which is then "corrected" to have htotal=1861 by the current drm_edid.c
      code.
      
      The fixup code was originally added in commit 7064fef5 ("drm: work
      around EDIDs with bad htotal/vtotal values"). Googling around we end up in
      https://bugs.launchpad.net/ubuntu/hardy/+source/xserver-xorg-video-intel/+bug/297245
      where we find an EDID for a Dell Studio 15, which reports:
      (II) VESA(0): clock: 65.0 MHz   Image Size:  331 x 207 mm
      (II) VESA(0): h_active: 1280  h_sync: 1328  h_sync_end 1360 h_blank_end 1337 h_border: 0
      (II) VESA(0): v_active: 800  v_sync: 803  v_sync_end 809 v_blanking: 810 v_border: 0
      
      Note that if we use the hblank size (as opposed of the hsync_end)
      from the DTD to determine htotal we get exactly 60Hz refresh rate in
      both cases, whereas using hsync_end to determine htotal we get a
      slightly lower refresh rates. This makes me believe the using the
      hblank size is what was intended even in those cases.
      
      Also note that in case of the HP Onmi 120 the VBIOS boots with these:
        crtc timings: 108000 1600 1780 1860 1800 900 910 913 1000, type: 0x40 flags: 0x5
      ie. it just blindly stuffs the bogus hsync_end and htotal from the DTD
      into the transcoder timing registers, and the display works. I believe
      the (at least more modern) hardware will automagically terminate the hsync
      pulse when the timing generator reaches htotal, which again points that we
      should use the hblank size to determine htotal. Unfortunatley the old bug
      reports for the Dell machines are extremely lacking in useful details so
      we have no idea what kind of timings the VBIOS programmed into the
      hardware :(
      
      Let's just flip this quirk around and reduce the length of the sync
      pulse instead of extending the blanking period. This at least seems
      to be the correct thing to do on more modern hardware. And if any
      issues crop up on older hardware we need to debug them properly.
      
      v2: Add debug message breadcrumbs (Jani)
      Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8895Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230920211934.14920-1-ville.syrjala@linux.intel.com
      2682768b
    • Douglas Anderson's avatar
      drm/hisilicon/kirin: Call drm_atomic_helper_shutdown() at shutdown/unbind time · 918ce090
      Douglas Anderson authored
      Based on grepping through the source code this driver appears to be
      missing a call to drm_atomic_helper_shutdown() at system shutdown time
      and at driver unbind time. Among other things, this means that if a
      panel is in use that it won't be cleanly powered off at system
      shutdown time.
      
      The fact that we should call drm_atomic_helper_shutdown() in the case
      of OS shutdown/restart and at driver remove (or unbind) time comes
      straight out of the kernel doc "driver instance overview" in
      drm_drv.c.
      
      I have attempted to put this in the right place at unbind time. In
      most other DRM drivers the call is made right after the call to
      drm_kms_helper_poll_fini(), so I've put it there. That means that this
      call will also be made in the case that we hit errors in bind, since
      kirin_drm_kms_cleanup() is called both in the bind error path and in
      unbind. I believe this is harmless even though it's not needed in the
      bind error path.
      
      For handling shutdown, we rely on the common technique of seeing if
      the drvdata is NULL to know whether we need to call
      drm_atomic_helper_shutdown(). This makes it important to make sure
      that the drvdata is NULL if bind failed or if unbind was called. We
      don't need the actual check for NULL and we'll rely on the patch
      ("drm/atomic-helper: drm_atomic_helper_shutdown(NULL) should be a
      noop").
      Suggested-by: default avatarMaxime Ripard <mripard@kernel.org>
      Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230901163944.RFT.6.I21e0916bbd276033f7d31979c0da171458dedd4d@changeid
      918ce090
    • Douglas Anderson's avatar
      drm: Call drm_atomic_helper_shutdown() at shutdown/remove time for misc drivers · 3c4babae
      Douglas Anderson authored
      Based on grepping through the source code these drivers appear to be
      missing a call to drm_atomic_helper_shutdown() at system shutdown time
      and at driver remove (or unbind) time. Among other things, this means
      that if a panel is in use that it won't be cleanly powered off at
      system shutdown time.
      
      The fact that we should call drm_atomic_helper_shutdown() in the case
      of OS shutdown/restart and at driver remove (or unbind) time comes
      straight out of the kernel doc "driver instance overview" in
      drm_drv.c.
      
      A few notes about these fixes:
      - I confirmed that these drivers were all DRIVER_MODESET type drivers,
        which I believe makes this relevant.
      - I confirmed that these drivers were all DRIVER_ATOMIC.
      - When adding drm_atomic_helper_shutdown() to the remove/unbind path,
        I added it after drm_kms_helper_poll_fini() when the driver had
        it. This seemed to be what other drivers did. If
        drm_kms_helper_poll_fini() wasn't there I added it straight after
        drm_dev_unregister().
      - This patch deals with drivers using the component model in similar
        ways as the patch ("drm: Call drm_atomic_helper_shutdown() at
        shutdown time for misc drivers")
      - These fixes rely on the patch ("drm/atomic-helper:
        drm_atomic_helper_shutdown(NULL) should be a noop") to simplify
        shutdown.
      Suggested-by: default avatarMaxime Ripard <mripard@kernel.org>
      Reviewed-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
      Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> # tilcdc
      Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230901163944.RFT.5.I771eb4bd03d8772b19e7dcfaef3e2c167bce5846@changeid
      3c4babae
    • Douglas Anderson's avatar
      drm/ssd130x: Call drm_atomic_helper_shutdown() at remove time · 10c8204c
      Douglas Anderson authored
      Based on grepping through the source code, this driver appears to be
      missing a call to drm_atomic_helper_shutdown() at remove time. Let's
      add it.
      
      The fact that we should call drm_atomic_helper_shutdown() in the case
      of OS driver remove comes straight out of the kernel doc "driver
      instance overview" in drm_drv.c.
      Suggested-by: default avatarMaxime Ripard <mripard@kernel.org>
      Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230901163944.RFT.4.I4752a39ad9f8fd08b32c2b78a8a3e40491bfb5eb@changeid
      10c8204c