]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/log
mirror_ubuntu-jammy-kernel.git
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
3 years agodrm/mgag200: Add support for G200 desktop cards
Thomas Zimmermann [Thu, 30 Jul 2020 10:28:44 +0000 (12:28 +0200)]
drm/mgag200: Add support for G200 desktop cards

This patch adds support for G200 desktop cards. We can reuse the whole
memory and modesetting code. A few PCI and DAC register values have to
be updated accordingly.

The most significant change is in the PLL setup. The driver parses the
device's BIOS to retrieve clock limits and reference clocks. With no BIOS
found, safe defaults are being used.

v2:
* copy BIOS ROM to system memory and access with regular
  load/store; resolves potential HW limitations
* fix some stray whitespaces

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Co-developed-by: Egbert Eich <eich@suse.com>
Signed-off-by: Egbert Eich <eich@suse.com>
Co-developed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730102844.10995-9-tzimmermann@suse.de
3 years agodrm/mgag200: Move G200SE's unique id into model-specific data
Thomas Zimmermann [Thu, 30 Jul 2020 10:28:43 +0000 (12:28 +0200)]
drm/mgag200: Move G200SE's unique id into model-specific data

The unique revision id is only useful for G200SE devices. Store the
value in model-specific data within struct mga_device. While at it,
the patch also adds an init helper for the value.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730102844.10995-8-tzimmermann@suse.de
3 years agodrm/mgag200: Clear <page> field during MM init
Thomas Zimmermann [Thu, 30 Jul 2020 10:28:42 +0000 (12:28 +0200)]
drm/mgag200: Clear <page> field during MM init

The modesetting code initialized the memory-related register CRTCEXT4.
Move this code to MM initialization.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730102844.10995-7-tzimmermann@suse.de
3 years agodrm/mgag200: Set MISC memory flags in mm init code
Thomas Zimmermann [Thu, 30 Jul 2020 10:28:41 +0000 (12:28 +0200)]
drm/mgag200: Set MISC memory flags in mm init code

The modesetting code initialized several memory-related flags in the
MISC register. Move this code to MM initialization.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730102844.10995-6-tzimmermann@suse.de
3 years agodrm/mgag200: Enable MGA mode during device register initialization
Thomas Zimmermann [Thu, 30 Jul 2020 10:28:40 +0000 (12:28 +0200)]
drm/mgag200: Enable MGA mode during device register initialization

MGA cards can run in traditional VGA mode or an enhanced MGA mode; with
the latter being required for KMS. So far, MGA mode was enabled during
modesetting. As it's fundamental for device operation, the patch moves
it next to the device register setup.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730102844.10995-5-tzimmermann@suse.de
3 years agodrm/mgag200: Initialize PCI registers early during device setup
Thomas Zimmermann [Thu, 30 Jul 2020 10:28:39 +0000 (12:28 +0200)]
drm/mgag200: Initialize PCI registers early during device setup

So far, PCI option registers were initialized as part of modesetting,
which is late in the process. As these registers control fundamental
operation, they should be set early.

The patch moves the PCI option handling into device register setup,
before even the device MMIO memory is being mapped. No functional
changes made.

Moving the PCI code next to the device-register setup also allows to
remove the has_sdram field from struct mga_device. The state is now
local to the init helper.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730102844.10995-4-tzimmermann@suse.de
3 years agodrm/mgag200: Move register initialization into helper function
Thomas Zimmermann [Thu, 30 Jul 2020 10:28:38 +0000 (12:28 +0200)]
drm/mgag200: Move register initialization into helper function

The mgag200 driver maps registers into the address space. Move the
code into a separate helper function. No functional changes.

One small difference is in the handling of SDRAM/SGRAM. MGA devices
can come with either SDRAM or SGRAM. So far, the driver checked for
SDRAM, which is the common case. The patch moves this code into a
separate helper and checks for SGRAM, which is the special case. The
test itself is the same as before.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730102844.10995-3-tzimmermann@suse.de
3 years agodrm/mgag200: Enable caching for SHMEM pages
Thomas Zimmermann [Thu, 30 Jul 2020 10:28:37 +0000 (12:28 +0200)]
drm/mgag200: Enable caching for SHMEM pages

SHMEM pages use write-combine caching by default, but can also use the
platform's default page caching. Doing so may improve the performance
of I/O on the framebuffer.

Mgag200's hardware does not access framebuffer pages directly (i.e.,
via DMA), so enabling caching does not have an effect on consistency
of the framebuffer memory or the displayed data.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730102844.10995-2-tzimmermann@suse.de
3 years agodrm/ast: Managed device release
Thomas Zimmermann [Thu, 30 Jul 2020 13:52:06 +0000 (15:52 +0200)]
drm/ast: Managed device release

This turns the ast's device cleanup code into a managed release helper
function. Note that the code uses devres helpers. The release function
switches the device back to VGA mode and therefore runs during HW device
cleanup; not at DRM device cleanup.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730135206.30239-10-tzimmermann@suse.de
3 years agodrm/ast: Manage release of firmware backup memory
Thomas Zimmermann [Thu, 30 Jul 2020 13:52:05 +0000 (15:52 +0200)]
drm/ast: Manage release of firmware backup memory

The ast driver keeps a backup copy of the DP501 encoder's firmware. This
patch adds managed release of the allocated memory.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730135206.30239-9-tzimmermann@suse.de
3 years agodrm/ast: Managed release of ast firmware
Thomas Zimmermann [Thu, 30 Jul 2020 13:52:04 +0000 (15:52 +0200)]
drm/ast: Managed release of ast firmware

The ast driver loads firmware for the DP501 display encoder. The
patch replaces the removal code with a managed release function.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730135206.30239-8-tzimmermann@suse.de
3 years agodrm/ast: Embed struct drm_device in struct ast_private
Thomas Zimmermann [Thu, 30 Jul 2020 13:52:03 +0000 (15:52 +0200)]
drm/ast: Embed struct drm_device in struct ast_private

Turns struct ast_private into a subclass of struct drm_device by
embedding the latter. This allows for using DRM's managed device
allocation.

The use of struct drm_device.dev_private is deprecated. The patch
converts the last remaining users to to_ast_private().

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730135206.30239-7-tzimmermann@suse.de
3 years agodrm/ast: Don't use ast->dev if dev is available
Thomas Zimmermann [Thu, 30 Jul 2020 13:52:02 +0000 (15:52 +0200)]
drm/ast: Don't use ast->dev if dev is available

Several places in ast use ast->dev, when a dev pointer is already
available within the function. Remove the extra indirection. No
functional changes made.

This is just a small cleanup before embedding the DRM device instance
in struct ast_private.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730135206.30239-6-tzimmermann@suse.de
3 years agodrm/ast: Replace struct_drm_device.dev_private with to_ast_private()
Thomas Zimmermann [Thu, 30 Jul 2020 13:52:01 +0000 (15:52 +0200)]
drm/ast: Replace struct_drm_device.dev_private with to_ast_private()

The ast code still references dev_private in several place when looking
up the ast device structure. Convert the remaining locations to use
to_ast_private().

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730135206.30239-5-tzimmermann@suse.de
3 years agodrm/ast: Replace driver load/unload functions with device create/destroy
Thomas Zimmermann [Thu, 30 Jul 2020 13:52:00 +0000 (15:52 +0200)]
drm/ast: Replace driver load/unload functions with device create/destroy

The ast driver's load and unload functions are left-overs from when
struct drm_driver.load/unload was still in use. The PCI probe helper
allocated the DRM device and ran load to initialize it.

This patch replaces this code with device create and destroy. The
main difference is that the device's create function allocates the
DRM device and ast structures in the same place. This will be required
for switching ast to managed allocations.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730135206.30239-4-tzimmermann@suse.de
3 years agodrm/ast: Separate DRM driver from PCI code
Thomas Zimmermann [Thu, 30 Jul 2020 13:51:59 +0000 (15:51 +0200)]
drm/ast: Separate DRM driver from PCI code

Putting the DRM driver to the top of the file and the PCI code to the
bottom makes ast_drv.c more readable. While at it, the patch prefixes
file-scope variables with ast_.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730135206.30239-3-tzimmermann@suse.de
3 years agodrm/ast: Embed CRTC and connector in struct ast_private
Thomas Zimmermann [Thu, 30 Jul 2020 13:51:58 +0000 (15:51 +0200)]
drm/ast: Embed CRTC and connector in struct ast_private

Only single instances of CRTC and connector are supported per
device. Embed both in ast's structure and remove the individual
memory allocations. DRM's CRTC cleanup helpers replace the rsp.
destroy function in ast.

While at it, also convert to_ast_connector() to a function.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730135206.30239-2-tzimmermann@suse.de
3 years agodrm/syncobj: Tune down unordered timeline DRM_ERROR
Daniel Vetter [Sat, 1 Aug 2020 09:26:25 +0000 (11:26 +0200)]
drm/syncobj: Tune down unordered timeline DRM_ERROR

Userspace can provoke this, we generally don't allow userspace to spam
dmesg. Tune it down to debug. Unfortunately we don't have easy access
to the drm_device here (not at all without changing a few things), so
leave it as old style dmesg output for now.

References: https://patchwork.freedesktop.org/series/80146/
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: "Christian König" <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200801092625.1107609-1-daniel.vetter@ffwll.ch
3 years agodrm/vkms: fix xrgb on compute crc
Melissa Wen [Thu, 30 Jul 2020 20:25:24 +0000 (17:25 -0300)]
drm/vkms: fix xrgb on compute crc

The previous memset operation was not correctly zeroing the alpha
channel to compute the crc, and as a result, the IGT subtest
kms_cursor_crc/pipe-A-cursor-alpha-transparent fails.

Fixes: db7f419c06d7c ("drm/vkms: Compute CRC with Cursor Plane")
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730202524.5upzuh4irboru7my@smtp.gmail.com
3 years agodrm/panel: simple: Add Chefree CH101OLHLWH-002 panel
Marek Vasut [Tue, 28 Jul 2020 20:12:42 +0000 (22:12 +0200)]
drm/panel: simple: Add Chefree CH101OLHLWH-002 panel

Add support for the Chefree CH101OLHLWH-002 10.1" (1280x800)
color TFT LCD panel, connected over LVDS.

Timings are taken from the datasheet version P0.5.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: dri-devel@lists.freedesktop.org
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200728201242.4336-3-marex@denx.de
3 years agodt-bindings: Add DT bindings for Chefree CH101OLHLWH-002
Marek Vasut [Tue, 28 Jul 2020 20:12:41 +0000 (22:12 +0200)]
dt-bindings: Add DT bindings for Chefree CH101OLHLWH-002

Add DT bindings for Chefree CH101OLHLWH-002 10.1" 1280x800 LCD.
This panel is connected via LVDS.

Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Rob Herring <robh@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200728201242.4336-2-marex@denx.de
3 years agodt-bindings: Add vendor prefix for Chefree
Marek Vasut [Tue, 28 Jul 2020 20:12:40 +0000 (22:12 +0200)]
dt-bindings: Add vendor prefix for Chefree

The Chefree Technology Corp. is an LCD panel manufacturer.

Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Rob Herring <robh@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200728201242.4336-1-marex@denx.de
3 years agodrm/panel: remove return value of function drm_panel_add
Bernard Zhao [Sat, 1 Aug 2020 12:02:13 +0000 (20:02 +0800)]
drm/panel: remove return value of function drm_panel_add

The function "int drm_panel_add(struct drm_panel *panel)"
always returns 0, this return value is meaningless.
Also, there is no need to check return value which calls
"drm_panel_add and", error branch code will never run.

Signed-off-by: Bernard Zhao <bernard@vivo.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200801120216.8488-1-bernard@vivo.com
3 years agodrm/ttm: remove the init_mem_type callback
Christian König [Thu, 23 Jul 2020 15:13:47 +0000 (17:13 +0200)]
drm/ttm: remove the init_mem_type callback

It is a very strange concept to call a function which just
calls back the caller for the functions parameters.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/382085/
3 years agodrm/vram-helper: stop implementing init_mem_type
Christian König [Thu, 23 Jul 2020 14:40:17 +0000 (16:40 +0200)]
drm/vram-helper: stop implementing init_mem_type

Instead just initialize the memory type parameters
before calling ttm_bo_init_mm.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/382086/
3 years agodrm/qxl: stop implementing init_mem_type
Christian König [Thu, 23 Jul 2020 14:29:59 +0000 (16:29 +0200)]
drm/qxl: stop implementing init_mem_type

Instead just initialize the memory type parameters
before calling ttm_bo_init_mm.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/382083/
3 years agodrm/nouveau: stop implementing init_mem_type
Christian König [Thu, 23 Jul 2020 13:39:57 +0000 (15:39 +0200)]
drm/nouveau: stop implementing init_mem_type

Instead just initialize the memory type parameters
before calling ttm_bo_init_mm.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/382081/
3 years agodrm/vmwgfx: stop implementing init_mem_type v2
Christian König [Thu, 23 Jul 2020 13:19:49 +0000 (15:19 +0200)]
drm/vmwgfx: stop implementing init_mem_type v2

Instead just initialize the memory type parameters
before calling ttm_bo_init_mm.

v2: keep extra system domain handling

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/382082/
3 years agodrm/amdgpu: stop implementing init_mem_type
Christian König [Thu, 23 Jul 2020 13:07:45 +0000 (15:07 +0200)]
drm/amdgpu: stop implementing init_mem_type

Instead just initialize the memory type parameters
before calling ttm_bo_init_mm.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/382084/
3 years agodrm/radeon: stop implementing init_mem_type
Christian König [Thu, 23 Jul 2020 09:47:57 +0000 (11:47 +0200)]
drm/radeon: stop implementing init_mem_type

Instead just initialize the memory type parameters
before calling ttm_bo_init_mm.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/382080/
3 years agodrm/ttm: remove TTM_MEMTYPE_FLAG_FIXED v2
Christian König [Tue, 21 Jul 2020 07:58:13 +0000 (09:58 +0200)]
drm/ttm: remove TTM_MEMTYPE_FLAG_FIXED v2

Instead use a boolean field in the memory manager structure.

Also invert the meaning of the field since the use of a TT
structure is the special case here.

v2: cleanup zero init.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/382079/
3 years agodrm/ttm: initialize the system domain with defaults v2
Christian König [Mon, 20 Jul 2020 12:41:31 +0000 (14:41 +0200)]
drm/ttm: initialize the system domain with defaults v2

Instead of repeating that in each driver.

v2: keep the caching limitation for VMWGFX for now.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/382078/
3 years agodrm/ingenic: ipu: Only enable clock when needed
Paul Cercueil [Thu, 30 Jul 2020 14:48:30 +0000 (16:48 +0200)]
drm/ingenic: ipu: Only enable clock when needed

Instead of keeping the IPU clock enabled constantly, enable and disable
it on demand, when the IPU plane is used. That way, we won't use any
extra power when the IPU is not used.

v2: Explain the reason of this patch

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730144830.10479-4-paul@crapouillou.net
3 years agodrm/ingenic: ipu: Remove YUV422 from supported formats on JZ4725B
Paul Cercueil [Thu, 30 Jul 2020 14:48:29 +0000 (16:48 +0200)]
drm/ingenic: ipu: Remove YUV422 from supported formats on JZ4725B

When configuring the IPU for packed YUV 4:2:2, depending on the scaling
ratios given by the source and destination resolutions, it is possible
to crash the IPU block, to the point where a software reset of the IP
does not fix it. This can happen anytime, in the first few frames, or
after dozens of minutes. The same crash also happens when the IPU is
fully controlled by the LCD controller (in that case no HW register is
written at any moment after startup), which points towards a hardware
bug.

Thanksfully multiplanar YUV is not affected.

Until this bug is fixed or worked around, address this issue by removing
support for YUV 4:2:2 on the IPU of the JZ4725B.

v2: Update commit message (remove the "crash beyond repair" bit)

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730144830.10479-3-paul@crapouillou.net
3 years agodrm/ingenic: ipu: Only restart manually on older SoCs
Paul Cercueil [Thu, 30 Jul 2020 14:48:28 +0000 (16:48 +0200)]
drm/ingenic: ipu: Only restart manually on older SoCs

On older SoCs, it is necessary to restart manually the IPU when a frame
is done processing. Doing so on newer SoCs (JZ4760/70) kinds of work
too, until the input or output resolutions or the framerate are too
high.

Make it work properly on newer SoCs by letting the LCD controller
trigger the IPU frame restart signal.

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730144830.10479-2-paul@crapouillou.net
3 years agodrm/doc: device hot-unplug for userspace
Pekka Paalanen [Tue, 7 Jul 2020 11:38:05 +0000 (14:38 +0300)]
drm/doc: device hot-unplug for userspace

Set up the expectations on how hot-unplugging a DRM device should look like to
userspace.

Written by Daniel Vetter's request and largely based on his comments in IRC and
from https://lists.freedesktop.org/archives/dri-devel/2020-May/265484.html .

A related Wayland protocol change proposal is at
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/35

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Noralf Trønnes <noralf@tronnes.org>
Cc: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Sean Paul <sean@poorly.run>
Cc: Simon Ser <contact@emersion.fr>
Cc: Ben Skeggs <skeggsb@gmail.com>
Cc: Karol Herbst <kherbst@redhat.com>
Acked-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200707113805.30936-1-ppaalanen@gmail.com
3 years agodrm/hisilicon: Fixed the warning: Assignment of 0/1 to bool variable
Tian Tao [Tue, 28 Jul 2020 12:55:07 +0000 (20:55 +0800)]
drm/hisilicon: Fixed the warning: Assignment of 0/1 to bool variable

fixed the following warning:
hibmc_drm_drv.c:296:1-18:WARNING: Assignment of 0/1 to bool variable.
hibmc_drm_drv.c:301:2-19: WARNING: Assignment of 0/1 to bool variable.

v2:
using the pci_dev.msi_enabled instead of priv->msi_enabled.

v3:
just call pci_enable_msi() and pci_disable_msi(), it's no need to
set dev->pdev->msi_enabled again.

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/1595940907-17874-1-git-send-email-tiantao6@hisilicon.com
3 years agodrm/ingenic: Validate mode in a .mode_valid callback
Paul Cercueil [Tue, 28 Jul 2020 15:16:41 +0000 (17:16 +0200)]
drm/ingenic: Validate mode in a .mode_valid callback

Validate modes in the drm_crtc_helper_funcs.mode_valid() callback, which
is designed for this purpose, instead of doing it in
drm_crtc_helper_funcs.atomic_check().

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200728151641.26124-3-paul@crapouillou.net
3 years agodrm/ingenic: Handle errors of drm_atomic_get_plane_state
Paul Cercueil [Tue, 28 Jul 2020 15:16:40 +0000 (17:16 +0200)]
drm/ingenic: Handle errors of drm_atomic_get_plane_state

drm_atomic_get_plane_state() can return errors, so we need to handle
these.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200728151641.26124-2-paul@crapouillou.net
3 years agodrm/panel: simple: Add Powertip PH800480T013 panel
Marek Vasut [Tue, 28 Jul 2020 12:12:46 +0000 (14:12 +0200)]
drm/panel: simple: Add Powertip PH800480T013 panel

Add support for Powertip PH800480T013 800x480 parallel LCD, this
one is used in the Raspberry Pi 7" touchscreen display unit.

Signed-off-by: Marek Vasut <marex@denx.de>
To: dri-devel@lists.freedesktop.org
Cc: Eric Anholt <eric@anholt.net>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200728121246.23304-3-marex@denx.de
3 years agodt-bindings: Add DT bindings for Powertip PH800480T013
Marek Vasut [Tue, 28 Jul 2020 12:12:45 +0000 (14:12 +0200)]
dt-bindings: Add DT bindings for Powertip PH800480T013

Add DT bindings for Powertip PH800480T013 800x480 parallel LCD,
this one is used in the Raspberry Pi 7" touchscreen display unit.

Signed-off-by: Marek Vasut <marex@denx.de>
To: dri-devel@lists.freedesktop.org
Cc: Eric Anholt <eric@anholt.net>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200728121246.23304-2-marex@denx.de
3 years agodt-bindings: Add vendor prefix for Powertip
Marek Vasut [Tue, 28 Jul 2020 12:12:44 +0000 (14:12 +0200)]
dt-bindings: Add vendor prefix for Powertip

The Powertip Tech. Corp. is an LCD panel manufacturer.

Signed-off-by: Marek Vasut <marex@denx.de>
To: dri-devel@lists.freedesktop.org
Cc: Eric Anholt <eric@anholt.net>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200728121246.23304-1-marex@denx.de
3 years agodrm: mxsfb: Support the alpha plane
Laurent Pinchart [Mon, 27 Jul 2020 02:06:54 +0000 (05:06 +0300)]
drm: mxsfb: Support the alpha plane

The LCDIF in the i.MX6SX and i.MX7 have a second plane called the alpha
plane. Support it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-23-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Remove unnecessary spaces after tab
Laurent Pinchart [Mon, 27 Jul 2020 02:06:53 +0000 (05:06 +0300)]
drm: mxsfb: Remove unnecessary spaces after tab

This is a cosmetic change only, no code change is included.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-22-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Merge mxsfb_set_pixel_fmt() and mxsfb_set_bus_fmt()
Laurent Pinchart [Mon, 27 Jul 2020 02:06:52 +0000 (05:06 +0300)]
drm: mxsfb: Merge mxsfb_set_pixel_fmt() and mxsfb_set_bus_fmt()

The mxsfb_set_pixel_fmt() and mxsfb_set_bus_fmt() functions both deal
with format configuration, are always called in a row from
mxsfb_crtc_mode_set_nofb(), and set fields from the LCDC_CTRL register.
This requires a read-modify-update cycle in mxsfb_set_bus_fmt(). Make
this more efficient by merging them together.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-21-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Turn mxsfb_set_pixel_fmt() into a void function
Laurent Pinchart [Mon, 27 Jul 2020 02:06:51 +0000 (05:06 +0300)]
drm: mxsfb: Turn mxsfb_set_pixel_fmt() into a void function

The mxsfb_set_pixel_fmt() function returns an error when the selected
pixel format is unsupported. This can never happen, as such errors are
caught by the DRM core. Remove the error check.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-20-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Drop non-OF support
Laurent Pinchart [Mon, 27 Jul 2020 02:06:50 +0000 (05:06 +0300)]
drm: mxsfb: Drop non-OF support

The mxsfb driver is only used by OF platforms. Drop non-OF support.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-19-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Update internal IP version number for i.MX6SX
Laurent Pinchart [Mon, 27 Jul 2020 02:06:49 +0000 (05:06 +0300)]
drm: mxsfb: Update internal IP version number for i.MX6SX

The LCDIF present in the i.MX6SX has extra features compared to
the i.MX28. It has however lost its IP version register, so no official
version number is known. Bump the version to MXSFB_V6 following the i.MX
version, in preparation for support for the additional features.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-18-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Add i.MX7 and i.MX8M to the list of supported SoCs in Kconfig
Laurent Pinchart [Mon, 27 Jul 2020 02:06:48 +0000 (05:06 +0300)]
drm: mxsfb: Add i.MX7 and i.MX8M to the list of supported SoCs in Kconfig

Extend the Kconfig option description by listing the i.MX7 and i.MX8M
SoCs, as they are supported by the same driver. Replace the list of SoCs
in the short description with just "(e)LCDIF LCD controller" to avoid
expanding it further in the future as support for more SoCs is added.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-17-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Remove mxsfb_devdata unused fields
Laurent Pinchart [Mon, 27 Jul 2020 02:06:47 +0000 (05:06 +0300)]
drm: mxsfb: Remove mxsfb_devdata unused fields

The debug0 and ipversion fields of the mxsfb_devdata structure are
unused. Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-16-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Enable vblank handling
Laurent Pinchart [Mon, 27 Jul 2020 02:06:46 +0000 (05:06 +0300)]
drm: mxsfb: Enable vblank handling

Enable vblank handling when the CRTC is turned on and disable it when it
is turned off. This requires moving vblank init after the KMS pipeline
initialisation, otherwise drm_vblank_init() gets called with 0 CRTCs.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-15-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Don't touch AXI clock in IRQ context
Laurent Pinchart [Mon, 27 Jul 2020 02:06:45 +0000 (05:06 +0300)]
drm: mxsfb: Don't touch AXI clock in IRQ context

The driver attempts agressive power management by enabling and disabling
the AXI clock around register accesses. This results in attempts to
enable and disable the clock in the IRQ handler, which is a no-go as
preparing or unpreparing the clock may sleep.

On the other hand, the driver enables the AXI clock when enabling the
CRTC and keeps it enabled until the CRTC is disabled. This is correct,
and renders the power management attempt pointless, as interrupts are
not supposed to occur when the CRTC is off.

The same reasoning can be applied to the CRTC .enable_vblank() and
.disable_vblank() that are not supposed to be called when the CRTC off
and thus don't require manual handling of the AXI clock. Furthermore,
vblank handling is never enabled, which results in the vblank enable and
disable handlers never being called.

To fix this, remove the manual clock handling in the IRQ, the CRTC
.enable_vblank() and .disable_vblank() handlers and the plane
.atomic_update() handler. We however need to handle the clock manually
in mxsfb_irq_disable() as is calls .disable_vblank() manually and is
used both at probe and remove time.

The clock disabling is also moved to the last step of the
mxsfb_crtc_atomic_disable() function, to prepare for enabling vblank
handling.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-14-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Move vblank event arm to CRTC .atomic_flush()
Laurent Pinchart [Mon, 27 Jul 2020 02:06:44 +0000 (05:06 +0300)]
drm: mxsfb: Move vblank event arm to CRTC .atomic_flush()

The vblank event is armed in the plane .atomic_update(). This works fine
as we have a single plane, and was the only option when the driver was
using the drm_simple_kms_helper helper, but will break as soon as
multiple planes are supported. Move it to CRTC .atomic_flush().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-13-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Stop using DRM simple display pipeline helper
Laurent Pinchart [Mon, 27 Jul 2020 02:06:43 +0000 (05:06 +0300)]
drm: mxsfb: Stop using DRM simple display pipeline helper

The DRM simple display pipeline helper only supports a single plane. In
order to prepare for support of the alpha plane on i.MX6SX and i.MX7,
move away from the helper. No new feature is added.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-12-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Rename mxsfb_crtc.c to mxsfb_kms.c
Laurent Pinchart [Mon, 27 Jul 2020 02:06:42 +0000 (05:06 +0300)]
drm: mxsfb: Rename mxsfb_crtc.c to mxsfb_kms.c

The mxsfb_crtc.c file doesn't handle just the CRTC, but also the other
KMS objects. Rename it accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-11-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Remove unneeded includes
Laurent Pinchart [Mon, 27 Jul 2020 02:06:41 +0000 (05:06 +0300)]
drm: mxsfb: Remove unneeded includes

A fair number of includes are not needed. Drop them, and add a couple of
required includes that were included indirectly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-10-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Remove register definitions from mxsfb_crtc.c
Laurent Pinchart [Mon, 27 Jul 2020 02:06:40 +0000 (05:06 +0300)]
drm: mxsfb: Remove register definitions from mxsfb_crtc.c

mxsfb_crtc.c defines several macros related to register addresses and
bit, which duplicates macros from mxsfb_regs.h. Use the macros from
mxsfb_regs.h instead and remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-9-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Use LCDC_CTRL register name explicitly
Laurent Pinchart [Mon, 27 Jul 2020 02:06:39 +0000 (05:06 +0300)]
drm: mxsfb: Use LCDC_CTRL register name explicitly

The LCDC_CTRL register is located at address 0x0000. Some of the
accesses to the register simply use the mxsfb->base address. Reference
the LCDC_CTRL register explicitly instead to clarify the code.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-8-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Pass mxsfb_drm_private pointer to mxsfb_reset_block()
Laurent Pinchart [Mon, 27 Jul 2020 02:06:38 +0000 (05:06 +0300)]
drm: mxsfb: Pass mxsfb_drm_private pointer to mxsfb_reset_block()

The mxsfb_reset_block() function isn't special, pass it the
mxsfb_drm_private pointer instead of a pointer to the base address.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-7-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Clarify format and bus width configuration
Laurent Pinchart [Mon, 27 Jul 2020 02:06:37 +0000 (05:06 +0300)]
drm: mxsfb: Clarify format and bus width configuration

Replace the convoluted way to set the format and bus width through
difficult to read macros with more explicit ones. Also remove the
outdated comment related to the limitations on bus width setting as it
doesn't apply anymore (the bus width can be specified through the
display_info bus format).

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-6-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Remove unused macros from mxsfb_regs.h
Laurent Pinchart [Mon, 27 Jul 2020 02:06:36 +0000 (05:06 +0300)]
drm: mxsfb: Remove unused macros from mxsfb_regs.h

mxsfb_regs.h defines macros related to register bits. Some of them are
not used and don't clearly map to any particular register, so their
purpose isn't known. Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-5-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Use BIT() macro to define register bitfields
Laurent Pinchart [Mon, 27 Jul 2020 02:06:35 +0000 (05:06 +0300)]
drm: mxsfb: Use BIT() macro to define register bitfields

Using BIT() is preferred over manual shifts as it's more readable,
handles the 1 << 31 case properly, and avoids other mistakes as shown by
the DEBUG0_HSYNC and DEBUG0_VSYNC bits (that are currently unused). Use
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-4-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Use drm_panel_bridge
Laurent Pinchart [Mon, 27 Jul 2020 02:06:34 +0000 (05:06 +0300)]
drm: mxsfb: Use drm_panel_bridge

Replace the manual connector implementation based on drm_panel with the
drm_panel_bridge helper. This simplifies the mxsfb driver by removing
connector-related code, and standardizing all pipeline control
operations on bridges.

A hack is needed to get hold of the connector, as that's our only source
of bus flags and formats for now. As soon as the bridge API provides us
with that information this can be fixed.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-3-laurent.pinchart@ideasonboard.com
3 years agodrm: mxsfb: Remove fbdev leftovers
Laurent Pinchart [Mon, 27 Jul 2020 02:06:33 +0000 (05:06 +0300)]
drm: mxsfb: Remove fbdev leftovers

Commit 8e93f1028d74 ("drm/mxsfb: Use drm_fbdev_generic_setup()")
replaced fbdev handling with drm_fbdev_generic_setup() but left
inclusion of the drm/drm_fb_cma_helper.h header. Remove it.

Fixes: 8e93f1028d74 ("drm/mxsfb: Use drm_fbdev_generic_setup()")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-2-laurent.pinchart@ideasonboard.com
3 years agodrm/ttm: fix pipelined gutting for evictions v2
Christian König [Thu, 23 Jul 2020 08:58:12 +0000 (10:58 +0200)]
drm/ttm: fix pipelined gutting for evictions v2

We can't pipeline that during eviction because the memory needs
to be available immediately.

v2: fix how we cleanup the BOs resources

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Tested-by: Alex Sierra <alex.sierra@amd.com>
Link: https://patchwork.freedesktop.org/patch/379039/
3 years agodrm/amdgpu: Change type of module param `ppfeaturemask` to hexint
Paul Menzel [Fri, 3 Jul 2020 14:29:39 +0000 (16:29 +0200)]
drm/amdgpu: Change type of module param `ppfeaturemask` to hexint

The newly added hexint helper is more convenient for bitmasks.

Before:

    $ more /sys/module/amdgpu/parameters/ppfeaturemask
    4294950911

After:

    $ more /sys/module/amdgpu/parameters/ppfeaturemask
    0xffffbfff

Cc: amd-gfx@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/374724/