platform/kernel/linux-starfive.git
17 months agodrm/ttm: Include <linux/vmalloc.h> to fix MIPS build
Thomas Zimmermann [Mon, 16 Jan 2023 12:10:23 +0000 (13:10 +0100)]
drm/ttm: Include <linux/vmalloc.h> to fix MIPS build

On MIPS, vmap() and vunmap() are undeclared in ttm_bo_util.c. An
error message is shown below.

  CC      drivers/gpu/drm/ttm/ttm_bo_util.o
  ../drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_kmap_ttm':
  ../drivers/gpu/drm/ttm/ttm_bo_util.c:364:32: error: implicit declaration of function 'vmap'; did you mean 'kmap'? [-Werror=implicit-function-declaration]
    364 |                 map->virtual = vmap(ttm->pages + start_page, num_pages,
|                                ^~~~
|                                kmap
  ../drivers/gpu/drm/ttm/ttm_bo_util.c:364:30: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    364 |                 map->virtual = vmap(ttm->pages + start_page, num_pages,
|                              ^
  ../drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_kunmap':
  ../drivers/gpu/drm/ttm/ttm_bo_util.c:429:17: error: implicit declaration of function 'vunmap'; did you mean 'kunmap'? [-Werror=implicit-function-declaration]
    429 |                 vunmap(map->virtual);
|                 ^~~~~~
|                 kunmap
  ../drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_vmap':
  ../drivers/gpu/drm/ttm/ttm_bo_util.c:509:23: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    509 |                 vaddr = vmap(ttm->pages, ttm->num_pages, 0, prot);
|                       ^

Fix this by including <linux/vmalloc.h>.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230116121023.14245-1-tzimmermann@suse.de
18 months agodrm/nouveau/fb/ga102: Replace zero-length array of trailing structs with flex-array
Kees Cook [Tue, 3 Jan 2023 23:48:36 +0000 (15:48 -0800)]
drm/nouveau/fb/ga102: Replace zero-length array of trailing structs with flex-array

Zero-length arrays are deprecated[1] and are being replaced with
flexible array members in support of the ongoing efforts to tighten the
FORTIFY_SOURCE routines on memcpy(), correctly instrument array indexing
with UBSAN_BOUNDS, and to globally enable -fstrict-flex-arrays=3.

Replace zero-length array with flexible-array member.

This results in no differences in binary output.

[1] https://github.com/KSPP/linux/issues/78

Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Karol Herbst <kherbst@redhat.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Gourav Samaiya <gsamaiya@nvidia.com>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230103234835.never.378-kees@kernel.org
18 months agodrm/bridge: tc358767: Set default CLRSIPO count
Marek Vasut [Sun, 16 Oct 2022 00:35:56 +0000 (02:35 +0200)]
drm/bridge: tc358767: Set default CLRSIPO count

The current CLRSIPO count is still marginal and does not work with high
DSI clock rates in burst mode. Increase it further to allow the DSI link
to work at up to 1Gbps lane speed. This returns the counts to defaults
as provided by datasheet.

Fixes: ea6490b02240b ("drm/bridge: tc358767: increase CLRSIPO count")
Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20221016003556.406441-1-marex@denx.de
18 months agodrm/radeon: Do not include <drm/drm_fb_helper.h>
Thomas Zimmermann [Wed, 11 Jan 2023 13:02:06 +0000 (14:02 +0100)]
drm/radeon: Do not include <drm/drm_fb_helper.h>

Including <drm/drm_fb_helper.h> is not required, so remove the include
statements. No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20230111130206.29974-11-tzimmermann@suse.de
18 months agodrm/radeon: Remove trailing whitespaces
Thomas Zimmermann [Wed, 11 Jan 2023 13:02:05 +0000 (14:02 +0100)]
drm/radeon: Remove trailing whitespaces

Fix coding style. No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20230111130206.29974-10-tzimmermann@suse.de
18 months agodrm/nouveau: Do not include <drm/drm_fb_helper.h>
Thomas Zimmermann [Wed, 11 Jan 2023 13:02:04 +0000 (14:02 +0100)]
drm/nouveau: Do not include <drm/drm_fb_helper.h>

Including <drm/drm_fb_helper.h> is not required, so remove the include
statement. No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20230111130206.29974-9-tzimmermann@suse.de
18 months agodrm/amdgpu: Do not include <drm/drm_fb_helper.h>
Thomas Zimmermann [Wed, 11 Jan 2023 13:02:03 +0000 (14:02 +0100)]
drm/amdgpu: Do not include <drm/drm_fb_helper.h>

Including <drm/drm_fb_helper.h> is not required, so remove the include
statements. No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20230111130206.29974-8-tzimmermann@suse.de
18 months agodrm: Define enum mode_set_atomic in drm_modeset_helper_tables.h
Thomas Zimmermann [Wed, 11 Jan 2023 13:02:02 +0000 (14:02 +0100)]
drm: Define enum mode_set_atomic in drm_modeset_helper_tables.h

Define enum mode_set_atomic next to the only interface that uses
the type. This will allow for removing several include statements
for drm_fb_helper.h. No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20230111130206.29974-7-tzimmermann@suse.de
18 months agodrm/panel: Do not include <linux/fb.h>
Thomas Zimmermann [Wed, 11 Jan 2023 13:02:01 +0000 (14:02 +0100)]
drm/panel: Do not include <linux/fb.h>

Remove unnecessary include statements for <linux/fb.h>. No functional
changes. Include <linux/of.h> where the driver got the header file via
<linux/fb.h>.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20230111130206.29974-6-tzimmermann@suse.de
18 months agodrm/amdgpu: Do not include <linux/fb.h>
Thomas Zimmermann [Wed, 11 Jan 2023 13:02:00 +0000 (14:02 +0100)]
drm/amdgpu: Do not include <linux/fb.h>

Remove unnecessary include statements for <linux/fb.h>. No functional
changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20230111130206.29974-5-tzimmermann@suse.de
18 months agodrm: Don't include <linux/fb.h> in drm_crtc_helper.h
Thomas Zimmermann [Wed, 11 Jan 2023 13:01:59 +0000 (14:01 +0100)]
drm: Don't include <linux/fb.h> in drm_crtc_helper.h

Including <linux/fb.h> in drm_crtc_helper.h is not required. Remove
the include statement and avoid rebuilding DRM whenever the fbdev
header changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20230111130206.29974-4-tzimmermann@suse.de
18 months agodrm: Include <linux/of.h> where needed
Thomas Zimmermann [Wed, 11 Jan 2023 13:01:58 +0000 (14:01 +0100)]
drm: Include <linux/of.h> where needed

Include <linux/of.h> in source files that need it. Some of DRM's
source code gets OF header via drm_crtc_helper.h and <linux/fb.h>,
which can leed to unnecessary recompilation.

In drm_modes.c, add a comment on the reason for still including
<linux/fb.h>. The header file is required to get KHZ2PICOS(). The
macro is part of the UAPI headers, so it cannot be moved to a less
prominent location.

v2:
* include <linux/of.h> in komeda_drv.c (kernel test robot)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Liviu Dudau <liviu.dudau@arm.com> # komeda
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20230111130206.29974-3-tzimmermann@suse.de
18 months agodrm: Include <linux/backlight.h> where needed
Thomas Zimmermann [Wed, 11 Jan 2023 13:01:57 +0000 (14:01 +0100)]
drm: Include <linux/backlight.h> where needed

Include <linux/backlight.h> in source files that need it. Some of
DRM's source code gets the backlight header via drm_crtc_helper.h
and <linux/fb.h>, which can leed to unnecessary recompilation. If
possible, do not include drm_crtc_helper.h any longer.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Christian König <christian.koenig@amd.com> # amd
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20230111130206.29974-2-tzimmermann@suse.de
18 months agodrm/fbdev: Remove aperture handling and FBINFO_MISC_FIRMWARE
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:16 +0000 (17:05 +0100)]
drm/fbdev: Remove aperture handling and FBINFO_MISC_FIRMWARE

There are no users left of struct fb_info.apertures and the flag
FBINFO_MISC_FIRMWARE. Remove both and the aperture-ownership code
in the fbdev core. All code for aperture ownership is now located
in the fbdev drivers.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-19-tzimmermann@suse.de
18 months agofbdev/vga16fb: Do not use struct fb_info.apertures
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:15 +0000 (17:05 +0100)]
fbdev/vga16fb: Do not use struct fb_info.apertures

Acquire ownership of the firmware scanout buffer by calling Linux'
aperture helpers. Remove the use of struct fb_info.apertures and do
not set FBINFO_MISC_FIRMWARE; both of which previously configured
buffer ownership.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-18-tzimmermann@suse.de
18 months agofbdev/vesafb: Do not use struct fb_info.apertures
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:14 +0000 (17:05 +0100)]
fbdev/vesafb: Do not use struct fb_info.apertures

Acquire ownership of the firmware scanout buffer by calling Linux'
aperture helpers. Remove the use of struct fb_info.apertures and do
not set FBINFO_MISC_FIRMWARE; both of which previously configured
buffer ownership.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-17-tzimmermann@suse.de
18 months agofbdev/vesafb: Remove trailing whitespaces
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:13 +0000 (17:05 +0100)]
fbdev/vesafb: Remove trailing whitespaces

Fix coding style. No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-16-tzimmermann@suse.de
18 months agofbdev/simplefb: Do not use struct fb_info.apertures
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:12 +0000 (17:05 +0100)]
fbdev/simplefb: Do not use struct fb_info.apertures

Acquire ownership of the firmware scanout buffer by calling Linux'
aperture helpers. Remove the use of struct fb_info.apertures and do
not set FBINFO_MISC_FIRMWARE; both of which previously configured
buffer ownership.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-15-tzimmermann@suse.de
18 months agofbdev/offb: Do not use struct fb_info.apertures
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:11 +0000 (17:05 +0100)]
fbdev/offb: Do not use struct fb_info.apertures

Acquire ownership of the firmware scanout buffer by calling Linux'
aperture helpers. Remove the use of struct fb_info.apertures and do
not set FBINFO_MISC_FIRMWARE; both of which previously configured
buffer ownership.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-14-tzimmermann@suse.de
18 months agofbdev/offb: Allocate struct offb_par with framebuffer_alloc()
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:10 +0000 (17:05 +0100)]
fbdev/offb: Allocate struct offb_par with framebuffer_alloc()

Move the palette array into struct offb_par and allocate both via
framebuffer_alloc(), as intended by fbdev. No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-13-tzimmermann@suse.de
18 months agofbdev/efifb: Do not use struct fb_info.apertures
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:09 +0000 (17:05 +0100)]
fbdev/efifb: Do not use struct fb_info.apertures

Acquire ownership of the firmware scanout buffer by calling Linux'
aperture helpers. Remove the use of struct fb_info.apertures and do
not set FBINFO_MISC_FIRMWARE; both of which previously configured
buffer ownership.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-12-tzimmermann@suse.de
18 months agofbdev/efifb: Add struct efifb_par for driver data
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:08 +0000 (17:05 +0100)]
fbdev/efifb: Add struct efifb_par for driver data

The efifb_par structure holds the palette for efifb. It will also
be useful for storing the device's aperture range.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-11-tzimmermann@suse.de
18 months agovfio-mdev/mdpy-fb: Do not set struct fb_info.apertures
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:07 +0000 (17:05 +0100)]
vfio-mdev/mdpy-fb: Do not set struct fb_info.apertures

Generic fbdev drivers use the apertures field in struct fb_info to
control ownership of the framebuffer memory and graphics device. Do
not set the values in mdpy-fb.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-10-tzimmermann@suse.de
18 months agofbdev/hyperv-fb: Do not set struct fb_info.apertures
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:06 +0000 (17:05 +0100)]
fbdev/hyperv-fb: Do not set struct fb_info.apertures

Generic fbdev drivers use the apertures field in struct fb_info to
control ownership of the framebuffer memory and graphics device. Do
not set the values in hyperv-fb.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-9-tzimmermann@suse.de
18 months agofbdev/clps711x-fb: Do not set struct fb_info.apertures
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:05 +0000 (17:05 +0100)]
fbdev/clps711x-fb: Do not set struct fb_info.apertures

Generic fbdev drivers use the apertures field in struct fb_info to
control ownership of the framebuffer memory and graphics device. Do
not set the values in clps711x-fb.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-8-tzimmermann@suse.de
18 months agodrm/fb-helper: Do not allocate unused apertures structure
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:04 +0000 (17:05 +0100)]
drm/fb-helper: Do not allocate unused apertures structure

The apertures field in struct fb_info is not used by DRM drivers. Do
not allocate it.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-7-tzimmermann@suse.de
18 months agodrm/radeon: Do not set struct fb_info.apertures
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:03 +0000 (17:05 +0100)]
drm/radeon: Do not set struct fb_info.apertures

Generic fbdev drivers use the apertures field in struct fb_info to
control ownership of the framebuffer memory and graphics device. Do
not set the values in radeon.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-6-tzimmermann@suse.de
18 months agodrm/i915: Do not set struct fb_info.apertures
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:02 +0000 (17:05 +0100)]
drm/i915: Do not set struct fb_info.apertures

Generic fbdev drivers use the apertures field in struct fb_info to
control ownership of the framebuffer memory and graphics device. Do
not set the values in i915.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-5-tzimmermann@suse.de
18 months agodrm/gma500: Do not set struct fb_info.apertures
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:01 +0000 (17:05 +0100)]
drm/gma500: Do not set struct fb_info.apertures

Generic fbdev drivers use the apertures field in struct fb_info to
control ownership of the framebuffer memory and graphics device. Do
not set the values in gma500.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-4-tzimmermann@suse.de
18 months agoRevert "fbcon: don't lose the console font across generic->chip driver switch"
Thomas Zimmermann [Mon, 19 Dec 2022 16:05:00 +0000 (17:05 +0100)]
Revert "fbcon: don't lose the console font across generic->chip driver switch"

This reverts commit ae1287865f5361fa138d4d3b1b6277908b54eac9.

Always free the console font when deinitializing the framebuffer
console. Subsequent framebuffer consoles will then use the default
font. Rely on userspace to load any user-configured font for these
consoles.

Commit ae1287865f53 ("fbcon: don't lose the console font across
generic->chip driver switch") was introduced to work around losing
the font during graphics-device handover. [1][2] It kept a dangling
pointer with the font data between loading the two consoles, which is
fairly adventurous hack. It also never covered cases when the other
consoles, such as VGA text mode, where involved.

The problem has meanwhile been solved in userspace. Systemd comes
with a udev rule that re-installs the configured font when a console
comes up. [3] So the kernel workaround can be removed.

This also removes one of the two special cases triggered by setting
FBINFO_MISC_FIRMWARE in an fbdev driver.

Tested during device handover from efifb and simpledrm to radeon. Udev
reloads the configured console font for the new driver's terminal.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://bugzilla.redhat.com/show_bug.cgi?id=892340
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1074624
Link: https://cgit.freedesktop.org/systemd/systemd/tree/src/vconsole/90-vconsole.rules.in?h=v222
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-3-tzimmermann@suse.de
18 months agofbcon: Remove trailing whitespaces
Thomas Zimmermann [Mon, 19 Dec 2022 16:04:59 +0000 (17:04 +0100)]
fbcon: Remove trailing whitespaces

Fix coding style. No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-2-tzimmermann@suse.de
18 months agoMAINTAINERS: Remove some obsolete drivers info(tdfx, mga, i810, savage, r128, sis)
Cai Huoqing [Sat, 3 Dec 2022 10:23:01 +0000 (18:23 +0800)]
MAINTAINERS: Remove some obsolete drivers info(tdfx, mga, i810, savage, r128, sis)

Commit 399516ab0fee ("MAINTAINERS: Add a bunch of legacy (UMS) DRM drivers")
marked these drivers obsolete 7 years ago.
And the mesa UMD of this drm driver already in deprecated list
link: https://docs.mesa3d.org/systems.html
3dfx Glide-->driver/gpu/drm/tdfx
Matrox-->driver/gpu/drm/mga
Intel i810-->driver/gpu/drm/i810
S3 Savage-->drivers/gpu/drm/savage
ATI Rage 128->drivers/gpu/drm/r128
Silicon Integrated Systems->drivers/gpu/drm/sis

It's time to remove these drivers.

Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20221203102502.3185-11-cai.huoqing@linux.dev
18 months agodrm: Remove some obsolete drm pciids(tdfx, mga, i810, savage, r128, sis, via)
Cai Huoqing [Sat, 3 Dec 2022 10:23:00 +0000 (18:23 +0800)]
drm: Remove some obsolete drm pciids(tdfx, mga, i810, savage, r128, sis, via)

Commit 399516ab0fee ("MAINTAINERS: Add a bunch of legacy (UMS) DRM drivers")
marked these drivers obsolete 7 years ago.
And the mesa UMD of this drm driver already in deprecated list
link: https://docs.mesa3d.org/systems.html
3dfx Glide-->driver/gpu/drm/tdfx
Matrox-->driver/gpu/drm/mga
Intel i810-->driver/gpu/drm/i810
S3 Savage-->drivers/gpu/drm/savage
ATI Rage 128->drivers/gpu/drm/r128
Silicon Integrated Systems->drivers/gpu/drm/sis
VIA Unichrome->drivers/gpu/drm/via

It's time to remove these drivers.

Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20221203102502.3185-10-cai.huoqing@linux.dev
18 months agodrm: Add comments to Kconfig
Cai Huoqing [Sat, 3 Dec 2022 10:22:59 +0000 (18:22 +0800)]
drm: Add comments to Kconfig

Add comments to avoid removing DRM_LEGACY config menu,
because DRM_LEGACY menu could list other legacy drivers.

Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20221203102502.3185-9-cai.huoqing@linux.dev
18 months agodrm: Remove the obsolete driver-via
Cai Huoqing [Sat, 3 Dec 2022 10:22:58 +0000 (18:22 +0800)]
drm: Remove the obsolete driver-via

Commit 399516ab0fee ("MAINTAINERS: Add a bunch of legacy (UMS) DRM drivers")
marked via driver obsolete 7 years ago.
And the mesa UMD of this drm driver already in deprecated list
link: https://docs.mesa3d.org/systems.html
VIA Unichrome->drivers/gpu/drm/via

It's time to remove this driver.

Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20221203102502.3185-8-cai.huoqing@linux.dev
18 months agodrm: Remove the obsolete driver-tdfx
Cai Huoqing [Sat, 3 Dec 2022 10:22:57 +0000 (18:22 +0800)]
drm: Remove the obsolete driver-tdfx

Commit 399516ab0fee ("MAINTAINERS: Add a bunch of legacy (UMS) DRM drivers")
marked tdfx driver obsolete 7 years ago.
And the mesa UMD of this drm driver already in deprecated list
link: https://docs.mesa3d.org/systems.html
3dfx Glide-->driver/gpu/drm/tdfx

It's time to remove this driver.

Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20221203102502.3185-7-cai.huoqing@linux.dev
18 months agodrm: Remove the obsolete driver-sis
Cai Huoqing [Sat, 3 Dec 2022 10:22:56 +0000 (18:22 +0800)]
drm: Remove the obsolete driver-sis

Commit 399516ab0fee ("MAINTAINERS: Add a bunch of legacy (UMS) DRM drivers")
marked sis driver obsolete 7 years ago.
And the mesa UMD of this drm driver already in deprecated list
link: https://docs.mesa3d.org/systems.html
Silicon Integrated Systems->drivers/gpu/drm/sis

It's time to remove this driver.

Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20221203102502.3185-6-cai.huoqing@linux.dev
18 months agodrm: Remove the obsolete driver-savage
Cai Huoqing [Sat, 3 Dec 2022 10:22:55 +0000 (18:22 +0800)]
drm: Remove the obsolete driver-savage

Commit 399516ab0fee ("MAINTAINERS: Add a bunch of legacy (UMS) DRM drivers")
marked savage driver obsolete 7 years ago.
And the mesa UMD of this drm driver already in deprecated list
link: https://docs.mesa3d.org/systems.html
S3 Savage-->drivers/gpu/drm/savage

It's time to remove this driver.

Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20221203102502.3185-5-cai.huoqing@linux.dev
18 months agodrm: Remove the obsolete driver-r128
Cai Huoqing [Sat, 3 Dec 2022 10:22:54 +0000 (18:22 +0800)]
drm: Remove the obsolete driver-r128

Commit 399516ab0fee ("MAINTAINERS: Add a bunch of legacy (UMS) DRM drivers")
marked r128 driver obsolete 7 years ago.
And the mesa UMD of this drm driver already in deprecated list
link: https://docs.mesa3d.org/systems.html
ATI Rage 128->drivers/gpu/drm/r128

It's time to remove this driver.

Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20221203102502.3185-4-cai.huoqing@linux.dev
18 months agodrm: Remove the obsolete driver-mga
Cai Huoqing [Sat, 3 Dec 2022 10:22:53 +0000 (18:22 +0800)]
drm: Remove the obsolete driver-mga

Commit 399516ab0fee ("MAINTAINERS: Add a bunch of legacy (UMS) DRM drivers")
marked mga driver obsolete 7 years ago.
And the mesa UMD of this drm driver already in deprecated list
link: https://docs.mesa3d.org/systems.html
Matrox-->driver/gpu/drm/mga

It's time to remove this driver.

Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20221203102502.3185-3-cai.huoqing@linux.dev
18 months agodrm: Remove the obsolete driver-i810
Cai Huoqing [Sat, 3 Dec 2022 10:22:52 +0000 (18:22 +0800)]
drm: Remove the obsolete driver-i810

Commit 399516ab0fee ("MAINTAINERS: Add a bunch of legacy (UMS) DRM drivers")
marked i810 driver obsolete 7 years ago.
And the mesa UMD of this drm driver already in deprecated list
link: https://docs.mesa3d.org/systems.html
Intel i810-->driver/gpu/drm/i810

It's time to remove this driver.

Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20221203102502.3185-2-cai.huoqing@linux.dev
18 months agodrm/nouveau: Remove support for legacy contexts/buffers
Thomas Zimmermann [Thu, 12 Jan 2023 13:38:58 +0000 (14:38 +0100)]
drm/nouveau: Remove support for legacy contexts/buffers

Remove nouveau's support for legacy contexts and buffers. It was
required by libdrm earlier than 2.4.33, released in March 2012. A
previous attempt in 2013 to remove the functionality [1] had to be
reverted [2] as there were still users left. Libdrm 2.4.33 is now
almost 11 years old and it is time for userspace to move on.

With the nouveau code gone, we can also remove the driver-feature
bit DRIVER_KMS_LEGACY_CONTEXT.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7c510133d93dd6f15ca040733ba7b2891ed61fd1
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c21eb21cb50d58e7cbdcb8b9e7ff68b85cfa5095
Link: https://patchwork.freedesktop.org/patch/msgid/20230112133858.17087-1-tzimmermann@suse.de
18 months agodrm/vkms: reintroduce prepare_fb and cleanup_fb functions
Maíra Canal [Wed, 11 Jan 2023 13:13:05 +0000 (10:13 -0300)]
drm/vkms: reintroduce prepare_fb and cleanup_fb functions

With commit 359c6649cd9a ("drm/gem: Implement shadow-plane {begin,
end}_fb_access with vmap"), the behavior of the shadow-plane helpers
changed and the vunmap is now performed at the end of
the current pageflip, instead of the end of the following pageflip.

By performing the vunmap at the end of the current pageflip, invalid
memory is accessed by the vkms during the plane composition, as the data
is being unmapped before being used, as reported by the following
warning:

 [  275.866047] BUG: unable to handle page fault for address: ffffb382814e8002
 [  275.866055] #PF: supervisor read access in kernel mode
 [  275.866058] #PF: error_code(0x0000) - not-present page
 [  275.866061] PGD 1000067 P4D 1000067 PUD 110a067 PMD 46e3067 PTE 0
 [  275.866066] Oops: 0000 [#1] PREEMPT SMP PTI
 [  275.866070] CPU: 2 PID: 49 Comm: kworker/u8:2 Not tainted 6.1.0-rc6-00018-gb357e7ac1b73-dirty #54
 [  275.866074] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.1-2.fc37 04/01/2014
 [  275.866076] Workqueue: vkms_composer vkms_composer_worker [vkms]
 [  275.866084] RIP: 0010:XRGB8888_to_argb_u16+0x5c/0xa0 [vkms]
 [  275.866092] Code: bf 56 0a 0f af 56 70 48 8b 76 28 01 ca 49 83 f8 02
 41 b9 01 00 00 00 4d 0f 43 c8 48 01 f2 48 83 c2 02 31 f6 66 c7 04 f0 ff
 ff <0f> b6 0c b2 89 cf c1 e7 08 09 cf 66 89 7c f0 02 0f b6 4c b2 ff 89
 [  275.866095] RSP: 0018:ffffb382801b7db0 EFLAGS: 00010246
 [  275.866098] RAX: ffff896336ace000 RBX: ffff896310e293c0 RCX: 0000000000000000
 [  275.866101] RDX: ffffb382814e8002 RSI: 0000000000000000 RDI: ffffb382801b7de8
 [  275.866103] RBP: 0000000000001400 R08: 0000000000000280 R09: 0000000000000280
 [  275.866105] R10: 0000000000000010 R11: ffffffffc011d990 R12: ffff896302a1ece0
 [  275.866107] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000080008001
 [  275.866109] FS:  0000000000000000(0000) GS:ffff89637dd00000(0000) knlGS:0000000000000000
 [  275.866112] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 [  275.866114] CR2: ffffb382814e8002 CR3: 0000000003bb4000 CR4: 00000000000006e0
 [  275.866120] Call Trace:
 [  275.866123]  <TASK>
 [  275.866124]  compose_active_planes+0x1c4/0x380 [vkms]
 [  275.866132]  vkms_composer_worker+0x9f/0x130 [vkms]
 [  275.866139]  process_one_work+0x1c0/0x370
 [  275.866160]  worker_thread+0x221/0x410
 [  275.866164]  ? worker_clr_flags+0x50/0x50
 [  275.866167]  kthread+0xe1/0x100
 [  275.866172]  ? kthread_blkcg+0x30/0x30
 [  275.866176]  ret_from_fork+0x22/0x30
 [  275.866181]  </TASK>
 [  275.866182] Modules linked in: vkms
 [  275.866186] CR2: ffffb382814e8002
 [  275.866191] ---[ end trace 0000000000000000 ]---

Therefore, introduce again prepare_fb and cleanup_fb functions to the
vkms, which were previously removed on commit b43e2ec03b0d ("drm/vkms:
Let shadow-plane helpers prepare the plane's FB").

Fixes: 359c6649cd9a ("drm/gem: Implement shadow-plane {begin, end}_fb_access with vmap")
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230111131304.106039-1-mcanal@igalia.com
18 months agodrm: document better that drivers shouldn't use drm_minor directly
Daniel Vetter [Mon, 9 Jan 2023 16:46:04 +0000 (17:46 +0100)]
drm: document better that drivers shouldn't use drm_minor directly

The documentation for struct drm_minor already states this, but that's
not always that easy to find.

Also due to historical reasons we still have the minor-centric
interfaces (like drm_debugfs_create_files), but since this is now
getting fixed we can put a few more pointers in place as to how this
should be done ideally. Note that debugfs isn't there yet for all
cases (debugfs files on kms objects like crtc/connector aren't
supported, neither debugfs files with full fops), so the debugfs side
of this is still rather aspirational and more for new users than
converting everything existing. todo.rst covers the additional work
needed already.

Motivated by some discussion with Rodrigo on irc about how drm/xe
should lay out its sysfs interfaces.

v2: Make the debugfs situation clearer in the commit message, but
don't elaborate more in the actual kerneldoc to avoid distracting from
the main message around sysfs (Jani)

Also fix some typos.

Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Wambui Karuga <wambui.karugax@gmail.com>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Melissa Wen <mwen@igalia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230109164604.3860862-1-daniel.vetter@ffwll.ch
18 months agodrm/panel-xinpeng-xpp055c272: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:22 +0000 (20:18 +0100)]
drm/panel-xinpeng-xpp055c272: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-14-javierm@redhat.com
18 months agodrm/panel-sony-tulip-truly-nt35521: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:21 +0000 (20:18 +0100)]
drm/panel-sony-tulip-truly-nt35521: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-13-javierm@redhat.com
18 months agodrm/panel-mantix-mlaf057we51: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:20 +0000 (20:18 +0100)]
drm/panel-mantix-mlaf057we51: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-12-javierm@redhat.com
18 months agodrm/panel-sharp-ls060t1sx01: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:19 +0000 (20:18 +0100)]
drm/panel-sharp-ls060t1sx01: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-11-javierm@redhat.com
18 months agodrm/panel-samsung-sofef00: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:18 +0000 (20:18 +0100)]
drm/panel-samsung-sofef00: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-10-javierm@redhat.com
18 months agodrm/panel-samsung-s6e88a0-ams452ef01: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:17 +0000 (20:18 +0100)]
drm/panel-samsung-s6e88a0-ams452ef01: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-9-javierm@redhat.com
18 months agodrm/panel-jdi-fhd-r63452: Drop custom DSI write macros
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:16 +0000 (20:18 +0100)]
drm/panel-jdi-fhd-r63452: Drop custom DSI write macros

There are macros for these already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macros defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-8-javierm@redhat.com
18 months agodrm/panel-novatek-nt35950: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:15 +0000 (20:18 +0100)]
drm/panel-novatek-nt35950: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-7-javierm@redhat.com
18 months agodrm/panel-boe-bf060y8m-aj0: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:14 +0000 (20:18 +0100)]
drm/panel-boe-bf060y8m-aj0: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-6-javierm@redhat.com
18 months agodrm/panel-elida-kd35t133: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:13 +0000 (20:18 +0100)]
drm/panel-elida-kd35t133: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-5-javierm@redhat.com
18 months agodrm/panel-leadtek-ltk050h3146w: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:12 +0000 (20:18 +0100)]
drm/panel-leadtek-ltk050h3146w: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-4-javierm@redhat.com
18 months agodrm/panel-sitronix-st7703: Drop custom DSI write macros
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:11 +0000 (20:18 +0100)]
drm/panel-sitronix-st7703: Drop custom DSI write macros

There are macros for these already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macros defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-3-javierm@redhat.com
18 months agodrm/panel-asus-z00t-tm5p5-n35596: Drop custom DSI write macros
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:10 +0000 (20:18 +0100)]
drm/panel-asus-z00t-tm5p5-n35596: Drop custom DSI write macros

There are macros for these already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macros defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-2-javierm@redhat.com
18 months agodrm/panel-edp: add IVO M133NW4J panel entry
Abel Vesa [Sat, 31 Dec 2022 14:27:21 +0000 (16:27 +0200)]
drm/panel-edp: add IVO M133NW4J panel entry

Add an eDP panel entry for IVO M133NW4J.

Due to lack of documentation, use the delay_200_500_p2e100 timings like
some other IVO entries for now.

Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20221231142721.338643-2-abel.vesa@linaro.org
18 months agodrm/panel-edp: fix name for IVO product id 854b
Abel Vesa [Sat, 31 Dec 2022 14:27:20 +0000 (16:27 +0200)]
drm/panel-edp: fix name for IVO product id 854b

The actual name is R133NW4K-R0.

Fixes: 0f9fa5f58c78 ("drm/panel-edp: add IVO M133NW4J-R3 panel entry")
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Tested-by: Steev Klimaszewski <steev@kali.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20221231142721.338643-1-abel.vesa@linaro.org
18 months agodrm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE
Siddh Raman Pant [Mon, 9 Jan 2023 13:00:35 +0000 (18:30 +0530)]
drm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE

drm_print.h says DRM_DEBUG_LEASE is deprecated in favor of
drm_dbg_lease().

Signed-off-by: Siddh Raman Pant <code@siddh.me>
Reviewed-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patchwork.freedesktop.org/patch/msgid/71a443d705c62a217a3352b221b7a96c53bb1031.1673269059.git.code@siddh.me
18 months agodrm/drm_blend: Remove usage of deprecated DRM_DEBUG_ATOMIC
Siddh Raman Pant [Mon, 9 Jan 2023 13:00:34 +0000 (18:30 +0530)]
drm/drm_blend: Remove usage of deprecated DRM_DEBUG_ATOMIC

drm_print.h says DRM_DEBUG_ATOMIC is deprecated in favor of
drm_dbg_atomic().

Signed-off-by: Siddh Raman Pant <code@siddh.me>
Reviewed-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patchwork.freedesktop.org/patch/msgid/1a5b5aa012689572baf561eea0dd0b5934645af5.1673269059.git.code@siddh.me
18 months agodrm: Remove usage of deprecated DRM_DEBUG_PRIME
Siddh Raman Pant [Mon, 9 Jan 2023 13:00:33 +0000 (18:30 +0530)]
drm: Remove usage of deprecated DRM_DEBUG_PRIME

drm_print.h says DRM_DEBUG_PRIME is deprecated in favor of
drm_dbg_prime().

Signed-off-by: Siddh Raman Pant <code@siddh.me>
Reviewed-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patchwork.freedesktop.org/patch/msgid/cd663b1bc42189e55898cddecdb3b73c591b341a.1673269059.git.code@siddh.me
18 months agodrm/imx/dcss: Don't call dev_set_drvdata(..., NULL);
Uwe Kleine-König [Fri, 30 Dec 2022 13:00:25 +0000 (14:00 +0100)]
drm/imx/dcss: Don't call dev_set_drvdata(..., NULL);

The driver core takes care about removing driver data, so this can be
dropped from the driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221230130025.240776-2-u.kleine-koenig@pengutronix.de
18 months agodrm/imx/dcss: Drop if blocks with always false condition
Uwe Kleine-König [Fri, 30 Dec 2022 13:00:24 +0000 (14:00 +0100)]
drm/imx/dcss: Drop if blocks with always false condition

dcss_drv_platform_remove() is only called for a device after
dcss_drv_platform_probe() returned 0. In that case dev_set_drvdata() was
called with a non-NULL value and so dev_get_drvdata() won't return NULL.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221230130025.240776-1-u.kleine-koenig@pengutronix.de
18 months agodrm/debugfs: add descriptions to struct parameters
Maíra Canal [Thu, 5 Jan 2023 19:30:39 +0000 (16:30 -0300)]
drm/debugfs: add descriptions to struct parameters

The structs drm_debugfs_info and drm_debugfs_entry don't have
descriptions for their parameters, which is causing the following warnings:

include/drm/drm_debugfs.h:93: warning: Function parameter or member
'name' not described in 'drm_debugfs_info'
include/drm/drm_debugfs.h:93: warning: Function parameter or member
'show' not described in 'drm_debugfs_info'
include/drm/drm_debugfs.h:93: warning: Function parameter or member
'driver_features' not described in 'drm_debugfs_info'
include/drm/drm_debugfs.h:93: warning: Function parameter or member
'data' not described in 'drm_debugfs_info'
include/drm/drm_debugfs.h:105: warning: Function parameter or member
'dev' not described in 'drm_debugfs_entry'
include/drm/drm_debugfs.h:105: warning: Function parameter or member
'file' not described in 'drm_debugfs_entry'
include/drm/drm_debugfs.h:105: warning: Function parameter or member
'list' not described in 'drm_debugfs_entry'

Therefore, fix the warnings by adding descriptions to all struct
parameters.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Maíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230105193039.287677-2-mcanal@igalia.com
18 months agodrm/debugfs: use octal permissions instead of symbolic permissions
Maíra Canal [Thu, 5 Jan 2023 19:30:38 +0000 (16:30 -0300)]
drm/debugfs: use octal permissions instead of symbolic permissions

Currently, debugfs functions are using symbolic macros as permission
bits, but checkpatch reinforces permission bits in the octal form, as
they are more readable and easier to understand [1]. Moreover, using
the symbolic macro S_IFREG is redundant.

Therefore, use octal permission bits in all debugfs functions.

[1] https://docs.kernel.org/dev-tools/checkpatch.html#permissions

Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Maíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230105193039.287677-1-mcanal@igalia.com
18 months agoMAINTAINERS: Add entry for Himax HX8394 panel controller driver
Javier Martinez Canillas [Mon, 2 Jan 2023 23:07:33 +0000 (00:07 +0100)]
MAINTAINERS: Add entry for Himax HX8394 panel controller driver

Add myself as maintainer for the driver and devicetree bindings schema.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230102230733.3506624-4-javierm@redhat.com
18 months agodrm: panel: Add Himax HX8394 panel controller driver
Kamil Trzciński [Mon, 2 Jan 2023 23:07:32 +0000 (00:07 +0100)]
drm: panel: Add Himax HX8394 panel controller driver

The driver is for panels based on the Himax HX8394 controller, such as the
HannStar HSD060BHW4 720x1440 TFT LCD panel that uses a MIPI-DSI interface.

Signed-off-by: Kamil Trzciński <ayufan@ayufan.eu>
Co-developed-by: Ondrej Jirman <megi@xff.cz>
Signed-off-by: Ondrej Jirman <megi@xff.cz>
Co-developed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Tested-by: Tom Fitzhenry <tom@tom-fitzhenry.me.uk>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230102230733.3506624-3-javierm@redhat.com
18 months agodt-bindings: display: Add Himax HX8394 panel controller
Javier Martinez Canillas [Mon, 2 Jan 2023 23:07:31 +0000 (00:07 +0100)]
dt-bindings: display: Add Himax HX8394 panel controller

Add device tree bindings for panels based on the Himax HX8394 controller,
such as the HannStar HSD060BHW4 720x1440 TFT LCD panel that is connected
through a MIPI-DSI video interface.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230102230733.3506624-2-javierm@redhat.com
18 months agodoc: add dma-buf IOCTL code to table
Simon Ser [Mon, 28 Nov 2022 13:39:05 +0000 (13:39 +0000)]
doc: add dma-buf IOCTL code to table

The code 'b' is used for dma-buf IOCTLs.

Signed-off-by: Simon Ser <contact@emersion.fr>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Christian König <christian.koenig@amd.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221128133853.355645-1-contact@emersion.fr
18 months agodrm/vc4: dsi: Drop unused i2c include
Uwe Kleine-König [Mon, 19 Dec 2022 08:40:23 +0000 (09:40 +0100)]
drm/vc4: dsi: Drop unused i2c include

The driver doesn't make use of any symbol provided by <linux/i2c.h>. So
drop the include.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219084023.1402282-1-u.kleine-koenig@pengutronix.de
18 months agoMAINTAINERS: drm/hisilicon: Drop Chen Feng
Uwe Kleine-König [Mon, 19 Dec 2022 08:53:07 +0000 (09:53 +0100)]
MAINTAINERS: drm/hisilicon: Drop Chen Feng

The listed address doesn't work any more:

  puck.chen@hisilicon.com
    host mx5.hisilicon.com [124.71.93.234]
    SMTP error from remote mail server after RCPT TO:<puck.chen@hisilicon.com>:
    551 5.1.1 <puck.chen@hisilicon.com>: Recipient address rejected:
    Failed recipient validation check.: host 127.0.0.1[127.0.0.1] said:
    554 5.7.1 recipient verify from ldap failed (in reply to RCPT TO command)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219085307.1403247-1-u.kleine-koenig@pengutronix.de
18 months agodrm: Only select I2C_ALGOBIT for drivers that actually need it
Uwe Kleine-König [Mon, 19 Dec 2022 08:36:27 +0000 (09:36 +0100)]
drm: Only select I2C_ALGOBIT for drivers that actually need it

While working on a drm driver that doesn't need the i2c algobit stuff I
noticed that DRM selects this code even though only 8 drivers actually use
it. While also only some drivers use i2c, keep the select for I2C for the
next cleanup patch. Still prepare this already by also selecting I2C for
the individual drivers.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219083627.1401627-1-u.kleine-koenig@pengutronix.de
18 months agodrm/panel: raspberrypi-touchscreen: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:36:17 +0000 (23:36 +0100)]
drm/panel: raspberrypi-touchscreen: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221118224540.619276-44-uwe@kleine-koenig.org
18 months agodrm/panel: olimex-lcd-olinuxino: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:36:16 +0000 (23:36 +0100)]
drm/panel: olimex-lcd-olinuxino: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221118224540.619276-43-uwe@kleine-koenig.org
18 months agodrm/i2c/tda998x: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:36:15 +0000 (23:36 +0100)]
drm/i2c/tda998x: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221118224540.619276-42-uwe@kleine-koenig.org
18 months agodrm/i2c/tda9950: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:36:14 +0000 (23:36 +0100)]
drm/i2c/tda9950: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221118224540.619276-41-uwe@kleine-koenig.org
18 months agodrm/i2c/sil164: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:36:13 +0000 (23:36 +0100)]
drm/i2c/sil164: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221118224540.619276-40-uwe@kleine-koenig.org
18 months agodrm/i2c/ch7006: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:36:12 +0000 (23:36 +0100)]
drm/i2c/ch7006: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221118224540.619276-39-uwe@kleine-koenig.org
18 months agodrm/mxsfb: improve clk handling for axi clk
Uwe Kleine-König [Tue, 10 Jan 2023 09:38:20 +0000 (10:38 +0100)]
drm/mxsfb: improve clk handling for axi clk

Ignoring errors from devm_clk_get() is wrong. To handle not all platforms
having an axi clk use devm_clk_get_optional() instead and do proper error
handling.

Also the clk API handles NULL as a dummy clk (which is also returned by
devm_clk_get_optional() if there is no clk) so there is no need to check
for NULL before calling clk_prepare_enable() or its counter part.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200720153254.18071-1-u.kleine-koenig@pengutronix.de
18 months agodrm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion
Marek Szyprowski [Mon, 9 Jan 2023 22:00:33 +0000 (23:00 +0100)]
drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion

devm_regulator_get_enable_optional() function returns 0 on success, so
use it for the check if function succeeded instead of the -ENODEV value.

Fixes: 429e87063661 ("drm/meson: dw-hdmi: Use devm_regulator_*get_enable*()")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
[narmstrong: s/succeeded/succeeded/ in commit message]
Link: https://patchwork.freedesktop.org/patch/msgid/20230109220033.31202-1-m.szyprowski@samsung.com
18 months agodrm/panel: add visionox vtdr6130 DSI panel driver
Neil Armstrong [Mon, 9 Jan 2023 08:49:30 +0000 (09:49 +0100)]
drm/panel: add visionox vtdr6130 DSI panel driver

Add support for the 1080x2400 Visionox VTDR6130 AMOLED DSI panel
found on the Qualcomm SM8550 MTP board.

By default the the panel is configured to work with DSI compressed
streams, but can work in uncompressed video mode since 1080x2400 in
RGB888 fits in the 4 DSI lanes bandwidth.

While display compression is preferred for performance and power
reasons, let's start with the uncompressed video mode support and
add the DSC support later on.

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
[narmstrong: moved drm/display/ include file before drm/drm_]
Link: https://patchwork.freedesktop.org/patch/msgid/20230103-topic-sm8550-upstream-vtdr6130-panel-v2-2-dd6200f47a76@linaro.org
18 months agodt-bindings: display: panel: document the Visionox VTDR6130 AMOLED DSI Panel
Neil Armstrong [Mon, 9 Jan 2023 08:49:29 +0000 (09:49 +0100)]
dt-bindings: display: panel: document the Visionox VTDR6130 AMOLED DSI Panel

Document the 1080x2400 Visionox VTDR6130 AMOLED DSI Panel bindings.

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
[narmstrong: drop last, redundant "bindings" in subject]
Link: https://patchwork.freedesktop.org/patch/msgid/20230103-topic-sm8550-upstream-vtdr6130-panel-v2-1-dd6200f47a76@linaro.org
18 months agodrm/vc4: vec: Support progressive modes
Mateusz Kwiatkowski [Wed, 7 Dec 2022 11:53:26 +0000 (12:53 +0100)]
drm/vc4: vec: Support progressive modes

The VEC is able to output progressive analog modes, but the driver has
never set the proper bit to do so.

Signed-off-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-15-1f8e0770798b@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 months agodrm/vc4: hdmi: Correct interlaced timings again
Dave Stevenson [Wed, 7 Dec 2022 11:53:25 +0000 (12:53 +0100)]
drm/vc4: hdmi: Correct interlaced timings again

The back porch timings were correct, only the sync offset was wrong.
Correct timing is now reported for 1080i and 576i, but the h offset is
incorrect for 480i for non-obvious reasons.

Fixes: fb10dc451c0f ("drm/vc4: hdmi: Correct HDMI timing registers for interlaced modes")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-14-1f8e0770798b@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 months agodrm/vc4: crtc: Fix timings for VEC modes
Mateusz Kwiatkowski [Wed, 7 Dec 2022 11:53:24 +0000 (12:53 +0100)]
drm/vc4: crtc: Fix timings for VEC modes

This commit fixes vertical timings of the VEC (composite output) modes
to accurately represent the 525-line ("NTSC") and 625-line ("PAL") ITU-R
standards.

Previous timings were actually defined as 502 and 601 lines, resulting
in non-standard 62.69 Hz and 52 Hz signals being generated,
respectively.

Changes to vc4_crtc.c have also been made, to make the PixelValve
vertical timings accurately correspond to the DRM modeline in interlaced
modes. The resulting VERTA/VERTB register values have been verified
against the reference values set by the Raspberry Pi firmware.

Signed-off-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-13-1f8e0770798b@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 months agodrm/vc4: Add comments for which HVS_PIXEL_ORDER_xxx defines apply
Dave Stevenson [Wed, 7 Dec 2022 11:53:23 +0000 (12:53 +0100)]
drm/vc4: Add comments for which HVS_PIXEL_ORDER_xxx defines apply

The HVS_PIXEL_ORDER_xxx defines apply to specific HVS_PIXEL_FORMAT_xxx
modes, so add comments to make this obvious.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-12-1f8e0770798b@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 months agodrm/vc4: plane: Add 3:3:2 and 4:4:4:4 RGB/RGBX/RGBA formats
Dave Stevenson [Wed, 7 Dec 2022 11:53:22 +0000 (12:53 +0100)]
drm/vc4: plane: Add 3:3:2 and 4:4:4:4 RGB/RGBX/RGBA formats

The hardware supports the 332 8bpp and 4:4:4:4 16bpp formats,
but the table of supported formats didn't include them.
Add them in.

In theory they are supported for T-format as well as linear,
but without a way to test them just add them as linear for now.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-11-1f8e0770798b@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 months agodrm/vc4: plane: Omit pixel_order from the hvs_format for hvs5 only formats
Dave Stevenson [Wed, 7 Dec 2022 11:53:21 +0000 (12:53 +0100)]
drm/vc4: plane: Omit pixel_order from the hvs_format for hvs5 only formats

pixel_order is used for the earlier versions of the HVS, so is
redundant on the 10:10:10:2 and 10bit YUV formats that are only
supported on HVS5.
Remove the assignment from the table to avoid confusion.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-10-1f8e0770798b@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 months agodrm/vc4: plane: Allow using 0 as a pixel order value
Dave Stevenson [Wed, 7 Dec 2022 11:53:20 +0000 (12:53 +0100)]
drm/vc4: plane: Allow using 0 as a pixel order value

vc4_plane_mode_set for HVS5 was using pixel_order unless pixel_order_hvs5
was non-zero, except 0 is a valid value for the pixel_order.

Specify pixel_order_hvs5 for all formats and remove the conditional.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-9-1f8e0770798b@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 months agodrm/vc4: hvs: Ignore atomic_flush if we're disabled
Maxime Ripard [Wed, 7 Dec 2022 11:53:19 +0000 (12:53 +0100)]
drm/vc4: hvs: Ignore atomic_flush if we're disabled

atomic_flush will be called for each CRTC even if they aren't enabled.

The whole code we have there will thus run without a properly affected
channel, which can then result in all sorts of weird behaviour.

Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-8-1f8e0770798b@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 months agodrm/vc4: hvs: Add DRM 210101010 RGB formats
Dave Stevenson [Wed, 7 Dec 2022 11:53:18 +0000 (12:53 +0100)]
drm/vc4: hvs: Add DRM 210101010 RGB formats

HVS5 supports the 210101010 RGB[A|X] formats, but they were
missing from the DRM to HVS mapping list, so weren't available.
Add them in.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-7-1f8e0770798b@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 months agodrm/vc4: hvs: Fix colour order for xRGB1555 on HVS5
Dave Stevenson [Wed, 7 Dec 2022 11:53:17 +0000 (12:53 +0100)]
drm/vc4: hvs: Fix colour order for xRGB1555 on HVS5

Same as the xRGB8888 formats, HVS5 has managed to swap the colour
channels for the xRGB1555 formats as well. Add the relevant
config for pixel_order_hvs5.

Fixes: c54619b0bfb3 ("drm/vc4: Add support for the BCM2711 HVS5")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-6-1f8e0770798b@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 months agodrm/vc4: hvs: Support zpos on all planes
Dave Stevenson [Wed, 7 Dec 2022 11:53:16 +0000 (12:53 +0100)]
drm/vc4: hvs: Support zpos on all planes

Adds the zpos property to all planes, and creates the dlist
by placing the fragments in the correct order based on zpos.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-5-1f8e0770798b@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 months agodrm/vc4: hvs: Correct interrupt masking bit assignment for HVS5
Dave Stevenson [Wed, 7 Dec 2022 11:53:15 +0000 (12:53 +0100)]
drm/vc4: hvs: Correct interrupt masking bit assignment for HVS5

HVS5 has moved the interrupt enable bits around within the
DISPCTRL register, therefore the configuration has to be updated
to account for this.

Fixes: c54619b0bfb3 ("drm/vc4: Add support for the BCM2711 HVS5")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-4-1f8e0770798b@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 months agodrm/vc4: hvs: SCALER_DISPBKGND_AUTOHS is only valid on HVS4
Dave Stevenson [Wed, 7 Dec 2022 11:53:14 +0000 (12:53 +0100)]
drm/vc4: hvs: SCALER_DISPBKGND_AUTOHS is only valid on HVS4

The bit used for SCALER_DISPBKGND_AUTOHS in SCALER_DISPBKGNDX
has been repurposed on HVS5 to configure whether a display can
win back-to-back arbitration wins for the COB.

This is not desirable, therefore only select this bit on HVS4,
and explicitly clear it on HVS5.

Fixes: c54619b0bfb3 ("drm/vc4: Add support for the BCM2711 HVS5")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-3-1f8e0770798b@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 months agodrm/vc4: hvs: Set AXI panic modes
Dave Stevenson [Wed, 7 Dec 2022 11:53:13 +0000 (12:53 +0100)]
drm/vc4: hvs: Set AXI panic modes

The HVS can change AXI request mode based on how full the COB
FIFOs are.
Until now the vc4 driver has been relying on the firmware to
have set these to sensible values.

With HVS channel 2 now being used for live video, change the
panic mode for all channels to be explicitly set by the driver,
and the same for all channels.

Fixes: c54619b0bfb3 ("drm/vc4: Add support for the BCM2711 HVS5")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-2-1f8e0770798b@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 months agodrm/vc4: hvs: Configure the HVS COB allocations
Dave Stevenson [Wed, 7 Dec 2022 11:53:12 +0000 (12:53 +0100)]
drm/vc4: hvs: Configure the HVS COB allocations

The HVS Composite Output Buffer (COB) is the memory used to
generate the output pixel data.
Until now the vc4 driver has been relying on the firmware to
have set these to sensible values.

In testing triple screen support it has been noted that only
1 line was being assigned to HVS channel 2. Whilst that is fine
for the transposer (TXP), and indeed needed as only some pixels
have an alpha channel, it is insufficient to run a live display.

Split the COB more evenly between the 3 HVS channels.

Fixes: c54619b0bfb3 ("drm/vc4: Add support for the BCM2711 HVS5")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-1-1f8e0770798b@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 months agodrm/mipi-dsi: Add a mipi_dsi_dcs_write_seq() macro
Javier Martinez Canillas [Mon, 2 Jan 2023 20:25:42 +0000 (21:25 +0100)]
drm/mipi-dsi: Add a mipi_dsi_dcs_write_seq() macro

Many panel drivers define dsi_dcs_write_seq() and dsi_generic_write_seq()
macros to send DCS commands and generic write packets respectively, with
the payload specified as a list of parameters instead of using arrays.

There's already a macro for the former, introduced by commit 2a9e9daf75231
("drm/mipi-dsi: Introduce mipi_dsi_dcs_write_seq macro") so drivers can be
changed to use that. But there isn't one yet for the latter, let's add it.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230102202542.3494677-2-javierm@redhat.com
18 months agodrm/mipi-dsi: Fix mipi_dsi_dcs_write_seq() macro definition format
Javier Martinez Canillas [Mon, 2 Jan 2023 20:25:41 +0000 (21:25 +0100)]
drm/mipi-dsi: Fix mipi_dsi_dcs_write_seq() macro definition format

Change made using a `clang-format -i include/drm/drm_mipi_dsi.h` command.

Suggested-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230102202542.3494677-1-javierm@redhat.com