platform/kernel/linux-rpi.git
3 years agodrm/virtio: implement blob resources: refactor UUID code somewhat
Gurchetan Singh [Thu, 24 Sep 2020 00:32:10 +0000 (17:32 -0700)]
drm/virtio: implement blob resources: refactor UUID code somewhat

For upcoming blob resources, userspace can specify that the
resource will be used for cross-device sharing. This is mainly
for exportable blobs that will only shared with the virtgpu
display but not across devices.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-15-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
3 years agodrm/virtio: implement blob resources: blob display integration
Gurchetan Singh [Thu, 24 Sep 2020 00:32:09 +0000 (17:32 -0700)]
drm/virtio: implement blob resources: blob display integration

SCANOUT_BLOB forwards the DRM framebuffer metadata to the host. The
modifier is intentionally left out -- it may be possible to query
the host for that.

We also assume one blob resource per DRM framebuffer.  That too is
an intentional simplification.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-14-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
3 years agodrm/virtio: implement blob resources: hypercall interface
Gurchetan Singh [Thu, 24 Sep 2020 00:32:08 +0000 (17:32 -0700)]
drm/virtio: implement blob resources: hypercall interface

This implements the blob hypercall interface.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-13-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
3 years agodrm/virtio: implement blob resources: implement vram object
Gerd Hoffmann [Thu, 24 Sep 2020 00:32:07 +0000 (17:32 -0700)]
drm/virtio: implement blob resources: implement vram object

A virtio-gpu vram object is based on range-based allocation.
No guest shmemfs backing, so we call drm_gem_private_object_init.

This is for host memory without any guest backing (atleast initially).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-12-gurchetansingh@chromium.org
Co-developed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
3 years agodrm/virtio: implement blob resources: add new fields to internal structs
Gurchetan Singh [Thu, 24 Sep 2020 00:32:06 +0000 (17:32 -0700)]
drm/virtio: implement blob resources: add new fields to internal structs

Useful for upcoming blob resources.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-11-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
3 years agodrm/virtio: implement blob resources: expose virtio_gpu_resource_id_get
Gurchetan Singh [Thu, 24 Sep 2020 00:32:05 +0000 (17:32 -0700)]
drm/virtio: implement blob resources: expose virtio_gpu_resource_id_get

VRAM object will need it.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-10-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
3 years agodrm/virtio: implement blob resources: probe for host visible region
Gerd Hoffmann [Thu, 24 Sep 2020 00:32:04 +0000 (17:32 -0700)]
drm/virtio: implement blob resources: probe for host visible region

The availability of the host visible region means host 3D
allocations can be directly mapped in the guest.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-9-gurchetansingh@chromium.org
Co-developed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
3 years agodrm/virtio: implement blob resources: probe for the feature.
Gerd Hoffmann [Thu, 24 Sep 2020 00:32:03 +0000 (17:32 -0700)]
drm/virtio: implement blob resources: probe for the feature.

Let's proble for VIRTIO_GPU_F_RESOURCE_BLOB.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-8-gurchetansingh@chromium.org
3 years agodrm/virtgpu api: cross-device feature
Gurchetan Singh [Thu, 24 Sep 2020 00:32:02 +0000 (17:32 -0700)]
drm/virtgpu api: cross-device feature

This feature was recently added to virtio-gpu, lets make
it userspace queryable. It's an error to use
BLOB_FLAG_USE_CROSS_DEVICE when this feature is not present.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-7-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
3 years agodrm/virtgpu api: host visible feature
Gurchetan Singh [Thu, 24 Sep 2020 00:32:01 +0000 (17:32 -0700)]
drm/virtgpu api: host visible feature

This exposes the host visible feature to userspace.  Without it,
it is an error to specify BLOB_MEM_HOST3D with
BLOG_FLAG_USE_MAPPABLE.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Lingfeng Yang <lfy@google.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-6-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
3 years agodrm/virtgpu api: blob resources
Gurchetan Singh [Thu, 24 Sep 2020 00:32:00 +0000 (17:32 -0700)]
drm/virtgpu api: blob resources

This makes blob resources available to guest userspace. They are needed
for GL4.5, Vulkan and zero-copy virtio-gpu.

For Mesa, blob resources have been tested with Piglit's ARB_buffer_storage
tests and apitraces.  Apitraces of GL4.5 games show we're between 70%
to 80% of host performance on Iris, based on a apitrace of a 2013 GL4.5
game:

11.204 FPS (guest)
15.947 FPS (host)

This is still better than the status quo, when said game was unplayable
with Virgl due to an inefficient GL4.3 fallback.  But there's still room
for improvement if we want to match HW-assisted virtualization.

For Vulkan, blob resources have been tested with dEQP.vk.memory* and
running Vulkan applications in production with the "Cuttlefish" virtual
Android device.  This has been done with Lingfeng Yang's "gfxstream"
Vulkan implementation, which virtualizes Vulkan across many Google
products.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Lingfeng Yang <lfy@google.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-5-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
3 years agovirtio-gpu api: host visible feature
Gerd Hoffmann [Thu, 24 Sep 2020 00:31:59 +0000 (17:31 -0700)]
virtio-gpu api: host visible feature

This patch adds a new virtgpu feature that allows directly
mapping host allocated resources.

This is based on virtio shared memory regions, which allows
querying for memory regions using PCI transport. Each shared
memory region has an associated "shmid", the meaning of which
is device specific.

For virtio-gpu, we can define the shared memory region with id
VIRTIO_GPU_SHM_ID_HOST_VISIBLE to be the "host visible memory
region".

The presence of the host visible memory region means the following
hypercalls are supported:

1) VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB

This hypercall tells the host to inject the host resource's
mapping in an offset into virtio-gpu's PCI address space.
This is typically done via KVM_SET_USER_MEMORY_REGION on Linux
hosts.

On success, VIRTIO_GPU_RESP_OK_MAP_INFO is returned, which
specifies the host buffer's caching type and possibly in the
future performance hints about the buffer..

2) VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB

This hypercall tells the host to remove the host resource's
mapping from the guest VM.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Lingfeng Yang <lfy@google.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-4-gurchetansingh@chromium.org
Co-developed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
3 years agovirtio-gpu api: blob resources
Gerd Hoffmann [Thu, 24 Sep 2020 00:31:58 +0000 (17:31 -0700)]
virtio-gpu api: blob resources

A blob resource is a container for:
   - VIRTIO_GPU_BLOB_MEM_GUEST: a guest memory allocation
     (referred to as a "guest-only blob resource")

   - VIRTIO_GPU_BLOB_MEM_HOST3D: a host3d memory allocation
     (referred to as a "host-only blob resource")

   - VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: a guest + host3d memory allocation
     (referred to as a "default blob resource").

The memory properties of the blob resource must be described by
`blob_mem`.

For default and guest only blob resources set, `nents` guest system
pages are assigned to the resource.  For default blob resources,
these guest pages are used for transfer operations. Attach/detach is
also possible to allow swap-in/swap-out, but isn't required since it
may not be applicable to future blob mem types
(shared guest/guest vram).

Host allocations depend on whether the 3D is supported. If 3D is not
supported, the only valid field for `blob_mem` is
VIRTIO_GPU_BLOB_MEM_GUEST.

If 3D is supported, the virtio-gpu resource is created from the
context local object identified by the `blob_id`. The actual host
allocation done by the CMD_SUBMIT_3D.

Userspace must specify if the blob resource is intended to be used
for userspace mapping, sharing between virtio-gpu contexts and/or
sharing between virtio devices. This is done via `blob_flags`.

For 3D hosts, both VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D and
VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D may be used to update
the host resource. There is no restriction on the image/buffer
view the guest/host userspace has on the blob resource.

VIRTIO_GPU_CMD_SET_SCANOUT_BLOB / VIRTIO_GPU_CMD_RESOURCE_FLUSH may
be used with blob resources as well.  The modifier is intentionally
left out of SCANOUT_BLOB, and auxilary blobs are also left out
as a simplification.

The use case for blob resources is zero-copy, needed for coherent
memory in virglrenderer. Host only blob resources are not mappable
without the feature described in the next patch, but are shareable.

Future work:
   - Emulated coherent `blob_mem` type for QEMU/vhost-user
   - A `blob_mem` type for guest-only resources imported in
     cache-coherent FOSS GPU/display drivers.
   - Display integration involving the blob model using seamless
     Wayland windows.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Lingfeng Yang <lfy@google.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-3-gurchetansingh@chromium.org
Co-developed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
3 years agodrm/virtio: blob prep: make CPU responses more generic
Gurchetan Singh [Thu, 24 Sep 2020 00:31:57 +0000 (17:31 -0700)]
drm/virtio: blob prep: make CPU responses more generic

RESOURCE_MAP_BLOB / RESOURCE_UNMAP_BLOB can use this.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-2-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
3 years agodrm/virtio: blob prep: refactor getting pages and attaching backing
Gurchetan Singh [Thu, 24 Sep 2020 00:31:56 +0000 (17:31 -0700)]
drm/virtio: blob prep: refactor getting pages and attaching backing

Useful for upcoming blob resources.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-1-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
3 years agodrm/rockchip: Include <drm/drm_gem_cma_helper> for drm_gem_cm_vm_ops
Thomas Zimmermann [Mon, 28 Sep 2020 08:16:43 +0000 (10:16 +0200)]
drm/rockchip: Include <drm/drm_gem_cma_helper> for drm_gem_cm_vm_ops

Include <drm/drm_gem_cma_helper.h> to get drm_gem_cma_vm_ops. Fallout
from the recent conversion to GEM object functions.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reported-by: kernel test robot <lkp@intel.com>
Fixes: 0d590af3140d ("drm/rockchip: Convert to drm_gem_object_funcs")
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Christian König <christian.koenig@amd.com>
Cc: Sandy Huang <hjc@rock-chips.com>
Cc: "Heiko Stübner" <heiko@sntech.de>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200928081643.8575-1-tzimmermann@suse.de
3 years agodrm/hisilicon: Deleted the drm_device declaration
Tian Tao [Fri, 25 Sep 2020 07:48:06 +0000 (15:48 +0800)]
drm/hisilicon: Deleted the drm_device declaration

drm_framebuffer.h already declares struct drm_device, so there's no
need to declare it in hibmc_drm_drv.h

v2:
fixed spelling errors in commit message.

v3:
rewrite the commit message.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/1601020086-43652-1-git-send-email-tiantao6@hisilicon.com
3 years agodrm/ttm: remove fault callback
Christian König [Fri, 25 Sep 2020 13:45:19 +0000 (15:45 +0200)]
drm/ttm: remove fault callback

Another one bites the dust.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/392325/
3 years agodrm/nouveau: stop using TTMs fault callback
Christian König [Fri, 25 Sep 2020 13:42:04 +0000 (15:42 +0200)]
drm/nouveau: stop using TTMs fault callback

We already implemented the fault handler ourself,
just open code what is necessary here.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/392323/
3 years agodrm/amdgpu: stop using TTMs fault callback
Christian König [Fri, 25 Sep 2020 13:21:49 +0000 (15:21 +0200)]
drm/amdgpu: stop using TTMs fault callback

Implement the fault handler ourself using the provided TTM functions.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/392324/
3 years agodrm/radeon: stop using TTMs fault callback
Christian König [Fri, 25 Sep 2020 12:17:09 +0000 (14:17 +0200)]
drm/radeon: stop using TTMs fault callback

We already implemented the fault handler ourself,
just open code what is necessary here.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/392322/
3 years agodrm/ttm: move SG flag check into ttm_bo_vm_reserve
Christian König [Fri, 25 Sep 2020 10:40:03 +0000 (12:40 +0200)]
drm/ttm: move SG flag check into ttm_bo_vm_reserve

Just check earlier if a BO can be page faulted in the first place.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/392321/
3 years agodrm/ingenic: Add support for paletted 8bpp
Paul Cercueil [Sun, 27 Sep 2020 19:36:45 +0000 (21:36 +0200)]
drm/ingenic: Add support for paletted 8bpp

On JZ4725B and newer, the F0 plane supports paletted 8bpp with a
256-entry palette. Add support for it.

v3: Only accept a full 256-entry palette.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200927193645.262612-2-paul@crapouillou.net
3 years agodrm/ingenic: Add support for 24-bit modes
Paul Cercueil [Sat, 26 Sep 2020 17:05:01 +0000 (19:05 +0200)]
drm/ingenic: Add support for 24-bit modes

Starting from the JZ4725B SoC, the primary and overlay planes support
24-bit pixel modes (8 bits per color component, without dummy byte).
Add support for these in the ingenic-drm driver.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200926170501.1109197-8-paul@crapouillou.net
3 years agodrm/ingenic: Add support for 30-bit modes
Paul Cercueil [Sat, 26 Sep 2020 17:05:00 +0000 (19:05 +0200)]
drm/ingenic: Add support for 30-bit modes

Starting from the JZ4760 SoC, the primary and overlay planes support
30-bit pixel modes (10 bits per color component). Add support for these
in the ingenic-drm driver.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200926170501.1109197-7-paul@crapouillou.net
3 years agodrm/ingenic: Support handling different pixel formats in F0/F1 planes
Paul Cercueil [Sat, 26 Sep 2020 17:04:58 +0000 (19:04 +0200)]
drm/ingenic: Support handling different pixel formats in F0/F1 planes

Until now the ingenic-drm driver supported the same pixel formats on the
F0 and F1 planes, and across all SoCs. However, the F0 plane does support
paletted 8bpp, while the F1 plane doesn't.

Furthermore, the three SoCs currently supported all have different pixel
formats available; 24bpp was added in JZ4725B, 30bpp was added in
JZ4770.

Prepare the inclusion of paletted 8bpp, 24bpp and 30bpp support by
having separate pixel format lists for F0 and F1 planes.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200926170501.1109197-5-paul@crapouillou.net
3 years agodrm/ingenic: Alloc F0 and F1 DMA descriptors at once
Paul Cercueil [Sat, 26 Sep 2020 17:04:57 +0000 (19:04 +0200)]
drm/ingenic: Alloc F0 and F1 DMA descriptors at once

Instead of calling dmam_alloc_coherent() once for each 4-bit DMA
hardware descriptor, we can have them both in a physical memory page, as
long as they are aligned to 16 bytes. This reduces memory consumption,
and will make it easier to add more DMA descriptors in the future.

Note that the old code would not create the F0 descriptor on SoCs that
don't support multiple planes. We don't care, because:
- we don't use more memory by allocating two descriptors instead of a
  single one;
- the only SoC that does not support multiple planes (JZ4740) still has
  two independent DMA channels, for an unknown reason.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200926170501.1109197-4-paul@crapouillou.net
3 years agodrm/ingenic: Add support for reserved memory
Paul Cercueil [Sat, 26 Sep 2020 17:04:56 +0000 (19:04 +0200)]
drm/ingenic: Add support for reserved memory

Add support for static memory reserved from Device Tree. Since we're
using GEM buffers backed by CMA, it is interesting to have an option to
specify the CMA area where the GEM buffers will be allocated.

v2: Don't abort probe if reserved memory cannot be obtained. The driver
    will still work fine provided the kernel configuration is sane.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200926170501.1109197-3-paul@crapouillou.net
3 years agodrm/ingenic: Reset pixclock rate when parent clock rate changes
Paul Cercueil [Sat, 26 Sep 2020 17:04:55 +0000 (19:04 +0200)]
drm/ingenic: Reset pixclock rate when parent clock rate changes

Old Ingenic SoCs can overclock very well, up to +50% of their nominal
clock rate, whithout requiring overvolting or anything like that, just
by changing the rate of the main PLL. Unfortunately, all clocks on the
system are derived from that PLL, and when the PLL rate is updated, so
is our pixel clock.

To counter that issue, we make sure that the panel is in VBLANK before
the rate change happens, and we will then re-set the pixel clock rate
afterwards, once the PLL has been changed, to be as close as possible to
the pixel rate requested by the encoder.

v2: Add comment about mutex usage

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200926170501.1109197-2-paul@crapouillou.net
3 years agofbdev: sbuslib: remove compat_alloc_user_space usage
Arnd Bergmann [Fri, 18 Sep 2020 10:09:06 +0000 (12:09 +0200)]
fbdev: sbuslib: remove compat_alloc_user_space usage

This is one of the last users of compat_alloc_user_space()
and copy_in_user(). The actual handler is implemented in the
same file and could be shared, but as I couldn't test this
properly I leave the native case alone and just make a straight
copy of it for the compat case, with a minimum set of
modifications.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200918100926.1447563-3-arnd@arndb.de
3 years agofbdev: sbuslib: remove unused FBIOSCURSOR32 helper
Arnd Bergmann [Fri, 18 Sep 2020 10:09:05 +0000 (12:09 +0200)]
fbdev: sbuslib: remove unused FBIOSCURSOR32 helper

No driver implements FBIOSCURSOR, so this function has no purpose
and can be removed. Apparently it was added in linux-2.1.44 to handle
compatibility for drivers/sbus/char/sunfb.c but lost its purpose when
that driver got rewritten in linux-2.5.63.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200918100926.1447563-2-arnd@arndb.de
3 years agofbdev: simplify fb_getput_cmap()
Arnd Bergmann [Fri, 18 Sep 2020 10:09:04 +0000 (12:09 +0200)]
fbdev: simplify fb_getput_cmap()

This function is one of the remaining users of compat_alloc_user_space()
and copy_in_user().

Clean it up by copying to a local data structure copy instead,
which also leads to more readable code.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200918100926.1447563-1-arnd@arndb.de
3 years agodrm/vram-helper: Don't put new BOs into VRAM
Thomas Zimmermann [Tue, 22 Sep 2020 14:57:00 +0000 (16:57 +0200)]
drm/vram-helper: Don't put new BOs into VRAM

Most drivers that use VRAM helpers have only a few MiB of framebuffer
memory available. To reduce fragmentation, new BOs are now put into
system memory by default. Only pin operations are allowed to move BOs
into VRAM.

v2:
* rebased onto latest drm-tip

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200922145700.25413-4-tzimmermann@suse.de
3 years agodrm/vram-helper: Set object function iff they are not provided by driver
Thomas Zimmermann [Tue, 22 Sep 2020 14:56:59 +0000 (16:56 +0200)]
drm/vram-helper: Set object function iff they are not provided by driver

Don't override the GEM object functions unconditionally. If the driver
sets the GEM functions, VRAM helpers will not set them. The idea has been
taken from SHMEM helpers.

v2:
* updated the commit message (Sam)
* document the new feature for drm_gem_vram_create()

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200922145700.25413-3-tzimmermann@suse.de
3 years agodrm/vram-helper: Integrate drm_gem_vram_init() into drm_gem_vram_create()
Thomas Zimmermann [Tue, 22 Sep 2020 14:56:58 +0000 (16:56 +0200)]
drm/vram-helper: Integrate drm_gem_vram_init() into drm_gem_vram_create()

The drm_gem_vram_create() function is the only caller of the internal
helper drm_gem_vram_init(). Streamline the code by putting all code into
the create function.

v2:
* rebased onto latest drm-tip
* fixed typo in commit message (Sam)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200922145700.25413-2-tzimmermann@suse.de
3 years agodrm: Remove obsolete GEM and PRIME callbacks from struct drm_driver
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:59 +0000 (12:21 +0200)]
drm: Remove obsolete GEM and PRIME callbacks from struct drm_driver

Several GEM and PRIME callbacks have been deprecated in favor of
per-instance GEM object functions. Remove the callbacks as they are
now unused. The only exception is .gem_prime_mmap, which is still
in use by several drivers.

What is also gone is gem_vm_ops in struct drm_driver. All drivers now
use struct drm_gem_object_funcs.vm_ops instead.

While at it, the patch also improves error handling around calls
to .free and .get_sg_table callbacks.

v3:
* restore default call to drm_gem_prime_export() in
  drm_gem_prime_handle_to_fd()
* return -ENOSYS if get_sg_table is not set
* drop all checks for obj->funcs
* clean up TODO list and documentation
v2:
* update related TODO item (Sam)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-23-tzimmermann@suse.de
3 years agodrm/xlnx: Initialize DRM driver instance with CMA helper macro
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:58 +0000 (12:21 +0200)]
drm/xlnx: Initialize DRM driver instance with CMA helper macro

The xlnx driver uses CMA helpers with default callback functions.
Initialize the driver structure with the rsp CMA helper macro. The
driver is being converted to use GEM object functions as part of
this change.

Two callbacks, .dumb_destroy and .gem_prime_import, were initialized
to their default implementations, so they are just kept empty now.

v2:
* initialize with DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE (Laurent)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-22-tzimmermann@suse.de
3 years agodrm/xen: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:57 +0000 (12:21 +0200)]
drm/xen: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in xen. The only exception is gem_prime_mmap,
which is non-trivial to convert.

v2:
* convert xen_drm_drv_free_object_unlocked() to static
  callback (Oleksandr)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-21-tzimmermann@suse.de
3 years agodrm/vkms: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:56 +0000 (12:21 +0200)]
drm/vkms: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in vkms.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Melissa Wen <melissa.srw@gmail.com>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-20-tzimmermann@suse.de
3 years agodrm/virtgpu: Set PRIME export function in struct drm_gem_object_funcs
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:55 +0000 (12:21 +0200)]
drm/virtgpu: Set PRIME export function in struct drm_gem_object_funcs

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces virtgpu's per-driver PRIME export
function with a per-object function.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-19-tzimmermann@suse.de
3 years agodrm/vgem: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:54 +0000 (12:21 +0200)]
drm/vgem: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in vgem. The only exception is gem_prime_mmap,
which is non-trivial to convert.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Melissa Wen <melissa.srw@gmail.com>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-18-tzimmermann@suse.de
3 years agodrm/vc4: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:53 +0000 (12:21 +0200)]
drm/vc4: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in vc4. The only exception is gem_prime_mmap,
which is non-trivial to convert.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-17-tzimmermann@suse.de
3 years agodrm/tegra: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:52 +0000 (12:21 +0200)]
drm/tegra: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in tegra.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-16-tzimmermann@suse.de
3 years agodrm/rockchip: Convert to drm_gem_object_funcs
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:51 +0000 (12:21 +0200)]
drm/rockchip: Convert to drm_gem_object_funcs

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in rockchip. The only exception is gem_prime_mmap,
which is non-trivial to convert.

v3:
* update documentation

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-15-tzimmermann@suse.de
3 years agodrm/radeon: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:50 +0000 (12:21 +0200)]
drm/radeon: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in radeon.

v2:
* move object-function instance to radeon_gem.c (Christian)
* set callbacks in radeon_gem_object_create() (Christian)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-14-tzimmermann@suse.de
3 years agodrm/pl111: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:49 +0000 (12:21 +0200)]
drm/pl111: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in pl111. The only exception is gem_prime_mmap,
which is non-trivial to convert.

v2:
* use drm_gem_cma_create_object_default_funcs() (Eric)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-13-tzimmermann@suse.de
3 years agodrm/omapdrm: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:48 +0000 (12:21 +0200)]
drm/omapdrm: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in omapdrm.

v2:
* make omap_gem_free_object() static (Tomi)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-12-tzimmermann@suse.de
3 years agodrm/nouveau: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:47 +0000 (12:21 +0200)]
drm/nouveau: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in nouveau.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-11-tzimmermann@suse.de
3 years agodrm/msm: Introduce GEM object funcs
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:46 +0000 (12:21 +0200)]
drm/msm: Introduce GEM object funcs

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in msm. The only exception is gem_prime_mmap,
which is non-trivial to convert.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-10-tzimmermann@suse.de
3 years agodrm/mediatek: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:45 +0000 (12:21 +0200)]
drm/mediatek: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in mediatek. The only exception is gem_prime_mmap,
which is non-trivial to convert.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-9-tzimmermann@suse.de
3 years agodrm/imx/dcss: Initialize DRM driver instance with CMA helper macro
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:44 +0000 (12:21 +0200)]
drm/imx/dcss: Initialize DRM driver instance with CMA helper macro

The i.MX DCSS driver uses CMA helpers with default callback functions.
Initialize the driver structure with the rsp CMA helper macro. The
driver is being converted to use GEM object functions as part of
this change.

Two callbacks, .gem_prime_export and .gem_prime_import, were initialized
to their default implementations, so they are just kept empty now.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-8-tzimmermann@suse.de
3 years agodrm/i915: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:43 +0000 (12:21 +0200)]
drm/i915: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in i915.

v2:
* move object-function instance to i915_gem_object.c (Jani)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-7-tzimmermann@suse.de
3 years agodrm/gma500: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:42 +0000 (12:21 +0200)]
drm/gma500: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in gma500.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-6-tzimmermann@suse.de
3 years agodrm/exynos: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:41 +0000 (12:21 +0200)]
drm/exynos: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in exynos. The only exception is gem_prime_mmap,
which is non-trivial to convert.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-5-tzimmermann@suse.de
3 years agodrm/etnaviv: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:40 +0000 (12:21 +0200)]
drm/etnaviv: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in etnaviv. The only exception is gem_prime_mmap,
which is non-trivial to convert.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-4-tzimmermann@suse.de
3 years agodrm/armada: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:39 +0000 (12:21 +0200)]
drm/armada: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in armada.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-3-tzimmermann@suse.de
3 years agodrm/amdgpu: Introduce GEM object functions
Thomas Zimmermann [Wed, 23 Sep 2020 10:21:38 +0000 (12:21 +0200)]
drm/amdgpu: Introduce GEM object functions

GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in amdgpu. The only exception is gem_prime_mmap,
which is non-trivial to convert.

v3:
* remove amdgpu_object.c from patch (Christian)
v2:
* move object-function instance to amdgpu_gem.c (Christian)
* set callbacks in amdgpu_gem_object_create() (Christian)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-2-tzimmermann@suse.de
3 years agodrm/hisilicon: Features to support reading resolutions from EDID
Tian Tao [Tue, 22 Sep 2020 12:44:30 +0000 (20:44 +0800)]
drm/hisilicon: Features to support reading resolutions from EDID

Use drm_get_edid to get the resolution, if that fails, set it to
a fixed resolution. Rewrite the desrtoy callback function to release
resources.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/1600778670-60370-3-git-send-email-tiantao6@hisilicon.com
3 years agodrm/hisilicon: Support i2c driver algorithms for bit-shift adapters
Tian Tao [Tue, 22 Sep 2020 12:44:29 +0000 (20:44 +0800)]
drm/hisilicon: Support i2c driver algorithms for bit-shift adapters

Adding driver implementation to support i2c driver algorithms for
bit-shift adapters, so hibmc will using the interface provided by
drm to read edid.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/1600778670-60370-2-git-send-email-tiantao6@hisilicon.com
3 years agodrm/panel: otm8009a: allow using non-continuous dsi clock
Antonio Borneo [Tue, 22 Sep 2020 07:42:53 +0000 (09:42 +0200)]
drm/panel: otm8009a: allow using non-continuous dsi clock

The panel is able to work when dsi clock is non-continuous, thus
the system power consumption can be reduced using such feature.

Add MIPI_DSI_CLOCK_NON_CONTINUOUS to panel's mode_flags.

Changes in v2:
  - Added my signed-off

Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200922074253.28810-1-yannick.fertre@st.com
3 years agodrm/panel: otm8009a: remove hack to force commands in HS
Antonio Borneo [Tue, 22 Sep 2020 07:42:42 +0000 (09:42 +0200)]
drm/panel: otm8009a: remove hack to force commands in HS

The panel is able to receive commands in LP. The current hack to
force backlight commands in HS was due to workaround an incorrect
settings on DSI controller that prevents sending LP commands while
video out was active.

Remove the hack that forces HS commands.

Changes in v2:
  - Added my signed-off

Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200922074242.28719-1-yannick.fertre@st.com
3 years agofbdev: mx3fb: remove unused variable 'irq'
Xiaofei Tan [Thu, 17 Sep 2020 09:19:20 +0000 (17:19 +0800)]
fbdev: mx3fb: remove unused variable 'irq'

Remove the variable 'irq' that is set but never used.

Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1600334360-4214-1-git-send-email-tanxiaofei@huawei.com
3 years agodrm/panel: rm68200: allow using non-continuous dsi clock
Yannick Fertre [Fri, 18 Sep 2020 11:47:36 +0000 (13:47 +0200)]
drm/panel: rm68200: allow using non-continuous dsi clock

The panel is able to work when dsi clock is non-continuous, thus
the system power consumption can be reduced using such feature.

Add MIPI_DSI_CLOCK_NON_CONTINUOUS to panel's mode_flags.

Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200918114736.11322-1-yannick.fertre@st.com
3 years agodrm/radeon/ttm: handle ttm moves properly
Dave Airlie [Thu, 24 Sep 2020 05:18:04 +0000 (15:18 +1000)]
drm/radeon/ttm: handle ttm moves properly

The core move code currently handles use_tt moves, for radeon
this was being handled also in the driver, but not using the same
paths.

If moving between TT/SYSTEM (all the use_tt paths on radeon) use
the core move function.

Eventually the core will be flipped over to calling the driver.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200924051845.397177-5-airlied@gmail.com
3 years agodrm/amdgpu/ttm: handle tt moves properly.
Dave Airlie [Thu, 24 Sep 2020 05:18:03 +0000 (15:18 +1000)]
drm/amdgpu/ttm: handle tt moves properly.

The core move code currently handles use_tt moves, for amdgpu
this was being handled also in the driver, but not using the same
paths.

If moving between TT/SYSTEM (all the use_tt paths on amdgpu) use
the core move function.

Eventually the core will be flipped over to calling the driver.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200924051845.397177-4-airlied@gmail.com
3 years agodrm/ttm: handle the SYSTEM->TT path in same place as others.
Dave Airlie [Thu, 24 Sep 2020 05:18:02 +0000 (15:18 +1000)]
drm/ttm: handle the SYSTEM->TT path in same place as others.

This just consolidates the code making the flow easier to understand
and also helps when moving move to the driver side.

Reviewed-by: Christian König <christian.koenig@amd.com>.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200924051845.397177-3-airlied@gmail.com
3 years agodrm/panel: simplify the return expression of td028ttec1_prepare
Qinglang Miao [Mon, 21 Sep 2020 13:10:18 +0000 (21:10 +0800)]
drm/panel: simplify the return expression of td028ttec1_prepare

Simplify the return expression.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200921131018.91513-1-miaoqinglang@huawei.com
3 years agodrm/ttm: remove TTM_PL_FLAG_NO_EVICT
Christian König [Mon, 21 Sep 2020 14:06:36 +0000 (16:06 +0200)]
drm/ttm: remove TTM_PL_FLAG_NO_EVICT

Not used any more.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Link: https://patchwork.freedesktop.org/patch/391604/?series=81973&rev=1
3 years agodrm/ttm: remove ttm_bo_create
Christian König [Mon, 21 Sep 2020 13:59:50 +0000 (15:59 +0200)]
drm/ttm: remove ttm_bo_create

Not used any more.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Link: https://patchwork.freedesktop.org/patch/391616/?series=81973&rev=1
3 years agodrm/amdgpu: switch over to the new pin interface
Christian König [Mon, 21 Sep 2020 13:55:39 +0000 (15:55 +0200)]
drm/amdgpu: switch over to the new pin interface

Stop using TTM_PL_FLAG_NO_EVICT.

Signed-off-by: Christian König <christian.koenig@amd.com>
Tested-by: Nirmoy Das <nirmoy.das@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Link: https://patchwork.freedesktop.org/patch/391617/?series=81973&rev=1
3 years agodrm/radeon: switch over to the new pin interface
Christian König [Mon, 21 Sep 2020 11:18:02 +0000 (13:18 +0200)]
drm/radeon: switch over to the new pin interface

Stop using TTM_PL_FLAG_NO_EVICT.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Link: https://patchwork.freedesktop.org/patch/391610/?series=81973&rev=1
3 years agodrm/qxl: switch over to the new pin interface
Christian König [Mon, 21 Sep 2020 13:24:53 +0000 (15:24 +0200)]
drm/qxl: switch over to the new pin interface

Stop using TTM_PL_FLAG_NO_EVICT.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Link: https://patchwork.freedesktop.org/patch/391607/?series=81973&rev=1
3 years agodrm/vram-helper: switch over to the new pin interface
Christian König [Mon, 21 Sep 2020 12:43:59 +0000 (14:43 +0200)]
drm/vram-helper: switch over to the new pin interface

Stop using TTM_PL_FLAG_NO_EVICT.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Link: https://patchwork.freedesktop.org/patch/391603/?series=81973&rev=1
3 years agodrm/nouveau: switch over to the new pin interface
Christian König [Mon, 21 Sep 2020 13:37:12 +0000 (15:37 +0200)]
drm/nouveau: switch over to the new pin interface

Stop using TTM_PL_FLAG_NO_EVICT.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Link: https://patchwork.freedesktop.org/patch/391606/?series=81973&rev=1
3 years agodrm/vmwgfx: switch over to the new pin interface v2
Christian König [Mon, 21 Sep 2020 12:37:25 +0000 (14:37 +0200)]
drm/vmwgfx: switch over to the new pin interface v2

Stop using TTM_PL_FLAG_NO_EVICT.

v2: fix unconditional pinning

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Link: https://patchwork.freedesktop.org/patch/391601/?series=81973&rev=1
3 years agodrm/vmwgfx: stop using ttm_bo_create v2
Christian König [Mon, 21 Sep 2020 12:14:32 +0000 (14:14 +0200)]
drm/vmwgfx: stop using ttm_bo_create v2

Implement in the driver instead since it is the only user of that function.

v2: fix usage of ttm_bo_init_reserved

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Link: https://patchwork.freedesktop.org/patch/391614/?series=81973&rev=1
3 years agodrm/vmwgfx: remove unused placement combination
Christian König [Mon, 21 Sep 2020 10:56:48 +0000 (12:56 +0200)]
drm/vmwgfx: remove unused placement combination

Just some dead code cleanup.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Link: https://patchwork.freedesktop.org/patch/391599/?series=81973&rev=1
3 years agodrm/ttm: add ttm_bo_pin()/ttm_bo_unpin() v2
Christian König [Mon, 21 Sep 2020 11:05:54 +0000 (13:05 +0200)]
drm/ttm: add ttm_bo_pin()/ttm_bo_unpin() v2

As an alternative to the placement flag add a
pin count to the ttm buffer object.

v2: add dma_resv_assert_help() calls

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Link: https://patchwork.freedesktop.org/patch/391596/?series=81973&rev=1
3 years agodrm/ast: Reload gamma LUT after changing primary plane's color format
Thomas Zimmermann [Tue, 22 Sep 2020 14:46:55 +0000 (16:46 +0200)]
drm/ast: Reload gamma LUT after changing primary plane's color format

The gamma LUT has to be reloaded after changing the primary plane's
color format. This used to be done implicitly by the CRTC atomic_enable()
helper after updating the primary plane. With the recent reordering of
the steps, the primary plane's setup was moved last and invalidated
the gamma LUT. Fix this by setting the LUT from within atomic_flush().

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Fixes: 2f0ddd89fe32 ("drm/ast: Enable CRTC before planes")
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200922144655.23624-1-tzimmermann@suse.de
3 years agodrm/ttm: remove persistent_swap_storage
Christian König [Thu, 17 Sep 2020 11:27:35 +0000 (13:27 +0200)]
drm/ttm: remove persistent_swap_storage

Not used any more. Cleanup the code as well while at it.

Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/391079/?series=81804&rev=1
Reviewed-by: Dave Airlie <airlied@redhat.com>
3 years agodrm/nouveau: stop using persistent_swap_storage
Christian König [Thu, 17 Sep 2020 11:16:53 +0000 (13:16 +0200)]
drm/nouveau: stop using persistent_swap_storage

According to Ben this is most likely just a leftover.

Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/391078/?series=81804&rev=1
Reviewed-by: Dave Airlie <airlied@redhat.com>
3 years agodrm/dp: add a number of DP 2.0 DPCD definitions
Jani Nikula [Fri, 18 Sep 2020 11:40:17 +0000 (14:40 +0300)]
drm/dp: add a number of DP 2.0 DPCD definitions

Prepare for future with DP 2.0 DPCD definitions, with a couple of
related drive-by cleanups. No functional changes.

v2: Send the version that actually builds.

Reviewed-by: Manasi Navare <manasi.d.navare@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200918114017.30198-2-jani.nikula@intel.com
3 years agodrm/dp: add subheadings to DPCD address definitions
Jani Nikula [Fri, 18 Sep 2020 11:40:16 +0000 (14:40 +0300)]
drm/dp: add subheadings to DPCD address definitions

Add the subheadings from the DP spec. No functional changes.

Reviewed-by: Manasi Navare <manasi.d.navare@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200918114017.30198-1-jani.nikula@intel.com
3 years agodrm/ttm: add bo wait that takes a ctx wrapper.
Dave Airlie [Wed, 23 Sep 2020 03:04:49 +0000 (13:04 +1000)]
drm/ttm: add bo wait that takes a ctx wrapper.

I'm thinking of pushing the wait into the drivers.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923030454.362731-6-airlied@gmail.com
3 years agodrm/nouveau/ttm: plumb ctx through move functions.
Dave Airlie [Wed, 23 Sep 2020 03:04:48 +0000 (13:04 +1000)]
drm/nouveau/ttm: plumb ctx through move functions.

This just uses the ctx instead of passing bools and recreating it.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923030454.362731-5-airlied@gmail.com
3 years agodrm/radeon: cleanup ttm operation ctx usage.
Dave Airlie [Wed, 23 Sep 2020 03:04:47 +0000 (13:04 +1000)]
drm/radeon: cleanup ttm operation ctx usage.

Just pass it around move, and remove unused pieces

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923030454.362731-4-airlied@gmail.com
3 years agodrm/qxl: kill unused bo wait wrapper
Dave Airlie [Wed, 23 Sep 2020 03:04:46 +0000 (13:04 +1000)]
drm/qxl: kill unused bo wait wrapper

This wasn't used anywheere

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923030454.362731-3-airlied@gmail.com
3 years agodrm/radeon: kill radeon_bo_wait
Dave Airlie [Wed, 23 Sep 2020 03:04:45 +0000 (13:04 +1000)]
drm/radeon: kill radeon_bo_wait

this is unused

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923030454.362731-2-airlied@gmail.com
3 years agodrm/doc: Document that modifiers are always required for fb
Daniel Vetter [Thu, 17 Sep 2020 16:47:22 +0000 (18:47 +0200)]
drm/doc: Document that modifiers are always required for fb

Even for legacy userspace, since otherwise GETFB2 is broken and if you
switch between modifier-less and modifier-aware compositors, smooth
transitions break.

Also it's just best practice to make sure modifiers are invariant for
a given drm_fb, and that a modifier-aware kms drivers only has one
place to store them, ignoring any old implicit bo flags or whatever
else might float around.

Motivated by some irc discussion with Bas about amdgpu modifier
support.

Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Fixes: 455e00f1412f ("drm: Add getfb2 ioctl")
Cc: Daniel Stone <daniels@collabora.com>
Cc: Juston Li <juston.li@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: Marek Olšák <maraeo@gmail.com>
Cc: "Wentland, Harry" <harry.wentland@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200917164721.2038541-1-daniel.vetter@ffwll.ch
3 years agodrm/ttm: stop dangerous caching attribute change
Christian König [Fri, 18 Sep 2020 14:34:49 +0000 (16:34 +0200)]
drm/ttm: stop dangerous caching attribute change

When we swapout/in a BO we try to change the caching
attributes of the pages before/after doing the copy.

On x86 this is done by calling set_pages_uc(),
set_memory_wc() or set_pages_wb() for not highmem pages
to update the linear mapping of the page.

On all other platforms we do exactly nothing.

Now on x86 this is unnecessary because copy_highpage() will
either create a temporary mapping of the page which is wb
anyway and destroyed immediately again or use the linear
mapping with the correct caching attributes.

So stop this nonsense and just keep the caching as it is and
return an error when a driver tries to change the caching of
an already populated TT object.

This is much more defensive since changing caching
attributes is platform and driver specific and usually
doesn't work after the page was initially allocated.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/391293/
3 years agodrm/ttm: remove nonsense AGP handling
Christian König [Fri, 18 Sep 2020 14:20:20 +0000 (16:20 +0200)]
drm/ttm: remove nonsense AGP handling

map_page_into_agp() and unmap_page_from_agp() are only defined on x86.

On all other platforms they are defined as noops. So this code doesn't has any effect at all.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/391292/
3 years agodrm/dp_mst: Retrieve extended DPCD caps for topology manager
Koba Ko [Tue, 22 Sep 2020 06:53:13 +0000 (14:53 +0800)]
drm/dp_mst: Retrieve extended DPCD caps for topology manager

As per DP-1.3, First check DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT.
If DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT is 1,read the DP_DP13_DPCD_REV to
get the faster capability.
If DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT is 0,read DP_DPCD_REV.

Signed-off-by: Koba Ko <koba.ko@canonical.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
[added aux name to drm_dbg_kms() call]
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200922065313.4794-1-koba.ko@canonical.com
3 years agovga_switcheroo: simplify the return expression of vga_switcheroo_runtime_resume
Qinglang Miao [Mon, 21 Sep 2020 13:11:10 +0000 (21:11 +0800)]
vga_switcheroo: simplify the return expression of vga_switcheroo_runtime_resume

Simplify the return expression.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200921131110.93365-1-miaoqinglang@huawei.com
3 years agodrm/gma500: clean up indentation issues
Colin Ian King [Sun, 20 Sep 2020 14:14:07 +0000 (15:14 +0100)]
drm/gma500: clean up indentation issues

There are a couple of statements that are indented too deeply,
remove the extraneous tabs and also an empty line.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200920141407.32672-1-colin.king@canonical.com
3 years agodrm/vram-helper: Fix use of top-down placement
Thomas Zimmermann [Mon, 21 Sep 2020 14:25:36 +0000 (16:25 +0200)]
drm/vram-helper: Fix use of top-down placement

Commit 7053e0eab473 ("drm/vram-helper: stop using TTM placement flags")
cleared the BO placement flags if top-down placement had been selected.
Hence, BOs that were supposed to go into VRAM are now placed in a default
location in system memory.

Trying to scanout the incorrectly pinned BO results in displayed garbage
and an error message.

[  146.108127] ------------[ cut here ]------------
[  146.1V08180] WARNING: CPU: 0 PID: 152 at drivers/gpu/drm/drm_gem_vram_helper.c:284 drm_gem_vram_offset+0x59/0x60 [drm_vram_helper]
...
[  146.108591]  ast_cursor_page_flip+0x3e/0x150 [ast]
[  146.108622]  ast_cursor_plane_helper_atomic_update+0x8a/0xc0 [ast]
[  146.108654]  drm_atomic_helper_commit_planes+0x197/0x4c0
[  146.108699]  drm_atomic_helper_commit_tail_rpm+0x59/0xa0
[  146.108718]  commit_tail+0x103/0x1c0
...
[  146.109302] ---[ end trace d901a1ba1d949036 ]---

Fix the bug by keeping the placement flags. The top-down placement flag
is stored in a separate variable.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Fixes: 7053e0eab473 ("drm/vram-helper: stop using TTM placement flags")
Cc: Christian König <christian.koenig@amd.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200921142536.4392-1-tzimmermann@suse.de
3 years agodrm/panel: samsung: make vint_table static const
Jason Yan [Wed, 16 Sep 2020 13:23:01 +0000 (21:23 +0800)]
drm/panel: samsung: make vint_table static const

This eliminates the following sparse warning:

drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c:217:15: warning: symbol
'vint_table' was not declared. Should it be static?

While at it, make the table const as it is never modified.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200916132301.2914017-1-yanaijie@huawei.com
3 years agodrm/imx/dcss: fix unused but set variable warnings
Wang ShaoBo [Fri, 11 Sep 2020 01:44:14 +0000 (09:44 +0800)]
drm/imx/dcss: fix unused but set variable warnings

Fix unused but set variable warning building with `make W=1`:

drivers/gpu/drm/imx/dcss/dcss-plane.c:270:6: warning:
 variable ‘pixel_format’ set but not used [-Wunused-but-set-variable]
  u32 pixel_format;
      ^~~~~~~~~~~~

Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200911014414.4663-1-bobo.shaobowang@huawei.com
3 years agodrm/vc4: hvs: Pull the state of all the CRTCs prior to PV muxing
Maxime Ripard [Thu, 17 Sep 2020 12:16:23 +0000 (14:16 +0200)]
drm/vc4: hvs: Pull the state of all the CRTCs prior to PV muxing

The vc4 display engine has a first controller called the HVS that will
perform the composition of the planes. That HVS has 3 FIFOs and can
therefore compose planes for up to three outputs. The timings part is
generated through a component called the Pixel Valve, and the BCM2711 has 6
of them.

Thus, the HVS has some bits to control which FIFO gets output to which
Pixel Valve. The current code supports that muxing by looking at all the
CRTCs in a new DRM atomic state in atomic_check, and given the set of
constraints that we have, assigns FIFOs to CRTCs or reject the mode
entirely. The actual muxing will occur during atomic_commit.

However, that doesn't work if only a fraction of the CRTCs' state is
updated in that state, since it will ignore the CRTCs that are kept running
unmodified, and will thus unassign its associated FIFO, and later disable
it.

In order to make the code work as expected, let's pull the CRTC state of
all the enabled CRTC in our atomic_check so that we can operate on all the
running CRTCs, no matter whether they are affected by the new state or not.

Fixes: 87ebcd42fb7b ("drm/vc4: crtc: Assign output to channel automatically")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Tested-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Reviewed-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200917121623.42023-1-maxime@cerno.tech
3 years agodrm/ttm: update kernel-doc line comments
Tian Tao [Fri, 18 Sep 2020 09:52:58 +0000 (17:52 +0800)]
drm/ttm: update kernel-doc line comments

Update kernel-doc line comments to fix warnings reported by make W=1.

drivers/gpu/drm/ttm/ttm_memory.c:271: warning: Function parameter or
member 'glob' not described in 'ttm_shrink'
drivers/gpu/drm/ttm/ttm_memory.c:271: warning: Function parameter or
member 'from_wq' not described in 'ttm_shrink'
drivers/gpu/drm/ttm/ttm_memory.c:271: warning: Function parameter or
member 'extra' not described in 'ttm_shrink'
drivers/gpu/drm/ttm/ttm_memory.c:271: warning: Function parameter or
member 'ctx' not described in 'ttm_shrink'

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Link: https://patchwork.freedesktop.org/patch/391317/
Signed-off-by: Christian König <christian.koenig@amd.com>
3 years agodrm/panfrost: add Amlogic GPU integration quirks
Neil Armstrong [Wed, 16 Sep 2020 15:01:47 +0000 (17:01 +0200)]
drm/panfrost: add Amlogic GPU integration quirks

This adds the required GPU quirks, including the quirk in the PWR
registers at the GPU reset time and the IOMMU quirk for shareability
issues observed on G52 in Amlogic G12B SoCs.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200916150147.25753-4-narmstrong@baylibre.com