platform/kernel/linux-starfive.git
4 years agodrm/tidss: remove AM65x PG1 YUV erratum code
Tomi Valkeinen [Wed, 29 Apr 2020 12:10:22 +0000 (15:10 +0300)]
drm/tidss: remove AM65x PG1 YUV erratum code

AM65x PG1 has a HW issue with YUV pixel formats, resulting in wrong
colors on the screen. This issue is fixed in PG2 hardware.

The driver currently has code to hide YUV pixel formats from the
userspace. To support PG2, we would need to add code to detect the SoC
version and hide the YUV formats based on that.

However, as PG1 will be phased out and PG2 will be the main platform, a
much simpler solution is just to drop the code in question. The downside
is that the users will be able to use YUV formats on PG1, getting wrong
colors on the screen. On the other hand, that may also be a plus, as the
same applications will now work on PG1 and PG2, even if the colors are
wrong on PG1.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200429121022.3871-1-tomi.valkeinen@ti.com
Reviewed-by: Jyri Sarha <jsarha@ti.com>
4 years agodrm/omap: change default signal polarities and drives
Tomi Valkeinen [Fri, 17 Apr 2020 11:41:51 +0000 (14:41 +0300)]
drm/omap: change default signal polarities and drives

If the given videomode does not specify DISPLAY_FLAG_* for the specific
signal property, the driver used a default value. These defaults were
never thought through, as the expectation was that all the DISPLAY_FLAGS
are always set explicitly.

With DRM bridge and panel drivers this is not the case, and while that
issue should be resolved in the future, it's still good to have sane
signal defaults.

This patch changes the defaults to what the hardware has as reset
defaults. Also, based on my experience, I think they make sense and are
more likely correct than the defaults without this patch.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200417114151.25843-1-tomi.valkeinen@ti.com
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
4 years agodrm/panel: boe-tv101wum-n16: fine tune clock
David Lu [Tue, 28 Apr 2020 06:45:21 +0000 (14:45 +0800)]
drm/panel: boe-tv101wum-n16: fine tune clock

fix boe_tv105wum_nw0 display shift.

Signed-off-by: David Lu <david.lu@bitland.com.cn>
Fixes: 963518c12431 ("drm/panel: support for boe,tv105wum-nw0 dsi video mode panel")
Cc: David Lu <david.lu@bitland.com.cn>
Cc: Nicolas Boichat <drinkcat@chromium.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
[added fixes tag]
Link: https://patchwork.freedesktop.org/patch/msgid/20200428064521.21511-1-david.lu@bitland.com.cn
4 years agodt-bindings: display: dw_mipi_dsi.txt: convert to yaml
Adrian Ratiu [Thu, 23 Apr 2020 10:00:58 +0000 (13:00 +0300)]
dt-bindings: display: dw_mipi_dsi.txt: convert to yaml

This converts the Synopsis MIPI DSI binding documentation to yaml and
should be quite straightforward. I've added a missing ref clk and also
added Philippe as maintainer b/c he's the original txt author following
the algorithm provided in Message-ID 20200420175909.GA5810@ravnborg.org.

Cc: Philippe CORNU <philippe.cornu@st.com>
Cc: devicetree@vger.kernel.org
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200423100058.1734009-1-adrian.ratiu@collabora.com
4 years agodrm/panel: panel-simple: fix AUO G101EVN010 connector/panel type
Tomi Valkeinen [Fri, 17 Apr 2020 11:40:43 +0000 (14:40 +0300)]
drm/panel: panel-simple: fix AUO G101EVN010 connector/panel type

The AUO G101EVN010 is a 18-bit LVDS panel, not a parallel panel, as
indicated by the current bus_format.

Fix the bus_format to MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, and also set the
connector_type to LVDS.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
[updated patch subject]
Link: https://patchwork.freedesktop.org/patch/msgid/20200417114043.25381-1-tomi.valkeinen@ti.com
4 years agodt-bindings: Add binding for IT6505.
allen [Mon, 27 Apr 2020 09:16:53 +0000 (17:16 +0800)]
dt-bindings: Add binding for IT6505.

Add a DT binding documentation for IT6505.

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Allen Chen <allen.chen@ite.com.tw>
Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
[fixed example to use i2c]
Link: https://patchwork.freedesktop.org/patch/msgid/1587979103-5630-3-git-send-email-allen.chen@ite.com.tw
4 years agodt-bindings: fix vendor prefix for ITE Tech. Inc.
allen [Mon, 27 Apr 2020 09:16:52 +0000 (17:16 +0800)]
dt-bindings: fix vendor prefix for ITE Tech. Inc.

ITE Tech. Inc. (abbreviated as ITE ) is a professional fabless IC
design house. ITE's core technology includes PC and NB Controller chips,
Super I/O, High Speed Serial Interface, Video Codec, Touch Sensing,
Surveillance, OFDM, Sensor Fusion, and so on.

Our official name is "ITE Tech. Inc.", so change "ITE," to "ITE.".

more information on: http://www.ite.com.tw/

Signed-off-by: Allen Chen <allen.chen@ite.com.tw>
Acked-by: Rob Herring <robh@kernel.org>
Fixes: 17ff9478ffa3 ("dt-bindings: Add ITE Tech prefix")
Cc: Marek Vasut <marex@denx.de>
Cc: devicetree@vger.kernel.org
Cc: Allen Chen <allen.chen@ite.com.tw>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
[added fixes tag and updated subject]
Link: https://patchwork.freedesktop.org/patch/msgid/1587979103-5630-2-git-send-email-allen.chen@ite.com.tw
4 years agodrm: Correct DP DSC macro typo
Rodrigo Siqueira [Wed, 29 Apr 2020 18:41:42 +0000 (14:41 -0400)]
drm: Correct DP DSC macro typo

In the file drm_dp_helper.h we have a macro named
DP_DSC_THROUGHPUT_MODE_{0,1}_UPSUPPORTED, the correct name should be
DP_DSC_THROUGHPUT_MODE_{0,1}_UNSUPPORTED. This commits adjusts this typo
in the header file and in other places that attempt to access this
macro.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200429184142.1867987-1-Rodrigo.Siqueira@amd.com
4 years agodrm/ast: remove duplicate assignment of ast_crtc_funcs member
Jason Yan [Wed, 29 Apr 2020 14:10:10 +0000 (22:10 +0800)]
drm/ast: remove duplicate assignment of ast_crtc_funcs member

The struct member 'set_config' was assigned twice:

static const struct drm_crtc_funcs ast_crtc_funcs = {
.reset = ast_crtc_reset,
.set_config = drm_crtc_helper_set_config,
......
.set_config = drm_atomic_helper_set_config,
......
};

Since the second one is which we use now in fact, we can remove the
first one.

This fixes the following coccicheck warning:

drivers/gpu/drm/ast/ast_mode.c:932:50-51: set_config: first occurrence
line 934, second occurrence line 937

Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200429141010.8445-1-yanaijie@huawei.com
4 years agodrm/bridge: fix stack usage warning on old gcc
Arnd Bergmann [Tue, 28 Apr 2020 21:53:54 +0000 (23:53 +0200)]
drm/bridge: fix stack usage warning on old gcc

Some older versions of gcc badly optimize code that passes
an inline function argument into another function by reference,
causing huge stack usage:

drivers/gpu/drm/bridge/tc358768.c: In function 'tc358768_bridge_pre_enable':
drivers/gpu/drm/bridge/tc358768.c:840:1: error: the frame size of 2256 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]

Use a temporary variable as a workaround and add a comment pointing
to the gcc bug.

Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200428215408.4111675-1-arnd@arndb.de
4 years agovideo: fbdev: controlfb: fix build for COMPILE_TEST=y && PPC_PMAC=y && PPC32=n
Bartlomiej Zolnierkiewicz [Wed, 29 Apr 2020 10:48:24 +0000 (12:48 +0200)]
video: fbdev: controlfb: fix build for COMPILE_TEST=y && PPC_PMAC=y && PPC32=n

powerpc allyesconfig fails like this:

drivers/video/fbdev/controlfb.c: In function 'controlfb_mmap':
drivers/video/fbdev/controlfb.c:756:23: error: implicit declaration of function 'pgprot_cached_wthru'; did you mean 'pgprot_cached'? [-Werror=implicit-function-declaration]
  756 |   vma->vm_page_prot = pgprot_cached_wthru(vma->vm_page_prot);
      |                       ^~~~~~~~~~~~~~~~~~~
      |                       pgprot_cached
drivers/video/fbdev/controlfb.c:756:23: error: incompatible types when assigning to type 'pgprot_t' {aka 'struct <anonymous>'} from type 'int'

Fix it by adding missing PPC32 dependency.

Fixes: a07a63b0e24d ("video: fbdev: controlfb: add COMPILE_TEST support")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reported-by: kbuild test robot <lkp@intel.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/fe520316-3863-e6c4-9581-5d709f49e906@samsung.com
4 years agodrm: Nuke mode->hsync
Ville Syrjälä [Tue, 28 Apr 2020 17:19:25 +0000 (20:19 +0300)]
drm: Nuke mode->hsync

Let's just calculate the hsync rate on demand. No point in wasting
space storing it and risking the cached value getting out of sync
with reality.

v2: Move drm_mode_hsync() next to its only users
    Drop the TODO

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> #v1
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200428171940.19552-2-ville.syrjala@linux.intel.com
4 years agoMAINTAINERS: Restore alphabetical sorting
Thomas Zimmermann [Thu, 23 Apr 2020 07:40:03 +0000 (09:40 +0200)]
MAINTAINERS: Restore alphabetical sorting

MAINTAINERS got sorted in

  commit 4400b7d68f6e ("MAINTAINERS: sort entries by entry name")

Merging from drm-next into drm-misc-next duplicated some of the
entries by restoring old, unsorted sections. Restore the sorted
list by removing the duplicates.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 08d99b2c23df ("Merge drm/drm-next into drm-misc-next")
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Jernej Skrabec <jernej.skrabec@siol.net>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Dariusz Marcinkiewicz <darekm@google.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200423074003.9637-1-tzimmermann@suse.de
4 years agodrm: pl111: Move VExpress setup into versatile init
Rob Herring [Sun, 5 Apr 2020 17:14:52 +0000 (11:14 -0600)]
drm: pl111: Move VExpress setup into versatile init

Since the VExpress setup in pl111_vexpress.c is now just a single
function call, let's move it into pl111_versatile.c and we can further
simplify pl111_versatile_init() by moving the other pieces for VExpress
into pl111_vexpress_clcd_init().

Cc: Eric Anholt <eric@anholt.net>
Cc: dri-devel@lists.freedesktop.org
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200409013947.12667-4-robh@kernel.org
4 years agodrm: pl111: Simplify vexpress init
Rob Herring [Thu, 2 Apr 2020 17:34:25 +0000 (11:34 -0600)]
drm: pl111: Simplify vexpress init

The init VExpress variants currently instantiates a 'muxfpga' driver for
the sole purpose of getting a regmap for it. There's no reason to
instantiate a driver and doing so just complicates things. The muxfpga
driver also isn't unregistered properly on module unload. Let's
just simplify all this this by just calling
devm_regmap_init_vexpress_config() directly.

Cc: Eric Anholt <eric@anholt.net>
Cc: dri-devel@lists.freedesktop.org
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200409013947.12667-3-robh@kernel.org
4 years agodrm: pl111: Fix module autoloading
Rob Herring [Fri, 3 Apr 2020 23:06:08 +0000 (17:06 -0600)]
drm: pl111: Fix module autoloading

Add a missing MODULE_DEVICE_TABLE entry to fix module autoloading.

Cc: Eric Anholt <eric@anholt.net>
Cc: dri-devel@lists.freedesktop.org
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200409013947.12667-2-robh@kernel.org
4 years agodrm/i915: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:40:13 +0000 (09:40 +0200)]
drm/i915: Use devm_drm_dev_alloc

Luckily we're already well set up in the main driver, with
drm_dev_put() being the last thing in both the unload error case and
the pci remove function.

Acked-by: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-39-daniel.vetter@ffwll.ch
4 years agodrm/qxl: Don't use drm_device->dev_private
Daniel Vetter [Wed, 15 Apr 2020 07:40:02 +0000 (09:40 +0200)]
drm/qxl: Don't use drm_device->dev_private

Upcasting using a container_of macro is more typesafe, faster and
easier for the compiler to optimize.

Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Cc: spice-devel@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-28-daniel.vetter@ffwll.ch
4 years agodrm/qxl: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:40:01 +0000 (09:40 +0200)]
drm/qxl: Use devm_drm_dev_alloc

Also need to remove the drm_dev_put from the remove hook.

Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Cc: spice-devel@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-27-daniel.vetter@ffwll.ch
4 years agodrm: make drm_file use keyed wakeups
Kenny Levinsen [Fri, 24 Apr 2020 14:51:03 +0000 (16:51 +0200)]
drm: make drm_file use keyed wakeups

Some processes, such as systemd, are only polling for EPOLLERR|EPOLLHUP.
As drm_file uses unkeyed wakeups, such a poll receives many spurious
wakeups from uninteresting events.

Use keyed wakeups to allow the wakeup target to more efficiently discard
these uninteresting events.

Signed-off-by: Kenny Levinsen <kl@kl.wtf>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200424145103.3048-1-kl@kl.wtf
4 years agodrm/bochs: Remove explicit drm_connector_register
Daniel Vetter [Wed, 15 Apr 2020 07:40:34 +0000 (09:40 +0200)]
drm/bochs: Remove explicit drm_connector_register

This is leftovers from the old drm_driver->load callback
upside-down issues. It doesn't do anything for not-hotplugged
connectors since drm_dev_register takes care of that.

Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-60-daniel.vetter@ffwll.ch
4 years agodrm/ast: Drop explicit connector register/unregister
Daniel Vetter [Wed, 15 Apr 2020 07:40:33 +0000 (09:40 +0200)]
drm/ast: Drop explicit connector register/unregister

This is only needed for hotpluggable connectors set up after
drm_dev_register().

Reviewed-by: Thomas Zimemrmann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Emil Velikov <emil.velikov@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-59-daniel.vetter@ffwll.ch
4 years agodrm/aspeed: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:40:30 +0000 (09:40 +0200)]
drm/aspeed: Use devm_drm_dev_alloc

As usual, we can drop the drm_dev_put() and need to embed the
drm_device. Since it's so few, also go right ahead and leave
drm_device->dev_private set to NULL, so that we always use the
container_of() upcast, which is faster anyway.

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Joel Stanley <joel@jms.id.au>
Cc: Andrew Jeffery <andrew@aj.id.au>
Cc: linux-aspeed@lists.ozlabs.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-56-daniel.vetter@ffwll.ch
4 years agodrm/aspeed: Drop aspeed_gfx->fbdev
Daniel Vetter [Wed, 15 Apr 2020 07:40:29 +0000 (09:40 +0200)]
drm/aspeed: Drop aspeed_gfx->fbdev

No longer used since the conversion to generic fbdev.

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Joel Stanley <joel@jms.id.au>
Cc: Andrew Jeffery <andrew@aj.id.au>
Cc: linux-aspeed@lists.ozlabs.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-55-daniel.vetter@ffwll.ch
4 years agodrm/cirrus: Move to drm/tiny
Daniel Vetter [Wed, 15 Apr 2020 07:40:12 +0000 (09:40 +0200)]
drm/cirrus: Move to drm/tiny

Because it is. Huge congrats to everyone who made this kind of
refactoring happen!

Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-38-daniel.vetter@ffwll.ch
4 years agodrm/cirrus: Don't use drm_device->dev_private
Daniel Vetter [Wed, 15 Apr 2020 07:40:11 +0000 (09:40 +0200)]
drm/cirrus: Don't use drm_device->dev_private

Upcasting using a container_of macro is more typesafe, faster and
easier for the compiler to optimize.

Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Eric Anholt <eric@anholt.net>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: virtualization@lists.linux-foundation.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-37-daniel.vetter@ffwll.ch
4 years agodrm/cirrus: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:40:10 +0000 (09:40 +0200)]
drm/cirrus: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.

Acked-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: virtualization@lists.linux-foundation.org
Cc: Emil Velikov <emil.velikov@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-36-daniel.vetter@ffwll.ch
4 years agodrm/komeda: use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:40:07 +0000 (09:40 +0200)]
drm/komeda: use devm_drm_dev_alloc

Komeda uses the component framework, which does open/close a new
devres group around all the bind callbacks. Which means we can use
devm_ functions for managing the drm_device cleanup, with leaking
stuff in case of deferred probes or other reasons to unbind
components, or the component_master.

Also note that this fixes a double-free in the probe unroll code, bot
drm_dev_put and kfree(kms) result in the kms allocation getting freed.

Aside: komeda_bind could be cleaned up a lot, devm_kfree is a bit
redundant. Plus I'm not clear on why there's suballocations for
mdrv->mdev and mdrv->kms. Plus I'm not sure the lifetimes are correct
with all that devm_kzalloc usage ... That structure layout is also the
reason why komeda still uses drm_device->dev_private and can't easily
be replaced with a proper container_of upcasting. I'm pretty sure that
there's endless amounts of hotunplug/hotremove bugs in there with all
the unprotected dereferencing of drm_device->dev_private.

Reviewed-by: James Qian Wang <james.qian.wang@arm.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: "James (Qian) Wang" <james.qian.wang@arm.com>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Mihail Atanassov <mihail.atanassov@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-33-daniel.vetter@ffwll.ch
4 years agodrm/ingenic: Don't set drm_device->dev_private
Daniel Vetter [Wed, 15 Apr 2020 07:40:06 +0000 (09:40 +0200)]
drm/ingenic: Don't set drm_device->dev_private

Entirely not used, just copypasta.

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Paul Cercueil <paul@crapouillou.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-32-daniel.vetter@ffwll.ch
4 years agodrm/ingenic: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:40:05 +0000 (09:40 +0200)]
drm/ingenic: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Paul Cercueil <paul@crapouillou.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-31-daniel.vetter@ffwll.ch
4 years agodrm/mcde: Don't use drm_device->dev_private
Daniel Vetter [Wed, 15 Apr 2020 07:40:04 +0000 (09:40 +0200)]
drm/mcde: Don't use drm_device->dev_private

Upcasting using a container_of macro is more typesafe, faster and
easier for the compiler to optimize.

v2: Move misplaced removal of double-assignment to this patch (Sam)

Reviewed-by: Linus Walleij <linus.walleij@linaro.org> (v1)
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-30-daniel.vetter@ffwll.ch
4 years agodrm/mcde: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:40:03 +0000 (09:40 +0200)]
drm/mcde: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.

v2: Move misplaced double-assignement to next patch (Sam)

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-29-daniel.vetter@ffwll.ch
4 years agodrm/tidss: Delete tidss->saved_state
Daniel Vetter [Wed, 15 Apr 2020 07:40:00 +0000 (09:40 +0200)]
drm/tidss: Delete tidss->saved_state

Not used anymore since the switch to suspend/resume helpers.

Tested-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jyri Sarha <jsarha@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-26-daniel.vetter@ffwll.ch
4 years agodrm/tidss: Don't use drm_device->dev_private
Daniel Vetter [Wed, 15 Apr 2020 07:39:59 +0000 (09:39 +0200)]
drm/tidss: Don't use drm_device->dev_private

Upcasting using a container_of macro is more typesafe, faster and
easier for the compiler to optimize.

Tested-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jyri Sarha <jsarha@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-25-daniel.vetter@ffwll.ch
4 years agodrm/tidss: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:39:58 +0000 (09:39 +0200)]
drm/tidss: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.

Tested-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jyri Sarha <jsarha@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-24-daniel.vetter@ffwll.ch
4 years agodrm/gm12u320: Don't use drm_device->dev_private
Daniel Vetter [Wed, 15 Apr 2020 07:39:57 +0000 (09:39 +0200)]
drm/gm12u320: Don't use drm_device->dev_private

Upcasting using a container_of macro is more typesafe, faster and
easier for the compiler to optimize.

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-23-daniel.vetter@ffwll.ch
4 years agodrm/gm12u320: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:39:56 +0000 (09:39 +0200)]
drm/gm12u320: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-22-daniel.vetter@ffwll.ch
4 years agodrm/hx8357d: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:39:55 +0000 (09:39 +0200)]
drm/hx8357d: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.

Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-21-daniel.vetter@ffwll.ch
4 years agodrm/ili9225: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:39:54 +0000 (09:39 +0200)]
drm/ili9225: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.

Acked-by: David Lechner <david@lechnology.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: David Lechner <david@lechnology.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-20-daniel.vetter@ffwll.ch
4 years agodrm/ili9341: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:39:53 +0000 (09:39 +0200)]
drm/ili9341: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.

Acked-by: David Lechner <david@lechnology.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Eric Anholt <eric@anholt.net>
Cc: David Lechner <david@lechnology.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-19-daniel.vetter@ffwll.ch
4 years agodrm/ili9486: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:39:52 +0000 (09:39 +0200)]
drm/ili9486: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.

Acked-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-18-daniel.vetter@ffwll.ch
4 years agodrm/mi0283qt: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:39:51 +0000 (09:39 +0200)]
drm/mi0283qt: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.

Acked-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-17-daniel.vetter@ffwll.ch
4 years agodrm/repaper: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:39:50 +0000 (09:39 +0200)]
drm/repaper: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.

Acked-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-16-daniel.vetter@ffwll.ch
4 years agodrm/st7586: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:39:49 +0000 (09:39 +0200)]
drm/st7586: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.

Acked-by: David Lechner <david@lechnology.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: David Lechner <david@lechnology.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-15-daniel.vetter@ffwll.ch
4 years agodrm/st7735r: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:39:48 +0000 (09:39 +0200)]
drm/st7735r: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.

Aside: There was an oddity in the old code, we allocated priv but in
the error path we've freed priv->dbidev ...

Acked-by: David Lechner <david@lechnology.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: David Lechner <david@lechnology.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-14-daniel.vetter@ffwll.ch
4 years agodrm/udl: don't set drm_device->dev_private
Daniel Vetter [Wed, 15 Apr 2020 07:39:47 +0000 (09:39 +0200)]
drm/udl: don't set drm_device->dev_private

We're mostly there already, just a handful of places that didn't use
the to_udl container_of cast. To make sure no new appear, don't set
->dev_private.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Sean Paul <sean@poorly.run>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Alexios Zavras <alexios.zavras@intel.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "José Roberto de Souza" <jose.souza@intel.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Allison Randal <allison@lohutok.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-13-daniel.vetter@ffwll.ch
4 years agodrm/udl: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:39:46 +0000 (09:39 +0200)]
drm/udl: Use devm_drm_dev_alloc

With Thomas' patch to clean up fbdev init this is a rather standard
conversion to the new wrapper macro.

v2: Rebase on top of Thomas' patches to remove the return value from
drm_fbdev_generic_setup()

v3: Update commit message to reflect the reality of the rebased patch
(Sam)

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Noralf Trønnes <noralf@tronnes.org>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Sean Paul <sean@poorly.run>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-12-daniel.vetter@ffwll.ch
4 years agodrm/v3d: Delete v3d_dev->pdev
Daniel Vetter [Wed, 15 Apr 2020 07:39:45 +0000 (09:39 +0200)]
drm/v3d: Delete v3d_dev->pdev

We already have it in v3d_dev->drm.dev with zero additional pointer
chasing. Personally I don't like duplicated pointers like this
because:
- reviewers need to check whether the pointer is for the same or
different objects if there's multiple
- compilers have an easier time too

To avoid having to pull in some big headers I implemented the casting
function as a macro instead of a static inline. Typechecking thanks to
container_of still assured.

But also a bit a bikeshed, so feel free to ignore.

v2: More parens for v3d_to_pdev macro (checkpatch)

Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-11-daniel.vetter@ffwll.ch
4 years agodrm/v3d: Delete v3d_dev->dev
Daniel Vetter [Wed, 15 Apr 2020 07:39:44 +0000 (09:39 +0200)]
drm/v3d: Delete v3d_dev->dev

We already have it in v3d_dev->drm.dev with zero additional pointer
chasing. Personally I don't like duplicated pointers like this
because:
- reviewers need to check whether the pointer is for the same or
  different objects if there's multiple
- compilers have an easier time too

But also a bit a bikeshed, so feel free to ignore.

Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-10-daniel.vetter@ffwll.ch
4 years agodrm/v3d: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:39:43 +0000 (09:39 +0200)]
drm/v3d: Use devm_drm_dev_alloc

Also allows us to simplify the unroll code since the drm_dev_put
disappears.

Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-9-daniel.vetter@ffwll.ch
4 years agodrm/v3d: Don't set drm_device->dev_private
Daniel Vetter [Wed, 15 Apr 2020 07:39:42 +0000 (09:39 +0200)]
drm/v3d: Don't set drm_device->dev_private

And switch the helper over to container_of, which is a bunch faster
than chasing a pointer. Plus allows gcc to see through this maze.

Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-8-daniel.vetter@ffwll.ch
4 years agodrm/vboxvideo: Use devm_gen_pool_create
Daniel Vetter [Wed, 15 Apr 2020 07:39:41 +0000 (09:39 +0200)]
drm/vboxvideo: Use devm_gen_pool_create

Aside from deleting all the cleanup code we're now also setting a name
for the pool

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-7-daniel.vetter@ffwll.ch
4 years agodrm/vboxvideo: use managed pci functions
Daniel Vetter [Wed, 15 Apr 2020 07:39:40 +0000 (09:39 +0200)]
drm/vboxvideo: use managed pci functions

Allows us to drop the cleanup code on the floor.

Sam noticed in his review:
> With this change we avoid calling pci_disable_device()
> twise in case vbox_mm_init() fails.
> Once in vbox_hw_fini() and once in the error path.

v2: Include Sam's review remarks

v3: Fix typo in commit summary (Thomas Zimmermann)

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-6-daniel.vetter@ffwll.ch
4 years agodrm/vboxvideo: Stop using drm_device->dev_private
Daniel Vetter [Wed, 15 Apr 2020 07:39:39 +0000 (09:39 +0200)]
drm/vboxvideo: Stop using drm_device->dev_private

We use the baseclass pattern here, so lets to the proper (and more
typesafe) upcasting.

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-5-daniel.vetter@ffwll.ch
4 years agodrm/vboxvideo: Use devm_drm_dev_alloc
Daniel Vetter [Wed, 15 Apr 2020 07:39:38 +0000 (09:39 +0200)]
drm/vboxvideo: Use devm_drm_dev_alloc

Straightforward conversion.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-4-daniel.vetter@ffwll.ch
4 years agodrm/vboxvideo: drop DRM_MTRR_WC #define
Daniel Vetter [Wed, 15 Apr 2020 07:39:37 +0000 (09:39 +0200)]
drm/vboxvideo: drop DRM_MTRR_WC #define

Doesn't apply to upstream kernels since a rather long time.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-3-daniel.vetter@ffwll.ch
4 years agodrm: Add devm_drm_dev_alloc macro
Daniel Vetter [Wed, 15 Apr 2020 07:39:36 +0000 (09:39 +0200)]
drm: Add devm_drm_dev_alloc macro

Add a new macro helper to combine the usual init sequence in drivers,
consisting of a kzalloc + devm_drm_dev_init + drmm_add_final_kfree
triplet. This allows us to remove the rather unsightly
drmm_add_final_kfree from all currently merged drivers.

The kerneldoc is only added for this new function. Existing kerneldoc
and examples will be udated at the very end, since once all drivers
are converted over to devm_drm_dev_alloc we can unexport a lot of
interim functions and make the documentation for driver authors a lot
cleaner and less confusing. There will be only one true way to
initialize a drm_device at the end of this, which is going to be
devm_drm_dev_alloc.

v2:
- Actually explain what this is for in the commit message (Sam)
- Fix checkpatch issues (Sam)

Acked-by: Noralf Trønnes <noralf@tronnes.org>
Cc: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-2-daniel.vetter@ffwll.ch
4 years agodrm/omap: venc: remove unused variable 'venc_config_pal_bdghi'
YueHaibing [Wed, 15 Apr 2020 13:21:05 +0000 (21:21 +0800)]
drm/omap: venc: remove unused variable 'venc_config_pal_bdghi'

drivers/gpu/drm/omapdrm/dss/venc.c:211:33:
 warning: 'venc_config_pal_bdghi' defined but not used [-Wunused-const-variable=]
 static const struct venc_config venc_config_pal_bdghi = {
                                 ^~~~~~~~~~~~~~~~~~~~~

It is never used, remove it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415132105.43636-1-yuehaibing@huawei.com
4 years agodrm/meson: Remove unneeded semicolon
Zheng Bin [Fri, 24 Apr 2020 07:49:49 +0000 (15:49 +0800)]
drm/meson: Remove unneeded semicolon

Fixes coccicheck warning:

drivers/gpu/drm/meson/meson_plane.c:226:3-4: Unneeded semicolon

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200424074949.12309-1-zhengbin13@huawei.com
4 years agodrm/dp_mst: Kill the second sideband tx slot, save the world
Lyude Paul [Fri, 24 Apr 2020 18:13:08 +0000 (14:13 -0400)]
drm/dp_mst: Kill the second sideband tx slot, save the world

While we support using both tx slots for sideband transmissions, it
appears that DisplayPort devices in the field didn't end up doing a very
good job of supporting it. From section 5.2.1 of the DP 2.0
specification:

  There are MST Sink/Branch devices in the field that do not handle
  interleaved message transactions.

  To facilitate message transaction handling by downstream devices, an
  MST Source device shall generate message transactions in an atomic
  manner (i.e., the MST Source device shall not concurrently interleave
  multiple message transactions). Therefore, an MST Source device shall
  clear the Message_Sequence_No value in the Sideband_MSG_Header to 0.

This might come as a bit of a surprise since the vast majority of hubs
will support using both tx slots even if they don't support interleaved
message transactions, and we've also been using both tx slots since MST
was introduced into the kernel.

However, there is one device we've had trouble getting working
consistently with MST for so long that we actually assumed it was just
broken: the infamous Dell P2415Qb. Previously this monitor would appear
to work sometimes, but in most situations would end up timing out
LINK_ADDRESS messages almost at random until you power cycled the whole
display. After reading section 5.2.1 in the DP 2.0 spec, some closer
investigation into this infamous display revealed it was only ever
timing out on sideband messages in the second TX slot.

Sure enough, avoiding the second TX slot has suddenly made this monitor
function perfectly for the first time in five years. And since they
explicitly mention this in the specification, I doubt this is the only
monitor out there with this issue. This might even explain explain the
seemingly harmless garbage sideband responses we would occasionally see
with MST hubs!

So - rewrite our sideband TX handlers to only support one TX slot. In
order to simplify our sideband handling now that we don't support
transmitting to multiple MSTBs at once, we also move all state tracking
for down replies from mstbs to the topology manager.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Fixes: ad7f8a1f9ced ("drm/helper: add Displayport multi-stream helper (v0.6)")
Cc: Sean Paul <sean@poorly.run>
Cc: "Lin, Wayne" <Wayne.Lin@amd.com>
Cc: <stable@vger.kernel.org> # v3.17+
Reviewed-by: Sean Paul <sean@poorly.run>
Link: https://patchwork.freedesktop.org/patch/msgid/20200424181308.770749-1-lyude@redhat.com
4 years agodrm/rockchip: Remove unneeded semicolon
Zheng Bin [Fri, 24 Apr 2020 07:44:10 +0000 (15:44 +0800)]
drm/rockchip: Remove unneeded semicolon

Fixes coccicheck warning:

drivers/gpu/drm/rockchip/cdn-dp-reg.c:604:2-3: Unneeded semicolon
drivers/gpu/drm/rockchip/cdn-dp-reg.c:622:2-3: Unneeded semicolon
drivers/gpu/drm/rockchip/cdn-dp-reg.c:703:2-3: Unneeded semicolon

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200424074410.1070-1-zhengbin13@huawei.com
4 years agodrm/rockchip: cdn-dp-core: Make cdn_dp_core_suspend/resume static
Enric Balletbo i Serra [Sun, 26 Apr 2020 16:16:53 +0000 (18:16 +0200)]
drm/rockchip: cdn-dp-core: Make cdn_dp_core_suspend/resume static

This fixes the following warning detected when running make with W=1

    drivers/gpu/drm/rockchip//cdn-dp-core.c:1112:5: warning: no previous
    prototype for ‘cdn_dp_suspend’ [-Wmissing-prototypes]

    drivers/gpu/drm/rockchip//cdn-dp-core.c:1126:5: warning: no previous
    prototype for ‘cdn_dp_resume’ [-Wmissing-prototypes]

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200426161653.7710-1-enric.balletbo@collabora.com
4 years agodrm/stm: ltdc: check number of endpoints
Yannick Fertre [Fri, 28 Feb 2020 08:07:38 +0000 (09:07 +0100)]
drm/stm: ltdc: check number of endpoints

Number of endpoints could exceed the fix value MAX_ENDPOINTS(2).
Instead of increase simply this value, the number of endpoint
could be read from device tree. Load sequence has been a little
rework to take care of several panel or bridge which can be
connected/disconnected or enable/disable.

Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1582877258-1112-1-git-send-email-yannick.fertre@st.com
4 years agopanel: simple: Add Ivo M133NWF4 R0
Bjorn Andersson [Mon, 20 Apr 2020 21:57:28 +0000 (14:57 -0700)]
panel: simple: Add Ivo M133NWF4 R0

The InfoVision Optoelectronics M133NWF4 R0 panel is a 13.3" 1920x1080
eDP panel, add support for it in panel-simple.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200420215728.1927434-2-bjorn.andersson@linaro.org
4 years agodt-bindings: display: simple: Add IVO M133NWF4 R0
Bjorn Andersson [Mon, 20 Apr 2020 21:57:27 +0000 (14:57 -0700)]
dt-bindings: display: simple: Add IVO M133NWF4 R0

Define the vendor prefix for InfoVision Optoelectronics and add their
M133NWF4 R0 13.3" FHD (1920x1080) TFT LCD panel to the compatible list
of panel-simple.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Rob Herring <robh@kernel.org> [vendor-prefix]
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200420215728.1927434-1-bjorn.andersson@linaro.org
4 years agopanel: simple: Add BOE NV133FHM-N61
Bjorn Andersson [Mon, 20 Apr 2020 21:57:42 +0000 (14:57 -0700)]
panel: simple: Add BOE NV133FHM-N61

The BOE NV133FHM-N61 panel is a 13.3" 1920x1080 eDP panel, add support
for it in panel-simple.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
[add boe_nv133fhm_n61_modes in alphabetical order]
Link: https://patchwork.freedesktop.org/patch/msgid/20200420215742.1927498-2-bjorn.andersson@linaro.org
4 years agodt-bindings: display: simple: Add BOE NV133FHM-N61
Bjorn Andersson [Mon, 20 Apr 2020 21:57:41 +0000 (14:57 -0700)]
dt-bindings: display: simple: Add BOE NV133FHM-N61

Add the BOE NV133FHM-N61 13.3" FHD (1920x1080) TFT LCD Panel to the
compatible list of panel-simple.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200420215742.1927498-1-bjorn.andersson@linaro.org
4 years agovideo/fbdev/riva: Remove dead code
Souptick Joarder [Mon, 20 Apr 2020 18:27:24 +0000 (23:57 +0530)]
video/fbdev/riva: Remove dead code

These are dead code since 3.15. These can be removed forever if no
plan to use it further.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1587407244-32574-1-git-send-email-jrdr.linux@gmail.com
4 years agodrm/panel: remove set but not used variable 'config'
YueHaibing [Fri, 17 Apr 2020 10:14:01 +0000 (18:14 +0800)]
drm/panel: remove set but not used variable 'config'

drivers/gpu/drm/panel/panel-truly-nt35597.c:493:31: warning: variable ‘config’ set but not used [-Wunused-but-set-variable]
  const struct nt35597_config *config;
                               ^~~~~~

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200417101401.19388-1-yuehaibing@huawei.com
4 years agodt-bindings: panel: Document some missing compatible strings
Thierry Reding [Fri, 17 Apr 2020 06:53:28 +0000 (08:53 +0200)]
dt-bindings: panel: Document some missing compatible strings

Add missing compatible strings for the Panasonic and Chunghwa panels
found on NVIDIA Dalmore and Cardhu boards.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200417065328.1578603-1-thierry.reding@gmail.com
4 years agodrm/bridge: panel: Return always an error pointer in drm_panel_bridge_add()
Enric Balletbo i Serra [Thu, 16 Apr 2020 21:06:54 +0000 (23:06 +0200)]
drm/bridge: panel: Return always an error pointer in drm_panel_bridge_add()

Since commit 89958b7cd955 ("drm/bridge: panel: Infer connector type from
panel by default"), drm_panel_bridge_add() and their variants can return
NULL and an error pointer. This is fine but none of the actual users of
the API are checking for the NULL value. Instead of change all the
users, seems reasonable to return an error pointer instead. So change
the returned value for those functions when the connector type is unknown.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200416210654.2468805-1-enric.balletbo@collabora.com
4 years agodrm/bridge: ps8640: Let panel to set the connector type
Enric Balletbo i Serra [Thu, 16 Apr 2020 16:44:04 +0000 (18:44 +0200)]
drm/bridge: ps8640: Let panel to set the connector type

The panel connector type should be set by the panel not the bridge, so
remove the connector_type assignment.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200416164404.2418426-2-enric.balletbo@collabora.com
4 years agodrm: panel: Set connector type for LP120UP1
Enric Balletbo i Serra [Thu, 16 Apr 2020 16:44:03 +0000 (18:44 +0200)]
drm: panel: Set connector type for LP120UP1

The LP120UP1 is a eDP panel, set the connector type accordingly.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200416164404.2418426-1-enric.balletbo@collabora.com
4 years agodrm/panel: ili9322: Remove unneeded semicolon
Zheng Bin [Fri, 24 Apr 2020 08:02:24 +0000 (16:02 +0800)]
drm/panel: ili9322: Remove unneeded semicolon

Fixes coccicheck warning:

drivers/gpu/drm/panel/panel-ilitek-ili9322.c:382:2-3: Unneeded semicolon
drivers/gpu/drm/panel/panel-ilitek-ili9322.c:391:2-3: Unneeded semicolon

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200424080224.30763-1-zhengbin13@huawei.com
4 years agodrm/panel: simple: Add support for AUO G121EAN01.4 panel
Sebastian Reichel [Wed, 15 Apr 2020 17:27:25 +0000 (19:27 +0200)]
drm/panel: simple: Add support for AUO G121EAN01.4 panel

Add timings for the AUO G121EAN01.4 panel.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415172725.84257-4-sebastian.reichel@collabora.com
4 years agodrm/panel: simple: Add support for AUO G156XTN01.0 panel
Sebastian Reichel [Wed, 15 Apr 2020 17:27:24 +0000 (19:27 +0200)]
drm/panel: simple: Add support for AUO G156XTN01.0 panel

Add timings for the AUO G156XTN01.0 panel.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415172725.84257-3-sebastian.reichel@collabora.com
4 years agodrm/panel: simple: Add support for AUO G190EAN01 panel
Sebastian Reichel [Wed, 15 Apr 2020 17:27:23 +0000 (19:27 +0200)]
drm/panel: simple: Add support for AUO G190EAN01 panel

Add timings for the G190EAN01 dual channel LVDS panel.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415172725.84257-2-sebastian.reichel@collabora.com
4 years agodrm/lima: enable runtime pm
Qiang Yu [Tue, 21 Apr 2020 13:35:51 +0000 (21:35 +0800)]
drm/lima: enable runtime pm

Enable runtime pm by default so GPU suspend when idle
for 200ms. This value can be changed by
autosuspend_delay_ms in device's power sysfs dir.

On Allwinner H3 lima_device_resume takes ~40us and
lima_device_suspend takes ~20us.

Tested-by: Bhushan Shah <bshah@kde.org>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-11-yuq825@gmail.com
4 years agodrm/lima: add pm resume/suspend ops
Qiang Yu [Tue, 21 Apr 2020 13:35:50 +0000 (21:35 +0800)]
drm/lima: add pm resume/suspend ops

Add driver pm system and runtime hardware resume/suspend ops.
Note this won't enable runtime pm of the device yet.

v2:
Do clock and power gating when suspend/resume.

Tested-by: Bhushan Shah <bshah@kde.org>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-10-yuq825@gmail.com
4 years agodrm/lima: separate clk/regulator enable/disable function
Qiang Yu [Tue, 21 Apr 2020 13:35:49 +0000 (21:35 +0800)]
drm/lima: separate clk/regulator enable/disable function

For being used by both device init/fini and suspend/resume.

Tested-by: Bhushan Shah <bshah@kde.org>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-9-yuq825@gmail.com
4 years agodrm/lima: add resume/suspend callback for each ip
Qiang Yu [Tue, 21 Apr 2020 13:35:48 +0000 (21:35 +0800)]
drm/lima: add resume/suspend callback for each ip

For called when PM do resume/suspend.

Tested-by: Bhushan Shah <bshah@kde.org>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-8-yuq825@gmail.com
4 years agodrm/lima: power down ip blocks when pmu exit
Qiang Yu [Tue, 21 Apr 2020 13:35:47 +0000 (21:35 +0800)]
drm/lima: power down ip blocks when pmu exit

Prepare resume/suspend PM.

v2:
Fix lima_pmu_wait_cmd timeout when mali400 case.

Tested-by: Bhushan Shah <bshah@kde.org>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-7-yuq825@gmail.com
4 years agodrm/lima: add lima_devfreq_resume/suspend
Qiang Yu [Tue, 21 Apr 2020 13:35:46 +0000 (21:35 +0800)]
drm/lima: add lima_devfreq_resume/suspend

Used for device resume/suspend in the following commits.

Tested-by: Bhushan Shah <bshah@kde.org>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-6-yuq825@gmail.com
4 years agodrm/lima: always set page directory when switch vm
Qiang Yu [Tue, 21 Apr 2020 13:35:45 +0000 (21:35 +0800)]
drm/lima: always set page directory when switch vm

We need to flush TLB anyway before every task start, and the
page directory will be set to empty vm after suspend/resume,
so always set it to the task vm even no ctx switch happens.

Tested-by: Bhushan Shah <bshah@kde.org>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-5-yuq825@gmail.com
4 years agodrm/lima: check vm != NULL in lima_vm_put
Qiang Yu [Tue, 21 Apr 2020 13:35:44 +0000 (21:35 +0800)]
drm/lima: check vm != NULL in lima_vm_put

No need to handle this check before calling lima_vm_put.

Tested-by: Bhushan Shah <bshah@kde.org>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-4-yuq825@gmail.com
4 years agodrm/lima: print process name and pid when task error
Qiang Yu [Tue, 21 Apr 2020 13:35:43 +0000 (21:35 +0800)]
drm/lima: print process name and pid when task error

When error task list is full, print the process info where
the error task come from for debug usage.

Tested-by: Bhushan Shah <bshah@kde.org>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-3-yuq825@gmail.com
4 years agodrm/lima: use module_platform_driver helper
Qiang Yu [Tue, 21 Apr 2020 13:35:42 +0000 (21:35 +0800)]
drm/lima: use module_platform_driver helper

Simplify module init/exit with module_platform_driver.

Tested-by: Bhushan Shah <bshah@kde.org>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-2-yuq825@gmail.com
4 years agodrm/lima: Clean up redundant pdev pointer
Robin Murphy [Tue, 21 Apr 2020 22:51:37 +0000 (23:51 +0100)]
drm/lima: Clean up redundant pdev pointer

There's no point explicitly tracking the platform device when it can be
trivially derived from the regular device pointer in the couple of
places it's ever used.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/8d9073cc91c10fc70910587fd1794e0e8f32b467.1587509150.git.robin.murphy@arm.com
4 years agodrm/lima: Clean up IRQ warnings
Robin Murphy [Tue, 21 Apr 2020 22:51:36 +0000 (23:51 +0100)]
drm/lima: Clean up IRQ warnings

Use the optional form of platform_get_irq() for blocks that legitimately
may not be present, to avoid getting an annoying barrage of spurious
warnings for non-existent PPs on configurations like Mali-450 MP2.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/de475904091400ef6c123285f221094654d96d35.1587509150.git.robin.murphy@arm.com
4 years agoRevert "drm/dp_mst: Remove single tx msg restriction."
Lyude Paul [Thu, 23 Apr 2020 16:42:24 +0000 (12:42 -0400)]
Revert "drm/dp_mst: Remove single tx msg restriction."

This reverts commit 6bb0942e8f46863a745489cce27efe5be2a3885e.

Unfortunately it would appear that the rumors we've heard of sideband
message interleaving not being very well supported are true. On the
Lenovo ThinkPad Thunderbolt 3 dock that I have, interleaved messages
appear to just get dropped:

  [drm:drm_dp_mst_wait_tx_reply [drm_kms_helper]] timedout msg send
  00000000571ddfd0 2 1
  [dp_mst] txmsg cur_offset=2 cur_len=2 seqno=1 state=SENT path_msg=1 dst=00
  [dp_mst]  type=ENUM_PATH_RESOURCES contents:
  [dp_mst]  port=2

DP descriptor for this hub:
  OUI 90-cc-24 dev-ID SYNA3  HW-rev 1.0 SW-rev 3.12 quirks 0x0008

It would seem like as well that this is a somewhat well known issue in
the field. From section 5.4.2 of the DisplayPort 2.0 specification:

  There are MST Sink/Branch devices in the field that do not handle
  interleaved message transactions.

  To facilitate message transaction handling by downstream devices, an
  MST Source device shall generate message transactions in an atomic
  manner (i.e., the MST Source device shall not concurrently interleave
  multiple message transactions). Therefore, an MST Source device shall
  clear the Message_Sequence_No value in the Sideband_MSG_Header to 0.

  MST Source devices that support field policy updates by way of
  software should update the policy to forego the generation of
  interleaved message transactions.

This is a bit disappointing, as features like HDCP require that we send
a sideband request every ~2 seconds for each active stream. However,
there isn't really anything in the specification that allows us to
accurately probe for interleaved messages.

If it ends up being that we -really- need this in the future, we might
be able to whitelist hubs where interleaving is known to work-or maybe
try some sort of heuristics. But for now, let's just play it safe and
not use it.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Fixes: 6bb0942e8f46 ("drm/dp_mst: Remove single tx msg restriction.")
Cc: Wayne Lin <Wayne.Lin@amd.com>
Cc: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200423164225.680178-1-lyude@redhat.com
Reviewed-by: Sean Paul <sean@poorly.run>
4 years agodma-buf: Couple of documentation typo fixes
Gal Pressman [Mon, 20 Apr 2020 07:41:15 +0000 (10:41 +0300)]
dma-buf: Couple of documentation typo fixes

Fix a couple of typos: "as" -> "has" and "int" -> "in".

Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200420074115.23931-1-galpress@amazon.com
4 years agodrm/gma500: Remove dead code
Souptick Joarder [Mon, 20 Apr 2020 18:12:17 +0000 (23:42 +0530)]
drm/gma500: Remove dead code

These are dead code since 3.7. If there is no plan to use them further,
these can be removed forever.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1587406337-32317-1-git-send-email-jrdr.linux@gmail.com
4 years agodrm/gma500: remove unused variable 'hdmi_ids'
YueHaibing [Fri, 17 Apr 2020 10:10:32 +0000 (18:10 +0800)]
drm/gma500: remove unused variable 'hdmi_ids'

drivers/gpu/drm/gma500/oaktrail_hdmi.c:676:35: warning: ‘hdmi_ids’ defined but not used [-Wunused-const-variable=]
 static const struct pci_device_id hdmi_ids[] = {
                                   ^~~~~~~~

It is never used, remove it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200417101032.8140-1-yuehaibing@huawei.com
4 years agodrm: Fix misspellings of "Analog Devices"
Geert Uytterhoeven [Thu, 16 Apr 2020 10:30:55 +0000 (12:30 +0200)]
drm: Fix misspellings of "Analog Devices"

According to https://www.analog.com/, the company name is spelled
"Analog Devices".

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200416103058.15269-4-geert+renesas@glider.be
4 years agodrm/ast: Allocate initial CRTC state of the correct size
Thomas Zimmermann [Thu, 30 Jan 2020 09:40:12 +0000 (10:40 +0100)]
drm/ast: Allocate initial CRTC state of the correct size

The ast driver inherits from DRM's CRTC state, but still uses the atomic
helper for struct drm_crtc_funcs.reset, drm_atomic_helper_crtc_reset().

The helper only allocates enough memory for the core CRTC state. That
results in an out-ouf-bounds access when duplicating the initial CRTC
state. Simplified backtrace shown below:

[   21.469321] ==================================================================
[   21.469434] BUG: KASAN: slab-out-of-bounds in ast_crtc_atomic_duplicate_state+0x84/0x100 [ast]
[   21.469445] Read of size 8 at addr ffff888036c1c5f8 by task systemd-udevd/382
[   21.469451]
[   21.469464] CPU: 2 PID: 382 Comm: systemd-udevd Tainted: G            E     5.5.0-rc6-1-default+ #214
[   21.469473] Hardware name: Sun Microsystems SUN FIRE X2270 M2/SUN FIRE X2270 M2, BIOS 2.05    07/01/2010
[   21.469480] Call Trace:
[   21.469501]  dump_stack+0xb8/0x110
[   21.469528]  print_address_description.constprop.0+0x1b/0x1e0
[   21.469557]  ? ast_crtc_atomic_duplicate_state+0x84/0x100 [ast]
[   21.469581]  ? ast_crtc_atomic_duplicate_state+0x84/0x100 [ast]
[   21.469597]  __kasan_report.cold+0x1a/0x35
[   21.469640]  ? ast_crtc_atomic_duplicate_state+0x84/0x100 [ast]
[   21.469665]  kasan_report+0xe/0x20
[   21.469693]  ast_crtc_atomic_duplicate_state+0x84/0x100 [ast]
[   21.469733]  drm_atomic_get_crtc_state+0xbf/0x1c0
[   21.469768]  __drm_atomic_helper_set_config+0x81/0x5a0
[   21.469803]  ? drm_atomic_plane_check+0x690/0x690
[   21.469843]  ? drm_client_rotation+0xae/0x240
[   21.469876]  drm_client_modeset_commit_atomic+0x230/0x390
[   21.469888]  ? __mutex_lock+0x8f0/0xbe0
[   21.469929]  ? drm_client_firmware_config.isra.0+0xa60/0xa60
[   21.469948]  ? drm_client_modeset_commit_force+0x28/0x230
[   21.470031]  ? memset+0x20/0x40
[   21.470078]  drm_client_modeset_commit_force+0x90/0x230
[   21.470110]  drm_fb_helper_restore_fbdev_mode_unlocked+0x5f/0xc0
[   21.470132]  drm_fb_helper_set_par+0x59/0x70
[   21.470155]  fbcon_init+0x61d/0xad0
[   21.470185]  ? drm_fb_helper_restore_fbdev_mode_unlocked+0xc0/0xc0
[   21.470232]  visual_init+0x187/0x240
[   21.470266]  do_bind_con_driver+0x2e3/0x460
[   21.470321]  do_take_over_console+0x20a/0x290
[   21.470371]  do_fbcon_takeover+0x85/0x100
[   21.470402]  register_framebuffer+0x2fd/0x490
[   21.470425]  ? kzalloc.constprop.0+0x10/0x10
[   21.470503]  __drm_fb_helper_initial_config_and_unlock+0xf2/0x140
[   21.470533]  drm_fbdev_client_hotplug+0x162/0x250
[   21.470563]  drm_fbdev_generic_setup+0xd2/0x155
[   21.470602]  ast_driver_load+0x688/0x850 [ast]
<...>
[   21.472625] ==================================================================

Allocating enough memory for struct ast_crtc_state in a custom ast CRTC
reset handler fixes the problem.

v2:
* implement according to drm_atomic_helper_crtc_reset()
* update state with __drm_atomic_helper_crtc_reset()

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 83be6a3ceb11 ("drm/ast: Introduce struct ast_crtc_state")
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200130094012.32140-1-tzimmermann@suse.de
4 years agodt-bindings: display: convert rockchip rk3066 hdmi bindings to yaml
Johan Jonker [Fri, 3 Apr 2020 13:36:30 +0000 (15:36 +0200)]
dt-bindings: display: convert rockchip rk3066 hdmi bindings to yaml

Current dts files with 'hdmi' nodes for rk3066 are manually verified.
In order to automate this process rockchip,rk3066-hdmi.txt
has to be converted to yaml.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200403133630.7377-1-jbx6244@gmail.com
4 years agodrm/tegra: Clean up GPIO includes
Linus Walleij [Wed, 15 Apr 2020 12:24:27 +0000 (14:24 +0200)]
drm/tegra: Clean up GPIO includes

The Tegra DRM drivers includes the legacy GPIO headers
<linux/gpio.h> and <linux/of_gpio.h> but what it really
uses is <linux/gpio/consumer.h> since only gpio_desc
structs are ever referenced.

Include the right header on the top level tegra/drm.h
file and drop all the surplus includes.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415122427.111769-1-linus.walleij@linaro.org
4 years agovideo: fbdev: vesafb: add missed release_region
Chuhong Yuan [Sun, 29 Mar 2020 14:58:39 +0000 (22:58 +0800)]
video: fbdev: vesafb: add missed release_region

The driver forgets to free the I/O region in remove and probe
failure.
Add the missed calls to fix it.

Since the success of request_region() is optional, add the "region" field
in vesafb_par to represent whether request_region() succeeds.
Then only call release_region() when "region" is not null.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200329145839.20076-1-hslester96@gmail.com
4 years agovideo: fbdev: arcfb: add missed free_irq and fix the order of request_irq
Chuhong Yuan [Tue, 24 Mar 2020 13:23:53 +0000 (21:23 +0800)]
video: fbdev: arcfb: add missed free_irq and fix the order of request_irq

The driver forgets to free irq in remove which is requested in
probe.
Add the missed call to fix it.
Also, the position of request_irq() in probe should be put before
register_framebuffer().

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200324132353.21785-1-hslester96@gmail.com
4 years agofbdev: s1d13xxxfb: add missed unregister_framebuffer in remove
Chuhong Yuan [Tue, 24 Mar 2020 13:23:11 +0000 (21:23 +0800)]
fbdev: s1d13xxxfb: add missed unregister_framebuffer in remove

The driver calls register_framebuffer() in probe but does not call
unregister_framebuffer() in remove.
Rename current remove to __s1d13xxxfb_remove() for error handler.
Then add a new remove to call unregister_framebuffer().

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Cc: Kristoffer Ericson <kristoffer.ericson@gmail.com>
[b.zolnierkie: ported over recent s1d13xxxfb changes]
[b.zolnierkie: removed extra newline]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200324132311.21729-1-hslester96@gmail.com