OSDN Git Service

uclinux-h8/linux.git
4 years agodrm/mm: Break long searches in fragmented address spaces
Chris Wilson [Fri, 7 Feb 2020 15:17:20 +0000 (15:17 +0000)]
drm/mm: Break long searches in fragmented address spaces

We try hard to select a suitable hole in the drm_mm first time. But if
that is unsuccessful, we then have to look at neighbouring nodes, and
this requires traversing the rbtree. Walking the rbtree can be slow
(much slower than a linear list for deep trees), and if the drm_mm has
been purposefully fragmented our search can be trapped for a long, long
time. For non-preemptible kernels, we need to break up long CPU bound
sections by manually checking for cond_resched(); similarly we should
also bail out if we have been told to terminate. (In an ideal world, we
would break for any signal, but we need to trade off having to perform
the search again after ERESTARTSYS, which again may form a trap of
making no forward progress.)

Reported-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200207151720.2812125-1-chris@chris-wilson.co.uk
4 years agodrm/bridge/mhl.h: Replace zero-length array with flexible-array member
Gustavo A. R. Silva [Thu, 5 Mar 2020 11:00:11 +0000 (05:00 -0600)]
drm/bridge/mhl.h: Replace zero-length array with flexible-array member

The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200305110011.GA21056@embeddedor
4 years agodrm/vc4/vc4_drv.h: Replace zero-length array with flexible-array member
Gustavo A. R. Silva [Thu, 5 Mar 2020 10:57:07 +0000 (04:57 -0600)]
drm/vc4/vc4_drv.h: Replace zero-length array with flexible-array member

The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200305105707.GA19261@embeddedor
4 years agodrm/gma500/intel_bios.h: Replace zero-length array with flexible-array member
Gustavo A. R. Silva [Thu, 5 Mar 2020 10:53:06 +0000 (04:53 -0600)]
drm/gma500/intel_bios.h: Replace zero-length array with flexible-array member

The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200305105306.GA18788@embeddedor
4 years agodrm/vblank: Fix documentation of VBLANK timestamp helper
Thomas Zimmermann [Tue, 3 Mar 2020 07:31:35 +0000 (08:31 +0100)]
drm/vblank: Fix documentation of VBLANK timestamp helper

Per-CRTC VBLANK information used to be addressed by device and pipe
index. A call drm_crtc_vblank_helper_get_vblank_timestamp_internal()
receives a pointer to the CRTC instead. Fix the documentation.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reported-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Fixes: f1e2b6371c12 ("drm: Add get_scanout_position() to struct drm_crtc_helper_funcs")
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
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/20200303073135.10605-1-tzimmermann@suse.de
4 years agodrm/simple-kms: Fix documentation for drm_simple_encoder_init()
Thomas Zimmermann [Wed, 4 Mar 2020 14:53:12 +0000 (15:53 +0100)]
drm/simple-kms: Fix documentation for drm_simple_encoder_init()

Brings the documentation of drm_simple_encoder_init() in sync with the
function's signature. Also add a paragraph clarifying the management of
the encoder's memory.

v2:
* document memory management

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Fixes: 63170ac6f2e8 ("drm/simple-kms: Add drm_simple_encoder_{init,create}()")
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
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/20200304145312.26458-1-tzimmermann@suse.de
4 years agodrm/panel: add panel driver for Elida KD35T133 panels
Heiko Stuebner [Sat, 29 Feb 2020 15:15:06 +0000 (16:15 +0100)]
drm/panel: add panel driver for Elida KD35T133 panels

Panel driver for the KD35T133 display from Elida, used for example
in the rk3326-based Odroid Go Advance handheld.

changes in v3:
- add missing return value assignment (Francesco)
- re-sort header includes (Sam)
changes in v2:
- rename dsi_generic_write_seq macro to dsi_dcs_write_seq to honor
  the underlying mipi_dsi_dcs_write (Robin)

Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200229151506.750242-3-heiko@sntech.de
4 years agodt-bindings: display: panel: Add binding document for Elida KD35T133
Heiko Stuebner [Sat, 29 Feb 2020 15:15:05 +0000 (16:15 +0100)]
dt-bindings: display: panel: Add binding document for Elida KD35T133

The KD35T133 is a 3.5" 320x480 DSI display used in the RK3326-based
Odroid Go Advance handheld device.

Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200229151506.750242-2-heiko@sntech.de
4 years agodrm/v3d: Replace wait_for macros to remove use of msleep
James Hughes [Mon, 17 Feb 2020 15:31:45 +0000 (15:31 +0000)]
drm/v3d: Replace wait_for macros to remove use of msleep

The wait_for macro's for Broadcom V3D driver used msleep, which is
inappropriate due to its inaccuracy at low values (minimum wait time
is about 30ms on the Raspberry Pi).  This sleep was triggering in
v3d_clean_caches(), causing us to only be able to dispatch ~33 compute
jobs per second.

This patch replaces the macro with the one from the Intel i915 version
which uses usleep_range to provide more accurate waits.

v2: Split from the vc4 patch so that we can confidently apply to
    stable (by anholt)

Signed-off-by: James Hughes <james.hughes@raspberrypi.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200217153145.13780-1-james.hughes@raspberrypi.com
Link: https://github.com/raspberrypi/linux/issues/3460
Fixes: 57692c94dcbe ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+")

4 years agodrm/vc4: Replace wait_for macros to remove use of msleep
James Hughes [Mon, 17 Feb 2020 15:31:45 +0000 (15:31 +0000)]
drm/vc4: Replace wait_for macros to remove use of msleep

The wait_for macro's for Broadcom VC4 driver used msleep, which is
inappropriate due to its inaccuracy at low values (minimum wait time
is about 30ms on the Raspberry Pi).  This sleep was triggering in
v3d_clean_caches(), causing us to only be able to dispatch ~33 compute
jobs per second.

This patch replaces the macro with the one from the Intel i915 version
which uses usleep_range to provide more accurate waits.

v2: Split from the v3d patch in case this tickles modesetting bugs (by
    anholt)

Signed-off-by: James Hughes <james.hughes@raspberrypi.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200217153145.13780-1-james.hughes@raspberrypi.com
4 years agoMerge drm/drm-next into drm-misc-next
Maxime Ripard [Wed, 4 Mar 2020 07:56:28 +0000 (08:56 +0100)]
Merge drm/drm-next into drm-misc-next

Daniel needs a few commits from drm-next.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
4 years agodrm/hdcp: fix DRM_HDCP_2_KSV_COUNT_2_LSBITS
Ramalingam C [Wed, 12 Feb 2020 10:29:39 +0000 (15:59 +0530)]
drm/hdcp: fix DRM_HDCP_2_KSV_COUNT_2_LSBITS

Need to extract the 2 most significant bits from a byte for constructing
the revoked KSV count of the SRM.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Reviewed-by: Anshuman Gupta <anshuman.gupta@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200212102942.26568-3-ramalingam.c@intel.com
4 years agodrm/hdcp: optimizing the srm handling
Ramalingam C [Wed, 12 Feb 2020 10:29:38 +0000 (15:59 +0530)]
drm/hdcp: optimizing the srm handling

As we are not using the sysfs infrastructure anymore, link to it is
removed. And global srm data and mutex to protect it are removed,
with required handling at revocation check function.

v2:
  srm_data is dropped and few more comments are addressed.
v3:
  ptr passing around is fixed with functional testing.
v4:
  fix htmldoc [lkp]

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Suggested-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Sean Paul <sean@poorly.run>
Link: https://patchwork.freedesktop.org/patch/msgid/20200212102942.26568-2-ramalingam.c@intel.com
4 years agovideo: Replace zero-length array with flexible-array member
Gustavo A. R. Silva [Fri, 21 Feb 2020 16:00:05 +0000 (10:00 -0600)]
video: Replace zero-length array with flexible-array member

The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200221160005.GA13552@embeddedor
4 years agovideo: fbdev: radeon: Remove dead code
Souptick Joarder [Tue, 18 Feb 2020 16:15:56 +0000 (21:45 +0530)]
video: fbdev: radeon: Remove dead code

This is dead code since 3.15 and can be removed if not
going to be useful further.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1582042556-21555-1-git-send-email-jrdr.linux@gmail.com
4 years agofbdev: simplefb: Platform data shan't include kernel.h
Andy Shevchenko [Tue, 4 Feb 2020 16:21:14 +0000 (18:21 +0200)]
fbdev: simplefb: Platform data shan't include kernel.h

Replace with appropriate types.h.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200204162114.28937-1-andriy.shevchenko@linux.intel.com
4 years agomatroxfb: add Matrox MGA-G200eW board support
Rich Felker [Sat, 25 Jan 2020 19:55:06 +0000 (14:55 -0500)]
matroxfb: add Matrox MGA-G200eW board support

It's needed to support the onboard video on my Spectre-free
Atom S1260 server board.

Signed-off-by: Rich Felker <dalias@libc.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
[b.zolnierkie: patch description fixup]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200125195506.GA16638@brightrain.aerifal.cx
4 years agovideo: fbdev: atyfb: remove set but not used variable 'mach64RefFreq'
yu kuai [Mon, 20 Jan 2020 06:33:27 +0000 (14:33 +0800)]
video: fbdev: atyfb: remove set but not used variable 'mach64RefFreq'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/video/fbdev/aty/mach64_gx.c: In function ‘aty_var_to_pll_8398’:
drivers/video/fbdev/aty/mach64_gx.c:621:36: warning: variable
‘mach64RefFreq’ set but not used [-Wunused-but-set-variable]

It is never used, and so can be removed.

Signed-off-by: yu kuai <yukuai3@huawei.com>
Cc: zhengbin <zhengbin13@huawei.com>
Cc: yi.zhang <yi.zhang@huawei.com>
[b.zolnierkie: minor patch summary fixup]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200120063327.43548-1-yukuai3@huawei.com
4 years agovideo: fbdev: kyrofb: remove set but not used variable 'ulScaleRight'
yu kuai [Sun, 19 Jan 2020 12:19:45 +0000 (20:19 +0800)]
video: fbdev: kyrofb: remove set but not used variable 'ulScaleRight'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/video/fbdev/kyro/STG4000OverlayDevice.c: In function
‘SetOverlayViewPort’:
drivers/video/fbdev/kyro/STG4000OverlayDevice.c:334:19: warning:
variable ‘ulScaleRight’ set but not used [-Wunused-but-set-variable]

It is never used, and so can be removed.

Signed-off-by: yu kuai <yukuai3@huawei.com>
Cc: zhengbin <zhengbin13@huawei.com>
Cc: yi.zhang <yi.zhang@huawei.com>
[b.zolnierkie: minor patch summary fixup]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200119121945.12517-1-yukuai3@huawei.com
4 years agovideo: fbdev: radeonfb: remove set but not used variable 'bytpp'
yu kuai [Sun, 19 Jan 2020 12:17:30 +0000 (20:17 +0800)]
video: fbdev: radeonfb: remove set but not used variable 'bytpp'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/video/fbdev/aty/radeon_base.c: In function
‘radeonfb_set_par’:
drivers/video/fbdev/aty/radeon_base.c:1660:32: warning:
variable ‘bytpp’ set but not used [-Wunused-but-set-variable]

It is never used, and so can be removed.

Signed-off-by: yu kuai <yukuai3@huawei.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: zhengbin <zhengbin13@huawei.com>
Cc: yi.zhang <yi.zhang@huawei.com>
[b.zolnierkie: minor patch summary fixup]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200119121730.10701-5-yukuai3@huawei.com
4 years agovideo: fbdev: radeonfb: remove set but not used variable '‘cSync’'
yu kuai [Sun, 19 Jan 2020 12:17:29 +0000 (20:17 +0800)]
video: fbdev: radeonfb: remove set but not used variable '‘cSync’'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/video/fbdev/aty/radeon_base.c: In function
‘radeonfb_set_par’:
drivers/video/fbdev/aty/radeon_base.c:1653:48: warning: variable
‘cSync’ set but not used [-Wunused-but-set-variable]

It is never used, and so can be removed.

Signed-off-by: yu kuai <yukuai3@huawei.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: zhengbin <zhengbin13@huawei.com>
Cc: yi.zhang <yi.zhang@huawei.com>
[b.zolnierkie: patch summary fixups]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200119121730.10701-4-yukuai3@huawei.com
4 years agovideo: fbdev: radeonfb: remove set but not used variable 'vSyncPol'
yu kuai [Sun, 19 Jan 2020 12:17:28 +0000 (20:17 +0800)]
video: fbdev: radeonfb: remove set but not used variable 'vSyncPol'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/video/fbdev/aty/radeon_base.c: In function
‘radeonfb_set_par’:
drivers/video/fbdev/aty/radeon_base.c:1653:38: warning: variable
‘vSyncPol’ set but not used [-Wunused-but-set-variable]

It is never used, and so can be removed.

Signed-off-by: yu kuai <yukuai3@huawei.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: zhengbin <zhengbin13@huawei.com>
Cc: yi.zhang <yi.zhang@huawei.com>
[b.zolnierkie: minor patch summary fixup]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200119121730.10701-3-yukuai3@huawei.com
4 years agovideo: fbdev: radeonfb: remove set but not used variable 'hSyncPol'
yu kuai [Sun, 19 Jan 2020 12:17:27 +0000 (20:17 +0800)]
video: fbdev: radeonfb: remove set but not used variable 'hSyncPol'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/video/fbdev/aty/radeon_base.c: In function
‘radeonfb_set_par’:
drivers/video/fbdev/aty/radeon_base.c:1653:6: warning: variable
‘hSyncPol’ set but not used [-Wunused-but-set-variable]

It is never used, and so can be removed.

Signed-off-by: yu kuai <yukuai3@huawei.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: zhengbin <zhengbin13@huawei.com>
Cc: yi.zhang <yi.zhang@huawei.com>
[b.zolnierkie: minor patch summary fixup]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200119121730.10701-2-yukuai3@huawei.com
4 years agovideo: fbdev: wm8505fb: add COMPILE_TEST support
Bartlomiej Zolnierkiewicz [Thu, 16 Jan 2020 14:58:08 +0000 (15:58 +0100)]
video: fbdev: wm8505fb: add COMPILE_TEST support

Add COMPILE_TEST support to wm8505fb driver for better compile
testing coverage.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/900c16b3-9306-7d17-f467-0f98bc95416a@samsung.com
4 years agovideo: fbdev: wm8505fb: fix sparse warnings about using incorrect types
Bartlomiej Zolnierkiewicz [Thu, 16 Jan 2020 14:56:50 +0000 (15:56 +0100)]
video: fbdev: wm8505fb: fix sparse warnings about using incorrect types

Use ->screen_buffer instead of ->screen_base to fix sparse warnings.

[ Please see commit 17a7b0b4d974 ("fb.h: Provide alternate screen_base
  pointer") for details. ]

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/567cba81-5fec-4d91-f711-c0bdbfe5b513@samsung.com
4 years agovideo: fbdev: w100fb: add COMPILE_TEST support
Bartlomiej Zolnierkiewicz [Thu, 16 Jan 2020 14:53:58 +0000 (15:53 +0100)]
video: fbdev: w100fb: add COMPILE_TEST support

Add COMPILE_TEST support to w100fb driver for better compile
testing coverage.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/a929db5e-d373-7b09-ae2b-efec227f7e85@samsung.com
4 years agovideo: fbdev: w100fb: fix sparse warnings
Bartlomiej Zolnierkiewicz [Thu, 16 Jan 2020 14:53:20 +0000 (15:53 +0100)]
video: fbdev: w100fb: fix sparse warnings

* Add missing __iomem annotations where needed.
* Make w100fb_probe() static.
* Return NULL pointer (instead of using plain integer) in
  w100_get_xtal_tabl().

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/d438108a-e569-a14a-a9b1-3fefd88fcadc@samsung.com
4 years agovideo: fbdev: arcfb: add COMPILE_TEST support
Bartlomiej Zolnierkiewicz [Thu, 16 Jan 2020 14:49:07 +0000 (15:49 +0100)]
video: fbdev: arcfb: add COMPILE_TEST support

Add COMPILE_TEST support to arcfb driver for better compile
testing coverage.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/acf2cc2e-614d-f0fb-ce40-cee62bfcde4c@samsung.com
4 years agovideo: fbdev: sh_mobile_lcdcfb: add COMPILE_TEST support
Bartlomiej Zolnierkiewicz [Thu, 16 Jan 2020 14:51:57 +0000 (15:51 +0100)]
video: fbdev: sh_mobile_lcdcfb: add COMPILE_TEST support

Add COMPILE_TEST support to sh_mobile_lcdcfb driver for better compile
testing coverage.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patchwork.freedesktop.org/patch/msgid/d98fea18-b72e-6d0f-33ac-1421738bd12b@samsung.com
4 years agovideo: fbdev: sh_mobile_lcdcfb: fix sparse warnings about using incorrect types
Bartlomiej Zolnierkiewicz [Thu, 16 Jan 2020 14:51:15 +0000 (15:51 +0100)]
video: fbdev: sh_mobile_lcdcfb: fix sparse warnings about using incorrect types

Use ->screen_buffer instead of ->screen_base to fix sparse warnings.

[ Please see commit 17a7b0b4d974 ("fb.h: Provide alternate screen_base
  pointer") for details. ]

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patchwork.freedesktop.org/patch/msgid/c687dbc5-cf5a-9508-2a61-e757a1a14568@samsung.com
4 years agovideo: fbdev: pxa168fb: remove unnecessary platform_get_irq
YueHaibing [Fri, 17 Jan 2020 03:22:41 +0000 (11:22 +0800)]
video: fbdev: pxa168fb: remove unnecessary platform_get_irq

commit 640ba2444fa9 ("drivers/video/pxa168fb.c: use devm_ functions")
left behind this, it can be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200117032241.59148-1-yuehaibing@huawei.com
4 years agodrm/qxl: Use simple encoder
Thomas Zimmermann [Fri, 28 Feb 2020 08:18:28 +0000 (09:18 +0100)]
drm/qxl: Use simple encoder

The qxl driver uses an empty implementation for its encoder. Replace
the code with the generic simple encoder.

v4:
* handle errors returned from drm_simple_encoder_init()
v2:
* rebase onto new simple-encoder interface

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200228081828.18463-5-tzimmermann@suse.de
4 years agodrm/mgag200: Use simple encoder
Thomas Zimmermann [Fri, 28 Feb 2020 08:18:27 +0000 (09:18 +0100)]
drm/mgag200: Use simple encoder

The mgag200 driver uses an empty implementation for its encoder. Replace
the code with the generic simple encoder.

v4:
* print error message with drm_err()
v3:
* init pre-allocated encoder with drm_simple_encoder_init()
v2:
* rebase onto new simple-encoder interface

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200228081828.18463-4-tzimmermann@suse.de
4 years agodrm/ast: Use simple encoder
Thomas Zimmermann [Fri, 28 Feb 2020 08:18:26 +0000 (09:18 +0100)]
drm/ast: Use simple encoder

The ast driver uses an empty implementation for its encoder. Replace
the code with the generic simple encoder.

v2:
* rebase onto new simple-encoder interface

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200228081828.18463-3-tzimmermann@suse.de
4 years agodrm/simple-kms: Add drm_simple_encoder_{init,create}()
Thomas Zimmermann [Fri, 28 Feb 2020 08:18:25 +0000 (09:18 +0100)]
drm/simple-kms: Add drm_simple_encoder_{init,create}()

This patch makes the internal encoder implementation of the simple
KMS helpers available to drivers.

These simple-encoder helpers initialize an encoder with an empty
implementation. This covers the requirements of most of the existing
DRM drivers. A call to drm_simple_encoder_create() allocates and
initializes an encoder instance, a call to drm_simple_encoder_init()
initializes a pre-allocated instance.

v3:
* remove drm_simple_encoder_create(); not required yet
* provide more precise documentation
v2:
* move simple encoder to KMS helpers
* remove name argument; simplifies implementation
* don't allocate with devm_ interfaces; unsafe with DRM

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200228081828.18463-2-tzimmermann@suse.de
4 years agodrm/panel: simple: add panel-dpi support
Sam Ravnborg [Sun, 16 Feb 2020 18:15:13 +0000 (19:15 +0100)]
drm/panel: simple: add panel-dpi support

The panel-dpi compatible is a fallback that
allows the DT to specify the timing.

When matching panel-dpi expect the device tree to include the
timing information for the display-panel.

Background for this change:
There are a lot of panels and new models hits the market very often.
It is a lost cause trying to chase them all and users of new panels
will often find them in situations that the panel they ues are not
supported by the kernel.
On top of this a lot of panels are customized based on customer
specifications.

Including the panel timing in the device tree allows for a simple
way to describe the actual HW and use this description in a generic
way in the kernel.
This allows uses of proprietary panels, or panels which are not
included in the kernel, to specify the timing in the device tree
together with all the other HW descriptions.
And thus, using the device tree it is then easy to add support
for an otherwise unknown panel.

The current support expect panels that do not require any
delays for prepare/enable/disable/unprepare.

Oleksandr Suvorov replied:
I've just tested this patch on Apalis iMX6Q and Colibri iMX7D using
panel settings from the following patch:
https://lore.kernel.org/linux-arm-kernel/20200115123401.2264293-4-oleksandr.suvorov@toradex.com/

It works for me, thanks!

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Tested-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200216181513.28109-6-sam@ravnborg.org
4 years agodt-bindings: display: add data-mapping to panel-dpi
Sam Ravnborg [Sun, 16 Feb 2020 18:15:12 +0000 (19:15 +0100)]
dt-bindings: display: add data-mapping to panel-dpi

Add data-mapping property that can be used to specify
the media format used for the connection betwwen the
display controller (connector) and the panel.

v2:
  - drop lvds666 (Rob)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200216181513.28109-5-sam@ravnborg.org
4 years agodt-bindings: display: convert panel-dpi to DT schema
Sam Ravnborg [Sun, 16 Feb 2020 18:15:11 +0000 (19:15 +0100)]
dt-bindings: display: convert panel-dpi to DT schema

With panel-timing converted, now convert the single
remaining .txt user in panel/ of panel-timing to DT schema.

v2:
  - Drop Thierry as maintainer, as this is not a general panel binding
    and I have no acks.
  - Drop requirement for a panel- specific binding - "panel-dpi" is enough
  - Updated example

v3:
  - added yaml document terminator "..."
  - always require a specific binding - panel-dpi (based on feedback from Rob)
  - use "power-supply" for the supply property, and made it mandatory
    "power-supply" is the standard property for panels

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200216181513.28109-4-sam@ravnborg.org
4 years agodt-bindings: display: convert display-timings to DT schema
Sam Ravnborg [Sun, 16 Feb 2020 18:15:10 +0000 (19:15 +0100)]
dt-bindings: display: convert display-timings to DT schema

Add display-timings.yaml - that references panel-timings.yaml.
display-timings.yaml will be used for display bindings
when they are converted to meta-schema format.

For now the old display-timing.txt points to the new
display-timings.yaml - and all users are left as-is.

v2:
  - Updated native-mode description

v3:
  - Simpler "^timing" pattern (Rob)
  - timing node is of type object (Rob)
  - added display-timings to panel-common.yaml
  - added yaml document terminator "..."

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Cc: devicetree@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200216181513.28109-3-sam@ravnborg.org
4 years agodt-bindings: display: add panel-timing.yaml
Sam Ravnborg [Sun, 16 Feb 2020 18:15:09 +0000 (19:15 +0100)]
dt-bindings: display: add panel-timing.yaml

Add meta-schema variant of panel-timing and
reference it from panel-common.yaml.

Part of this came form other files with other
licenses - original commits:

commit cc3f414cf2e4 ("video: add of helper for display timings/videomode")
commit 86f46565dff3 ("dt-bindings: display: display-timing: Add property to configure sync drive edge")
commit 9cad9c95d7e8 ("Documentation: DocBook DRM framework documentation")

The original authors acked the license change to:
(GPL-2.0-only OR BSD-2-Clause)

v2:
  - Got OK from original authors for re-license
    Huge thanks for the quick replies!
  - Typo fixes (Oleksandr)
  - Drop -array variant when not needed (Maxime)
  - Replace oneOf:... with enum (Maxime)
  - Drop type from clock-frequency (Rob)
  - Drop "|" when not needed (Rob)

v3:
  - Added comment to acks that are only for the license change
  - Add yaml document terminator "..."
  - Updated description (removed reference to native-mode)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [license change]
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> [license change]
Acked-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> [license change]
Acked-by: Philipp Zabel <p.zabel@pengutronix.de> [license change]
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: devicetree@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200216181513.28109-2-sam@ravnborg.org
4 years agodrm/panel: Add driver for Novatek NT35510-based panels
Linus Walleij [Sun, 23 Feb 2020 12:18:41 +0000 (13:18 +0100)]
drm/panel: Add driver for Novatek NT35510-based panels

This adds a driver for panels based on the Novatek NT35510
display driver IC, such as the Hydis HVA40WV1 panel found
in the Samsung GT-S7710.

The NT35510 can be used with both internal and external
backlight (such as GPIO backlight) so we support both:
if no external backlight is found, we register a subdriver
for the internal backlight.

Cc: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200223121841.26836-3-linus.walleij@linaro.org
4 years agodrm/panel: Add DT bindings for Novatek NT35510-based panels
Linus Walleij [Sun, 23 Feb 2020 12:18:40 +0000 (13:18 +0100)]
drm/panel: Add DT bindings for Novatek NT35510-based panels

This adds device tree bindings for the Novatek NT35510-based
family of panels. Since several such panels are in existence
we define bindings common for all, and define the compatible
string for one certain panel (Hydis HVA40WV1).

As other panels are discovered and investigated, we can add
more compatibles to the binding using oneOf constructions.

Cc: Stephan Gerhold <stephan@gerhold.net>
Cc: devicetree@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200223121841.26836-2-linus.walleij@linaro.org
4 years agodt-bindings: Add vendor prefix for Hydis technologies
Linus Walleij [Sun, 23 Feb 2020 12:18:39 +0000 (13:18 +0100)]
dt-bindings: Add vendor prefix for Hydis technologies

This vendor has produced a number of display panels,
including HVA40WV1.

Cc: devicetree@vger.kernel.org
Cc: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200223121841.26836-1-linus.walleij@linaro.org
4 years agodrm: prevent a harmless integer overflow in drm_legacy_sg_alloc()
Dan Carpenter [Fri, 28 Feb 2020 09:23:21 +0000 (12:23 +0300)]
drm: prevent a harmless integer overflow in drm_legacy_sg_alloc()

There is an integer overflow when we round up to PAGE_SIZE, but it's
harmless because we never re-use "request->size" for anything meaningful.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200228092321.axulddmkxrujkmas@kili.mountain
4 years agodrm/client: Dual licence the file in GPL-2 and MIT
Emmanuel Vadot [Sat, 15 Feb 2020 18:09:10 +0000 (19:09 +0100)]
drm/client: Dual licence the file in GPL-2 and MIT

Contributors for this file are :
Chris Wilson <chris@chris-wilson.co.uk>
Denis Efremov <efremov@linux.com>
Jani Nikula <jani.nikula@intel.com>
Maxime Ripard <mripard@kernel.org>
Noralf Trønnes <noralf@tronnes.org>
Sam Ravnborg <sam@ravnborg.org>
Thomas Zimmermann <tzimmermann@suse.de>

Acked-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Denis Efremov <efremov@linux.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Emmanuel Vadot <manu@FreeBSD.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200215180911.18299-2-manu@FreeBSD.org
4 years agodrm/tidss: Drop pointless static qualifier in dispc_find_csc()
YueHaibing [Thu, 27 Feb 2020 06:50:57 +0000 (06:50 +0000)]
drm/tidss: Drop pointless static qualifier in dispc_find_csc()

There is no need to have the 'const struct dispc_csc_coef *coef'
variable static since new value always be assigned before use it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Jyri Sarha <jsarha@ti.com>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200227065057.92766-1-yuehaibing@huawei.com
4 years agodrm/tidss: fix spelling mistakes "bufer" and "requsted"
Colin Ian King [Mon, 24 Feb 2020 17:42:26 +0000 (17:42 +0000)]
drm/tidss: fix spelling mistakes "bufer" and "requsted"

There are two spelling mistakes in warning and debug messages.
Fix them.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Jyri Sarha <jsarha@ti.com>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200224174226.387874-1-colin.king@canonical.com
4 years agodrm/tidss: Use drm_for_each_bridge_in_chain()
Laurent Pinchart [Sat, 22 Feb 2020 11:07:18 +0000 (13:07 +0200)]
drm/tidss: Use drm_for_each_bridge_in_chain()

Replace the manual encoder->bridge_chain walk with the
drm_for_each_bridge_in_chain() macro. Drivers should not touch the
bridge_chain field directly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jyri Sarha <jsarha@ti.com>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200222110718.26272-1-laurent.pinchart@ideasonboard.com
4 years agodrm/tidss: dispc: Fix broken plane positioning code
Jyri Sarha [Thu, 27 Feb 2020 12:00:52 +0000 (14:00 +0200)]
drm/tidss: dispc: Fix broken plane positioning code

The old implementation of placing planes on the CRTC while configuring
the planes was naive and relied on the order in which the planes were
configured, enabled, and disabled. The situation where a plane's zpos
was changed on the fly was completely broken. The usual symptoms of
this problem was scrambled display and a flood of sync lost errors,
when a plane was active in two layers at the same time, or a missing
plane, in case when a layer was accidentally disabled.

The rewrite takes a more straight forward approach when HW is
concerned. The plane positioning registers are in the CRTC (or
actually OVR) register space and it is more natural to configure them
in a one go when configuring the CRTC. To do this we need make sure we
have all the planes on the updated CRTCs in the new atomic state. The
untouched planes on CRTCs that need plane position update are added to
the atomic state in tidss_atomic_check().

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200227120052.23168-1-jsarha@ti.com
4 years agodrm/dp_mst: Check crc4 value while building sideband message
Benjamin Gaignard [Mon, 3 Feb 2020 12:16:20 +0000 (13:16 +0100)]
drm/dp_mst: Check crc4 value while building sideband message

Check that computed crc value is matching the one encoded in the message.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200203121620.9002-1-benjamin.gaignard@st.com
4 years agodrm/dp_mst: Fix W=1 warnings
Benjamin Gaignard [Wed, 5 Feb 2020 08:48:42 +0000 (09:48 +0100)]
drm/dp_mst: Fix W=1 warnings

Fix the warnings that show up with W=1.
They are all about unused but set variables.
If functions returns are not used anymore make them void.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200205084842.5642-1-benjamin.gaignard@st.com
4 years agoMerge tag 'drm-misc-next-2020-02-27' of git://anongit.freedesktop.org/drm/drm-misc...
Dave Airlie [Fri, 28 Feb 2020 06:21:14 +0000 (16:21 +1000)]
Merge tag 'drm-misc-next-2020-02-27' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for 5.7

UAPI Changes:

Cross-subsystem Changes:

Core Changes:
  - bridge: huge rework to get rid of omap_dss custom display drivers

Driver Changes:
  - hisilicon: some fixes related to modes it can deal with / default to
  - virtio: shmem and gpu context fixes and enhancements
  - sun4i: Support for LVDS on the A33

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200227113222.cdwzy4cvcqjtbmou@gilmour.lan
4 years agoMerge tag 'amd-drm-next-5.7-2020-02-26' of git://people.freedesktop.org/~agd5f/linux...
Dave Airlie [Fri, 28 Feb 2020 05:40:26 +0000 (15:40 +1000)]
Merge tag 'amd-drm-next-5.7-2020-02-26' of git://people.freedesktop.org/~agd5f/linux into drm-next

amd-drm-next-5.7-2020-02-26:

amdgpu:
- Rework VM update handling in preparation for HMM support
- HDCP srm support
- PSR fixes
- DC watermark fixes
- OLED panel support
- SR-IOV fixes
- BACO fixes
- Optimize debugging vram access
- RAS fixes
- Use BACO for runtime pm
- HDCP fixes
- XGMI fixes
- DDC fixes
- DC clock programming optimizations and fixes
- PSP fw loading sequence updates
- Drop DRIVER_USE_AGP
- Remove legacy drm load and unload callbacks

amdkfd:
- Add runtime pm support

radeon:
- Drop DRIVER_USE_AGP

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200227043142.4075-1-alexander.deucher@amd.com
4 years agodrm/panfrost: default_supplies[] can be static
kbuild test robot [Thu, 27 Feb 2020 01:41:46 +0000 (09:41 +0800)]
drm/panfrost: default_supplies[] can be static

Fixes: 3e1399bccf51 ("drm/panfrost: Add support for multiple regulators")
Signed-off-by: kbuild test robot <lkp@intel.com>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200227014100.GA61938@e50d7db646c3
4 years agodma-buf: make move_notify mandatory if importer_ops are provided
Christian König [Wed, 19 Feb 2020 12:32:43 +0000 (13:32 +0100)]
dma-buf: make move_notify mandatory if importer_ops are provided

This makes the move_notify callback mandatory when the importer_ops are
provided. Since amdgpu is now migrated it doesn't make much sense
anymore to allow this.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/353995/?series=73646&rev=1
4 years agodma-buf: drop dynamic_mapping flag
Christian König [Tue, 18 Feb 2020 15:57:24 +0000 (16:57 +0100)]
dma-buf: drop dynamic_mapping flag

Instead use the pin() callback to detect dynamic DMA-buf handling.
Since amdgpu is now migrated it doesn't make much sense to keep
the extra flag.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/353997/?series=73646&rev=1
4 years agodrm/amdgpu: implement amdgpu_gem_prime_move_notify v2
Christian König [Thu, 7 Jun 2018 08:28:47 +0000 (10:28 +0200)]
drm/amdgpu: implement amdgpu_gem_prime_move_notify v2

Implement the importer side of unpinned DMA-buf handling.

v2: update page tables immediately

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/353998/?series=73646&rev=1
4 years agodrm/amdgpu: add amdgpu_dma_buf_pin/unpin v2
Christian König [Wed, 30 May 2018 12:42:24 +0000 (14:42 +0200)]
drm/amdgpu: add amdgpu_dma_buf_pin/unpin v2

This implements the exporter side of unpinned DMA-buf handling.

v2: fix minor coding style issues

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/353999/?series=73646&rev=1
4 years agodrm/amdgpu: use allowed_domains for exported DMA-bufs
Christian König [Mon, 6 May 2019 14:35:26 +0000 (16:35 +0200)]
drm/amdgpu: use allowed_domains for exported DMA-bufs

Avoid that we ping/pong the buffers when we stop to pin DMA-buf
exports by using the allowed domains for exported buffers.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/353996/?series=73646&rev=1
4 years agodrm/ttm: remove the backing store if no placement is given
Christian König [Thu, 15 Mar 2018 15:48:20 +0000 (16:48 +0100)]
drm/ttm: remove the backing store if no placement is given

Pipeline removal of the BOs backing store when no placement is given
during validation.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/353994/?series=73646&rev=1
4 years agodma-buf: add dynamic DMA-buf handling v15
Christian König [Tue, 3 Jul 2018 14:42:26 +0000 (16:42 +0200)]
dma-buf: add dynamic DMA-buf handling v15

On the exporter side we add optional explicit pinning callbacks. Which are
called when the importer doesn't implement dynamic handling, move notification
or need the DMA-buf locked in place for its use case.

On the importer side we add an optional move_notify callback. This callback is
used by the exporter to inform the importers that their mappings should be
destroyed as soon as possible.

This allows the exporter to provide the mappings without the need to pin
the backing store.

v2: don't try to invalidate mappings when the callback is NULL,
    lock the reservation obj while using the attachments,
    add helper to set the callback
v3: move flag for invalidation support into the DMA-buf,
    use new attach_info structure to set the callback
v4: use importer_priv field instead of mangling exporter priv.
v5: drop invalidation_supported flag
v6: squash together with pin/unpin changes
v7: pin/unpin takes an attachment now
v8: nuke dma_buf_attachment_(map|unmap)_locked,
    everything is now handled backward compatible
v9: always cache when export/importer don't agree on dynamic handling
v10: minimal style cleanup
v11: drop automatically re-entry avoidance
v12: rename callback to move_notify
v13: add might_lock in appropriate places
v14: rebase on separated locking change
v15: add EXPERIMENTAL flag, some more code comments

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/353993/?series=73646&rev=1
4 years agodrm/panel: simple: Add NewEast Optoelectronics CO., LTD WJFH116008A panel support
Vasily Khoruzhick [Wed, 26 Feb 2020 08:10:10 +0000 (00:10 -0800)]
drm/panel: simple: Add NewEast Optoelectronics CO., LTD WJFH116008A panel support

This commit adds support for the NewEast Optoelectronics CO., LTD
WJFH116008A 11.6" 1920x1080 TFT LCD panel.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200226081011.1347245-6-anarsoul@gmail.com
4 years agodt-bindings: display: simple: Add NewEast Optoelectronics WJFH116008A compatible
Vasily Khoruzhick [Wed, 26 Feb 2020 08:10:09 +0000 (00:10 -0800)]
dt-bindings: display: simple: Add NewEast Optoelectronics WJFH116008A compatible

This commit adds compatible for NewEast Optoelectronics WJFH116008A panel
to panel-simple binding

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200226081011.1347245-5-anarsoul@gmail.com
4 years agodt-bindings: Add Guangdong Neweast Optoelectronics CO. LTD vendor prefix
Vasily Khoruzhick [Wed, 26 Feb 2020 08:10:08 +0000 (00:10 -0800)]
dt-bindings: Add Guangdong Neweast Optoelectronics CO. LTD vendor prefix

Add vendor prefix for Guangdong Neweast Optoelectronics CO. LTD

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200226081011.1347245-4-anarsoul@gmail.com
4 years agodrm/bridge: anx6345: don't print error message if regulator is not ready
Vasily Khoruzhick [Wed, 26 Feb 2020 08:10:07 +0000 (00:10 -0800)]
drm/bridge: anx6345: don't print error message if regulator is not ready

We don't want to print scary message if devm_regulator_get() returns
-EPROBE_DEFER

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200226081011.1347245-3-anarsoul@gmail.com
4 years agodrm/virtio: add virtio_gpu_is_shmem helper
Gurchetan Singh [Thu, 27 Feb 2020 00:25:55 +0000 (16:25 -0800)]
drm/virtio: add virtio_gpu_is_shmem helper

The plan is use have both shmem and virtual "vram" running
side-by-side in virtio-gpu. It looks like we'll eventually use
struct drm_gem_object as a base class, and we'll need to convert
to shmem and vram objects on the fly. As a first step, add a
virtio_gpu_is_shmem helper. Thanks to kraxel for suggesting this
approach on Gitlab.

Suggested-by: Gerd Hoffman <kraxel@redhat.com>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20200227002601.745-3-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
4 years agodrm/virtio: make mmap callback consistent with callbacks
Gurchetan Singh [Thu, 27 Feb 2020 00:25:54 +0000 (16:25 -0800)]
drm/virtio: make mmap callback consistent with callbacks

This is a very, very minor cleanup.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20200227002601.745-2-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
4 years agodrm/hisilicon: Fixed pcie resource conflict between drm and firmware
Tian Tao [Mon, 24 Feb 2020 06:01:52 +0000 (14:01 +0800)]
drm/hisilicon: Fixed pcie resource conflict between drm and firmware

use the drm_fb_helper_remove_conflicting_pci_framebuffer to remove
the framebuffer initialized by fireware/bootloader to avoid resource
conflict.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1582524112-5628-1-git-send-email-tiantao6@hisilicon.com
4 years agodrm/hisilicon: Set preferred mode resolution and maximum resolution
Tian Tao [Wed, 19 Feb 2020 02:51:47 +0000 (10:51 +0800)]
drm/hisilicon: Set preferred mode resolution and maximum resolution

set the preferred mode resolution to 1024 * 768 and maximum
resolution to 1920 * 1200.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Gong junjie <gongjunjie2@huawei.com>
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1582080707-18825-1-git-send-email-tiantao6@hisilicon.com
4 years agodrm/hisilicon: Add the mode_valid function
Tian Tao [Wed, 8 Jan 2020 09:41:41 +0000 (17:41 +0800)]
drm/hisilicon: Add the mode_valid function

add mode_valid function, we can make sure the resolution is valid.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Gong junjie <gongjunjie2@huawei.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1578476501-45807-1-git-send-email-tiantao6@hisilicon.com
4 years agodrm/hisilicon: fixed the wrong resolution configurations
Tian Tao [Fri, 3 Jan 2020 03:55:56 +0000 (11:55 +0800)]
drm/hisilicon: fixed the wrong resolution configurations

The maximum resolution supported by hibmc is 1920 * 1200 instead of
1920 * 1440, this patch fixed this problem

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Gong junjie <gongjunjie2@huawei.com>
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1578023756-46567-1-git-send-email-tiantao6@hisilicon.com
4 years agodrm/hisilicon: Enable the shadowfb for hibmc
Tian Tao [Sat, 11 Jan 2020 03:09:06 +0000 (11:09 +0800)]
drm/hisilicon: Enable the shadowfb for hibmc

set the prefer_shadow as 1,so we use the shadowfb to acceleration.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Gong junjie <gongjunjie2@huawei.com>
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1578712146-16327-1-git-send-email-tiantao6@hisilicon.com
4 years agodrm/hisilicon: Add new clock/resolution configurations
Tian Tao [Tue, 31 Dec 2019 06:42:51 +0000 (14:42 +0800)]
drm/hisilicon: Add new clock/resolution configurations

Add the three new pll config for corresponding resolution 1440x900 and
1600x900, 640x480 for hibmc

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Gong junjie <gongjunjie2@huawei.com>
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1577774571-60493-1-git-send-email-tiantao6@hisilicon.com
4 years agoMerge tag 'drm-intel-next-2020-02-25' of git://anongit.freedesktop.org/drm/drm-intel...
Dave Airlie [Wed, 26 Feb 2020 22:59:19 +0000 (08:59 +1000)]
Merge tag 'drm-intel-next-2020-02-25' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

- A backmerge of drm-next solving conflicts on i915/gt/intel_lrc.c
- Clean up shadow batch after I915_EXEC_SECURE
- Drop assertion that active->fence is unchanged

Here goes drm-intel-next-2020-02-25:
- A backmerge of drm-next solving conflicts on i915/gt/intel_lrc.c
- Clean up shadow batch after I915_EXEC_SECURE
- Drop assertion that active->fence is unchanged
drm-intel-next-2020-02-24-1:
- RC6 fixes - Chris
- Add extra slice common debug register - Lionel
- Align virtual engines uabi_class/instance with i915_drm.h - Tvrtko
- Avoid potential division by zero in computing CS timestamp - Chris
- Avoid using various globals - Michal Winiarski, Matt Auld
- Break up long lists of GEM object reclaim - Chris
- Check that the vma hasn't been closed before we insert it - Chris
- Consolidate SDVO HDMI force_dvi handling - Ville
- Conversion to new logging and warn macros and functions - Pankaj, Wambul, Chris
- DC3CO fixes - Jose
- Disable use of hwsp_cacheline for kernel_context - Chris
- Display IRQ pre/post uninstall refactor - Jani
- Display port sync refactor for robustness and fixes - Ville, Manasi
- Do not attempt to reprogram IA/ring frequencies for dgfx - Chris
- Drop alpha_support for good in favor of force_probe - Jani
- DSI ACPI related fixes and refactors - Vivek, Jani, Rajat
- Encoder refactor for flexibility to add more information, especiallly DSI related - Jani, Vandita
- Engine workarounds refactor for robustness around resue - Daniele
- FBC simplification and tracepoints
- Various fixes for build - Jani, Kees Cook, Chris, Zhang Xiaoxu
- Fix cmdparser - Chris
- Fix DRM_I915_GEM_MMAP_OFFFSET - Chris
- Fix i915_request flags - Chris
- Fix inconsistency between pfit enable and scaler freeing - Stanislav
- Fix inverted warn_on on display code - Chris
- Fix modeset locks in sanitize_watermarks - Ville
- Fix OA context id overlap with idle context id - Umesh
- Fix pipe and vblank enable for MST - Jani
- Fix VBT handling for timing parameters - Vandita
- Fixes o kernel doc - Chris, Ville
- Force full modeset whenever DSC is enabled at probe - Jani
- Various GEM locking simplification and fixes - Jani , Chris, Jose
  - Including some changes in preparation for making GEM execbuf parallel - Chris
- Gen11 pcode error codes - Matt Roper
- Gen8+ interrupt handler refactor - Chris
- Many fixes and improvements around GuC code - Daniele, Michal Wajdeczko
- i915 parameters improvements sfor flexible input and better debugability - Chris, Jani
- Ice Lake and Elkhart Lake Fixes and workarounds - Matt Roper, Jose, Vivek, Matt Atwood
- Improvements on execlists, requests and other areas, fixing hangs and also
  improving hang detection, recover and debugability - Chris
  - Also introducing offline GT error capture - Chris
- Introduce encoder->compute_config_late() to help MST - Ville
- Make dbuf configuration const - Jani
- Few misc clean ups - Ville, Chris
- Never allow userptr into the new mapping types - Janusz
- Poison rings after use and GTT scratch pages - Chris
- Protect signaler walk with RCU - Chris
- PSR fixes - Jose
- Pull sseu context updates under gt - Chris
- Read rawclk_freq earlier - Chris
- Refactor around VBT handling to allow geting information through the encoder - Jani
- Refactor l3cc/mocs availability - Chris
- Refactor to use intel_connector over drm_connector - Ville
- Remove i915_energy_uJ from debugfs - Tvrtko
- Remove lite restore defines - Mika Kuoppala
- Remove prefault_disable modparam - Chris
- Many selftests fixes and improvements - Chris
- Set intel_dp_set_m_n() for MST slaves - Jose
- Simplify hot plug pin handling and other fixes around pin and polled modes - Ville
- Skip CPU synchronization on dma-buf attachments - chris
- Skip global serialization of clear_range for bxt vtd - Chris
- Skip rmw for marked register - Chris
- Some other GEM Fixes - Chris
- Some small changes for satisfying static code analysis - Colin, Chris
- Suppress warnings for unused debugging locals
- Tiger Lake enabling, including re-enable -f RPS, workarounds and other display fixes and changes - Chris, Matt Roper, Mika Kuoppala, Anshuman, Jose, Radhakrishna, Rafael.
- Track hw reported context runtime - Tvrtko
- Update bug filling URL - Jani
- Use async bind for PIN_USER into bsw/bxt ggtt - Chris
- Use the kernel_context to measuer the breadcrumb size - Chris
- Userptr fixes and robustness for big pages - Matt Auld
- Various Display refactors and clean-ups, specially around logs and use of drm_i915_private - Jani, Ville
- Various display refactors and fixes, especially around cdclk, modeset, and encoder - Chris, Jani
- Various eDP/DP fixes around DPCD - Lyude
- Various fixes and refactors for better Display watermark handling - Ville, Stanislav
- Various other display refactors - Ville
- Various refactor for better handling of display plane states - Ville
- Wean off drm_pci_alloc/drm_pci_free - Chris
- Correctly terminate connector iteration- Ville
- Downgrade gen7 (ivb, byt, hsw) back to aliasing-ppgtt - Chris

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200225185853.GA3282832@intel.com
4 years agoMerge tag 'drm-misc-next-2020-02-21' of git://anongit.freedesktop.org/drm/drm-misc...
Dave Airlie [Wed, 26 Feb 2020 22:38:33 +0000 (08:38 +1000)]
Merge tag 'drm-misc-next-2020-02-21' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for 5.7:

UAPI Changes:

Cross-subsystem Changes:

Core Changes:
  - crtc: Drop get_crtc callback
  - dp: Add support for DP1.4 EDID corruption test
  - edid: Improve CEA detailed timings support
  - format-helper: Move to a GPL2/MIT dual license
  - mode: Drop drm_display_mode.private
  - vblank: Convert drm-driver vblank related code to CRTC equivalents and
    cleanup the core.
  - drm_global_mutex reworks

Driver Changes:
  - hibmc: Add gamma_set support and improve DPMS support
  - pl111: Support Integrator IM-PD1
  - sun4i: LVDS support for the A20, improvements to panel handling in DSI
  - virtio: job batching improvements, mem handling code rework
  - panel: Support for Rocktech RK101II01D-CT
  - bridge: Support for ADV7535, tc358768, improvements to ti-sn65dsi86

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200221100928.anipic2v7q5wswkb@gilmour.lan
4 years agodrm/amdgpu: drop legacy drm load and unload callbacks
Alex Deucher [Tue, 4 Feb 2020 18:21:52 +0000 (13:21 -0500)]
drm/amdgpu: drop legacy drm load and unload callbacks

We've moved the debugfs handling into a centralized place
so we can remove the legacy load an unload callbacks.

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/display: don't call drm_dp_mst_connector_late_register (v2)
Alex Deucher [Tue, 25 Feb 2020 18:39:44 +0000 (13:39 -0500)]
drm/amdgpu/display: don't call drm_dp_mst_connector_late_register (v2)

Nothing else calls it.  Not sure it's necessary.

v2: remove unused port variable.

Reviewed-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/display: split dp connector registration (v4)
Alex Deucher [Wed, 5 Feb 2020 15:18:04 +0000 (10:18 -0500)]
drm/amdgpu/display: split dp connector registration (v4)

Split into init and register functions to avoid a segfault
in some configs when the load/unload callbacks are removed.

v2:
- add back accidently dropped has_aux setting
- set dev in late_register

v3:
- fix dp cec ordering

v4:
- squash in kdev reference fix

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/display: add a late register connector callback
Alex Deucher [Tue, 4 Feb 2020 22:11:18 +0000 (17:11 -0500)]
drm/amdgpu/display: add a late register connector callback

To handle debugfs setup on non DP MST connectors.

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: move dpcd debugfs members setup
Alex Deucher [Tue, 4 Feb 2020 22:07:39 +0000 (17:07 -0500)]
drm/amd/display: move dpcd debugfs members setup

Into the function that creates the debugfs files rather
than setting them explicitly in the callers.

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/display: move debugfs init into core amdgpu debugfs (v2)
Alex Deucher [Tue, 25 Feb 2020 16:21:30 +0000 (11:21 -0500)]
drm/amdgpu/display: move debugfs init into core amdgpu debugfs (v2)

In order to remove the load and unload drm callbacks,
we need to reorder the init sequence to move all the drm
debugfs file handling.  Do this for display.

v2: add config guard for DC

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Harry Wentland <harry.wentland@amd.com> (v1)
Acked-by: Christian König <christian.koenig@amd.com> (v1)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: don't call drm_connector_register for non-MST ports
Alex Deucher [Tue, 4 Feb 2020 22:02:34 +0000 (17:02 -0500)]
drm/amdgpu: don't call drm_connector_register for non-MST ports

The core does this for us now.

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/ring: move debugfs init into core amdgpu debugfs
Alex Deucher [Tue, 25 Feb 2020 16:20:18 +0000 (11:20 -0500)]
drm/amdgpu/ring: move debugfs init into core amdgpu debugfs

In order to remove the load and unload drm callbacks,
we need to reorder the init sequence to move all the drm
debugfs file handling.  Do this for rings.

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/firmware: move debugfs init into core amdgpu debugfs
Alex Deucher [Tue, 4 Feb 2020 18:11:50 +0000 (13:11 -0500)]
drm/amdgpu/firmware: move debugfs init into core amdgpu debugfs

In order to remove the load and unload drm callbacks,
we need to reorder the init sequence to move all the drm
debugfs file handling.  Do this for firmware.

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/regs: move debugfs init into core amdgpu debugfs
Alex Deucher [Tue, 4 Feb 2020 18:07:31 +0000 (13:07 -0500)]
drm/amdgpu/regs: move debugfs init into core amdgpu debugfs

In order to remove the load and unload drm callbacks,
we need to reorder the init sequence to move all the drm
debugfs file handling.  Do this for register access files.

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/gem: move debugfs init into core amdgpu debugfs
Alex Deucher [Tue, 4 Feb 2020 18:04:05 +0000 (13:04 -0500)]
drm/amdgpu/gem: move debugfs init into core amdgpu debugfs

In order to remove the load and unload drm callbacks,
we need to reorder the init sequence to move all the drm
debugfs file handling.  Do this for gem.

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/fence: move debugfs init into core amdgpu debugfs
Alex Deucher [Tue, 4 Feb 2020 17:59:02 +0000 (12:59 -0500)]
drm/amdgpu/fence: move debugfs init into core amdgpu debugfs

In order to remove the load and unload drm callbacks,
we need to reorder the init sequence to move all the drm
debugfs file handling.  Do this for fence handling.

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/sa: move debugfs init into core amdgpu debugfs
Alex Deucher [Tue, 4 Feb 2020 17:55:38 +0000 (12:55 -0500)]
drm/amdgpu/sa: move debugfs init into core amdgpu debugfs

In order to remove the load and unload drm callbacks,
we need to reorder the init sequence to move all the drm
debugfs file handling.  Do this for SA (sub allocator).

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/pm: move debugfs init into core amdgpu debugfs
Alex Deucher [Tue, 4 Feb 2020 17:46:56 +0000 (12:46 -0500)]
drm/amdgpu/pm: move debugfs init into core amdgpu debugfs

In order to remove the load and unload drm callbacks,
we need to reorder the init sequence to move all the drm
debugfs file handling.  Do this for pm.

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/ttm: move debugfs init into core amdgpu debugfs
Alex Deucher [Tue, 4 Feb 2020 17:41:25 +0000 (12:41 -0500)]
drm/amdgpu/ttm: move debugfs init into core amdgpu debugfs

In order to remove the load and unload drm callbacks,
we need to reorder the init sequence to move all the drm
debugfs file handling.  Do this for ttm.

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: rename amdgpu_debugfs_preempt_cleanup
Alex Deucher [Tue, 4 Feb 2020 17:37:08 +0000 (12:37 -0500)]
drm/amdgpu: rename amdgpu_debugfs_preempt_cleanup

to amdgpu_debugfs_fini.  It will be used for other things in
the future.

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: Increase timout on emulator to tenfold instead of twice
Yong Zhao [Wed, 26 Feb 2020 00:54:53 +0000 (19:54 -0500)]
drm/amdgpu: Increase timout on emulator to tenfold instead of twice

Since emulators are slower, sometime some operations like flushing tlb
through FM need more than twice the regular timout of 100ms, so increase
the timeout to 1s on emulators.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/powerplay: add DFCstate control pptable func for arct
Hawking Zhang [Tue, 25 Feb 2020 11:46:50 +0000 (19:46 +0800)]
drm/amd/powerplay: add DFCstate control pptable func for arct

This is the callback function that is going to be invoked
when amdgpu_dpm_set_df_cstate is called to toggle DFCstate

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/powerplay: update arcturus ppsmc header to 54.15.0
Hawking Zhang [Mon, 24 Feb 2020 10:00:22 +0000 (18:00 +0800)]
drm/amd/powerplay: update arcturus ppsmc header to 54.15.0

two new smc messages added for arcturus with pmfw 54.15.0

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/display: clean up hdcp workqueue handling
Alex Deucher [Tue, 18 Feb 2020 18:20:30 +0000 (13:20 -0500)]
drm/amdgpu/display: clean up hdcp workqueue handling

Use the existence of the workqueue itself to determine when to
enable HDCP features rather than sprinkling asic checks all over
the code.  Also add a check for the existence of the hdcp
workqueue in the irq handling on the off chance we get and HPD
RX interrupt with the CP bit set.  This avoids a crash if
the driver doesn't support HDCP for a particular asic.

Fixes: 96a3b32e67236f ("drm/amd/display: only enable HDCP for DCN+")
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=206519
Reviewed-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdkfd: Delete unnecessary unmap queue package submissions
Yong Zhao [Wed, 5 Feb 2020 21:53:37 +0000 (16:53 -0500)]
drm/amdkfd: Delete unnecessary unmap queue package submissions

The previous way of using SDMA queue count to infer whether we should unmap
SDMA engines has bugs. The reason it did not cause issues is because MEC
firmware unmaps all queues (CP + SDMA) when a unmap package for compute
engine is received. Becasue of that, only one unmap queue package
is needed, instead of one unmap queue package for CP and each SDMA engine,
which results in much simpler driver code.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdkfd: Delete excessive printings
Yong Zhao [Wed, 5 Feb 2020 23:22:48 +0000 (18:22 -0500)]
drm/amdkfd: Delete excessive printings

Those printings are duplicated or useless.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdkfd: Fix a memory leak in queue creation error handling
Yong Zhao [Wed, 5 Feb 2020 22:13:54 +0000 (17:13 -0500)]
drm/amdkfd: Fix a memory leak in queue creation error handling

When the queue creation failed, some resources were not freed. Fix it.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdkfd: Count active CP queues directly
Yong Zhao [Wed, 5 Feb 2020 19:48:38 +0000 (14:48 -0500)]
drm/amdkfd: Count active CP queues directly

The previous code of calculating active CP queues is problematic if
some SDMA queues are inactive. Fix that by counting CP queues directly.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdkfd: Avoid ambiguity by indicating it's cp queue
Yong Zhao [Thu, 30 Jan 2020 23:35:23 +0000 (18:35 -0500)]
drm/amdkfd: Avoid ambiguity by indicating it's cp queue

The queues represented in queue_bitmap are only CP queues.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>