02 Mar, 2021

1 commit

  • android display hal has refined the logic to use block commit when
    there is overlay but without android out fence. This android out
    fence patch can be reverted now.

    Revert "MA-14133 Enable android out fence and normal out fence simultaneously"

    This reverts commit d5d94e0e13b5bdf8b3ab4f60341e00898bbaf3c2.

    Change-Id: I8ef48ba46350324965e055e5314c837472aead6d
    Signed-off-by: Richard Liu

    Richard Liu
     

19 Jan, 2021

1 commit

  • Add android out-fence support for DRM, enable android out fence and
    normal out fence simultaneously. Android present fence depends on
    normal out fence which represents current frame on screen. Layer
    release fence depends on android out fence which should be signaled
    when it is off screen.

    Key changes:
    Add DRIVER_ATOMIC_ANDROID_FENCE feature to declare android out-fence support.
    Add ANDROID_OUT_FENCE_PTR property to transfer fence fd.
    Android fence is created when drm_atomic_commit called.
    Add drm_crtc_arm_fence_event to insert fence to queue.
    Add drm_crtc_handle_fence to signal buffer fence off screen.
    Add drm android out-fence to dcss crtc.

    This patch cherry-pick below four patches from L4.19 kernel and do
    some update based on L5.4 kernel changes.
    commit d939f92ae2ffde6b78d5f4befd409f448f0e78c9
    Author: Ivan.liu
    MA-11972 Add android out-fence support for DRM.
    Android requires buffer fence signaled when it is off screen.
    But default out-fence can't meet that.
    Add DRIVER_ATOMIC_ANDROID_FENCE feature to declare android out-fence support.
    Add ANDROID_OUT_FENCE_PTR property to transfer fence fd.
    Android fence is created when drm_atomic_commit called.
    Add drm_crtc_arm_fence_event to insert fence to queue.
    Add drm_crtc_handle_fence to signal buffer fence off screen.
    commit a0391e0dc88450e624e8f57fa568ed043e0cee99
    Author: Ivan.liu
    MA-11972-2 Add android out-fence support for DRM.
    Add drm android out-fence to dcss crtc.
    commit c3f41907367dcad63ae5a23391331dc2193d3918
    Author: Ivan.liu
    MA-14133 Enable android out fence and normal out fence simultaneously.
    Refine fence generation codes to support android out fence and normal out fence.
    Android present fence depends on normal out fence which represents current frame on screen.
    Layer release fence depends on android out fence which should be signaled when it is off screen.
    commit 26262450de93647c809ad4970bce5ccce94fec62
    Author: Ivan.liu
    MA-13203 Fix kernel panic when do video plaback with dual display on 8mq.
    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    Internal error: Oops: 96000004 [#1] PREEMPT SMP
    Hardware name: Freescale i.MX8MQ EVK (DT)
    PC is at dma_fence_signal_locked+0x50/0x178
    LR is at dma_fence_signal_locked+0xbc/0x178
    Call trace:
    [] dma_fence_signal_locked+0x50/0x178
    [] drm_crtc_handle_fence+0x7c/0xfc
    [] dcss_crtc_irq_handler+0x54/0x6c
    [] __handle_irq_event_percpu+0x60/0x24c
    [] handle_irq_event+0x58/0xc0
    The root cause is fence is copied to CRTC state and reused again.
    Set state fence to null when duplicate CRTC state to fix this issue.

    Change-Id: Id98b2a49be49574b836a508c182c3e3a99230ac4
    Signed-off-by: Richard Liu

    Richard Liu
     

15 Jul, 2020

1 commit


18 Feb, 2020

1 commit

  • Commit 751465913f04 ("drm/bridge: Add a drm_bridge_state object")
    introduced new helpers and hooks but the kernel was slightly broken.
    Fix that now.

    v2:
    * Fix the drm_atomic_add_encoder_bridges() doc

    Fixes: 751465913f04 ("drm/bridge: Add a drm_bridge_state object")
    Signed-off-by: Boris Brezillon
    Reviewed-by: Neil Armstrong
    Signed-off-by: Neil Armstrong
    Link: https://patchwork.freedesktop.org/patch/msgid/20200218151503.595825-1-boris.brezillon@collabora.com

    Boris Brezillon
     

31 Jan, 2020

2 commits

  • drm_bridge_state is extended to describe the input and output bus
    configurations. These bus configurations are exposed through the
    drm_bus_cfg struct which encodes the configuration of a physical
    bus between two components in an output pipeline, usually between
    two bridges, an encoder and a bridge, or a bridge and a connector.

    The bus configuration is stored in drm_bridge_state separately for
    the input and output buses, as seen from the point of view of each
    bridge. The bus configuration of a bridge output is usually identical
    to the configuration of the next bridge's input, but may differ if
    the signals are modified between the two bridges, for instance by an
    inverter on the board. The input and output configurations of a
    bridge may differ if the bridge modifies the signals internally,
    for instance by performing format conversion, or*modifying signals
    polarities.

    Bus format negotiation is automated by the core, drivers just have
    to implement the ->atomic_get_{output,input}_bus_fmts() hooks if they
    want to take part to this negotiation. Negotiation happens in reverse
    order, starting from the last element of the chain (the one directly
    connected to the display) up to the first element of the chain (the one
    connected to the encoder).
    During this negotiation all supported formats are tested until we find
    one that works, meaning that the formats array should be in decreasing
    preference order (assuming the driver has a preference order).

    Note that the bus format negotiation works even if some elements in the
    chain don't implement the ->atomic_get_{output,input}_bus_fmts() hooks.
    In that case, the core advertises only MEDIA_BUS_FMT_FIXED and lets
    the previous bridge element decide what to do (most of the time, bridge
    drivers will pick a default bus format or extract this piece of
    information from somewhere else, like a FW property).

    v10:
    * Add changelog to the commit message

    v9:
    * No changes

    v8:
    * Fix a test in drm_atomic_bridge_chain_select_bus_fmts() (Reported by
    Jonas)

    v7:
    * Adapt the code to deal with the fact that not all bridges in the
    chain have a bridge state

    v5 -> v6:
    * No changes

    v4:
    * Enhance the doc
    * Fix typos
    * Rename some parameters/fields
    * Reword the commit message

    v3:
    * Fix the commit message (Reported by Laurent)
    * Document the fact that bus formats should not be directly modified by
    drivers (Suggested by Laurent)
    * Document the fact that format order matters (Suggested by Laurent)
    * Propagate bus flags by default
    * Document the fact that drivers can tweak bus flags if needed
    * Let ->atomic_get_{output,input}_bus_fmts() allocate the bus format
    array (Suggested by Laurent)
    * Add a drm_atomic_helper_bridge_propagate_bus_fmt()
    * Mandate that bridge drivers return accurate input_fmts even if they
    are known to be the first element in the bridge chain

    v2:
    * Rework things to support more complex use cases

    Signed-off-by: Boris Brezillon
    Signed-off-by: Neil Armstrong
    [narmstrong: fixed doc in include/drm/drm_bridge.h:69 fmt->format]
    Reviewed-by: Jernej Skrabec
    Tested-by: Jonas Karlman
    Link: https://patchwork.freedesktop.org/patch/msgid/20200128135514.108171-7-boris.brezillon@collabora.com

    Boris Brezillon
     
  • One of the last remaining objects to not have its atomic state.

    This is being motivated by our attempt to support runtime bus-format
    negotiation between elements of the bridge chain.
    This patch just paves the road for such a feature by adding a new
    drm_bridge_state object inheriting from drm_private_obj so we can
    re-use some of the existing state initialization/tracking logic.

    v10:
    * Add changelog to the commit message

    v9:
    * Clarify the fact that the bridge->atomic_reset() and
    {connector,plane,crtc,...}->reset() semantics are different
    * Move the drm_atomic_private_obj_init() call back to
    drm_bridge_attach()
    * Check the presence of ->atomic_duplicate_state instead of
    ->atomic_reset in drm_atomic_add_encoder_bridges()
    * Fix copy&paste errors in the atomic bridge state helpers doc
    * Add A-b/R-b tags

    v8:
    * Move bridge state helpers out of the CONFIG_DEBUGFS section

    v7:
    * Move helpers, struct-defs, ... to atomic helper files to avoid the
    drm -> drm_kms_helper -> drm circular dep
    * Stop providing default implementation for atomic state reset,
    duplicate and destroy hooks (has to do with the helper/core split)
    * Drop all R-b/T-b as helpers have now be moved to other places

    v6:
    * Made helpers private, removed doc and moved them to satisfy dependencies
    * Renamed helpers to _default_

    v5:
    * Re-introduced the helpers from v4

    v4:
    * Fix the doc
    * Kill default helpers (inlined)
    * Fix drm_atomic_get_bridge_state() to check for an ERR_PTR()
    * Add Neil's R-b

    v3:
    * No changes

    v2:
    * Use drm_for_each_bridge_in_chain()
    * Rename helpers to be more consistent with the rest of the DRM API
    * Improve/fix the doc

    Signed-off-by: Boris Brezillon
    Signed-off-by: Neil Armstrong
    Reviewed-by: Neil Armstrong
    Acked-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20200128135514.108171-2-boris.brezillon@collabora.com

    Boris Brezillon
     

08 Jan, 2020

1 commit

  • This reverts commit 6ed7e9625fa6 ("drm/bridge: Add a drm_bridge_state
    object") which introduced a circular dependency between drm.ko and
    drm_kms_helper.ko. Looks like the helper/core split is not appropriate
    and fixing that is not simple.

    Signed-off-by: Boris Brezillon
    Acked-by: Neil Armstrong
    Link: https://patchwork.freedesktop.org/patch/msgid/20200107185807.606999-6-boris.brezillon@collabora.com

    Boris Brezillon
     

07 Jan, 2020

1 commit

  • One of the last remaining objects to not have its atomic state.

    This is being motivated by our attempt to support runtime bus-format
    negotiation between elements of the bridge chain.
    This patch just paves the road for such a feature by adding a new
    drm_bridge_state object inheriting from drm_private_obj so we can
    re-use some of the existing state initialization/tracking logic.

    Signed-off-by: Boris Brezillon
    Reviewed-by: Neil Armstrong
    Reviewed-by: Laurent Pinchart
    Signed-off-by: Neil Armstrong
    Reviewed by: Jernej Skrabec
    Tested-by: Jonas Karlman
    Link: https://patchwork.freedesktop.org/patch/msgid/20200106143409.32321-2-narmstrong@baylibre.com

    Boris Brezillon
     

22 Dec, 2019

2 commits

  • CRTC is an abbreviation and should be all caps in prose. Update all
    kerneldoc comments to use a consistent spelling.

    v2: remove hunk unrelated to the CRTC spelling fixes

    Reviewed-by: Thomas Zimmermann
    Signed-off-by: Thierry Reding
    Link: https://patchwork.freedesktop.org/patch/msgid/20191206135336.2084564-2-thierry.reding@gmail.com

    Thierry Reding
     
  • These are just a couple of things that I came across as I was reading
    through the code and comments.

    v2: added one more hunk that ended up in the wrong patch

    Reviewed-by: Thomas Zimmermann
    Signed-off-by: Thierry Reding
    Link: https://patchwork.freedesktop.org/patch/msgid/20191206135336.2084564-1-thierry.reding@gmail.com

    Thierry Reding
     

11 Dec, 2019

1 commit

  • Both locking and especially sequencing of nonblocking commits have
    evolved a lot. The details are all there, but I noticed that the big
    picture and connections have fallen behind a bit. Apply polish.

    Motivated by some review discussions with Thierry.

    v2: Review from Thierry

    Reviewed-by: Thierry Reding
    Cc: Thierry Reding
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20191204100011.859468-1-daniel.vetter@ffwll.ch

    Daniel Vetter
     

07 Nov, 2019

1 commit

  • Few for_each macro set variables that are never used later which led
    to generate unused-but-set-variable warnings.
    Add (void)(foo) inside the macros to remove these warnings

    Signed-off-by: Benjamin Gaignard
    Reviewed-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20191008124254.2144-1-benjamin.gaignard@st.com

    Benjamin Gaignard
     

14 Jun, 2019

2 commits

  • This patch adds a new drm helper library to help drivers implement
    self refresh. Drivers choosing to use it will register crtcs and
    will receive callbacks when it's time to enter or exit self refresh
    mode.

    In its current form, it has a timer which will trigger after a
    driver-specified amount of inactivity. When the timer triggers, the
    helpers will submit a new atomic commit to shut the refreshing pipe
    off. On the next atomic commit, the drm core will revert the self
    refresh state and bring everything back up to be actively driven.

    From the driver's perspective, this works like a regular disable/enable
    cycle. The driver need only check the 'self_refresh_active' state in
    crtc_state. It should initiate self refresh mode on the panel and enter
    an off or low-power state.

    Changes in v2:
    - s/psr/self_refresh/ (Daniel)
    - integrated the psr exit into the commit that wakes it up (Jose/Daniel)
    - made the psr state per-crtc (Jose/Daniel)
    Changes in v3:
    - Remove the self_refresh_(active|changed) from connector state (Daniel)
    - Simplify loop in drm_self_refresh_helper_alter_state (Daniel)
    - Improve self_refresh_aware comment (Daniel)
    - s/self_refresh_state/self_refresh_data/ (Daniel)
    Changes in v4:
    - Move docbook location below panel (Daniel)
    - Improve docbook with references and more detailed explanation (Daniel)
    - Instead of register/unregister, use init/cleanup (Daniel)
    Changes in v5:
    - Resolved conflict in drm_atomic_helper.c #include block
    - Resolved conflict in rst with HDCP helper docs
    Changes in v6:
    - Fix include ordering, clean up forward declarations (Sam)

    Link to v1: https://patchwork.freedesktop.org/patch/msgid/20190228210939.83386-2-sean@poorly.run
    Link to v2: https://patchwork.freedesktop.org/patch/msgid/20190326204509.96515-1-sean@poorly.run
    Link to v3: https://patchwork.freedesktop.org/patch/msgid/20190502194956.218441-6-sean@poorly.run
    Link to v4: https://patchwork.freedesktop.org/patch/msgid/20190508160920.144739-6-sean@poorly.run
    Link to v5: https://patchwork.freedesktop.org/patch/msgid/20190611160844.257498-6-sean@poorly.run

    Cc: Daniel Vetter
    Cc: Jose Souza
    Cc: Zain Wang
    Cc: Tomasz Figa
    Cc: Ville Syrjälä
    Cc: Sam Ravnborg
    Tested-by: Heiko Stuebner
    Reviewed-by: Daniel Vetter
    Signed-off-by: Sean Paul
    Link: https://patchwork.freedesktop.org/patch/msgid/20190612145026.191846-1-sean@poorly.run

    Sean Paul
     
  • Add functions to the atomic core to retrieve the old and new connectors
    associated with an encoder in a drm_atomic_state. This is useful for
    encoders and bridges that need to access the connector, for instance for
    the drm_display_info.

    The CRTC associated with the encoder can also be retrieved through the
    connector state, and from it, the old and new CRTC states.

    Changed in v4:
    - Added to the set
    Changed in v5:
    - Fix up docbook (Daniel & Laurent)
    Changed in v6:
    - Updated commit subject (Sam)

    Link to v4: https://patchwork.freedesktop.org/patch/msgid/20190508160920.144739-3-sean@poorly.run
    Link to v5: https://patchwork.freedesktop.org/patch/msgid/20190611160844.257498-3-sean@poorly.run

    Cc: Daniel Vetter
    Cc: Sam Ravnborg
    Tested-by: Heiko Stuebner
    Reviewed-by: Daniel Vetter
    Signed-off-by: Laurent Pinchart

    [seanpaul removed WARNs from helpers and added docs to explain why
    returning NULL might be valid]
    Signed-off-by: Sean Paul
    Link: https://patchwork.freedesktop.org/patch/msgid/20190611205147.181298-1-sean@poorly.run

    Laurent Pinchart
     

29 Apr, 2019

1 commit


06 Feb, 2019

1 commit

  • Since

    commit 39b50c603878 ("drm/atomic_helper: Stop modesets on unregistered
    connectors harder")

    We've been failing atomic checks if they try to enable new displays on
    unregistered connectors. This is fine except for the one situation that
    breaks atomic assumptions: suspend/resume. If a connector is
    unregistered before we attempt to restore the atomic state, something we
    end up failing the atomic check that happens when trying to restore the
    state during resume.

    Normally this would be OK: we try our best to make sure that the atomic
    state pre-suspend can be restored post-suspend, but failures at that
    point usually don't cause problems. That is of course, until we
    introduced the new atomic MST VCPI helpers:

    [drm:drm_atomic_helper_check_modeset [drm_kms_helper]] [CRTC:65:pipe B] active changed
    [drm:drm_atomic_helper_check_modeset [drm_kms_helper]] Updating routing for [CONNECTOR:123:DP-5]
    [drm:drm_atomic_helper_check_modeset [drm_kms_helper]] Disabling [CONNECTOR:123:DP-5]
    [drm:drm_atomic_get_private_obj_state [drm]] Added new private object 0000000025844636 state 000000009fd2899a to 000000003a13d7b8
    WARNING: CPU: 6 PID: 1070 at drivers/gpu/drm/drm_dp_mst_topology.c:3153 drm_dp_atomic_release_vcpi_slots+0xb9/0x200 [drm_kms_helper]
    Modules linked in: fuse vfat fat snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic joydev iTCO_wdt i915(O) wmi_bmof intel_rapl btusb btrtl x86_pkg_temp_thermal btbcm btintel coretemp i2c_algo_bit drm_kms_helper(O) crc32_pclmul snd_hda_intel syscopyarea sysfillrect snd_hda_codec sysimgblt snd_hda_core bluetooth fb_sys_fops snd_pcm pcspkr drm(O) psmouse snd_timer mei_me ecdh_generic i2c_i801 mei i2c_core ucsi_acpi typec_ucsi typec wmi thinkpad_acpi ledtrig_audio snd soundcore tpm_tis rfkill tpm_tis_core video tpm acpi_pad pcc_cpufreq uas usb_storage crc32c_intel nvme serio_raw xhci_pci nvme_core xhci_hcd
    CPU: 6 PID: 1070 Comm: gnome-shell Tainted: G W O 5.0.0-rc2Lyude-Test+ #1
    Hardware name: LENOVO 20L8S2N800/20L8S2N800, BIOS N22ET35W (1.12 ) 04/09/2018
    RIP: 0010:drm_dp_atomic_release_vcpi_slots+0xb9/0x200 [drm_kms_helper]
    Code: 00 4c 39 6d f0 74 49 48 8d 7b 10 48 89 f9 48 c1 e9 03 42 80 3c 21 00 0f 85 d2 00 00 00 48 8b 6b 10 48 8d 5d f0 49 39 ee 75 c5 0b 48 c7 c7 c0 78 b3 a0 48 89 c2 4c 89 ee e8 03 6c aa ff b8 ea
    RSP: 0018:ffff88841235f268 EFLAGS: 00010246
    RAX: ffff88841bf12ab0 RBX: ffff88841bf12aa8 RCX: 1ffff110837e2557
    RDX: dffffc0000000000 RSI: 0000000000000000 RDI: ffffed108246bde0
    RBP: ffff88841bf12ab8 R08: ffffed1083db3c93 R09: ffffed1083db3c92
    R10: ffffed1083db3c92 R11: ffff88841ed9e497 R12: ffff888419555d80
    R13: ffff8883bc499100 R14: ffff88841bf12ab8 R15: 0000000000000000
    FS: 00007f16fbd4cd00(0000) GS:ffff88841ed80000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00007f1687c9f000 CR3: 00000003ba3cc003 CR4: 00000000003606e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
    drm_atomic_helper_check_modeset+0xf21/0x2f50 [drm_kms_helper]
    ? drm_atomic_helper_commit_modeset_enables+0xa90/0xa90 [drm_kms_helper]
    ? __printk_safe_exit+0x10/0x10
    ? save_stack+0x8c/0xb0
    ? vprintk_func+0x96/0x1bf
    ? __printk_safe_exit+0x10/0x10
    intel_atomic_check+0x234/0x4750 [i915]
    ? printk+0x9f/0xc5
    ? kmsg_dump_rewind_nolock+0xd9/0xd9
    ? _raw_spin_lock_irqsave+0xa4/0x140
    ? drm_atomic_check_only+0xb1/0x28b0 [drm]
    ? drm_dbg+0x186/0x1b0 [drm]
    ? drm_dev_dbg+0x200/0x200 [drm]
    ? intel_link_compute_m_n+0xb0/0xb0 [i915]
    ? drm_mode_put_tile_group+0x20/0x20 [drm]
    ? skl_plane_format_mod_supported+0x17f/0x1b0 [i915]
    ? drm_plane_check_pixel_format+0x14a/0x310 [drm]
    drm_atomic_check_only+0x13c4/0x28b0 [drm]
    ? drm_state_info+0x220/0x220 [drm]
    ? drm_atomic_helper_disable_plane+0x1d0/0x1d0 [drm_kms_helper]
    ? pick_single_encoder_for_connector+0xe0/0xe0 [drm_kms_helper]
    ? kasan_unpoison_shadow+0x35/0x40
    drm_atomic_commit+0x3b/0x100 [drm]
    drm_atomic_helper_set_config+0xd5/0x100 [drm_kms_helper]
    drm_mode_setcrtc+0x636/0x1660 [drm]
    ? vprintk_func+0x96/0x1bf
    ? drm_dev_dbg+0x200/0x200 [drm]
    ? drm_mode_getcrtc+0x790/0x790 [drm]
    ? printk+0x9f/0xc5
    ? mutex_unlock+0x1d/0x40
    ? drm_mode_addfb2+0x2e9/0x3a0 [drm]
    ? rcu_sync_dtor+0x2e0/0x2e0
    ? drm_dbg+0x186/0x1b0 [drm]
    ? set_page_dirty+0x271/0x4d0
    drm_ioctl_kernel+0x203/0x290 [drm]
    ? drm_mode_getcrtc+0x790/0x790 [drm]
    ? drm_setversion+0x7f0/0x7f0 [drm]
    ? __switch_to_asm+0x34/0x70
    ? __switch_to_asm+0x34/0x70
    drm_ioctl+0x445/0x950 [drm]
    ? drm_mode_getcrtc+0x790/0x790 [drm]
    ? drm_getunique+0x220/0x220 [drm]
    ? expand_files.part.10+0x920/0x920
    do_vfs_ioctl+0x1a1/0x13d0
    ? ioctl_preallocate+0x2b0/0x2b0
    ? __fget_light+0x2d6/0x390
    ? schedule+0xd7/0x2e0
    ? fget_raw+0x10/0x10
    ? apic_timer_interrupt+0xa/0x20
    ? apic_timer_interrupt+0xa/0x20
    ? rcu_cleanup_dead_rnp+0x2c0/0x2c0
    ksys_ioctl+0x60/0x90
    __x64_sys_ioctl+0x6f/0xb0
    do_syscall_64+0x136/0x440
    ? syscall_return_slowpath+0x2d0/0x2d0
    ? do_page_fault+0x89/0x330
    ? __do_page_fault+0x9c0/0x9c0
    ? prepare_exit_to_usermode+0x188/0x200
    ? perf_trace_sys_enter+0x1090/0x1090
    ? __x64_sys_sigaltstack+0x280/0x280
    ? __put_user_4+0x1c/0x30
    entry_SYSCALL_64_after_hwframe+0x44/0xa9
    RIP: 0033:0x7f16ff89a09b
    Code: 0f 1e fa 48 8b 05 ed bd 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 3d 01 f0 ff ff 73 01 c3 48 8b 0d bd bd 0c 00 f7 d8 64 89 01 48
    RSP: 002b:00007fff001232b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
    RAX: ffffffffffffffda RBX: 00007fff001232f0 RCX: 00007f16ff89a09b
    RDX: 00007fff001232f0 RSI: 00000000c06864a2 RDI: 000000000000000b
    RBP: 00007fff001232f0 R08: 0000000000000000 R09: 000055a79d484460
    R10: 000055a79d44e770 R11: 0000000000000246 R12: 00000000c06864a2
    R13: 000000000000000b R14: 0000000000000000 R15: 000055a79d44e770
    WARNING: CPU: 6 PID: 1070 at drivers/gpu/drm/drm_dp_mst_topology.c:3153 drm_dp_atomic_release_vcpi_slots+0xb9/0x200 [drm_kms_helper]
    ---[ end trace d536c05c13c83be2 ]---
    [drm:drm_dp_atomic_release_vcpi_slots [drm_kms_helper]] *ERROR* no VCPI for [MST PORT:00000000f9e2b143] found in mst state 000000009fd2899a

    This appears to be happening because we destroy the VCPI allocations
    when disabling all connected displays while suspending, and those VCPI
    allocations don't get restored on resume due to failing to restore the
    atomic state.

    So, fix this by introducing the suspending option to
    drm_atomic_helper_duplicate_state() and use that to indicate in the
    atomic state that it's being used for suspending or resuming the system,
    and thus needs to be fixed up by the driver. We can then use the new
    state->duplicated hook to tell update_connector_routing() in
    drm_atomic_check_modeset() to allow for modesets on unregistered
    connectors, which allows us to restore atomic states that contain MST
    topologies that were removed after the state was duplicated and thus:
    mostly fixing suspend and resume. This just leaves some issues that were
    introduced with nouveau, that will be addressed next.

    Changes since v3:
    * Remove ->duplicated hunks that I left in the VCPI helpers by accident.
    These don't need to be here, that was the supposed to be the purpose
    of the last revision
    Changes since v2:
    * Remove the changes in this patch to the VCPI helpers, they aren't
    needed anymore
    Changes since v1:
    * Rename suspend_or_resume to duplicated

    Signed-off-by: Lyude Paul
    Fixes: eceae1472467 ("drm/dp_mst: Start tracking per-port VCPI allocations")
    Cc: Daniel Vetter
    Reviewed-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20190202002023.29665-4-lyude@redhat.com

    Lyude Paul
     

04 Feb, 2019

1 commit

  • Most of these are just cases where code comments used contractions
    (it's, who's) where they actually mean to use a possessive pronoun (its,
    whose) or vice-versa.

    Signed-off-by: Matt Roper
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20190202012326.20096-1-matthew.d.roper@intel.com

    Matt Roper
     

11 Jan, 2019

1 commit


11 Dec, 2018

1 commit


13 Nov, 2018

1 commit


29 Oct, 2018

1 commit

  • Pull drm updates from Dave Airlie:
    "This is going to rebuild more than drm as it adds a new helper to
    list.h for doing bulk updates. Seemed like a reasonable addition to
    me.

    Otherwise the usual merge window stuff lots of i915 and amdgpu, not so
    much nouveau, and piles of everything else.

    Core:
    - Adds a new list.h helper for doing bulk list updates for TTM.
    - Don't leak fb address in smem_start to userspace (comes with EXPORT
    workaround for people using mali out of tree hacks)
    - udmabuf device to turn memfd regions into dma-buf
    - Per-plane blend mode property
    - ref/unref replacements with get/put
    - fbdev conflicting framebuffers code cleaned up
    - host-endian format variants
    - panel orientation quirk for Acer One 10

    bridge:
    - TI SN65DSI86 chip support

    vkms:
    - GEM support.
    - Cursor support

    amdgpu:
    - Merge amdkfd and amdgpu into one module
    - CEC over DP AUX support
    - Picasso APU support + VCN dynamic powergating
    - Raven2 APU support
    - Vega20 enablement + kfd support
    - ACP powergating improvements
    - ABGR/XBGR display support
    - VCN jpeg support
    - xGMI support
    - DC i2c/aux cleanup
    - Ycbcr 4:2:0 support
    - GPUVM improvements
    - Powerplay and powerplay endian fixes
    - Display underflow fixes

    vmwgfx:
    - Move vmwgfx specific TTM code to vmwgfx
    - Split out vmwgfx buffer/resource validation code
    - Atomic operation rework

    bochs:
    - use more helpers
    - format/byteorder improvements

    qxl:
    - use more helpers

    i915:
    - GGTT coherency getparam
    - Turn off resource streamer API
    - More Icelake enablement + DMC firmware
    - Full PPGTT for Ivybridge, Haswell and Valleyview
    - DDB distribution based on resolution
    - Limited range DP display support

    nouveau:
    - CEC over DP AUX support
    - Initial HDMI 2.0 support

    virtio-gpu:
    - vmap support for PRIME objects

    tegra:
    - Initial Tegra194 support
    - DMA/IOMMU integration fixes

    msm:
    - a6xx perf improvements + clock prefix
    - GPU preemption optimisations
    - a6xx devfreq support
    - cursor support

    rockchip:
    - PX30 support
    - rgb output interface support

    mediatek:
    - HDMI output support on mt2701 and mt7623

    rcar-du:
    - Interlaced modes on Gen3
    - LVDS on R8A77980
    - D3 and E3 SoC support

    hisilicon:
    - misc fixes

    mxsfb:
    - runtime pm support

    sun4i:
    - R40 TCON support
    - Allwinner A64 support
    - R40 HDMI support

    omapdrm:
    - Driver rework changing display pipeline ordering to use common code
    - DMM memory barrier and irq fixes
    - Errata workarounds

    exynos:
    - out-bridge support for LVDS bridge driver
    - Samsung 16x16 tiled format support
    - Plane alpha and pixel blend mode support

    tilcdc:
    - suspend/resume update

    mali-dp:
    - misc updates"

    * tag 'drm-next-2018-10-24' of git://anongit.freedesktop.org/drm/drm: (1382 commits)
    firmware/dmc/icl: Add missing MODULE_FIRMWARE() for Icelake.
    drm/i915/icl: Fix signal_levels
    drm/i915/icl: Fix DDI/TC port clk_off bits
    drm/i915/icl: create function to identify combophy port
    drm/i915/gen9+: Fix initial readout for Y tiled framebuffers
    drm/i915: Large page offsets for pread/pwrite
    drm/i915/selftests: Disable shrinker across mmap-exhaustion
    drm/i915/dp: Link train Fallback on eDP only if fallback link BW can fit panel's native mode
    drm/i915: Fix intel_dp_mst_best_encoder()
    drm/i915: Skip vcpi allocation for MSTB ports that are gone
    drm/i915: Don't unset intel_connector->mst_port
    drm/i915: Only reset seqno if actually idle
    drm/i915: Use the correct crtc when sanitizing plane mapping
    drm/i915: Restore vblank interrupts earlier
    drm/i915: Check fb stride against plane max stride
    drm/amdgpu/vcn:Fix uninitialized symbol error
    drm: panel-orientation-quirks: Add quirk for Acer One 10 (S1003)
    drm/amd/amdgpu: Fix debugfs error handling
    drm/amdgpu: Update gc_9_0 golden settings.
    drm/amd/powerplay: update PPtable with DC BTC and Tvr SocLimit fields
    ...

    Linus Torvalds
     

19 Oct, 2018

1 commit

  • This fixes a general protection fault, caused by accessing the contents
    of a flip_done completion object that has already been freed. It occurs
    due to the preemption of a non-blocking commit worker thread W by
    another commit thread X. X continues to clear its atomic state at the
    end, destroying the CRTC commit object that W still needs. Switching
    back to W and accessing the commit objects then leads to bad results.

    Worker W becomes preemptable when waiting for flip_done to complete. At
    this point, a frequently occurring commit thread X can take over. Here's
    an example where W is a worker thread that flips on both CRTCs, and X
    does a legacy cursor update on both CRTCs:

    ...
    1. W does flip work
    2. W runs commit_hw_done()
    3. W waits for flip_done on CRTC 1
    4. > flip_done for CRTC 1 completes
    5. W finishes waiting for CRTC 1
    6. W waits for flip_done on CRTC 2

    7. > Preempted by X
    8. > flip_done for CRTC 2 completes
    9. X atomic_check: hw_done and flip_done are complete on all CRTCs
    10. X updates cursor on both CRTCs
    11. X destroys atomic state
    12. X done

    13. > Switch back to W
    14. W waits for flip_done on CRTC 2
    15. W raises general protection fault

    The error looks like so:

    general protection fault: 0000 [#1] PREEMPT SMP PTI
    **snip**
    Call Trace:
    lock_acquire+0xa2/0x1b0
    _raw_spin_lock_irq+0x39/0x70
    wait_for_completion_timeout+0x31/0x130
    drm_atomic_helper_wait_for_flip_done+0x64/0x90 [drm_kms_helper]
    amdgpu_dm_atomic_commit_tail+0xcae/0xdd0 [amdgpu]
    commit_tail+0x3d/0x70 [drm_kms_helper]
    process_one_work+0x212/0x650
    worker_thread+0x49/0x420
    kthread+0xfb/0x130
    ret_from_fork+0x3a/0x50
    Modules linked in: x86_pkg_temp_thermal amdgpu(O) chash(O)
    gpu_sched(O) drm_kms_helper(O) syscopyarea sysfillrect sysimgblt
    fb_sys_fops ttm(O) drm(O)

    Note that i915 has this issue masked, since hw_done is signaled after
    waiting for flip_done. Doing so will block the cursor update from
    happening until hw_done is signaled, preventing the cursor commit from
    destroying the state.

    v2: The reference on the commit object needs to be obtained before
    hw_done() is signaled, since that's the point where another commit
    is allowed to modify the state. Assuming that the
    new_crtc_state->commit object still exists within flip_done() is
    incorrect.

    Fix by getting a reference in setup_commit(), and releasing it
    during default_clear().

    Signed-off-by: Leo Li
    Reviewed-by: Daniel Vetter
    Signed-off-by: Harry Wentland
    Link: https://patchwork.freedesktop.org/patch/msgid/1539611200-6184-1-git-send-email-sunpeng.li@amd.com

    Leo Li
     

06 Oct, 2018

1 commit


09 Sep, 2018

3 commits

  • This leaves all the commit/check and state handling in drm_atomic.c,
    while pulling all the uapi glue and the huge ioctl itself into a
    seprate file.

    This seems to almost perfectly split the rather big drm_atomic.c file
    into 2 equal sizes.

    Also adjust the kerneldoc and type a very terse overview text.

    v2: Rebase.

    v3: Fix tiny typo.

    v4:
    - Fixup armada, newly converted atomic driver hooray!
    - Fixup msm/dpu1, newly added too.

    Signed-off-by: Daniel Vetter
    Cc: David Airlie
    Cc: Gustavo Padovan
    Cc: Maarten Lankhorst
    Cc: Sean Paul
    Cc: Jani Nikula
    Cc: Joonas Lahtinen
    Cc: Rodrigo Vivi
    Cc: Rob Clark
    Cc: Eric Anholt
    Cc: intel-gfx@lists.freedesktop.org
    Cc: linux-arm-msm@vger.kernel.org
    Cc: freedreno@lists.freedesktop.org
    Acked-by: Rodrigo Vivi
    Link: https://patchwork.freedesktop.org/patch/msgid/20180905135711.28370-7-daniel.vetter@ffwll.ch

    Daniel Vetter
     
  • Remove the kerneldoc and EXPORT_SYMBOL which aren't used and really
    shouldn't ever be used by drivers directly.

    Unfortunately this means we need to move the set_writeback_fb function
    around to avoid a forward decl.

    Acked-by: Heiko Stuebner
    Signed-off-by: Daniel Vetter
    Cc: David Airlie
    Cc: Gustavo Padovan
    Cc: Maarten Lankhorst
    Cc: Sean Paul
    Link: https://patchwork.freedesktop.org/patch/msgid/20180905135711.28370-5-daniel.vetter@ffwll.ch

    Daniel Vetter
     
  • We have a bunch of neat little macros all over the place which should
    move to kernel.h. But some of them died in bikesheds on lkml, and we
    need a decent home for them.

    Start out by moving the for_each_if macro there.

    v2: Rename to drm_util.h instead (Dave&Sean)

    Cc: Sean Paul
    Acked-by: Sean Paul
    Cc: Dave Airlie
    Acked-by: Dave Airlie
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20180905135711.28370-1-daniel.vetter@ffwll.ch

    Daniel Vetter
     

20 Jun, 2018

2 commits

  • Add the WRITEBACK_OUT_FENCE_PTR property to writeback connectors, to
    enable userspace to get a fence which will signal once the writeback is
    complete. It is not allowed to request an out-fence without a
    framebuffer attached to the connector.

    A timeline is added to drm_writeback_connector for use by the writeback
    out-fences.

    In the case of a commit failure or DRM_MODE_ATOMIC_TEST_ONLY, the fence
    is set to -1.

    Changes from v2:
    - Rebase onto Gustavo Padovan's v9 explicit sync series
    - Change out_fence_ptr type to s32 __user *
    - Set *out_fence_ptr to -1 in drm_atomic_connector_set_property
    - Store fence in drm_writeback_job
    Gustavo Padovan:
    - Move out_fence_ptr out of connector_state
    - Signal fence from drm_writeback_signal_completion instead of
    in driver directly

    Changes from v3:
    - Rebase onto commit 7e9081c5aac7 ("drm/fence: fix memory overwrite
    when setting out_fence fd") (change out_fence_ptr to s32 __user *,
    for real this time.)
    - Update documentation around WRITEBACK_OUT_FENCE_PTR

    Signed-off-by: Brian Starkey
    [rebased and fixed conflicts]
    Signed-off-by: Mihail Atanassov
    Signed-off-by: Liviu Dudau
    Reviewed-by: Eric Anholt
    Reviewed-by: Sean Paul
    Link: https://patchwork.freedesktop.org/patch/229036/

    Brian Starkey
     
  • Writeback connectors represent writeback engines which can write the
    CRTC output to a memory framebuffer. Add a writeback connector type and
    related support functions.

    Drivers should initialize a writeback connector with
    drm_writeback_connector_init() which takes care of setting up all the
    writeback-specific details on top of the normal functionality of
    drm_connector_init().

    Writeback connectors have a WRITEBACK_FB_ID property, used to set the
    output framebuffer, and a WRITEBACK_PIXEL_FORMATS blob used to expose the
    supported writeback formats to userspace.

    When a framebuffer is attached to a writeback connector with the
    WRITEBACK_FB_ID property, it is used only once (for the commit in which
    it was included), and userspace can never read back the value of
    WRITEBACK_FB_ID. WRITEBACK_FB_ID can only be set if the connector is
    attached to a CRTC.

    Changes since v1:
    - Added drm_writeback.c + documentation
    - Added helper to initialize writeback connector in one go
    - Added core checks
    - Squashed into a single commit
    - Dropped the client cap
    - Writeback framebuffers are no longer persistent

    Changes since v2:
    Daniel Vetter:
    - Subclass drm_connector to drm_writeback_connector
    - Relax check to allow CRTC to be set without an FB
    - Add some writeback_ prefixes
    - Drop PIXEL_FORMATS_SIZE property, as it was unnecessary
    Gustavo Padovan:
    - Add drm_writeback_job to handle writeback signalling centrally

    Changes since v3:
    - Rebased
    - Rename PIXEL_FORMATS -> WRITEBACK_PIXEL_FORMATS

    Chances since v4:
    - Embed a drm_encoder inside the drm_writeback_connector to
    reduce the amount of boilerplate code required from the drivers
    that are using it.

    Changes since v5:
    - Added Rob Clark's atomic_commit() vfunc to connector helper
    funcs, so that writeback jobs are committed from atomic helpers
    - Updated create_writeback_properties() signature to return an
    error code rather than a boolean false for failure.
    - Free writeback job with the connector state rather than when
    doing the cleanup_work()

    Changes since v7:
    - fix extraneous use of out_fence that is only introduced in a
    subsequent patch.

    Changes since v8:
    - whitespace changes pull from subsequent patch

    Changes since v9:
    - Revert the v6 changes that free the writeback job in the connector
    state cleanup and return to doing it in the cleanup_work() function

    Signed-off-by: Brian Starkey
    [rebased and fixed conflicts]
    Signed-off-by: Mihail Atanassov
    [rebased and added atomic_commit() vfunc for writeback jobs]
    Signed-off-by: Rob Clark
    Signed-off-by: Liviu Dudau
    Reviewed-by: Eric Anholt
    Link: https://patchwork.freedesktop.org/patch/229037/

    Brian Starkey
     

12 Jun, 2018

1 commit

  • Stop playing around with plane->crtc/fb/old_fb with atomic
    drivers. Make life a lot simpler when we don't have to do the
    magic old_fb vs. fb dance around plane updates. That way we
    can't risk plane->fb getting out of sync with plane->state->fb
    and we're less likely to leak any refcounts as well.

    Signed-off-by: Ville Syrjälä
    Reviewed-by: Maarten Lankhorst
    Acked-by: Harry Wentland
    Link: https://patchwork.freedesktop.org/patch/msgid/20180525185045.29689-14-ville.syrjala@linux.intel.com
    Reviewed-by: Sinclair Yeh

    Ville Syrjälä
     

14 Mar, 2018

1 commit

  • drm-misc-next for 4.17:

    UAPI Changes:
    plane: Add color encoding/range properties (Jyri)
    nouveau: Replace iturbt_709 property with color_encoding property (Ville)

    Core Changes:
    atomic: Move plane clipping into plane check helper (Ville)
    property: Multiple new property checks/verification (Ville)

    Driver Changes:
    rockchip: Fixes & improvements for rk3399/chromebook plus (various)
    sun4i: Add H3/H5 HDMI support (Jernej)
    i915: Add support for limited/full-range ycbcr toggling (Ville)
    pl111: Add bandwidth checking/limiting (Linus)

    Cc: Jernej Skrabec
    Cc: Jyri Sarha
    Cc: Ville Syrjälä
    Cc: Linus Walleij

    * tag 'drm-misc-next-2018-03-09-3' of git://anongit.freedesktop.org/drm/drm-misc: (85 commits)
    drm/rockchip: Don't use atomic constructs for psr
    drm/rockchip: analogix_dp: set psr activate/deactivate when enable/disable bridge
    drm/rockchip: dw_hdmi: Move HDMI vpll clock enable to bind()
    drm/rockchip: inno_hdmi: reorder clk_disable_unprepare call in unbind
    drm/rockchip: inno_hdmi: Fix error handling path.
    drm/rockchip: dw-mipi-dsi: Fix connector and encoder cleanup.
    drm/nouveau: Replace the iturbt_709 prop with the standard COLOR_ENCODING prop
    drm/pl111: Use max memory bandwidth for resolution
    drm/bridge: sii902x: Retry status read after DDI I2C
    drm/pl111: Handle the RealView variant separately
    drm/pl111: Make the default BPP a per-variant variable
    drm: simple_kms_helper: Fix .mode_valid() documentation
    bridge: Elaborate a bit on dumb VGA bridges in Kconfig
    drm/atomic: Add new reverse iterator over all plane state (V2)
    drm: Reject bad property flag combinations
    drm: Make property flags u32
    drm/uapi: Deprecate DRM_MODE_PROP_PENDING
    drm: WARN when trying to add enum value > 63 to a bitmask property
    drm: WARN when trying add enum values to non-enum/bitmask properties
    drm: Reject replacing property enum values
    ...

    Dave Airlie
     

08 Mar, 2018

1 commit

  • Add reverse iterator for_each_oldnew_plane_in_state_reverse to
    compliment the for_each_oldnew_plane_in_state way or reading plane
    states.

    The plane states are required to be read in reverse order for
    amd drivers, cause the z order convention followed in linux is
    opposite to how the planes are supposed to be presented to DC
    engine, which is in common to both windows and linux.

    V2: fix compile time errors due to -Werror flag.

    Signed-off-by: Shirish S
    Signed-off-by: Pratik Vishwakarma
    Reviewed-by: Daniel Vetter
    Signed-off-by: Harry Wentland
    Link: https://patchwork.freedesktop.org/patch/msgid/1520392203-6885-1-git-send-email-shirish.s@amd.com

    Shirish S
     

01 Mar, 2018

1 commit

  • Driver Changes:

    - Lift alpha_support protection from Cannonlake (Rodrigo)
    * Meaning the driver should mostly work for the hardware we had
    at our disposal when testing
    * Used to be preliminary_hw_support
    - Add missing Cannonlake PCI device ID of 0x5A4C (Rodrigo)
    - Cannonlake port register fix (Mahesh)

    - Fix Dell Venue 8 Pro black screen after modeset (Hans)
    - Fix for always returning zero out-fence from execbuf (Daniele)
    - Fix HDMI audio when no no relevant video output is active (Jani)
    - Fix memleak of VBT data on driver_unload (Hans)

    - Fix for KASAN found locking issue (Maarten)
    - RCU barrier consolidation to improve igt/gem_sync/idle (Chris)
    - Optimizations to IRQ handlers (Chris)
    - vblank tracking improvements (64-bit resolution, PM) (Dhinakaran)
    - Pipe select bit corrections (Ville)
    - Reduce runtime computed device_info fields (Chris)
    - Tune down some WARN_ONs to GEM_BUG_ON now that CI has good coverage (Chris)
    - A bunch of kerneldoc warning fixes (Chris)

    * tag 'drm-intel-next-2018-02-21' of git://anongit.freedesktop.org/drm/drm-intel: (113 commits)
    drm/i915: Update DRIVER_DATE to 20180221
    drm/i915/fbc: Use PLANE_HAS_FENCE to determine if the plane is fenced
    drm/i915/fbdev: Use the PLANE_HAS_FENCE flags from the time of pinning
    drm/i915: Move the policy for placement of the GGTT vma into the caller
    drm/i915: Also check view->type for a normal GGTT view
    drm/i915: Drop WaDoubleCursorLP3Latency:ivb
    drm/i915: Set the primary plane pipe select bits on gen4
    drm/i915: Don't set cursor pipe select bits on g4x+
    drm/i915: Assert that we don't overflow frontbuffer tracking bits
    drm/i915: Track number of pending freed objects
    drm/i915/: Initialise trans_min for skl_compute_transition_wm()
    drm/i915: Clear the in-use marker on execbuf failure
    drm/i915: Prune gen8_gt_irq_handler
    drm/i915: Track GT interrupt handling using the master iir
    drm/i915: Remove WARN_ONCE for failing to pm_runtime_if_in_use
    drm: intel_dpio_phy: fix kernel-doc comments at nested struct
    drm/i915: Release connector iterator on a digital port conflict.
    drm/i915/execlists: Remove too early assert
    drm/i915: Assert that we always complete a submission to guc/execlists
    drm: move read_domains and write_domain into i915
    ...

    Dave Airlie
     

16 Feb, 2018

1 commit

  • 570e86963a51 ("drm: Widen vblank count to 64-bits [v3]") changed the
    return type for drm_crtc_vblank_count() to u64.

    The flip ioctl receives a 32-bit target sequence from user space and is
    compared against the current sequence from drm_crtc_vblank_count(). So,
    typecast return from drm_crtc_vblank_count() explicitly to add clarity.

    __drm_crtcs_state.last_vblank_count however only ever stores the value from
    drm_crtc_vblank_count() and can be upgraded to u64.

    Cc: Keith Packard
    Cc: Rodrigo Vivi
    Signed-off-by: Dhinakaran Pandiyan
    Reviewed-by: Keith Packard
    Signed-off-by: Rodrigo Vivi
    Link: https://patchwork.freedesktop.org/patch/msgid/20180203051302.9974-7-dhinakaran.pandiyan@intel.com

    Dhinakaran Pandiyan
     

30 Jan, 2018

1 commit

  • During a non-blocking commit, it is possible to return before the
    commit_tail work is queued (-ERESTARTSYS, for example).

    Since a reference on the crtc commit object is obtained for the pending
    vblank event when preparing the commit, the above situation will leave
    us with an extra reference.

    Therefore, if the commit_tail worker has not consumed the event at the
    end of a commit, release it's reference.

    Changes since v1:
    - Also check for state->event->base.completion being set, to
    handle the case where stall_checks() fails in setup_crtc_commit().
    Changes since v2:
    - Add a flag to drm_crtc_commit, to prevent dereferencing a freed event.
    i915 may unreference the state in a worker.

    Fixes: 24835e442f28 ("drm: reference count event->completion")
    Cc: # v4.11+
    Signed-off-by: Leo (Sunpeng) Li
    Acked-by: Harry Wentland #v1
    Signed-off-by: Maarten Lankhorst
    Link: https://patchwork.freedesktop.org/patch/msgid/20180117115108.29608-1-maarten.lankhorst@linux.intel.com
    Reviewed-by: Sean Paul

    Leo (Sunpeng) Li
     

15 Dec, 2017

2 commits

  • We don't want people to accidentally stumble over there.

    Also rename the plane helpers to legacy plane helpers. After Ville's
    patch to make the clipping helper atomic and move it to
    drm_atomic_helper.c there's nothing left in there that should be
    useful for modern drivers.

    v2: Laurent had a few questions around how state is added to
    drm_atomic_state, tried to clarify that. And spotted another sentence
    where the docs suggested subclassing.

    v3: Small polish (Alex).

    Reviewed-by: Alex Deucher
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20171214203054.20141-6-daniel.vetter@ffwll.ch

    Daniel Vetter
     
  • DK put some nice docs into the commit introducing driver private
    state, but in the git history alone it'll be lost.

    Also, since Ville remove the void* usage it's a good opportunity to
    give the driver private stuff some tlc on the doc front.

    Finally try to explain why the "let's just subclass drm_atomic_state"
    approach wasn't the greatest, and annotate all those functions as
    deprecated in favour of more standardized driver private states. Also
    note where we could/should extend driver private states going forward
    (atm neither locking nor synchronization is handled in core/helpers,
    which isn't really all that great).

    v2: Spelling and phrasing improvements (Alex, DK).

    Cc: Harry Wentland
    Cc: Dhinakaran Pandiyan
    Cc: Maarten Lankhorst
    Cc: Ville Syrjälä
    Cc: Laurent Pinchart
    Cc: Rob Clark
    Cc: Alex Deucher
    Cc: Ben Skeggs
    Reviewed-by: Dhinakaran Pandiyan
    Reviewed-by: Alex Deucher
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20171214203054.20141-5-daniel.vetter@ffwll.ch

    Daniel Vetter
     

06 Oct, 2017

2 commits

  • Commit 669c9215afea ("drm/atomic: Make async plane update checks work as
    intended, v2.") assumed incorrectly that if only 1 plane is matched in
    the loop, the variables will be set to that plane. In reality we reset
    them to NULL every time a new plane was iterated. This behavior is
    surprising, so fix this by making the for loops only assign the
    variables on a match.

    When we have not added all the planes/crtc/connector to the state, and
    there's a few NULL ones after the last one we iterated, te assumption
    is broken that the pointers will hold the values from the last loop
    iteration, which holds true for all other for_each macros we're using.
    Except of course the iterator pointer itself, but that one really is
    entirely internal.

    Cc: Dmitry Osipenko
    Fixes: 669c9215afea ("drm/atomic: Make async plane update checks work as intended, v2.")
    Signed-off-by: Maarten Lankhorst
    Link: https://patchwork.freedesktop.org/patch/msgid/20170927083532.5756-2-maarten.lankhorst@linux.intel.com
    Reviewed-by: Daniel Vetter
    Tested-by: Dmitry Osipenko

    Maarten Lankhorst
     
  • It can be seen in drm_atomic_get_private_obj_state() that
    ptr will never be NULL, so skip the check for that case.

    Signed-off-by: Maarten Lankhorst
    Link: https://patchwork.freedesktop.org/patch/msgid/20170927083532.5756-1-maarten.lankhorst@linux.intel.com
    Reviewed-by: Daniel Vetter

    Maarten Lankhorst
     

08 Sep, 2017

2 commits

  • Now that the last users have been converted, we can finally get rid of
    for_each_obj_in_state, we have better macros to replace them with.

    Signed-off-by: Maarten Lankhorst
    Cc: Daniel Vetter
    Cc: Jani Nikula
    Cc: Sean Paul
    Cc: David Airlie
    Link: https://patchwork.freedesktop.org/patch/msgid/20170719143920.25685-8-maarten.lankhorst@linux.intel.com
    Reviewed-by: Daniel Vetter

    Maarten Lankhorst
     
  • Currently we neatly track the crtc state, but forget to look at
    plane/connector state.

    When doing a nonblocking modeset, immediately followed by a setprop
    before the modeset completes, the setprop will see the modesets new
    state as the old state and free it.

    This has to be solved by waiting for hw_done on the connector, even
    if it's not assigned to a crtc. When a connector is unbound we take
    the last crtc commit, and when it stays unbound we create a new
    fake crtc commit for that gets signaled on hw_done for all the
    planes/connectors.

    We wait for it the same way as we do for crtc's, which will make
    sure we never run into a use-after-free situation.

    Changes since v1:
    - Only create a single disable commit. (danvet)
    - Fix leak in intel_legacy_cursor_update.
    Changes since v2:
    - Make reference counting in drm_atomic_helper_setup_commit
    more obvious. (pinchartl)
    - Call cleanup_done for fake commit. (danvet)
    - Add comments to drm_atomic_helper_setup_commit. (danvet, pinchartl)
    - Add comment to drm_atomic_helper_swap_state. (pinchartl)

    Signed-off-by: Maarten Lankhorst
    Testcase: kms_atomic_transition.plane-use-after-nonblocking-unbind*
    Cc: Laurent Pinchart
    Link: https://patchwork.freedesktop.org/patch/msgid/20170904104838.23822-6-maarten.lankhorst@linux.intel.com
    Reviewed-by: Daniel Vetter

    Maarten Lankhorst