Skip to content
  1. Jan 11, 2019
    • Lyude Paul's avatar
      drm/nouveau: Keep malloc references to MST ports · 81640f01
      Lyude Paul authored
      
      
      Now that we finally have a sane way to keep port allocations around, use
      it to fix the potential unchecked ->port accesses that nouveau makes by
      making sure we keep the mst port allocated for as long as it's
      drm_connector is accessible.
      
      Additionally, now that we've guaranteed that mstc->port is allocated for
      as long as we keep mstc around we can remove the connector registration
      checks for codepaths which release payloads, allowing us to release
      payloads on active topologies properly. These registration checks were
      only required before in order to avoid situations where mstc->port could
      technically be pointing at freed memory.
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarBen Skeggs <bskeggs@redhat.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@redhat.com>
      Cc: Jerry Zuo <Jerry.Zuo@amd.com>
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Juston Li <juston.li@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-15-lyude@redhat.com
      81640f01
    • Lyude Paul's avatar
      drm/nouveau: Remove unnecessary VCPI checks in nv50_msto_cleanup() · 5e292e76
      Lyude Paul authored
      
      
      There is no need to look at the port's VCPI allocation before calling
      drm_dp_mst_deallocate_vcpi(), as we already have msto->disabled to let
      us avoid cleaning up an msto more then once. The DP MST core will never
      call drm_dp_mst_deallocate_vcpi() on it's own, which is presumably what
      these checks are meant to protect against.
      
      More importantly though, we're about to stop clearing mstc->port in the
      next commit, which means if we could potentially hit a use-after-free
      error if we tried to check mstc->port->vcpi here. So to make life easier
      for anyone who bisects this code in the future, use msto->disabled
      instead to check whether or not we need to deallocate VCPI instead.
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarBen Skeggs <bskeggs@redhat.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@redhat.com>
      Cc: Jerry Zuo <Jerry.Zuo@amd.com>
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Juston Li <juston.li@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-14-lyude@redhat.com
      5e292e76
    • Lyude Paul's avatar
      drm/nouveau: Remove bogus cleanup in nv50_mstm_add_connector() · 01324093
      Lyude Paul authored
      
      
      Trying to destroy the connector using mstc->connector.funcs->destroy()
      if connector initialization fails is wrong: there is no possible
      codepath in nv50_mstc_new where nv50_mstm_add_connector() would return
      <0 and mstc would be non-NULL.
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarBen Skeggs <bskeggs@redhat.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@redhat.com>
      Cc: Jerry Zuo <Jerry.Zuo@amd.com>
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Juston Li <juston.li@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-13-lyude@redhat.com
      01324093
    • Lyude Paul's avatar
      drm/amdgpu/display: Keep malloc ref to MST port · d2568976
      Lyude Paul authored
      
      
      Just like i915 and nouveau, it's a good idea for us to hold a malloc
      reference to the port here so that we never pass a freed pointer to any
      of the DP MST helper functions.
      
      Also, we stop unsetting aconnector->port in
      dm_dp_destroy_mst_connector(). There's literally no point to that
      assignment that I can see anyway.
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@redhat.com>
      Cc: Jerry Zuo <Jerry.Zuo@amd.com>
      Cc: Juston Li <juston.li@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-12-lyude@redhat.com
      d2568976
    • Lyude Paul's avatar
      drm/i915: Keep malloc references to MST ports · 79a47cd3
      Lyude Paul authored
      
      
      So that the ports stay around until we've destroyed the connectors, in
      order to ensure that we don't pass an invalid pointer to any MST helpers
      once we introduce the new MST VCPI helpers.
      
      Changes since v1:
      * Move drm_dp_mst_get_port_malloc() to where we assign
        intel_connector->port - danvet
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarDaniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@redhat.com>
      Cc: Jerry Zuo <Jerry.Zuo@amd.com>
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Juston Li <juston.li@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-11-lyude@redhat.com
      79a47cd3
    • Lyude Paul's avatar
      drm/dp_mst: Fix payload deallocation on hotplugs using malloc refs · cfe9f903
      Lyude Paul authored
      
      
      Up until now, freeing payloads on remote MST hubs that just had ports
      removed has almost never worked because we've been relying on port
      validation in order to stop us from accessing ports that have already
      been freed from memory, but ports which need their payloads released due
      to being removed will never be a valid part of the topology after
      they've been removed.
      
      Since we've introduced malloc refs, we can replace all of the validation
      logic in payload helpers which are used for deallocation with some
      well-placed malloc krefs. This ensures that regardless of whether or not
      the ports are still valid and in the topology, any port which has an
      allocated payload will remain allocated in memory until it's payloads
      have been removed - finally allowing us to actually release said
      payloads correctly.
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Cc: David Airlie <airlied@redhat.com>
      Cc: Jerry Zuo <Jerry.Zuo@amd.com>
      Cc: Juston Li <juston.li@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-10-lyude@redhat.com
      cfe9f903
    • Lyude Paul's avatar
      drm/dp_mst: Stop releasing VCPI when removing ports from topology · a68f9917
      Lyude Paul authored
      
      
      This has never actually worked, and isn't needed anyway: the driver's
      always going to try to deallocate VCPI when it tears down the display
      that the VCPI belongs to.
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Reviewed-by: default avatarDaniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@redhat.com>
      Cc: Jerry Zuo <Jerry.Zuo@amd.com>
      Cc: Juston Li <juston.li@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-9-lyude@redhat.com
      a68f9917
    • Lyude Paul's avatar
      drm/dp_mst: Restart last_connected_port_and_mstb() if topology ref fails · 56d1c14e
      Lyude Paul authored
      
      
      While this isn't a complete fix, this will improve the reliability of
      drm_dp_get_last_connected_port_and_mstb() pretty significantly during
      hotplug events, since there's a chance that the in-memory topology tree
      may not be fully updated when drm_dp_get_last_connected_port_and_mstb()
      is called and thus might end up causing our search to fail on an mstb
      whose topology refcount has reached 0, but has not yet been removed from
      it's parent.
      
      Ideally, we should further fix this problem by ensuring that we deal
      with the potential for racing with a hotplug event, which would look
      like this:
      
      * drm_dp_payload_send_msg() retrieves the last living relative of mstb
        with drm_dp_get_last_connected_port_and_mstb()
      * drm_dp_payload_send_msg() starts building payload message
        At the same time, mstb gets unplugged from the topology and is no
        longer the actual last living relative of the original mstb
      * drm_dp_payload_send_msg() tries sending the payload message, hub times
        out
      * Hub timed out, we give up and run away-resulting in the payload being
        leaked
      
      This could be fixed by restarting the
      drm_dp_get_last_connected_port_and_mstb() search whenever we get a
      timeout, sending the payload to the new mstb, then repeating until
      either the entire topology is removed from the system or
      drm_dp_get_last_connected_port_and_mstb() fails. But since the above
      race condition is not terribly likely, we'll address that in a later
      patch series once we've improved the recovery handling for VCPI
      allocations in the rest of the DP MST helpers.
      
      Changes since v1:
      * Convert kerneldoc for drm_dp_get_last_connected_port_and_mstb to
        normal comment - danvet
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Reviewed-by: default avatarDaniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@redhat.com>
      Cc: Jerry Zuo <Jerry.Zuo@amd.com>
      Cc: Juston Li <juston.li@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-8-lyude@redhat.com
      56d1c14e
    • Lyude Paul's avatar
      drm/dp_mst: Introduce new refcounting scheme for mstbs and ports · ebcc0e6b
      Lyude Paul authored
      The current way of handling refcounting in the DP MST helpers is really
      confusing and probably just plain wrong because it's been hacked up many
      times over the years without anyone actually going over the code and
      seeing if things could be simplified.
      
      To the best of my understanding, the current scheme works like this:
      drm_dp_mst_port and drm_dp_mst_branch both have a single refcount. When
      this refcount hits 0 for either of the two, they're removed from the
      topology state, but not immediately freed. Both ports and branch devices
      will reinitialize their kref once it's hit 0 before actually destroying
      themselves. The intended purpose behind this is so that we can avoid
      problems like not being able to free a remote payload that might still
      be active, due to us having removed all of the port/branch device
      structures in memory, as per:
      
      commit 91a25e46 ("drm/dp/mst: deallocate payload on port destruction")
      
      Which may have worked, but then it...
      ebcc0e6b
    • Lyude Paul's avatar
      drm/dp_mst: Rename drm_dp_mst_get_validated_(port|mstb)_ref and friends · d0757afd
      Lyude Paul authored
      
      
      s/drm_dp_get_validated_port_ref/drm_dp_mst_topology_get_port_validated/
      s/drm_dp_put_port/drm_dp_mst_topology_put_port/
      s/drm_dp_get_validated_mstb_ref/drm_dp_mst_topology_get_mstb_validated/
      s/drm_dp_put_mst_branch_device/drm_dp_mst_topology_put_mstb/
      
      This is a much more consistent naming scheme, and will make even more
      sense once we redesign how the current refcounting scheme here works.
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarDaniel Vetter <daniel@ffwll.ch>
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Cc: David Airlie <airlied@redhat.com>
      Cc: Jerry Zuo <Jerry.Zuo@amd.com>
      Cc: Juston Li <juston.li@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-6-lyude@redhat.com
      d0757afd
    • Lyude Paul's avatar
      drm/dp_mst: Fix some formatting in drm_dp_mst_deallocate_vcpi() · 4afb8a26
      Lyude Paul authored
      
      
      Split some stuff across multiple lines
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Reviewed-by: default avatarDaniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@redhat.com>
      Cc: Jerry Zuo <Jerry.Zuo@amd.com>
      Cc: Juston Li <juston.li@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-5-lyude@redhat.com
      4afb8a26
    • Lyude Paul's avatar
      drm/dp_mst: Fix some formatting in drm_dp_mst_allocate_vcpi() · e0ac7113
      Lyude Paul authored
      
      
      Fix some indenting, split some stuff across multiple lines.
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Reviewed-by: default avatarDaniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@redhat.com>
      Cc: Jerry Zuo <Jerry.Zuo@amd.com>
      Cc: Juston Li <juston.li@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-4-lyude@redhat.com
      e0ac7113
    • Lyude Paul's avatar
      drm/dp_mst: Fix some formatting in drm_dp_payload_send_msg() · de6d6818
      Lyude Paul authored
      
      
      Split some stuff across multiple lines, remove some unnecessary braces
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Reviewed-by: default avatarDaniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@redhat.com>
      Cc: Jerry Zuo <Jerry.Zuo@amd.com>
      Cc: Juston Li <juston.li@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-3-lyude@redhat.com
      de6d6818
    • Lyude Paul's avatar
      drm/dp_mst: Fix some formatting in drm_dp_add_port() · 3d76df63
      Lyude Paul authored
      
      
      Reindent some stuff, and split some stuff across multiple lines so we
      aren't going over the text width limit.
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Reviewed-by: default avatarDaniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@redhat.com>
      Cc: Jerry Zuo <Jerry.Zuo@amd.com>
      Cc: Juston Li <juston.li@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-2-lyude@redhat.com
      3d76df63
    • Daniele Castagna's avatar
      drm/rockchip: Add reflection properties · 677e8bbc
      Daniele Castagna authored
      
      
      Add the KMS plane rotation property to the DRM rockchip driver,
      for SoCs RK3328, RK3368 and RK3399.
      
      RK3288 only supports rotation at the display level (i.e. CRTC),
      but for now we are only interested in plane rotation.
      
      This commit only adds support for the value of reflect-y
      and reflect-x (i.e. mirroring).
      
      Note that y-mirroring is not compatible with YUV.
      
      The following modetest commands would test this feature,
      where 30 is the plane ID, and 49 = rotate_0 + relect_y + reflect_x.
      
      X mirror:
      modetest -s 43@33:1920x1080@XR24 -w 30:rotation:17
      
      Y mirror:
      modetest -s 43@33:1920x1080@XR24 -w 30:rotation:33
      
      XY mirror:
      modetest -s 43@33:1920x1080@XR24 -w 30:rotation:49
      
      Signed-off-by: default avatarDaniele Castagna <dcastagna@chromium.org>
      Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190109185639.5093-4-ezequiel@collabora.com
      677e8bbc
    • Ezequiel Garcia's avatar
      drm/rockchip: Separate RK3288 from RK3368 win01 registers · fbb1c738
      Ezequiel Garcia authored
      
      
      This commit splits the registers for RK3288 from those
      for RK3328, RK3368 and RK3399. It seems RK3288 does not
      support plane x-y-mirroring, and so in order to support this
      for the other SoCs, we need to have separate set of registers
      for win0 and win1.
      
      Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190109185639.5093-3-ezequiel@collabora.com
      fbb1c738
    • Ezequiel Garcia's avatar
      drm/rockchip: Fix typo in VOP macros argument · 2996fb75
      Ezequiel Garcia authored
      
      
      Fix a small typo in the macros VOP argument. The macro argument
      is currently wrongly named "x", and then never used. The code
      built fine almost by accident, as the macros are always used
      in a context where a proper "vop" symbol exists.
      
      This fix is almost cosmetic, as the resulting code shouldn't change.
      
      Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190109185639.5093-2-ezequiel@collabora.com
      2996fb75
    • Daniele Castagna's avatar
      drm/rockchip: Fix YUV buffers color rendering · 1c21aa8f
      Daniele Castagna authored
      
      
      Currently, YUV hardware overlays are converted to RGB using
      a color space conversion different than BT.601.
      
      The result is that colors of e.g. NV12 buffers don't match
      colors of YUV hardware overlays.
      
      In order to fix this, enable YUV2YUV and set appropriate coefficients
      for formats such as NV12 to be displayed correctly.
      
      This commit was tested using modetest, gstreamer and chromeos (hardware
      accelerated video playback). Before the commit, tests rendering
      with NV12 format resulted in colors not displayed correctly.
      
      Test examples (Tested on RK3399 and RK3288 boards
      connected to HDMI monitor):
      
        $ modetest 39@32:1920x1080@NV12
        $ gst-launch-1.0 videotestrc ! video/x-raw,format=NV12 ! kmssink
      
      Signed-off-by: default avatarDaniele Castagna <dcastagna@chromium.org>
      [ezequiel: rebase on linux-next and massage commit log]
      Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190108214659.28794-1-ezequiel@collabora.com
      1c21aa8f
    • Enric Balletbo i Serra's avatar
      drm/rockchip: update cursors asynchronously through atomic. · 15609559
      Enric Balletbo i Serra authored
      
      
      Add support to async updates of cursors by using the new atomic
      interface for that.
      
      Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
      [updated for upstream]
      Signed-off-by: default avatarHelen Koike <helen.koike@collabora.com>
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181205123310.7965-1-helen.koike@collabora.com
      15609559
    • Shayenne Moura's avatar
      drm: msm: Cleanup drm_display_mode print str · 7510a9c6
      Shayenne Moura authored
      
      
      This patch adjust the print string of drm_display_mode object
      to remove drm_mode_object dependency in msm files.
      
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Signed-off-by: default avatarShayenne Moura <shayenneluzmoura@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/3e2dcd38c964061f245b0ae22186c71da06e9742.1547143069.git.shayenneluzmoura@gmail.com
      7510a9c6
    • Linus Walleij's avatar
      drm/fb-helper: Scale back depth to supported maximum · f4bd542b
      Linus Walleij authored
      
      
      The following happened when migrating an old fbdev driver to DRM:
      
      The Integrator/CP PL111 supports 16BPP but only ARGB1555/ABGR1555
      or XRGB1555/XBGR1555 i.e. the maximum depth is 15.
      
      This makes the initialization of the framebuffer fail since
      the code in drm_fb_helper_single_fb_probe() assigns the same value
      to sizes.surface_bpp and sizes.surface_depth. I.e. it simply assumes
      a 1-to-1 mapping between BPP and depth, which is true in most cases
      but not for this hardware that only support odd formats.
      
      To support the odd case of a driver supporting 16BPP with only 15
      bits of depth, this patch will make the code loop over the formats
      supported on the primary plane on each CRTC managed by the FB
      helper and cap the depth to the maximum supported on any primary
      plane.
      
      On the PL110 Integrator, this makes drm_mode_legacy_fb_format()
      select DRM_FORMAT_XRGB1555 which is acceptable for this driver, and
      thus we get framebuffer, penguin and console on the Integrator/CP.
      
      Cc: Noralf Trønnes <noralf@tronnes.org>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190110114049.10618-1-linus.walleij@linaro.org
      f4bd542b
    • Ville Syrjälä's avatar
      drm/edid: Add display_info.rgb_quant_range_selectable · 1581b2df
      Ville Syrjälä authored
      
      
      Move the CEA-861 QS bit handling entirely into the edid code. No
      need to bother the drivers with this.
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: Eric Anholt <eric@anholt.net> (supporter:DRM DRIVERS FOR VC4)
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Acked-by: default avatarEric Anholt <eric@anholt.net>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190108172828.15184-4-ville.syrjala@linux.intel.com
      1581b2df
    • Ville Syrjälä's avatar
      drm/radeon: Use drm_hdmi_avi_infoframe_quant_range() · 8ee491b4
      Ville Syrjälä authored
      
      
      Fill out the AVI infoframe quantization range bits using
      drm_hdmi_avi_infoframe_quant_range() instead of hand rolling it.
      
      This changes the behaviour slightly as
      drm_hdmi_avi_infoframe_quant_range() will set a non-zero Q bit
      even when QS==0 iff the Q bit matched the default quantization
      range for the given mode. This matches the recommendation in
      HDMI 2.0 and is allowed even before that.
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
      Cc: amd-gfx@lists.freedesktop.org
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190108172828.15184-3-ville.syrjala@linux.intel.com
      8ee491b4
    • Ville Syrjälä's avatar
      drm/i915: Use drm_hdmi_avi_infoframe_quant_range() for SDVO HDMI as well · c3735f5c
      Ville Syrjälä authored
      
      
      Fill out the AVI infoframe quantization range bits using
      drm_hdmi_avi_infoframe_quant_range() for SDVO HDMI encoder as well.
      
      This changes the behaviour slightly as
      drm_hdmi_avi_infoframe_quant_range() will set a non-zero Q bit
      even when QS==0 iff the Q bit matched the default quantization
      range for the given mode. This matches the recommendation in
      HDMI 2.0 and is allowed even before that.
      
      v2: Pimp commit msg (DK)
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190108172828.15184-2-ville.syrjala@linux.intel.com
      c3735f5c
    • Ville Syrjälä's avatar
      drm/edid: Pass connector to AVI infoframe functions · 13d0add3
      Ville Syrjälä authored
      
      
      Make life easier for drivers by simply passing the connector
      to drm_hdmi_avi_infoframe_from_display_mode() and
      drm_hdmi_avi_infoframe_quant_range(). That way drivers don't
      need to worry about is_hdmi2_sink mess.
      
      v2: Make is_hdmi2_sink() return true for sil-sii8620
          Adapt to omap/vc4 changes
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
      Cc: Archit Taneja <architt@codeaurora.org>
      Cc: Andrzej Hajda <a.hajda@samsung.com>
      Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
      Cc: Inki Dae <inki.dae@samsung.com>
      Cc: Joonyoung Shim <jy0922.shim@samsung.com>
      Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
      Cc: Kyungmin Park <kyungmin.park@samsung.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: CK Hu <ck.hu@mediatek.com>
      Cc: Philipp Zabel <p.zabel@pengutronix.de>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Sandy Huang <hjc@rock-chips.com>
      Cc: "Heiko Stübner" <heiko@sntech.de>
      Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
      Cc: Vincent Abriou <vincent.abriou@st.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Ilia Mirkin <imirkin@alum.mit.edu>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: linux-arm-msm@vger.kernel.org
      Cc: freedreno@lists.freedesktop.org
      Cc: nouveau@lists.freedesktop.org
      Cc: linux-tegra@vger.kernel.org
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Acked-by: default avatarThierry Reding <treding@nvidia.com>
      Acked-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190108172828.15184-1-ville.syrjala@linux.intel.com
      13d0add3
  2. Jan 10, 2019
  3. Jan 09, 2019
    • Gustavo A. R. Silva's avatar
      qxl: Use struct_size() in kzalloc() · d4b9dd50
      Gustavo A. R. Silva authored
      
      
      One of the more common cases of allocation size calculations is finding the
      size of a structure that has a zero-sized array at the end, along with memory
      for some number of elements for that array. For example:
      
      struct foo {
          int stuff;
          void *entry[];
      };
      
      instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);
      
      Instead of leaving these open-coded and prone to type mistakes, we can now
      use the new struct_size() helper:
      
      instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);
      
      This code was detected with the help of Coccinelle.
      
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20190108162152.GA25361@embeddedor
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      d4b9dd50