OSDN Git Service

uclinux-h8/linux.git
3 years agodrm/radeon: drop superflous AGP handling
Christian König [Wed, 5 Aug 2020 12:35:10 +0000 (14:35 +0200)]
drm/radeon: drop superflous AGP handling

The object flags created in radeon_ttm_placement_from_domain take care that
we use the correct caching for AGP, this is just superflous.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/384336/?series=80346&rev=1
3 years agodrm/ttm: give resource functions their own [ch] files
Christian König [Mon, 3 Aug 2020 14:25:15 +0000 (16:25 +0200)]
drm/ttm: give resource functions their own [ch] files

This is a separate object we work within TTM.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/384338/?series=80346&rev=1
3 years agodrm/ttm: rename ttm_resource_manager_func callbacks
Christian König [Mon, 3 Aug 2020 13:06:38 +0000 (15:06 +0200)]
drm/ttm: rename ttm_resource_manager_func callbacks

The names get/put are associated with reference counting
in the Linux kernel, use alloc/free instead.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/384340/?series=80346&rev=1
3 years agodrm/hisilicon: Code refactoring for hibmc_drv_de
Tian Tao [Wed, 12 Aug 2020 07:42:59 +0000 (15:42 +0800)]
drm/hisilicon: Code refactoring for hibmc_drv_de

The memory used to be allocated with devres helpers and released
automatically. In rare circumstances, the memory's release could
have happened before the DRM device got released, which would have
caused memory corruption of some kind. Now we're embedding the data
structures in struct hibmc_drm_private. The whole release problem
has been resolved, because struct hibmc_drm_private is allocated
with drmm_kzalloc and always released with the DRM device.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/1597218179-3938-3-git-send-email-tiantao6@hisilicon.com
3 years agodrm/hisilicon: Remove the unused include statements
Tian Tao [Wed, 12 Aug 2020 07:42:58 +0000 (15:42 +0800)]
drm/hisilicon: Remove the unused include statements

Remove some unused include statements.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/1597218179-3938-2-git-send-email-tiantao6@hisilicon.com
3 years agodrm/panel-notatek-nt35510: Fix MTP read init
Linus Walleij [Sat, 8 Aug 2020 22:43:22 +0000 (00:43 +0200)]
drm/panel-notatek-nt35510: Fix MTP read init

In order to successfully read ID of the MTP panel the
panel MTP control page must be unlocked. Previously
this wasn't encountered because in the setup with this
panel the power wasn't ever really dropped. When power
gets dropped from the panel, MTP needs to be unlocked.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Cc: newbytee@protonmail.com
Cc: Stephan Gerhold <stephan@gerhold.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200808224322.1507713-1-linus.walleij@linaro.org
3 years agodrm/amdgpu: utilize subconnector property for DP through DisplayManager
Oleg Vasilev [Fri, 24 Apr 2020 12:50:55 +0000 (18:20 +0530)]
drm/amdgpu: utilize subconnector property for DP through DisplayManager

Since DP-specific information is stored in driver's structures, every
driver needs to implement subconnector property by itself. Display
Core already has the subconnector information, we only need to
expose it through DRM property.

v2:rebase

v3: renamed a function call

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: Jeevan B <jeevan.b@intel.com>
Signed-off-by: Oleg Vasilev <oleg.vasilev@intel.com>
Tested-by: Oleg Vasilev <oleg.vasilev@intel.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1587732655-17544-5-git-send-email-jeevan.b@intel.com
3 years agodrm/amdgpu: utilize subconnector property for DP through atombios
Oleg Vasilev [Fri, 24 Apr 2020 12:50:54 +0000 (18:20 +0530)]
drm/amdgpu: utilize subconnector property for DP through atombios

Since DP-specific information is stored in driver's structures, every
driver needs to implement subconnector property by itself.

v2: rebase

v3: renamed a function call

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: Jeevan B <jeevan.b@intel.com>
Signed-off-by: Oleg Vasilev <oleg.vasilev@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1587732655-17544-4-git-send-email-jeevan.b@intel.com
3 years agodrm/i915: utilize subconnector property for DP
Oleg Vasilev [Fri, 24 Apr 2020 12:50:52 +0000 (18:20 +0530)]
drm/i915: utilize subconnector property for DP

Since DP-specific information is stored in driver's structures, every
driver needs to implement subconnector property by itself.

v2: updates to match previous commit changes

v3: rebase

v4: renamed a function call

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Signed-off-by: Jeevan B <jeevan.b@intel.com>
Signed-off-by: Oleg Vasilev <oleg.vasilev@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com> #and acked for merging
Tested-by: Oleg Vasilev <oleg.vasilev@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1587732655-17544-2-git-send-email-jeevan.b@intel.com
3 years agodrm: report dp downstream port type as a subconnector property
Oleg Vasilev [Fri, 24 Apr 2020 12:50:51 +0000 (18:20 +0530)]
drm: report dp downstream port type as a subconnector property

Currently, downstream port type is only reported in debugfs. This
information should be considered important since it reflects the actual
physical connector type. Some userspace (e.g. window compositors)
may want to show this info to a user.

The 'subconnector' property is already utilized for DVI-I and TV-out for
reporting connector subtype.

The initial motivation for this feature came from i2c test [1].
It is supposed to be skipped on VGA connectors, but it cannot
detect VGA over DP and fails instead.

v2:
 - Ville: utilized drm_dp_is_branch()
 - Ville: implement DP 1.0 downstream type info
 - Replaced create_dp_properties with add_dp_subconnector_property
 - Added dp_set_subconnector_property helper

v4:
 - Ville: add DP1.0 best assumption about subconnector
 - Ville: assume DVI is DVI-D
 - Ville: reuse Writeback enum value for Virtual subconnector
 - Renamed #defines: HDMI -> HDMIA, DP -> DisplayPort

v5: rebase

v6:
 - Jani Nikula: renamed a function name
 - Jani Nikula: addressed the issues with documentation

[1]: https://bugs.freedesktop.org/show_bug.cgi?id=104097

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Signed-off-by: Jeevan B <jeevan.b@intel.com>
Signed-off-by: Oleg Vasilev <oleg.vasilev@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1587732655-17544-1-git-send-email-jeevan.b@intel.com
3 years agodrm/vmwgfx/ttm: fix the non-THP cleanup path.
Dave Airlie [Mon, 10 Aug 2020 05:39:20 +0000 (15:39 +1000)]
drm/vmwgfx/ttm: fix the non-THP cleanup path.

I fixed the init path, but missed the cleanup path.

Fixes: e0830704de7c ("drm/vmwgfx: takedown vram manager")
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200810054110.4192239-1-airlied@gmail.com
3 years agodisplay/drm/bridge: TC358775 DSI/LVDS driver
Vinay Simha BN [Fri, 10 Jul 2020 13:41:28 +0000 (19:11 +0530)]
display/drm/bridge: TC358775 DSI/LVDS driver

This driver is tested with two panels individually with Apq8016-IFC6309 board
https://www.inforcecomputing.com/products/single-board-computers-sbc/qualcomm-snapdragon-410-inforce-6309-micro-sbc

1. 1366x768@60 auo,b101xtn01 data-mapping = "jeida-24"
2. 800x480@60 innolux,at070tn92 data-mapping = "vesa-24"

- power off sequence in proper order
- put_unaligned_be16, put_unaligned_le32 macros used
- static function for mode_valid
- len initialized
- MODE_CLOCK_HIGH handled properly
- bus_formats handled in mode_valid
- GENMASK and FIELD_PREP used
- Kconfig proper indentation
- error handling endpoint data-lanes
- check for bus_formats unsupported
- display_timings naming local variables
- help modified
- ~vsdelay dynamic value set based on the
  calculation of dsi speed, output speed, blanking
- panel->connector_type removed
- dual port implemented
- devm_drm_panel_bridge_add method used instead of panel
  description modified
- regulator enable and disable with proper orders and delays
  as per the spec
- removed drm_connector_status
- added bus_formats
- mdelay to usleep_range
- magic number to macros for CLRSI and mux registers
  description modified
- replaced u32 instead of uint32_t
- updated alphabetic order of headers
- added SPDX identifier license

Signed-off-by: Vinay Simha BN <simhavcs@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sam Ravnborg <sam.ravnborg@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1594388491-15129-2-git-send-email-simhavcs@gmail.com
3 years agodt-binding: Add DSI/LVDS TC358775 bridge bindings
Vinay Simha BN [Fri, 10 Jul 2020 13:41:27 +0000 (19:11 +0530)]
dt-binding: Add DSI/LVDS TC358775 bridge bindings

- license modified to (GPL-2.0-only OR BSD-2-Clause)
- single-link and dual-link lvds description and
  examples are added
- proper indentation
- VESA/JEIDA formats picked from panel-lvds dts
- dsi data-lanes property removed, it will be picked
  from dsi0 ports
- dual-link lvds port added and implemented
- converted from .txt to .yaml

Signed-off-by: Vinay Simha BN <simhavcs@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sam Ravnborg <sam.ravnborg@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1594388491-15129-1-git-send-email-simhavcs@gmail.com
3 years agodrm/v3d: convert to use module_platform_driver
Qinglang Miao [Mon, 10 Aug 2020 12:59:31 +0000 (20:59 +0800)]
drm/v3d: convert to use module_platform_driver

Get rid of boilerplate code by using module_platform_driver macro
for v3d_drm.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200810125931.186456-1-miaoqinglang@huawei.com
3 years agodrm/vkms: add missing platform_device_unregister() in vkms_init()
Qinglang Miao [Mon, 10 Aug 2020 13:00:11 +0000 (21:00 +0800)]
drm/vkms: add missing platform_device_unregister() in vkms_init()

When vkms_init() get into out_put, the unregister call of
vkms_device->platform is missing. So add it before return.

Fixes: ac19f140bc27 ("drm/vkms: Use drmm_add_final_kfree")
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200810130011.187691-1-miaoqinglang@huawei.com
3 years agodrm/vgem: add missing platform_device_unregister() in vgem_init()
Qinglang Miao [Mon, 10 Aug 2020 12:59:42 +0000 (20:59 +0800)]
drm/vgem: add missing platform_device_unregister() in vgem_init()

When vgem_init() get into out_put, the unregister call of
vgem_device->platform is missing. So add it before return.

Fixes: 363de9e7d4f6 ("drm/vgem: Use drmm_add_final_kfree")
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200810125942.186637-1-miaoqinglang@huawei.com
3 years agodrm/vkms: guarantee vblank when capturing crc
Melissa Wen [Sat, 8 Aug 2020 12:09:00 +0000 (09:09 -0300)]
drm/vkms: guarantee vblank when capturing crc

VKMS needs vblank interrupts enabled to capture CRC. When vblank is
disabled, tests like kms_cursor_crc and kms_pipe_crc_basic getting stuck
waiting for a capture that will not occur until vkms wakes up. This patch
adds a helper to set composer and ensure that vblank remains enabled as
long as the CRC capture is needed.

It clears the execution of the following kms_cursor_crc subtests:
1. pipe-A-cursor-[size,alpha-opaque, NxN-(on-screen, off-screen, sliding,
random, fast-moving])] - successful when running individually.
2. pipe-A-cursor-dpms passes again
3. pipe-A-cursor-suspend also passes

The issue was initially tracked in the sequential execution of IGT
kms_cursor_crc subtests: when running the test sequence or one of its
subtests twice, the odd execs complete and the pairs get stuck in an
endless wait. In the IGT code, calling a wait_for_vblank on preparing for
CRC capture prevented the busy-wait. But the problem persisted in the
pipe-A-cursor-dpms and -suspend subtests.

Checking the history, the pipe-A-cursor-dpms subtest was successful when,
in vkms_atomic_commit_tail, instead of using the flip_done op, it used
wait_for_vblanks. Another way to prevent blocking was wait_one_vblank when
enabling crtc. However, in both cases, pipe-A-cursor-suspend persisted
blocking in the 2nd start of CRC capture, which may indicate that
something got stuck in the step of CRC setup. Indeed, wait_one_vblank in
the crc setup was able to sync things and free all kms_cursor_crc
subtests. Besides, other alternatives to force enabling vblanks or prevent
disabling them such as calling drm_crtc_put_vblank or modeset_enables
before commit_planes + offdelay = 0, also unlock all subtests executions.

Finally, due to vkms's dependence on vblank interruptions to perform
tasks, this patch uses refcount to ensure that vblanks happen when
enabling composer and while crc capture is needed.

Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
v2:
- extract a vkms_set_composer helper
- fix vblank refcounting for the disabling case

v3:
- make the vkms_set_composer helper static
- review the credit tags

Co-debugged-by: Sidong Yang <realwakka@gmail.com>
Signed-off-by: Sidong Yang <realwakka@gmail.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[danvet: add changelog back in]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200808120900.pudwwrfz44g3rqx7@smtp.gmail.com
3 years agodrm/gma500: fix spelling mistake "pannel" -> "panel"
Colin Ian King [Wed, 5 Aug 2020 12:42:27 +0000 (13:42 +0100)]
drm/gma500: fix spelling mistake "pannel" -> "panel"

There a handful of spelling mistakes. fix them.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200805124227.20005-1-colin.king@canonical.com
3 years agodrm/amdgpu/ttm: drop the adev link from vram mgr
Dave Airlie [Thu, 6 Aug 2020 23:18:17 +0000 (09:18 +1000)]
drm/amdgpu/ttm: drop the adev link from vram mgr

There is no need for that now since it's embedded.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200806233459.4057784-3-airlied@gmail.com
3 years agodrm/amdgpu/ttm: move vram/gtt mgr allocations to mman.
Dave Airlie [Thu, 6 Aug 2020 23:04:50 +0000 (09:04 +1000)]
drm/amdgpu/ttm: move vram/gtt mgr allocations to mman.

Christian suggested this and it makes sense.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200806233459.4057784-2-airlied@gmail.com
3 years agodrm: Remove unnecessary drm_panel_attach and drm_panel_detach
Joe Perches [Sun, 2 Aug 2020 16:43:59 +0000 (09:43 -0700)]
drm: Remove unnecessary drm_panel_attach and drm_panel_detach

These functions are now empty and no longer
useful so remove the functions and their uses.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Bernard Zhao <bernard@vivo.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>,
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Icenowy Zheng <icenowy@aosc.io>,
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Robert Chiras <robert.chiras@nxp.com>
Cc: dri-devel@lists.freedesktop.org,
Cc: linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> # Fixed build and a few warnings
Link: https://patchwork.freedesktop.org/patch/msgid/9e13761020750b1ce2f1fabee23ef6e2a2942882.camel@perches.com
3 years agodrm/mgag200: fix build on alpha arch
Sam Ravnborg [Fri, 7 Aug 2020 18:05:47 +0000 (20:05 +0200)]
drm/mgag200: fix build on alpha arch

When building imgag200 for the alpha architecture it fails like this:
mgag200_drv.c:233:9: error: implicit declaration of function ‘vmalloc’
  233 |  bios = vmalloc(size);
      |         ^~~~~~~
      |         kmalloc

When building for other architectures vmalloc.h is pulled in via some
other header file - for example asm-generic/io.h.
Use an explicit include of vmalloc.h to fix the build.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Fixes: e20dfd27f7aa ("drm/mgag200: Add support for G200 desktop cards")
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Egbert Eich <eich@suse.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200807180547.GA923146@ravnborg.org
3 years agodrm/panfrost: perfcnt: fix ref count leak in panfrost_perfcnt_enable_locked
Navid Emamdoost [Sun, 14 Jun 2020 06:36:19 +0000 (01:36 -0500)]
drm/panfrost: perfcnt: fix ref count leak in panfrost_perfcnt_enable_locked

in panfrost_perfcnt_enable_locked, pm_runtime_get_sync is called which
increments the counter even in case of failure, leading to incorrect
ref count. In case of failure, decrement the ref count before returning.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200614063619.44944-1-navid.emamdoost@gmail.com
3 years agodrm/panfrost: add regulators to devfreq
Clément Péron [Fri, 10 Jul 2020 09:54:05 +0000 (11:54 +0200)]
drm/panfrost: add regulators to devfreq

Some OPP tables specify voltage for each frequency. Devfreq can
handle these regulators but they should be get only 1 time to avoid
issue and know who is in charge.

If OPP table is probe don't init regulator.

Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200710095409.407087-11-peron.clem@gmail.com
3 years agodrm/panfrost: dynamically alloc regulators
Clément Péron [Fri, 10 Jul 2020 09:54:04 +0000 (11:54 +0200)]
drm/panfrost: dynamically alloc regulators

We will later introduce regulators managed by OPP.

Only alloc regulators when it's needed. This also help use
to release the regulators only when they are allocated.

Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200710095409.407087-10-peron.clem@gmail.com
3 years agodrm/panfrost: move devfreq_init()/fini() in device
Clément Péron [Fri, 10 Jul 2020 09:54:03 +0000 (11:54 +0200)]
drm/panfrost: move devfreq_init()/fini() in device

Later we will introduce devfreq probing regulator if they
are present. As regulator should be probe only one time we
need to get this logic in the device_init().

panfrost_device is already taking care of devfreq_resume()
and devfreq_suspend(), so it's not totally illogic to move
the devfreq_init() and devfreq_fini() here.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200710095409.407087-9-peron.clem@gmail.com
3 years agodrm/panfrost: rename error labels in device_init
Clément Péron [Fri, 10 Jul 2020 09:54:02 +0000 (11:54 +0200)]
drm/panfrost: rename error labels in device_init

Rename goto labels in device_init it will be easier to maintain.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200710095409.407087-8-peron.clem@gmail.com
3 years agodrm/panfrost: properly handle error in probe
Clément Péron [Fri, 10 Jul 2020 09:54:01 +0000 (11:54 +0200)]
drm/panfrost: properly handle error in probe

Introduce a boolean to know if opp table has been added.

With this, we can call panfrost_devfreq_fini() in case of error
and release what has been initialised.

Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200710095409.407087-7-peron.clem@gmail.com
3 years agodrm/panfrost: use spinlock instead of atomic
Clément Péron [Fri, 10 Jul 2020 09:54:00 +0000 (11:54 +0200)]
drm/panfrost: use spinlock instead of atomic

Convert busy_count to a simple int protected by spinlock.

Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200710095409.407087-6-peron.clem@gmail.com
3 years agodrm/panfrost: introduce panfrost_devfreq struct
Clément Péron [Fri, 10 Jul 2020 09:53:59 +0000 (11:53 +0200)]
drm/panfrost: introduce panfrost_devfreq struct

Introduce a proper panfrost_devfreq to deal with devfreq variables.

Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200710095409.407087-5-peron.clem@gmail.com
3 years agodrm/panfrost: don't use pfdevfreq.busy_count to know if hw is idle
Clément Péron [Fri, 10 Jul 2020 09:53:58 +0000 (11:53 +0200)]
drm/panfrost: don't use pfdevfreq.busy_count to know if hw is idle

This use devfreq variable that will be lock with spinlock in future
patches. We should either introduce a function to access this one
but as devfreq is optional let's just remove it.

Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200710095409.407087-4-peron.clem@gmail.com
3 years agodrm/panfrost: clean headers in devfreq
Clément Péron [Fri, 10 Jul 2020 09:53:57 +0000 (11:53 +0200)]
drm/panfrost: clean headers in devfreq

Don't include not required headers and sort them.

Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200710095409.407087-3-peron.clem@gmail.com
3 years agodrm/panfrost: avoid static declaration
Clément Péron [Fri, 10 Jul 2020 09:53:56 +0000 (11:53 +0200)]
drm/panfrost: avoid static declaration

This declaration can be avoided so change it.

Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200710095409.407087-2-peron.clem@gmail.com
3 years agodrm/panfrost: Add compatible string for bifrost
Tomeu Vizoso [Thu, 11 Jun 2020 08:58:44 +0000 (10:58 +0200)]
drm/panfrost: Add compatible string for bifrost

Mesa now supports some Bifrost devices, so enable it.

Tested-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200611085900.49740-2-tomeu.vizoso@collabora.com
3 years agodrm/panfrost: Make sure GPU is powered on when reading GPU_LATEST_FLUSH_ID
Tomeu Vizoso [Thu, 11 Jun 2020 08:58:43 +0000 (10:58 +0200)]
drm/panfrost: Make sure GPU is powered on when reading GPU_LATEST_FLUSH_ID

Bifrost devices do support the flush reduction feature, so on first job
submit we were trying to read the register while still powered off.

If the GPU is powered off, the feature doesn't bring any benefit, so
don't try to read.

Tested-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200611085900.49740-1-tomeu.vizoso@collabora.com
3 years agodrm/amdgpu: make sure userptr ttm is allocated
Christian König [Thu, 6 Aug 2020 12:44:07 +0000 (14:44 +0200)]
drm/amdgpu: make sure userptr ttm is allocated

We need to allocate that manually now.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Tested-by: Michel Dänzer <mdaenzer@redhat.com>
Link: https://patchwork.freedesktop.org/patch/384330/
3 years agodrm/ttm: rename ttm_mem_reg to ttm_resource.
Dave Airlie [Tue, 4 Aug 2020 02:56:32 +0000 (12:56 +1000)]
drm/ttm: rename ttm_mem_reg to ttm_resource.

This name better reflects what the object does. I didn't rename
all the pointers it seemed too messy.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-60-airlied@gmail.com
3 years agodrm/ttm: rename ttm_mem_type_manager -> ttm_resource_manager.
Dave Airlie [Tue, 4 Aug 2020 02:56:31 +0000 (12:56 +1000)]
drm/ttm: rename ttm_mem_type_manager -> ttm_resource_manager.

This name makes a lot more sense, since these are about managing
driver resources rather than just memory ranges.

Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-59-airlied@gmail.com
3 years agodrm/ttm: rename bo manager to range manager.
Dave Airlie [Tue, 4 Aug 2020 02:56:30 +0000 (12:56 +1000)]
drm/ttm: rename bo manager to range manager.

The generic manager is called the range manager now, rename
the file and some internals.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-58-airlied@gmail.com
3 years agodrm/ttm: add a wrapper for checking if manager is in use
Dave Airlie [Tue, 4 Aug 2020 02:56:29 +0000 (12:56 +1000)]
drm/ttm: add a wrapper for checking if manager is in use

This converts vmwgfx over to using an interface to set the
in use and check the in use flag.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-57-airlied@gmail.com
3 years agodrm/ttm: drop type manager has_type
Dave Airlie [Tue, 4 Aug 2020 02:56:28 +0000 (12:56 +1000)]
drm/ttm: drop type manager has_type

under driver control, this flag isn't needed anymore,
remove the API that used to access it, and consoldiate
with the used api.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-56-airlied@gmail.com
3 years agodrm/ttm: drop list of memory managers from device. (v2)
Dave Airlie [Tue, 4 Aug 2020 02:56:27 +0000 (12:56 +1000)]
drm/ttm: drop list of memory managers from device. (v2)

The driver now controls these, the core just controls the system
memory one.

v2: init sysman explicitly and assign it as a driver manager
to simplify the lookup sequence.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-55-airlied@gmail.com
3 years agodrm/ttm: drop man->bdev link.
Dave Airlie [Tue, 4 Aug 2020 02:56:26 +0000 (12:56 +1000)]
drm/ttm: drop man->bdev link.

This link isn't needed anymore, drop it from the init interface.

Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-54-airlied@gmail.com
3 years agodrm/amdgpu/ttm: remove man->bdev references.
Dave Airlie [Tue, 4 Aug 2020 02:56:25 +0000 (12:56 +1000)]
drm/amdgpu/ttm: remove man->bdev references.

Just store the device in the private so the link
can be removed from the manager

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-53-airlied@gmail.com
3 years agodrm/ttm: drop priv pointer in memory manager
Dave Airlie [Tue, 4 Aug 2020 02:56:24 +0000 (12:56 +1000)]
drm/ttm: drop priv pointer in memory manager

This isn't needed anymore by any drivers.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-52-airlied@gmail.com
3 years agodrm/nouveau/ttm: move to driver allocated manager
Dave Airlie [Tue, 4 Aug 2020 02:56:23 +0000 (12:56 +1000)]
drm/nouveau/ttm: move to driver allocated manager

Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-51-airlied@gmail.com
3 years agodrm/vmwgfx/gmrid: convert to driver controlled allocation.
Dave Airlie [Tue, 4 Aug 2020 02:56:22 +0000 (12:56 +1000)]
drm/vmwgfx/gmrid: convert to driver controlled allocation.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-50-airlied@gmail.com
3 years agodrm/vmwgfx/ttm: move thp to driver managed
Dave Airlie [Tue, 4 Aug 2020 02:56:21 +0000 (12:56 +1000)]
drm/vmwgfx/ttm: move thp to driver managed

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-49-airlied@gmail.com
3 years agodrm/ttm: move range manager to subclassed driver allocation
Dave Airlie [Tue, 4 Aug 2020 02:56:20 +0000 (12:56 +1000)]
drm/ttm: move range manager to subclassed driver allocation

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-48-airlied@gmail.com
3 years agodrm/ttm: make ttm_range_man_init/takedown take type + args
Dave Airlie [Tue, 4 Aug 2020 02:56:19 +0000 (12:56 +1000)]
drm/ttm: make ttm_range_man_init/takedown take type + args

This makes it easier to move these to a driver allocated system

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-47-airlied@gmail.com
3 years agodrm/amdgpu/ttm: use bo manager subclassing for vram/gtt mgrs
Dave Airlie [Tue, 4 Aug 2020 02:56:18 +0000 (12:56 +1000)]
drm/amdgpu/ttm: use bo manager subclassing for vram/gtt mgrs

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-46-airlied@gmail.com
3 years agodrm/ttm: allow drivers to provide their own manager subclasses
Dave Airlie [Tue, 4 Aug 2020 02:56:17 +0000 (12:56 +1000)]
drm/ttm: allow drivers to provide their own manager subclasses

This will get removed eventually and all drivers will use this.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-45-airlied@gmail.com
3 years agodrm/ttm: rename manager variable to make sure wrapper is used.
Dave Airlie [Tue, 4 Aug 2020 02:56:16 +0000 (12:56 +1000)]
drm/ttm: rename manager variable to make sure wrapper is used.

Other users of this should notice this change and switch to wrapper.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-44-airlied@gmail.com
3 years agodrm/vmwgfx/ttm: use wrapper to access memory manager
Dave Airlie [Tue, 4 Aug 2020 02:56:15 +0000 (12:56 +1000)]
drm/vmwgfx/ttm: use wrapper to access memory manager

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-43-airlied@gmail.com
3 years agodrm/radeon/ttm: use wrapper to access memory manager
Dave Airlie [Tue, 4 Aug 2020 02:56:14 +0000 (12:56 +1000)]
drm/radeon/ttm: use wrapper to access memory manager

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-42-airlied@gmail.com
3 years agodrm/qxl/ttm: use wrapper to access memory manager
Dave Airlie [Tue, 4 Aug 2020 02:56:13 +0000 (12:56 +1000)]
drm/qxl/ttm: use wrapper to access memory manager

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-41-airlied@gmail.com
3 years agodrm/nouveau/ttm: use wrapper to access memory managers
Dave Airlie [Tue, 4 Aug 2020 02:56:12 +0000 (12:56 +1000)]
drm/nouveau/ttm: use wrapper to access memory managers

Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-40-airlied@gmail.com
3 years agodrm/vram-helper: use wrapper to access memory managers
Dave Airlie [Tue, 4 Aug 2020 02:56:11 +0000 (12:56 +1000)]
drm/vram-helper: use wrapper to access memory managers

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-39-airlied@gmail.com
3 years agodrm/amdgfx/ttm: use wrapper to get ttm memory managers
Dave Airlie [Tue, 4 Aug 2020 02:56:10 +0000 (12:56 +1000)]
drm/amdgfx/ttm: use wrapper to get ttm memory managers

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-38-airlied@gmail.com
3 years agodrm/ttm: add wrapper to get manager from bdev.
Dave Airlie [Tue, 4 Aug 2020 02:56:09 +0000 (12:56 +1000)]
drm/ttm: add wrapper to get manager from bdev.

This will allow different abstractions later.

Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-37-airlied@gmail.com
3 years agodrm/ttm: make TTM responsible for cleaning system only.
Dave Airlie [Tue, 4 Aug 2020 02:56:08 +0000 (12:56 +1000)]
drm/ttm: make TTM responsible for cleaning system only.

Drivers should all be cleaning up their memory managers
themselves now, so let the core just clean the system one up.

Remove the legacy cleaning interface.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-36-airlied@gmail.com
3 years agodrm/ttm: remove range manager legacy takedown path
Dave Airlie [Tue, 4 Aug 2020 02:56:07 +0000 (12:56 +1000)]
drm/ttm: remove range manager legacy takedown path

Now all drivers have been converted, drop the non-driver path.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-35-airlied@gmail.com
3 years agodrm/vmwgfx: fix gmrid takedown paths to new interface
Dave Airlie [Tue, 4 Aug 2020 02:56:06 +0000 (12:56 +1000)]
drm/vmwgfx: fix gmrid takedown paths to new interface

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-34-airlied@gmail.com
3 years agodrm/qxl/ttm: use new takedown path
Dave Airlie [Tue, 4 Aug 2020 02:56:05 +0000 (12:56 +1000)]
drm/qxl/ttm: use new takedown path

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-33-airlied@gmail.com
3 years agodrm/radeon/ttm: use new takedown paths
Dave Airlie [Tue, 4 Aug 2020 02:56:04 +0000 (12:56 +1000)]
drm/radeon/ttm: use new takedown paths

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-32-airlied@gmail.com
3 years agodrm/nouveau: use new cleanup paths
Dave Airlie [Tue, 4 Aug 2020 02:56:03 +0000 (12:56 +1000)]
drm/nouveau: use new cleanup paths

Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-31-airlied@gmail.com
3 years agodrm/vram_helper: call explicit mm takedown
Dave Airlie [Tue, 4 Aug 2020 02:56:02 +0000 (12:56 +1000)]
drm/vram_helper: call explicit mm takedown

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-30-airlied@gmail.com
3 years agodrm/vmwgfx: takedown vram manager
Dave Airlie [Tue, 4 Aug 2020 02:56:01 +0000 (12:56 +1000)]
drm/vmwgfx: takedown vram manager

Don't bother returning EBUSY, nobody cares enough,
if the driver has a problem, it should deal with it.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-29-airlied@gmail.com
3 years agodrm/amdgpu/ttm: use new takedown path
Dave Airlie [Tue, 4 Aug 2020 02:56:00 +0000 (12:56 +1000)]
drm/amdgpu/ttm: use new takedown path

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-28-airlied@gmail.com
3 years agodrm/ttm: start allowing drivers to use new takedown path (v2)
Dave Airlie [Tue, 4 Aug 2020 02:55:59 +0000 (12:55 +1000)]
drm/ttm: start allowing drivers to use new takedown path (v2)

Allow the takedown path callback to be optional as well.

v2: use fini for range manager

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-27-airlied@gmail.com
3 years agodrm/ttm: make some inline helper functions for cleanup paths. (v2)
Dave Airlie [Tue, 4 Aug 2020 02:55:58 +0000 (12:55 +1000)]
drm/ttm: make some inline helper functions for cleanup paths. (v2)

The disable path is just temporary for now, it will be dropped once has_type
is gone in a later patch.

v2: add docs.
rename to ttm_mem_type_manager namespace

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-26-airlied@gmail.com
3 years agodrm/ttm: pass man around instead of mem_type in some places
Dave Airlie [Tue, 4 Aug 2020 02:55:57 +0000 (12:55 +1000)]
drm/ttm: pass man around instead of mem_type in some places

This makes it easier to cleanup things

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-25-airlied@gmail.com
3 years agodrm/ttm: purge old manager init path.
Dave Airlie [Tue, 4 Aug 2020 02:55:56 +0000 (12:55 +1000)]
drm/ttm: purge old manager init path.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-24-airlied@gmail.com
3 years agodrm/ttm: convert system manager init to new code.
Dave Airlie [Tue, 4 Aug 2020 02:55:55 +0000 (12:55 +1000)]
drm/ttm: convert system manager init to new code.

Remove the exit path, since this can't fail now.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-23-airlied@gmail.com
3 years agodrm/vmwgfx/ttm: switch gmrid allocator to new init paths.
Dave Airlie [Tue, 4 Aug 2020 02:55:54 +0000 (12:55 +1000)]
drm/vmwgfx/ttm: switch gmrid allocator to new init paths.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-22-airlied@gmail.com
3 years agodrm/vmwgfx/ttm: convert vram mm init to new code paths
Dave Airlie [Tue, 4 Aug 2020 02:55:53 +0000 (12:55 +1000)]
drm/vmwgfx/ttm: convert vram mm init to new code paths

Split out the vram thp init path vs the range manager init.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-21-airlied@gmail.com
3 years agodrm/nouveau: use new memory manager init paths
Dave Airlie [Tue, 4 Aug 2020 02:55:52 +0000 (12:55 +1000)]
drm/nouveau: use new memory manager init paths

Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-20-airlied@gmail.com
3 years agodrm/vram_helper: use new ttm manager init function
Dave Airlie [Tue, 4 Aug 2020 02:55:51 +0000 (12:55 +1000)]
drm/vram_helper: use new ttm manager init function

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-19-airlied@gmail.com
3 years agodrm/qxl/ttm: use new init path for manager
Dave Airlie [Tue, 4 Aug 2020 02:55:50 +0000 (12:55 +1000)]
drm/qxl/ttm: use new init path for manager

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-18-airlied@gmail.com
3 years agodrm/radeon: use new ttm man init path
Dave Airlie [Tue, 4 Aug 2020 02:55:49 +0000 (12:55 +1000)]
drm/radeon: use new ttm man init path

Use the new common manager init path.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-17-airlied@gmail.com
3 years agodrm/amdgpu/ttm: init managers from the driver side.
Dave Airlie [Tue, 4 Aug 2020 02:55:48 +0000 (12:55 +1000)]
drm/amdgpu/ttm: init managers from the driver side.

Use new init calls to unwrap manager init

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-16-airlied@gmail.com
3 years agodrm/ttm: provide a driver-led init path for range mm manager. (v2)
Dave Airlie [Tue, 4 Aug 2020 02:55:47 +0000 (12:55 +1000)]
drm/ttm: provide a driver-led init path for range mm manager. (v2)

This lets the generic range mm manager be initialised by the driver.

v2: add docs.
rename api to range_man_init for now.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-15-airlied@gmail.com
3 years agodrm/ttm: split the mm manager init code (v2)
Dave Airlie [Tue, 4 Aug 2020 02:55:46 +0000 (12:55 +1000)]
drm/ttm: split the mm manager init code (v2)

This will allow the driver to control the ordering here better.

Eventually the old path will be removed.

v2: add docs for new APIs.
rename new path to ttm_mem_type_manager_init/set_used(for now)

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-14-airlied@gmail.com
3 years agodrm/vram-helper: call the ttm manager debug function
Dave Airlie [Tue, 4 Aug 2020 02:55:45 +0000 (12:55 +1000)]
drm/vram-helper: call the ttm manager debug function

This code was assuming there was a drm_mm here, don't do
that call the correct API.

v2: use the new exported interface.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-13-airlied@gmail.com
3 years agodrm/qxl/ttm: call ttm manager debug (v2)
Dave Airlie [Tue, 4 Aug 2020 02:55:44 +0000 (12:55 +1000)]
drm/qxl/ttm: call ttm manager debug (v2)

v2: use the new exported interface.
This code was poking inside a struct and assuming it was a drm_mm
at the start. Call the proper API.

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-12-airlied@gmail.com
3 years agodrm/vmwgfx/gmrid: don't provide pointless ttm debug callback
Dave Airlie [Tue, 4 Aug 2020 02:55:43 +0000 (12:55 +1000)]
drm/vmwgfx/gmrid: don't provide pointless ttm debug callback

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-11-airlied@gmail.com
3 years agodrm/nouveau/ttm: don't fill in blank ttm debug callback
Dave Airlie [Tue, 4 Aug 2020 02:55:42 +0000 (12:55 +1000)]
drm/nouveau/ttm: don't fill in blank ttm debug callback

Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-10-airlied@gmail.com
3 years agodrm/ttm: export memory type debug entrypoint.
Dave Airlie [Tue, 4 Aug 2020 02:55:41 +0000 (12:55 +1000)]
drm/ttm: export memory type debug entrypoint.

As suggested on review, just export the memory type debug for
drivers to use, while also making the debug callback optional
(don't need to test for system as it won't init it).

rename it to be more consistent with object name for now.
(we may rename all the objects later.)

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-9-airlied@gmail.com
3 years agodrm/vram-helper: remove populate/unpopulate
Dave Airlie [Tue, 4 Aug 2020 02:55:40 +0000 (12:55 +1000)]
drm/vram-helper: remove populate/unpopulate

The default path for populate/unpopulate is already this.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-8-airlied@gmail.com
3 years agodrm/ttm: use a helper for unlocked moves to the lru tail
Dave Airlie [Tue, 4 Aug 2020 02:55:39 +0000 (12:55 +1000)]
drm/ttm: use a helper for unlocked moves to the lru tail

The pattern was repeated a few times, just make an inline for it.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-7-airlied@gmail.com
3 years agodrm/ttm/amdgpu: consolidate ttm reserve paths
Dave Airlie [Tue, 4 Aug 2020 02:55:38 +0000 (12:55 +1000)]
drm/ttm/amdgpu: consolidate ttm reserve paths

Drop the WARN_ON and consolidate the two paths into one.

Use the consolidate slowpath in the execbuf utils code.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-6-airlied@gmail.com
3 years agoqxl/ttm: drop the unusued no wait flag to reserve function
Dave Airlie [Tue, 4 Aug 2020 02:55:37 +0000 (12:55 +1000)]
qxl/ttm: drop the unusued no wait flag to reserve function

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-5-airlied@gmail.com
3 years agonouveau: use ttm populate mapping functions. (v2)
Dave Airlie [Tue, 4 Aug 2020 02:55:36 +0000 (12:55 +1000)]
nouveau: use ttm populate mapping functions. (v2)

Instead of rolling driver copies of them.

v2: cleanup return handling (Ben)

Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-4-airlied@gmail.com
3 years agodrm/vmwgfx: drop bo map/unmap dma functions.
Dave Airlie [Tue, 4 Aug 2020 02:55:35 +0000 (12:55 +1000)]
drm/vmwgfx: drop bo map/unmap dma functions.

The map one was used once, just inline it, and drop them both.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-3-airlied@gmail.com
3 years agodrm/vmwgfx: consolidate ttm object creation and populate
Dave Airlie [Tue, 4 Aug 2020 02:55:34 +0000 (12:55 +1000)]
drm/vmwgfx: consolidate ttm object creation and populate

These two functions has the same code in them, create a common
helper function instead.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-2-airlied@gmail.com
3 years agovideo: fbdev: pvr2fb: initialize variables
Tom Rix [Mon, 20 Jul 2020 19:18:45 +0000 (12:18 -0700)]
video: fbdev: pvr2fb: initialize variables

clang static analysis reports this repesentative error

pvr2fb.c:1049:2: warning: 1st function call argument
  is an uninitialized value [core.CallAndMessage]
        if (*cable_arg)
        ^~~~~~~~~~~~~~~

Problem is that cable_arg depends on the input loop to
set the cable_arg[0].  If it does not, then some random
value from the stack is used.

A similar problem exists for output_arg.

So initialize cable_arg and output_arg.

Signed-off-by: Tom Rix <trix@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200720191845.20115-1-trix@redhat.com
3 years agodrm/mgag200: Set PCI option register in G200SE models
Thomas Zimmermann [Tue, 4 Aug 2020 06:51:58 +0000 (08:51 +0200)]
drm/mgag200: Set PCI option register in G200SE models

The initial value of the PCI option register got lost while refactoring
the driver init code. Restore the setting.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reported-by: kernel test robot <lkp@intel.com>
Fixes: 2021708e0d6e ("drm/mgag200: Initialize PCI registers early during device setup")
Cc: Lyude Paul <lyude@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Emil Velikov <emil.velikov@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804065158.21049-1-tzimmermann@suse.de
3 years agofbdev: Use fallthrough pseudo-keyword
Gustavo A. R. Silva [Tue, 7 Jul 2020 21:05:39 +0000 (16:05 -0500)]
fbdev: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200707210539.GA12530@embeddedor
3 years agoomapfb/dss: Include the right header
Linus Walleij [Mon, 6 Jul 2020 12:59:31 +0000 (14:59 +0200)]
omapfb/dss: Include the right header

The hdmi4.c and hdmi5.c files include the legacy GPIO
header <linux/gpio.h> but does not use any of the symbols
from this file.

What it does use is the implicit inclusion of <linux/of.h>
leading to compile errors if we just drop this include.

Include the right header.

Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200706125931.752539-1-linus.walleij@linaro.org
3 years agofbdev: Remove trailing whitespace
Thomas Zimmermann [Wed, 29 Jul 2020 13:41:44 +0000 (15:41 +0200)]
fbdev: Remove trailing whitespace

Removes trailing whitespaces in several places.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200729134148.6855-2-tzimmermann@suse.de