1
0
Fork 0
Commit Graph

855589 Commits (892e8ba38f28d68a17122a9e14cf36ea756aa6b8)

Author SHA1 Message Date
Douglas Anderson 892e8ba38f video: of: display_timing: Don't yell if no timing node is present
There may be cases (like in panel-simple.c) where we have a sane
fallback if no timings are specified in the device tree.  Let's get
rid of the unconditional pr_err().  We can add error messages in
individual drivers if it makes sense.

NOTE: we'll still print errors if the node is present but there are
problems parsing the timings.

Fixes: b8a2948fa2 ("drm/panel: simple: Add ability to override typical timing")
Reported-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190722182439.44844-3-dianders@chromium.org
2019-07-26 16:32:26 +02:00
Douglas Anderson 4faba50edb video: of: display_timing: Add of_node_put() in of_get_display_timing()
From code inspection it can be seen that of_get_display_timing() is
lacking an of_node_put().  Add it.

Fixes: ffa3fd21de ("videomode: implement public of_get_display_timing()")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190722182439.44844-2-dianders@chromium.org
2019-07-26 16:32:25 +02:00
Jeffrey Hugo cd5e1cbe1f drm/panel: simple: Add support for Sharp LD-D5116Z01B panel
The Sharp LD-D5116Z01B is a 12.3" eDP panel with a 1920X1280 resolution.

Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190708165811.46370-1-jeffrey.l.hugo@gmail.com
2019-07-26 14:16:48 +02:00
Jeffrey Hugo 85266d7515 dt-bindings: panel: Add Sharp LD-D5116Z01B
The Sharp LD-D5116Z01B is a 12.3" eDP panel with a 1920X1280 resolution.

Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190708165753.46275-1-jeffrey.l.hugo@gmail.com
2019-07-26 13:50:14 +02:00
Navid Emamdoost afd6d4f5a5 drm/panel: check failure cases in the probe func
The following function calls may fail and return NULL, so the null check
is added.
of_graph_get_next_endpoint
of_graph_get_remote_port_parent
of_graph_get_remote_port

Update: Thanks to Sam Ravnborg, for suggession on the use of goto to avoid
leaking endpoint.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190724195534.9303-1-navid.emamdoost@gmail.com
2019-07-26 13:44:42 +02:00
Yue Hu 67fe62dcf7 drm: Switch to use DEVFREQ_GOV_SIMPLE_ONDEMAND constant
Since governor name is defined by DEVFREQ framework internally, use the
macro definition instead of using the name directly.

Signed-off-by: Yue Hu <huyue2@yulong.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Jordan Crouse <jcrouse@codeaurora.org> for the msm part.
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190725035239.1192-1-zbestahu@gmail.com
2019-07-25 16:14:43 -06:00
Steven Price 4bced8bea0 drm/panfrost: Export all GPU feature registers
Midgard/Bifrost GPUs have a bunch of feature registers providing details
of what the hardware supports. Panfrost already reads these, this patch
exports them all to user space so that the jobs created by the user space
driver can be tuned for the particular hardware implementation.

Signed-off-by: Steven Price <steven.price@arm.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190724105626.53552-1-steven.price@arm.com
2019-07-25 16:10:52 -06:00
Leo Li a1b27e9922 drm/amd/display: Implement MST Aux device registration
Implement late_register and early_unregister hooks for MST connectors.
Call drm helpers for MST connector registration, which registers the
AUX devices.

Cc: Jerry Zuo <Jerry.Zuo@amd.com>
Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Leo Li <sunpeng.li@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190723232808.28128-10-sunpeng.li@amd.com
2019-07-25 17:52:17 -04:00
Leo Li db432cd096 drm/amd/display: Use connector kdev as aux device parent
Set the connector's kernel device as the parent for the aux kernel
device. This allows udev rules to access connector attributes when
creating symlinks to aux devices.

For example, the following udev rule:

SUBSYSTEM=="drm_dp_aux_dev", SUBSYSTEMS=="drm", ATTRS{edid}=="*",
	SYMLINK+="drm_dp_aux/by-name/$id"

Will create the following symlinks using the connector's name:

$ ls /dev/drm_dp_aux/by-name/
card0-DP-1  card0-DP-2  card0-DP-3

Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Cc: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190723232808.28128-6-sunpeng.li@amd.com
2019-07-25 17:51:57 -04:00
Leo Li 7713c0f10d drm/nouveau: Use connector kdev as aux device parent
Set the connector's kernel device as the parent for the aux kernel
device. This allows udev rules to access connector attributes when
creating symlinks to aux devices.

Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Leo Li <sunpeng.li@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190723232808.28128-4-sunpeng.li@amd.com
2019-07-25 17:51:26 -04:00
Ville Syrjälä 562836a269 drm/dp_mst: Enable registration of AUX devices for MST ports
All available downstream ports - physical and logical - are exposed for
each MST device. They are listed in /dev/, following the same naming
scheme as SST devices by appending an incremental ID.

Although all downstream ports are exposed, only some will work as
expected. Consider the following topology:

               +---------+
               |  ASIC   |
               +---------+
              Conn-0|
                    |
               +----v----+
          +----| MST HUB |----+
          |    +---------+    |
          |                   |
          |Port-1       Port-2|
    +-----v-----+       +-----v-----+
    |  MST      |       |  SST      |
    |  Display  |       |  Display  |
    +-----------+       +-----------+
          |Port-1
          x

 MST Path  | MST Device
 ----------+----------------------------------
 sst:0     | MST Hub
 mst:0-1   | MST Display
 mst:0-1-1 | MST Display's disconnected DP out
 mst:0-1-8 | MST Display's internal sink
 mst:0-2   | SST Display

On certain MST displays, the upstream physical port will ACK DPCD reads.
However, reads on the local logical port to the internal sink will
*NAK*. i.e. reading mst:0-1 ACKs, but mst:0-1-8 NAKs.

There may also be duplicates. Some displays will return the same GUID
when reading DPCD from both mst:0-1 and mst:0-1-8.

There are some device-dependent behavior as well. The MST hub used
during testing will actually *ACK* read requests on a disconnected
physical port, whereas the MST displays will NAK.

In light of these discrepancies, it's simpler to expose all downstream
ports - both physical and logical - and let the user decide what to use.

v3 changes:
* Change WARN_ON_ONCE -> DRM_ERROR on dpcd read errors
* Docstring and cosmetic fixes

v2 changes:

Moved remote aux device (un)registration to new mst connector late
register and early unregister helpers. Drivers should call these from
their own mst connector function hooks.

This is to solve an issue during driver unload, where mst connector
devices are unregistered before the remote aux devices are. In a setup
where aux devices are created as children of connector devices, the aux
device would be removed too early, and uncleanly. Doing so in
early_unregister solves this issue, as that is called before connector
unregistration.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Leo Li <sunpeng.li@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190723232808.28128-3-sunpeng.li@amd.com
2019-07-25 16:39:35 -04:00
Leo Li 3935ec4a11 drm/dp: Use non-cyclic idr
In preparation for adding aux devices for DP MST, make the IDR
non-cyclic. That way, hotplug cycling MST devices won't needlessly
increment the minor version index.

Signed-off-by: Leo Li <sunpeng.li@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190723232808.28128-2-sunpeng.li@amd.com
2019-07-25 16:19:19 -04:00
Sam Ravnborg 0005cbda43 drm/via: drop use of drmP.h
Drop use of the deprecated drmP.h header.
While touching the files divide include files in blocks
and sort the files alphabetically.

v2:
- Replace all uses of DRM_WAIT_ON() with VIA_WAIT_ON()
  and thus avoiding to pull in drm_os_linux.h

v3:
- DRM_WAIT_ON replacement moved to earlier patch (Emil)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: Kevin Brace <kevinbrace@gmx.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Mike Marshall <hubcap@omnibond.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Michel Dänzer <michel@daenzer.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190723200944.17285-5-sam@ravnborg.org
2019-07-25 17:35:20 +02:00
Sam Ravnborg 2299b52d13 drm/via: make via_drv.h self-contained
Added include of header files to make via_drv.h self-contained.

v3:
- Reworded changelog a little - to reflect that more than one
  header files are added

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: Kevin Brace <kevinbrace@gmx.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Mike Marshall <hubcap@omnibond.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Michel Dänzer <michel@daenzer.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190723200944.17285-4-sam@ravnborg.org
2019-07-25 17:35:20 +02:00
Sam Ravnborg 9154e60c4e drm/via: copy DRM_WAIT_ON as VIA_WAIT_ON and use it
VIA_WAIT_ON() is a direct copy of DRM_WAIT_ON() from
drm_os_linux.h.
The copy is made so we can avoid the dependency on the legacy header.
A more involved approach had been to introduce wait_event_* but for this
legacy driver the simpler and more safe approach with a copy of the
macro was selected.
Added the relevant header files for the functions used in VIA_WAIT_ON.

v3:
- Updated users of DRM_WAIT_ON => VIA_WAIT_ON (Emil)
- Updated $subject (Emil)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: Kevin Brace <kevinbrace@gmx.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Mike Marshall <hubcap@omnibond.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Michel Dänzer <michel@daenzer.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190723200944.17285-3-sam@ravnborg.org
2019-07-25 17:35:11 +02:00
Sam Ravnborg 3bf2a06e36 drm/via: drop use of DRM(READ|WRITE) macros
The DRM_READ, DRM_WRITE macros comes from the deprecated drm_os_linux.h
header file. Remove their use to remove this dependency.

Replace the use of the macros with static inline variants.

v4:
- Use a more standard via_write8_mask() function (Emil)

v3:
- Use static inline functions, rather than macros (Emil)
- Use dedicated mask variants for byte access (Emil)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: Kevin Brace <kevinbrace@gmx.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Mike Marshall <hubcap@omnibond.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Michel Dänzer <michel@daenzer.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190723200944.17285-2-sam@ravnborg.org
2019-07-25 17:33:38 +02:00
Olivier Moysan 17224cf29c drm/bridge: sii902x: add audio graph card support
Implement get_dai_id callback of audio HDMI codec
to support ASoC audio graph card.
HDMI audio output has to be connected to sii902x port 3.
get_dai_id callback maps this port to ASoC DAI index 0.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Reviewed-by: Philippe Cornu <philippe.cornu@st.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1562141052-26221-1-git-send-email-olivier.moysan@st.com
2019-07-25 14:20:02 +02:00
Olivier Moysan 6b72c7a98b drm/bridge: sii902x: make audio mclk optional
The master clock on i2s bus is not mandatory,
as sii902X internal PLL can be used instead.
Make use of mclk optional.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Reviewed-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1563811560-29589-4-git-send-email-olivier.moysan@st.com
2019-07-25 12:03:59 +02:00
Olivier Moysan 512ec50a97 dt-bindings: display: sii902x: Change audio mclk binding
As stated in SiL9022/24 datasheet, master clock is not required for I2S.
Make mclk property optional in DT bindings.

Fixes: 3f18021f43 ("dt-bindings: display: sii902x: Add HDMI audio bindings")

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Reviewed-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1563811560-29589-3-git-send-email-olivier.moysan@st.com
2019-07-25 12:03:43 +02:00
Olivier Moysan 365d28c92f drm/bridge: sii902x: fix missing reference to mclk clock
Add devm_clk_get call to retrieve reference to master clock.

Fixes: ff5781634c ("drm/bridge: sii902x: Implement HDMI audio support")

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Reviewed-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1563811560-29589-2-git-send-email-olivier.moysan@st.com
2019-07-25 12:02:38 +02:00
Ahmad Fatoum 8fabc9c310 drm/stm: attach gem fence to atomic state
To properly synchronize with other devices the fence from the GEM
object backing the framebuffer needs to be attached to the atomic
state, so the commit work can wait on fence signaling.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Philippe Cornu <philippe.cornu@st.com>
Tested-by: Philippe Cornu <philippe.cornu@st.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190712084228.8338-1-l.stach@pengutronix.de
2019-07-25 12:00:09 +02:00
Noralf Trønnes f27e43b46d MAINTAINERS: Remove tinydrm entry
tinydrm is just a collection of tiny drivers now.
Add T: drm-misc entry for tinydrm drivers that lacks it.

Cc: David Lechner <david@lechnology.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: David Lechner <david@lechnology.com>
Acked-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190722104312.16184-10-noralf@tronnes.org
2019-07-25 10:45:53 +02:00
Noralf Trønnes 174102f4de drm/tinydrm: Move mipi-dbi
This moves mipi-dbi to be a core helper with the name drm_mipi_dbi.

Fixup include's in drivers.
Move the docs entry and delete tinydrm.rst.
Delete the last tinydrm todo entry.

v2: Make DRM_MIPI_DBI tristate to enable it being built as a module.

Cc: Eric Anholt <eric@anholt.net>
Cc: David Lechner <david@lechnology.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: David Lechner <david@lechnology.com>
Acked-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190722104312.16184-9-noralf@tronnes.org
2019-07-25 10:45:07 +02:00
Noralf Trønnes 2d2bb61a6c drm/tinydrm/mipi-dbi: Select DRM_KMS_HELPER
mipi-dbi uses several KMS helper functions but that build dependency is
not expressed. Select DRM_KMS_HELPER to fix that.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: David Lechner <david@lechnology.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190722104312.16184-8-noralf@tronnes.org
2019-07-25 10:44:20 +02:00
Noralf Trønnes 3389669ac5 drm/tinydrm/Kconfig: drivers: Select BACKLIGHT_CLASS_DEVICE
The mipi_dbi helper is missing a dependency on DRM_KMS_HELPER and putting
that in revealed this problem:

drivers/video/fbdev/Kconfig:12:error: recursive dependency detected!
drivers/video/fbdev/Kconfig:12: symbol FB is selected by DRM_KMS_FB_HELPER
drivers/gpu/drm/Kconfig:75:     symbol DRM_KMS_FB_HELPER depends on DRM_KMS_HELPER
drivers/gpu/drm/Kconfig:69:     symbol DRM_KMS_HELPER is selected by TINYDRM_MIPI_DBI
drivers/gpu/drm/tinydrm/Kconfig:11:     symbol TINYDRM_MIPI_DBI is selected by TINYDRM_HX8357D
drivers/gpu/drm/tinydrm/Kconfig:15:     symbol TINYDRM_HX8357D depends on BACKLIGHT_CLASS_DEVICE
drivers/video/backlight/Kconfig:144:    symbol BACKLIGHT_CLASS_DEVICE is selected by FB_BACKLIGHT
drivers/video/fbdev/Kconfig:187:        symbol FB_BACKLIGHT depends on FB

A symbol that selects DRM_KMS_HELPER can not depend on
BACKLIGHT_CLASS_DEVICE. The reason for this is that DRM_KMS_FB_HELPER
selects FB instead of depending on it.

The tinydrm drivers have somehow gotten away with depending on
BACKLIGHT_CLASS_DEVICE because DRM_TINYDRM selects DRM_KMS_HELPER and the
drivers depend on that symbol.

An audit shows that all DRM drivers that select DRM_KMS_HELPER and use
BACKLIGHT_CLASS_DEVICE, selects it:
  DRM_TILCDC, DRM_GMA500, DRM_SHMOBILE, DRM_NOUVEAU, DRM_FSL_DCU,
  DRM_I915, DRM_RADEON, DRM_AMDGPU, DRM_PARADE_PS8622

Documentation/kbuild/kconfig-language.txt has a note regarding select:
1. 'select should be used with care since it doesn't visit dependencies.'
   This is not a problem since BACKLIGHT_CLASS_DEVICE doesn't have any
   dependencies.
2. 'In general use select only for non-visible symbols'
   BACKLIGHT_CLASS_DEVICE is user visible.

The real solution to this would be to have DRM_KMS_FB_HELPER depend on the
user visible symbol FB. That is a can of worms I'm not willing to tackle.
I fear that such a change will result in me handling difficult fallouts
for the next weeks. So I'm following DRM suite here.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: David Lechner <david@lechnology.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190722104312.16184-7-noralf@tronnes.org
2019-07-25 10:44:03 +02:00
Noralf Trønnes 7c9f1312cf drm/tinydrm/mipi-dbi: Remove CMA helper dependency
mipi-dbi depends on the CMA helper through its use of
drm_fb_cma_get_gem_obj(). This is an unnecessary dependency to drag in for
drivers that only want to use the MIPI DBI interface part.
Avoid this by open coding the function.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: David Lechner <david@lechnology.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190722104312.16184-6-noralf@tronnes.org
2019-07-25 10:43:38 +02:00
Noralf Trønnes 84137b866e drm/tinydrm: Split struct mipi_dbi in two
Split struct mipi_dbi into an interface part and a display pipeline part.
The interface part can be used by drivers that need to initialize the
controller, but that won't upload the framebuffer over this interface.

MIPI DBI supports 3 interface types:
- A. Motorola 6800 type parallel bus
- B. Intel 8080 type parallel bus
- C. SPI type with 3 options:

I've embedded the SPI type specifics in the mipi_dbi struct to avoid
adding unnecessary complexity. If more interface types will be supported
in the future, the type specifics might have to be split out.

Rename functions to match the new struct mipi_dbi_dev:
- drm_to_mipi_dbi() -> drm_to_mipi_dbi_dev().
- mipi_dbi_init*() -> mipi_dbi_dev_init*().

Cc: Eric Anholt <eric@anholt.net>
Cc: David Lechner <david@lechnology.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: David Lechner <david@lechnology.com>
Acked-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190722104312.16184-5-noralf@tronnes.org
2019-07-25 10:42:25 +02:00
Noralf Trønnes 440961d209 drm/tinydrm: Rename remaining variable mipi -> dbidev
struct mipi_dbi is going to be split into an interface part and a display
pipeline part. The interface part can be used by drivers that need to
initialize the controller, but that won't upload the framebuffer over
this interface.

tinydrm uses the variable name 'mipi' but this is not a good name since
MIPI refers to a lot of standards. This patch changes the variable name
to 'dbidev' where it refers to the pipeline part of struct mipi_dbi.

Cc: Eric Anholt <eric@anholt.net>
Cc: David Lechner <david@lechnology.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: David Lechner <david@lechnology.com>
Acked-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190722104312.16184-4-noralf@tronnes.org
2019-07-25 10:41:10 +02:00
Noralf Trønnes 36b5057216 drm/tinydrm: Rename variable mipi -> dbi
struct mipi_dbi is going to be split into an interface part and a display
pipeline part. The interface part can be used by drivers that need to
initialize the controller, but that won't upload the framebuffer over
this interface.

tinydrm uses the variable name 'mipi' but this is not a good name since
MIPI refers to a lot of standards. This patch changes the variable name
to 'dbi' where it refers to the interface part of struct mipi_dbi.

Functions that use both future parts will have both variables temporarily
pointing to the same structure.

Cc: Eric Anholt <eric@anholt.net>
Cc: David Lechner <david@lechnology.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: David Lechner <david@lechnology.com>
Acked-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190722104312.16184-3-noralf@tronnes.org
2019-07-25 10:40:01 +02:00
Noralf Trønnes 771ea160e6 drm/tinydrm/mipi-dbi: Move cmdlock mutex init
cmdlock protects command execution so put it in mipi_dbi_spi_init()
where it conceptually belongs.
This is prep work for the splitting of struct mipi_dbi.

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190722104312.16184-2-noralf@tronnes.org
2019-07-25 10:38:50 +02:00
Thomas Zimmermann a9c342ab77 drm/mgag200: Don't unpin the current cursor image's buffer.
Currently the displayed cursor buffer might be evicted from video memory.
Not unpinning the BO fixes this problem. At this point, pixels_current
also references the BO and it will be unpinned during the next cursor
update.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Fixes: 94dc57b103 ("drm/mgag200: Rewrite cursor handling")
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190723075425.24028-4-tzimmermann@suse.de
2019-07-24 09:48:30 +02:00
Thomas Zimmermann cf578c8c8e drm/mgag200: Set cursor scanout address to correct BO
The hardware requires the correct memory address of the buffer. Currently
the same BO's address is programmed unconditionally, so only every second
cursor update actually becomes visible.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Fixes: 94dc57b103 ("drm/mgag200: Rewrite cursor handling")
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190723075425.24028-3-tzimmermann@suse.de
2019-07-24 09:48:03 +02:00
Thomas Zimmermann a0fd72d2c9 drm/mgag200: Pin displayed cursor BO to video memory
The cursor BO has to be pinned to video ram while it's being displayed.
With the current code, the BO might be pinned to system memory instead.
The patch fixes this problem.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Fixes: 94dc57b103 ("drm/mgag200: Rewrite cursor handling")
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190723075425.24028-2-tzimmermann@suse.de
2019-07-24 09:47:43 +02:00
Marko Kohtala de6786bee4 video: ssd1307fb: Add devicetree configuration of display setup
Various displays have differences that only mean initializing the display
driver IC with different fixed register values. Defining these in
devicetree offers easier way to adapt the driver to new displays than
requiring a patch to the kernel.

This adds devicetree properties needed to make the initialization match
the example setup as offered by Densitron for their 128x36 display.

It also makes some old one bit parameter handling a little cleaner.

Signed-off-by: Marko Kohtala <marko.kohtala@okoko.fi>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: Michal Vokáč <michal.vokac@ysoft.com>
[b.zolnierkie: fix parenthesis alignment]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190618074111.9309-7-marko.kohtala@okoko.fi
2019-07-23 17:26:56 +02:00
Marko Kohtala ca6216fce8 dt-bindings: display: ssd1307fb: Add initialization properties
Document new bindings for adapting ssd1307fb driver to new displays.

Signed-off-by: Marko Kohtala <marko.kohtala@okoko.fi>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: Michal Vokáč <michal.vokac@ysoft.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190618074111.9309-6-marko.kohtala@okoko.fi
2019-07-23 17:18:34 +02:00
Marko Kohtala b0020d8af9 video: ssd1307fb: Handle width and height that are not multiple of 8
Some displays have dimensions that are not multiple of eight, for example
height of 36, but the driver divided the dimensions by 8. Defining display
to the next multiple of 8 is not good as then the display registers get
configured to dimensions that do not match. This contradicts intructions
by some display manufacturers.

Use DIV_ROUND_UP to multiple of 8 when needed so correct values can be
used.

The ssd1307fb_update_display bit reordering receives a simplification in
the process.

Signed-off-by: Marko Kohtala <marko.kohtala@okoko.fi>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: Michal Vokáč <michal.vokac@ysoft.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190618074111.9309-5-marko.kohtala@okoko.fi
2019-07-23 17:18:19 +02:00
Marko Kohtala dd9782834d video: ssd1307fb: Start page range at page_offset
The page_offset was only applied to the end of the page range. This caused
the display updates to cause a scrolling effect on the display because the
amount of data written to the display did not match the range display
expected.

Fixes: 301bc0675b ("video: ssd1307fb: Make use of horizontal addressing mode")
Signed-off-by: Marko Kohtala <marko.kohtala@okoko.fi>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: Michal Vokáč <michal.vokac@ysoft.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190618074111.9309-4-marko.kohtala@okoko.fi
2019-07-23 17:18:06 +02:00
Marko Kohtala 6bc9431111 video: ssd1307fb: Remove unneeded semicolons
coccicheck reported unneeded semicolons. Remove them.

Signed-off-by: Marko Kohtala <marko.kohtala@okoko.fi>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: Michal Vokáč <michal.vokac@ysoft.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190618074111.9309-3-marko.kohtala@okoko.fi
2019-07-23 17:17:53 +02:00
Marko Kohtala ed1dc7d565 video: ssd1307fb: Use screen_buffer instead of screen_base
sparse reported incorrect type due to different address spaces.
The screen_base is __iomem, but the memory is not from a device so we can
use screen_buffer instead and avoid some type casts.

Signed-off-by: Marko Kohtala <marko.kohtala@okoko.fi>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: Michal Vokáč <michal.vokac@ysoft.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190618074111.9309-2-marko.kohtala@okoko.fi
2019-07-23 17:17:37 +02:00
Fuqian Huang 8cbff03bb0 video: fbdev-MMP: Remove call to memset after dma_alloc_coherent
In commit 518a2f1925
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190715032017.7311-1-huangfq.daxian@gmail.com
2019-07-23 17:17:12 +02:00
Souptick Joarder 9b9f35e7c6 video: fbdev: nvidia: Remove dead code
This is dead code since 3.15. If there is no plan to use it
further, this can be removed forever.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1562782586-3994-1-git-send-email-jrdr.linux@gmail.com
2019-07-23 17:16:48 +02:00
Souptick Joarder b519294ee1 video: fbdev: nvidia: Remove extra return
Minor cleanup to remove extra return statement.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1562781795-3494-1-git-send-email-jrdr.linux@gmail.com
2019-07-23 17:16:27 +02:00
Christoph Hellwig 5ae01cba59 au1200fb: don't use DMA_ATTR_NON_CONSISTENT
au1200fb allocates DMA memory using DMA_ATTR_NON_CONSISTENT, but never
calls dma_cache_sync to synchronize the memory between the CPU and the
device.  If it was use on a not cache coherent bus that would be fatal,
but as far as I can tell from the naming and the mips platform
implementation it always is used in cache coherent systems.  Remove
the DMA_ATTR_NON_CONSISTENT flag, which is a no-op in that case.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190625121321.10197-1-hch@lst.de
2019-07-23 17:14:55 +02:00
Colin Ian King a74cefd915 fbmem: remove redundant assignment to err
Variable err is initialized to a value that is never read and it
is re-assigned later.  The initialization is redundant and can
be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190624223724.13629-1-colin.king@canonical.com
2019-07-23 17:14:22 +02:00
Noralf Trønnes 710ae47dc6 drm/tinydrm: Move tinydrm_display_pipe_init() to mipi-dbi
tinydrm_display_pipe_init() has only one user now, so move it to mipi-dbi.

Changes:
- Remove drm_connector_helper_funcs.detect, it's always connected.
- Store the connector and mode in mipi_dbi instead of it's own struct.

Otherwise remove some leftover tinydrm-helpers.h inclusions.

Cc: Eric Anholt <eric@anholt.net>
Cc: David Lechner <david@lechnology.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190719155916.62465-12-noralf@tronnes.org
2019-07-23 15:50:46 +02:00
Noralf Trønnes cc43121271 drm/tinydrm/mipi-dbi: Add mipi_dbi_init_with_formats()
The MIPI DBI standard support more pixel formats than what this helper
supports. Add an init function that lets the driver use different
format(s). This avoids open coding mipi_dbi_init() in st7586.

st7586 sets preferred_depth but this is not necessary since it only
supports one format.

v2: Forgot to remove the mipi->rotation assignment in st7586,
    mipi_dbi_init_with_formats() handles it.

Cc: David Lechner <david@lechnology.com>
Acked-by: David Lechner <david@lechnology.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Tested-by: David Lechner <david@lechnology.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190719155916.62465-11-noralf@tronnes.org
2019-07-23 15:49:39 +02:00
Noralf Trønnes 1321db8375 drm/tinydrm/repaper: Don't use tinydrm_display_pipe_init()
tinydrm.ko is going away so let's implement a connector.

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190719155916.62465-10-noralf@tronnes.org
2019-07-23 15:48:15 +02:00
Noralf Trønnes f729d8d962 drm/tinydrm: Move tinydrm_machine_little_endian()
The tinydrm helper is going away so move it into the only user mipi-dbi.

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190719155916.62465-9-noralf@tronnes.org
2019-07-23 15:47:58 +02:00
Noralf Trønnes d23d4d4dac drm/tinydrm: Move tinydrm_spi_transfer()
This is only used by mipi-dbi drivers so move it there.

The reason this isn't moved to the SPI subsystem is that it will in a
later patch pass a dummy rx buffer for SPI controllers that need this.
Low memory boards (64MB) can run into a problem allocating such a "large"
contiguous buffer on every transfer after a long up time.
This leaves a very specific use case, so we'll keep the function here.
mipi-dbi will first go through a refactoring though, before this will
be done.

Remove SPI todo entry now that we're done with the tinydrm.ko SPI code.

v2: Drop moving the mipi_dbi_spi_init() declaration (Sam)

Cc: David Lechner <david@lechnology.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: : David Lechner <david@lechnology.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190719155916.62465-8-noralf@tronnes.org
2019-07-23 15:47:33 +02:00
Noralf Trønnes 083a6c23b9 drm/tinydrm: Clean up tinydrm_spi_transfer()
Prep work before moving the function to mipi-dbi.

tinydrm_spi_transfer() was made to support one class of drivers in
drivers/staging/fbtft that has not been converted to DRM yet, so strip
away the unused functionality:
- Start byte (header) is not used.
- No driver relies on the automatic 16-bit byte swapping on little endian
  machines with SPI controllers only supporting 8 bits per word.

Other changes:
- No need to initialize ret
- No need for the WARN since mipi-dbi only uses 8 and 16 bpw.
- Use spi_message_init_with_transfers()

Cc: David Lechner <david@lechnology.com>
Acked-by: : David Lechner <david@lechnology.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190719155916.62465-7-noralf@tronnes.org
2019-07-23 15:46:56 +02:00