1. Dec 15, 2019
  2. Dec 14, 2019
    • Linus Walleij's avatar
      drm/gma500: Pass GPIO for Intel MID using descriptors · cd6a1ca3
      Linus Walleij authored
      
      
      The GMA500 driver is using the legacy GPIO API to fetch
      three optional display control GPIO lines from the SFI
      description used by the Medfield platform.
      
      Switch this over to use GPIO descriptors and delete the
      custom platform data.
      
      We create three new static locals in the tc35876x bridge
      code but it is hardly any worse than the I2C client static
      local already there: I tried first to move it to the DRM
      driver state container but there are workarounds for
      probe order in the code so I just stayed off it, as the
      result is unpredictable.
      
      People wanting to do a more throrugh and proper cleanup
      of the GMA500 driver can work on top of this, I can't
      solve much more since I don't have access to the hardware,
      I can only attempt to tidy up my GPIO corner.
      
      Cc: Daniel Stone <daniels@collabora.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Acked-by: default avatarPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191206094301.76368-1-linus.walleij@linaro.org
      
      
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      cd6a1ca3
    • Daniel Vetter's avatar
      drm/atmel: plane_state->fb iff plane_state->crtc · 2840f1f0
      Daniel Vetter authored
      
      
      Checking both is one too much, so wrap a WARN_ON around it to stope
      the copypasta.
      
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Boris Brezillon <bbrezillon@kernel.org>
      Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191213172612.1514842-3-daniel.vetter@ffwll.ch
      2840f1f0
    • Jerry Han's avatar
      drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel · 4b6dd3ca
      Jerry Han authored
      
      
      Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
      panel.
      
      V11:
      - Use the backlight support in drm_panel to simplify the driver (Sam)
      
      V10:
      - Adjust init code, make the format more concise (Emil)
      
      V9:
      - kill off default_off_cmds (Emil)
      - use mipi_dsi_dcs_set_display_{on,off} in their enable/disable
          callbacks. (Emil)
      - Adjusting the delay function (Emil)
      
      V8:
      - modify PARENTHESIS_ALIGNMENT format (Sam)
      - use gpios are required API replace optional gpio API (Emil)
      
      V7:
      - Modify communication address
      
      V6:
      - Add the information of the reviewer
      - Remove unnecessary delays, The udelay_range code gracefully returns
          without hitting the scheduler on a delay of 0. (Derek)
      - Merge the same data structures, like display_mode and off_cmds (Derek)
      - Optimize the processing of results returned by
          devm_gpiod_get_optional (Derek)
      
      V5:
      - Add the information of the reviewer (Sam)
      - Delete unnecessary header files #include <linux/fb.h> (Sam)
      - The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
      - ADD static, set_gpios function is not used outside this module (Sam)
      
      V4:
      - Frefix all function maes with boe_ (Sam)
      - Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
      - Sort include lines alphabetically (Sam)
      - Fixed entries in the makefile must be sorted alphabetically (Sam)
      - Add send_mipi_cmds function to avoid duplicating the code (Sam)
      - Add the necessary delay(reset_delay_t5) between reset and sending
          the initialization command (Rock wang)
      
      V3:
      - Remove unnecessary delays in sending initialization commands (Jitao Shi)
      
      V2:
      - Use SPDX identifier (Sam)
      - Use necessary header files replace drmP.h (Sam)
      - Delete unnecessary header files #include <linux/err.h> (Sam)
      - Specifies a GPIOs array to control the reset timing,
          instead of reading "dsi-reset-sequence" data from DTS (Sam)
      - Delete backlight_disable() function when already disabled (Sam)
      - Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
      - Move the necessary data in the DTS to the current file,
          like porch, display_mode and Init code etc. (Sam)
      - Add compatible device "boe,himax8279d10p" (Sam)
      
      V1:
      - Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
          panel.
      
      Signed-off-by: default avatarJerry Han <jerry.han.hq@gmail.com>
      Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Reviewed-by: default avatarDerek Basehore <dbasehore@chromium.org>
      Reviewed-by: default avatarEmil Velikov <emil.l.velikov@gmail.com>
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Cc: Jitao Shi <jitao.shi@mediatek.com>
      Cc: Rock wang <rock_wang@himax.com.cn>
      Signed-off-by: Sam Ravnborg <sam@ravnborg.org> [fixed boe_panel_get_modes + backlight]
      Link: https://patchwork.freedesktop.org/patch/msgid/20191212115208.3878-1-jerry.han.hq@gmail.com
      4b6dd3ca
    • Daniel Vetter's avatar
      drm/gma500: globle no more! · 2f69293a
      Daniel Vetter authored
      
      
      globle, goblin, moblin?
      
      It's dead code, we lucked out.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191211120001.1167980-1-daniel.vetter@ffwll.ch
      2f69293a
  3. Dec 13, 2019
  4. Dec 12, 2019
  5. Dec 11, 2019
  6. Dec 10, 2019
    • Thomas Zimmermann's avatar
      drm/ast: Store primary-plane format in struct ast_crtc_state · 3339fdf5
      Thomas Zimmermann authored
      
      
      Reading the primary plane's framebuffer from the CRTC's atomic_flush()
      function is fragile as the plane state or framebuffer can be NULL.
      Instead, we let the plane's atomic_check() store the framebuffer format
      in the CRTC state. The CRTC always receives the framebuffer format that
      is currently programmed, or NULL if no mode has been set yet.
      
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191202111557.15176-8-tzimmermann@suse.de
      3339fdf5
    • Thomas Zimmermann's avatar
      drm/ast: Store VBIOS mode info in struct ast_crtc_state · e7d70cd4
      Thomas Zimmermann authored
      
      
      After looking up VBIOS mode information in CRTC's atomic_check(), we
      can reuse it in atomic_flush(). No need for a second look-up.
      
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191202111557.15176-7-tzimmermann@suse.de
      e7d70cd4
    • Thomas Zimmermann's avatar
      drm/ast: Introduce struct ast_crtc_state · 83be6a3c
      Thomas Zimmermann authored
      
      
      AST-specific CRTC state can be placed in the new struct ast_crtc_state.
      The atomic check functions of the CRTC and the primary plane will store
      the VBIOS mode info and the framebuffer format here. The CRTC will consume
      these during atomic_flush().
      
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191202111557.15176-6-tzimmermann@suse.de
      83be6a3c
    • Thomas Zimmermann's avatar
      drm/ast: Add plane atomic_check() functions · ae46a57d
      Thomas Zimmermann authored
      
      
      Introducing atomic_check() for priamry and cursor plane. The functions
      validate the plane state and will later set format information for the
      CRTC's atomic_flush().
      
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191202111557.15176-5-tzimmermann@suse.de
      ae46a57d
    • Thomas Zimmermann's avatar
      drm/ast: Clean up arguments of register functions · ae37025d
      Thomas Zimmermann authored
      
      
      In preparation of an update of the primary-plane code, this patch
      changes the arguments of several register-setting functions. No
      functional changes are made. The function ast_set_dac_reg() has no
      effect and therefore gets removed entirely.
      
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191202111557.15176-4-tzimmermann@suse.de
      ae37025d
    • Thomas Zimmermann's avatar
      drm/ast: Enable and disable screen in primary-plane functions · 2fbeec03
      Thomas Zimmermann authored
      
      
      Enabling and disabling the screen used to be done in the register
      initialization and the DPMS function. None of these places is related
      to the screen's output.
      
      Now the primary plane's update and disable functions handle screen
      display state. The primary plane can now be switched off without
      displaying garbage.
      
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191202111557.15176-3-tzimmermann@suse.de
      2fbeec03
    • Thomas Zimmermann's avatar
      drm/ast: Move modesetting code to CRTC's atomic_flush() · 71d873cc
      Thomas Zimmermann authored
      
      
      When enabling the CRTC after waking up from a power-saving mode, the
      primary plane's framebuffer might be NULL, which leads to a stack trace
      as shown below.
      
        [  632.624608] BUG: kernel NULL pointer dereference, address: 0000000000000048
        [  632.624631] #PF: supervisor read access in kernel mode
        [  632.624639] #PF: error_code(0x0000) - not-present page
        [  632.624647] PGD 0 P4D 0
        [  632.624654] Oops: 0000 [#1] SMP PTI
        [  632.624662] CPU: 0 PID: 2082 Comm: gnome-shell Tainted: G            E     5.4.0-rc7-1-default+ #114
        [  632.624673] Hardware name: Sun Microsystems SUN FIRE X2270 M2/SUN FIRE X2270 M2, BIOS 2.05    07/01/2010
        [  632.624689] RIP: 0010:ast_crtc_helper_atomic_enable+0x7d/0x680 [ast]
        [  632.624698] Code: 48 8b 80 e0 02 00 00 4c 8b 60 10 31 c0 f3 48 ab 48 8b 83 78 04 00 00 4c 89 ef 48 8d 70 18 e8 9a e9 55 ce 48 8b 83 78 04 00 00 <49> 8b 7c 24 48 4c 89 ea 4c 8d 44 24 28 48 8d 4c 24 20 48 8d 70 18
        [  632.624718] RSP: 0018:ffffbe9ec123fa40 EFLAGS: 00010246
        [  632.624726] RAX: ffff95a13cfd3400 RBX: ffff95a13cf32000 RCX: 0000000000000000
        [  632.624735] RDX: 0000000000000000 RSI: ffff95a13cfd34e8 RDI: ffffbe9ec123fb40
        [  632.624744] RBP: ffffbe9ec123fb80 R08: 0000000000000000 R09: 0000000000000003
        [  632.624753] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
        [  632.624762] R13: ffffbe9ec123fa70 R14: ffff95a13beb7000 R15: ffff95a13cf32800
        [  632.624772] FS:  00007f6d2763e140(0000) GS:ffff95a134000000(0000) knlGS:0000000000000000
        [  632.624782] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        [  632.624790] CR2: 0000000000000048 CR3: 00000001192f8004 CR4: 00000000000206f0
        [  632.624800] Call Trace:
        [  632.624811]  ? __lock_acquire+0x409/0x7c0
        [  632.624830]  drm_atomic_helper_commit_modeset_enables+0x1af/0x200
        [  632.624840]  drm_atomic_helper_commit_tail+0x32/0x70
        [  632.624849]  commit_tail+0xc7/0x110
        [  632.624857]  drm_atomic_helper_commit+0x121/0x130
        [  632.624867]  drm_atomic_connector_commit_dpms+0xd7/0x100
        [  632.624878]  set_property_atomic+0xaf/0x110
        [  632.624890]  drm_mode_obj_set_property_ioctl+0xbb/0x190
        [  632.624899]  ? drm_mode_obj_find_prop_id+0x40/0x40
        [  632.624909]  drm_ioctl_kernel+0x86/0xd0
        [  632.624918]  drm_ioctl+0x1e4/0x36b
        [  632.624925]  ? drm_mode_obj_find_prop_id+0x40/0x40
        [  632.624939]  do_vfs_ioctl+0x4bd/0x6e0
        [  632.624949]  ksys_ioctl+0x5e/0x90
        [  632.624957]  __x64_sys_ioctl+0x16/0x20
        [  632.624966]  do_syscall_64+0x5a/0x220
        [  632.624976]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
        [  632.624984] RIP: 0033:0x7f6d2b0de387
        [  632.624991] Code: 00 00 90 48 8b 05 f9 9a 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c9 9a 0c 00 f7 d8 64 89 01 48
        [  632.625011] RSP: 002b:00007fffb49def38 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
        [  632.625021] RAX: ffffffffffffffda RBX: 00007fffb49def70 RCX: 00007f6d2b0de387
        [  632.625030] RDX: 00007fffb49def70 RSI: 00000000c01864ba RDI: 0000000000000009
        [  632.625040] RBP: 00000000c01864ba R08: 0000000000000000 R09: 00000000c0c0c0c0
        [  632.625049] R10: 0000000000000030 R11: 0000000000000246 R12: 000055bc367eb920
        [  632.625058] R13: 0000000000000009 R14: 0000000000000002 R15: 0000000000000000
        [  632.625071] Modules linked in: ebtable_filter(E) ebtables(E) ip6table_filter(E) ip6_tables(E) iptable_filter(E) ip_tables(E) x_tables(E) af_packet(E) scsi_transport_iscsi(E) dmi_sysfs(E) msr(E) xfs(E) intel_powerclamp(E) coretemp(E) k)
        [  632.625185] CR2: 0000000000000048
      
      The STR is
      
      	* start gdm and wait for it to switch off the display
      	* wake up the display by pressing a key
      
      CRTC modesetting depends on the new state of the CRTC and the primary
      plane's framebuffer. The bugfix moves the modesetting code into the
      CRTC's atomic_flush() function, where it is protected from the plane's
      framebuffer being NULL.
      
      The CRTC's atomic-enable function, which is the modesetting's original
      location, still contains DPMS state handling. It's exactly the inverse
      of the atomic-disable function.
      
      v3:
      	* protect modesetting from from fb == NULL
      v2:
      	* do an atomic check for plane
      	* reject invisible primary planes
      
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Fixes: b48e1b6f ("drm/ast: Add CRTC helpers for atomic modesetting")
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: "Y.C. Chen" <yc_chen@aspeedtech.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191202111557.15176-2-tzimmermann@suse.de
      71d873cc