1. 09 Apr, 2021 19 commits
  2. 08 Apr, 2021 16 commits
  3. 07 Apr, 2021 1 commit
  4. 01 Apr, 2021 4 commits
    • Ville Syrjälä's avatar
      drm/vblank: Do not store a new vblank timestamp in drm_vblank_restore() · 167b4002
      Ville Syrjälä authored
      drm_vblank_restore() exists because certain power saving states
      can clobber the hardware frame counter. The way it does this is
      by guesstimating how many frames were missed purely based on
      the difference between the last stored timestamp vs. a newly
      sampled timestamp.
      
      If we should call this function before a full frame has
      elapsed since we sampled the last timestamp we would end up
      with a possibly slightly different timestamp value for the
      same frame. Currently we will happily overwrite the already
      stored timestamp for the frame with the new value. This
      could cause userspace to observe two different timestamps
      for the same frame (and the timestamp could even go
      backwards depending on how much error we introduce when
      correcting the timestamp based on the scanout position).
      
      To avoid that let's not update the stored timestamp at all,
      and instead we just fix up the last recorded hw vblank counter
      value such that the already stored timestamp/seq number will
      match. Thus the next time a vblank irq happens it will calculate
      the correct diff between the current and stored hw vblank counter
      values.
      
      Sidenote: Another possible idea that came to mind would be to
      do this correction only if the power really was removed since
      the last time we sampled the hw frame counter. But to do that
      we would need a robust way to detect when it has occurred. Some
      possibilities could involve some kind of hardare power well
      transition counter, or potentially we could store a magic value
      in a scratch register that lives in the same power well. But
      I'm not sure either of those exist, so would need an actual
      investigation to find out. All of that is very hardware specific
      of course, so would have to be done in the driver code.
      
      Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210218160305.16711-1-ville.syrjala@linux.intel.comReviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      167b4002
    • Ville Syrjälä's avatar
      drm: Refuse to create zero width/height cmdline modes · 19a9a0ef
      Ville Syrjälä authored
      If the user specifies zero width/height cmdline mode i915 will
      blow up as the fbdev path will bypass the regular fb sanity
      check that would otherwise have refused to create a framebuffer
      with zero width/height.
      
      The reason I thought to try this is so that I can force a specific
      depth for fbdev without actually having to hardcode the mode
      on the kernel cmdline. Eg. if I pass video=0x0-8 I will get an
      8bpp framebuffer at my monitor's native resolution.
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190607162611.23514-2-ville.syrjala@linux.intel.comReviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      19a9a0ef
    • Julian Braha's avatar
      drivers: gpu: drm: bridge: fix kconfig dependency on DRM_KMS_HELPER · 62066d31
      Julian Braha authored
      When DRM_TOSHIBA_TC358762 is enabled and DRM_KMS_HELPER is disabled,
      Kbuild gives the following warning:
      
      WARNING: unmet direct dependencies detected for DRM_PANEL_BRIDGE
        Depends on [n]: HAS_IOMEM [=y] && DRM_BRIDGE [=y] && DRM_KMS_HELPER [=n]
        Selected by [y]:
        - DRM_TOSHIBA_TC358762 [=y] && HAS_IOMEM [=y] && DRM [=y] && DRM_BRIDGE [=y] && OF [=y]
      
      This is because DRM_TOSHIBA_TC358762 selects DRM_PANEL_BRIDGE,
      without depending on or selecting DRM_KMS_HELPER,
      despite that config option depending on DRM_KMS_HELPER.
      Signed-off-by: default avatarJulian Braha <julianbraha@gmail.com>
      Reviewed-by: default avatarRobert Foss <robert.foss@linaro.org>
      Signed-off-by: default avatarRobert Foss <robert.foss@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210222215502.24487-1-julianbraha@gmail.com
      62066d31
    • Dafna Hirschfeld's avatar
      drm/mediatek: Don't support hdmi connector creation · 2e477391
      Dafna Hirschfeld authored
      commit f0119514 ("drm/mediatek: mtk_dpi: Create connector for bridges")
      broke the display support for elm device since mtk_dpi calls
      drm_bridge_attach with the flag DRM_BRIDGE_ATTACH_NO_CONNECTOR
      while mtk_hdmi does not yet support this flag.
      
      Fix this by accepting DRM_BRIDGE_ATTACH_NO_CONNECTOR in bridge attachment.
      Implement the drm_bridge_funcs .detect() and .get_edid() operations, and
      call drm_bridge_hpd_notify() to report HPD. This provides the
      necessary API to support disabling connector creation.
      
      In addition, the field 'conn' is removed from the mtk_hdmi struct since
      mtk_hdmi don't create a connector. It is replaced with a pointer
      'curr_conn' that points to the current connector which can be access
      through the global state.
      
      This patch is inspired by a similar patch for bridge/synopsys/dw-hdmi.c:
      commit ec971aaa
      ("drm: bridge: dw-hdmi: Make connector creation optional")
      But with the difference that in mtk-hdmi only the option of not creating
      a connector is supported.
      
      Fixes: f0119514 ("drm/mediatek: mtk_dpi: Create connector for bridges")
      Signed-off-by: default avatarDafna Hirschfeld <dafna.hirschfeld@collabora.com>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarChun-Kuang Hu <chunkuang.hu@kernel.org>
      2e477391