Tom Callaway
9f99963a43
drm/tinydrm/mi0283qt: Always set rotation value
...
The PiTFT (ili9340) has a hardware reset circuit that resets only
on power-on and not on each reboot through a gpio like the
rpi-display does. As a result, we need to always apply the
rotation value regardless of the display "on/off" state.
Moved the rotation setting code below out_enable:.
Signed-off-by: Tom Callaway <tcallawa@redhat.com >
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20180423161639.14420-1-tcallawa@redhat.com
2018-04-30 11:00:19 +02:00
Daniel Vetter
ccc3b2b348
drm: Move simple_display_pipe prepare_fb helper into gem fb helpers
...
There's nothing tinydrm specific to this, and there's a few more
copies of the same in various other drivers.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Gustavo Padovan <gustavo@padovan.org >
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Cc: Sean Paul <seanpaul@chromium.org >
Cc: David Airlie <airlied@linux.ie >
Cc: David Lechner <david@lechnology.com >
Cc: "Noralf Trønnes" <noralf@tronnes.org >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Shawn Guo <shawnguo@kernel.org >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Daniel Stone <daniels@collabora.com >
Cc: Haneen Mohammed <hamohammed.sa@gmail.com >
Cc: Ben Widawsky <ben@bwidawsk.net >
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com >
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com >
Acked-by: David Lechner <david@lechnology.com >
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20180405154449.23038-3-daniel.vetter@ffwll.ch
2018-04-24 13:57:22 +02:00
Ville Syrjälä
e85d30060e
drm/tinydrm: Make fb_dirty into a lower level hook
...
mipi_dbi_enable_flush() wants to call the fb->dirty() hook from the
bowels of the .atomic_enable() hook. That prevents us from taking the
plane mutex in fb->dirty() unless we also plumb down the acquire
context.
Instead it seems simpler to split the fb->dirty() into a tinydrm
specific lower level hook that can be called from
mipi_dbi_enable_flush() and from a generic higher level
tinydrm_fb_dirty() helper. As we don't have a tinydrm specific
vfuncs table we'll just stick it into tinydrm_device directly
for now.
v2: Deal with the fb->dirty() in tinydrm_display_pipe_update() as well (Noralf)
Cc: "Noralf Trønnes" <noralf@tronnes.org >
Cc: David Lechner <david@lechnology.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20180323153509.15287-1-ville.syrjala@linux.intel.com
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Tested-by: Noralf Trønnes <noralf@tronnes.org >
2018-03-28 19:19:32 +03:00
Ville Syrjälä
0c9c7fd00e
drm/simple-kms-helper: Plumb plane state to the enable hook
...
tinydrm enable hook wants to play around with the new fb in
.atomic_enable(), thus we'll need access to the plane state.
Performed with coccinelle:
@r1@
identifier F =~ ".*enable$";
identifier P, CS;
@@
F(
struct drm_simple_display_pipe *P
,struct drm_crtc_state *CS
+ ,struct drm_plane_state *plane_state
)
{
...
}
@@
struct drm_simple_display_pipe *P;
expression E;
@@
{
+ struct drm_plane *plane;
...
+ plane = &P->plane;
P->funcs->enable(P
,E
+ ,plane->state
);
...
}
@@
identifier P, CS;
@@
struct drm_simple_display_pipe_funcs {
...
void (*enable)(struct drm_simple_display_pipe *P
,struct drm_crtc_state *CS
+ ,struct drm_plane_state *plane_state
);
...
};
v2: Pimp the commit message (David)
Cc: Marek Vasut <marex@denx.de >
Cc: Eric Anholt <eric@anholt.net >
Cc: David Lechner <david@lechnology.com >
Cc: "Noralf Trønnes" <noralf@tronnes.org >
Cc: Linus Walleij <linus.walleij@linaro.org >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20180322202738.25817-1-ville.syrjala@linux.intel.com
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
2018-03-28 19:19:32 +03:00
Daniel Vetter
a7d2a87e99
drm/tinydrm: Use gem_free_object_unlocked
...
tinydrm doesn't use dev->struct_mutex and therefore has no need to use
gem_free_object.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: "Noralf Trønnes" <noralf@tronnes.org >
Acked-by: Noralf Trønnes <noralf@tronnes.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20180322105133.11211-2-daniel.vetter@ffwll.ch
2018-03-27 10:19:42 +02:00
Arnd Bergmann
7628166d5e
tinydrm: add backlight dependency
...
Calling devm_of_find_backlight directly means we get a link failure
without CONFIG_BACKLIGHT_CLASS_DEVICE:
drivers/gpu/drm/tinydrm/mi0283qt.o: In function `mi0283qt_probe':
mi0283qt.c:(.text+0x684): undefined reference to `devm_of_find_backlight'
This adds an explicit Kconfig dependency for it. While I did not
observe that failure for st7735r, I assume the same change is needed
there for the same reason.
Fixes: d1a2e7004b ("drm/tinydrm: Replace tinydrm_of_find_backlight with of_find_backlight")
Signed-off-by: Arnd Bergmann <arnd@arndb.de >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20180228134111.2042877-1-arnd@arndb.de
2018-02-28 15:08:56 -05:00
Meghana Madhyastha
27f6640c8f
drm/tinydrm: Call devres version of of_find_backlight
...
Call devm_of_find_backlight (the devres version) instead of
of_find_backlight.
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Sean Paul <seanpaul@chromium.org >
Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/244cd4d567cb3944a8cb7633715ffc8ac4e1ce83.1516810725.git.meghana.madhyastha@gmail.com
2018-02-20 11:07:22 -05:00
Meghana Madhyastha
d1a2e7004b
drm/tinydrm: Replace tinydrm_of_find_backlight with of_find_backlight
...
Remove tinydrm_of_find_backlight from tinydrm-helpers.c. We now have
a generic of_find_backlight defined in backlight.c. Let the callers
of tinydrm_of_find_backlight call of_find_backlight. Also, remove
select BACKLIGHT_LCD_SUPPORT and select BACKLIGHT_CLASS_DEVICE from
tinydrm/Kconfig as it is a hack that is no longer needed.
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Sean Paul <seanpaul@chromium.org >
Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/11dd1cabd098a730d07ab04c5987b139d14d8b21.1516810725.git.meghana.madhyastha@gmail.com
2018-02-20 11:07:22 -05:00
Meghana Madhyastha
414147e8a3
drm/tinydrm: Convert tinydrm_enable/disable_backlight to backlight_enable/disable
...
Remove tinydrm_enable/disable_backlight and let the callers call the
more generic backlight_enable/disable helpers
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Sean Paul <seanpaul@chromium.org >
Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/ec700724e47814e6426966e093bd32b2364ba147.1516810725.git.meghana.madhyastha@gmail.com
2018-02-20 11:07:22 -05:00
Noralf Trønnes
10399b22c1
drm/tinydrm/mipi-dbi: Change reset active time
...
The MIPI DBI spec states that reset active/low time should be more
than 9us. Change from 20ms to 20us.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: David Lechner <david@lechnology.com >
Tested-by: David Lechner <david@lechnology.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20180110185940.53841-8-noralf@tronnes.org
2018-01-15 15:17:24 +01:00
Noralf Trønnes
fe4be3b8f3
drm/tinydrm: Embed the mode in tinydrm_connector
...
Embed the mode in tinydrm_connector instead of doing an devm_ allocation.
Remove unnecessary use of ret variable at the end of
tinydrm_display_pipe_init().
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: David Lechner <david@lechnology.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20180110185940.53841-7-noralf@tronnes.org
2018-01-15 15:16:59 +01:00
Noralf Trønnes
f730eceb42
drm/tinydrm/mi0283qt: Let the display pipe handle power
...
It's better to leave power handling and controller init to the
modesetting machinery using the simple pipe .enable and .disable
callbacks. Remove unused mipi_dbi_pipe_enable().
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: David Lechner <david@lechnology.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20180110185940.53841-6-noralf@tronnes.org
2018-01-15 15:16:06 +01:00
Noralf Trønnes
070ab1283a
drm/tinydrm/mipi-dbi: Add poweron-reset functions
...
Split out common poweron-reset functionality.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: David Lechner <david@lechnology.com >
Tested-by: David Lechner <david@lechnology.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20180110185940.53841-5-noralf@tronnes.org
2018-01-15 15:13:47 +01:00
Noralf Trønnes
22edc8d38b
drm/tinydrm/mipi-dbi: Add mipi_dbi_enable_flush()
...
Add and use a function for enabling, flushing and turning on backlight.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: David Lechner <david@lechnology.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20180110185940.53841-4-noralf@tronnes.org
2018-01-15 15:10:28 +01:00
Noralf Trønnes
24e05e7a82
drm/tinydrm/mi0283qt: Remove ili9341.h
...
No need for a public header file for the command macros.
Just include the necessary ones in the driver.
Also use the MIPI_DCS_PIXEL_FMT_16BIT macro.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: David Lechner <david@lechnology.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20180110185940.53841-3-noralf@tronnes.org
2018-01-15 15:08:50 +01:00
Noralf Trønnes
2a678996d8
drm/tinydrm/mi0283qt: Use common include order
...
Include linux headers before drm headers as it's commonly done.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: David Lechner <david@lechnology.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20180110185940.53841-2-noralf@tronnes.org
2018-01-15 15:08:25 +01:00
David Lechner
5b8ea816e8
drm/tinydrm: add driver for ST7735R panels
...
This adds a new driver for Sitronix ST7735R display panels.
This has been tested using an Adafruit 1.8" TFT.
Signed-off-by: David Lechner <david@lechnology.com >
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Linus Walleij <linus.walleij@linaro.org >
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Link: https://patchwork.freedesktop.org/patch/msgid/1514833336-22564-4-git-send-email-david@lechnology.com
2018-01-03 13:54:24 +01:00
David Lechner
f3125a545d
drm/tinydrm: Update ILI9225 compatible string
...
This updates the compatible string for a no-name LCD panel to
"vot,v220hf01a-t", "ilitek,ili9225".
The original bindings were the generic "ilitek,ili9225-2.2in-176x220"
because I could not find a datasheet. However, after some more research,
I finally found one, so the actual vendor and model name are now known.
This previous bindings have not made it to the mainline kernel yet, so
this is not breaking backwards compatibility.
Signed-off-by: David Lechner <david@lechnology.com >
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Link: https://patchwork.freedesktop.org/patch/msgid/1513881187-3197-4-git-send-email-david@lechnology.com
2018-01-03 13:52:53 +01:00
Noralf Trønnes
d3820952ea
drm/tinydrm: Use drm_fb_cma_fbdev_init_with_funcs/fini()
...
Use drm_fb_cma_fbdev_init_with_funcs() and drm_fb_cma_fbdev_fini() which
relies on the fact that drm_device holds a pointer to the drm_fb_helper
structure. This means that the driver doesn't have to keep track of that.
Also use the drm_fb_helper functions directly.
Remove todo entry.
Cc: David Lechner <david@lechnology.com >
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Acked-by: David Lechner <david@lechnology.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Tested-by: David Lechner <david@lechnolgy.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20171208193743.34450-11-noralf@tronnes.org
2017-12-10 15:37:07 +01:00
David Lechner
b57e8b7661
drm/tinydrm: add driver for ILI9225 panels
...
This adds a new driver for display panels based on the Ilitek ILI9225
controller.
This was developed for a no-name panel with a red PCB that is commonly
marketed for Arduino. See <https://github.com/Nkawu/TFT_22_ILI9225 >.
Signed-off-by: David Lechner <david@lechnology.com >
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Link: https://patchwork.freedesktop.org/patch/msgid/1511122328-31133-5-git-send-email-david@lechnology.com
2017-12-01 14:08:37 +01:00
David Lechner
13deee8111
drm/tinydrm: export mipi_dbi_buf_copy and mipi_dbi_spi_cmd_max_speed
...
This exports the mipi_dbi_buf_copy() and mipi_dbi_spi_cmd_max_speed()
functions so that they can be shared with other drivers.
Signed-off-by: David Lechner <david@lechnology.com >
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Link: https://patchwork.freedesktop.org/patch/msgid/1511122328-31133-4-git-send-email-david@lechnology.com
2017-12-01 14:07:16 +01:00
Noralf Trønnes
6e8e9a01ec
drm/tinydrm: Use drm_mode_config_helper_suspend/resume()
...
Replace driver's code with the generic helpers that do the same thing.
Remove todo entry.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Stefan Agner <stefan@agner.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20171106191812.38927-6-noralf@tronnes.org
2017-11-30 18:19:15 +01:00
Noralf Trønnes
beed8313be
drm/tinydrm: Use drm_gem_cma_print_info()
...
There is a new core debugfs file that prints fb/gem info:
<debugfs>/dri/<n>/framebuffer
Use drm_gem_cma_print_info() to provide info to that output instead
of using drm_fb_cma_debugfs_show().
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20171107191348.17555-12-noralf@tronnes.org
2017-11-11 11:24:44 +01:00
Harsha Sharma
b7fa1bdb10
drm/tinydrm: Replace list_for_each with list_for_each_entry
...
Replace use of list_for_each with list_for_each_entry to simplify the
code and remove variables that are used only in list_for_each.
Done with following coccinelle patch:
@r@
identifier fn,i,f,p;
expression e;
iterator name list_for_each, list_for_each_entry;
type T;
@@
fn(...) {
++ T *i;
<+...
- list_for_each(p,e)
+ list_for_each_entry(i,e,f)
{
...
- T *i = list_entry(p,T,f);
...
}
...+>
}
@@
identifier r.fn,r.p;
@@
fn(...) {
...
- struct list_head *p;
... when != p
}
@@
identifier r.fn,r.i,r.f;
expression r.e;
statement S;
@@
fn(...) {
<...
list_for_each_entry(i,e,f)
- {
S
- }
...>
}
@s@
identifier i,f,p;
expression e;
type T;
@@
- list_for_each(p,e)
+ list_for_each_entry(i,e,f)
{
... when != T *i;
- i = list_entry(p,T,f);
...
}
@@
identifier s.p;
@@
- struct list_head *p;
... when != p
@@
identifier s.i,s.f;
expression s.e;
statement S;
@@
list_for_each_entry(i,e,f)
- {
S
- }
Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com >
Reviewed-by: Sean Paul <seanpaul@chromium.org >
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20171014202823.29230-1-harshasharmaiitr@gmail.com
2017-10-21 16:28:41 +02:00
Haneen Mohammed
9205281cb3
drm/tinydrm: Remove explicit .best_encoder assignment
...
Since the driver is relying on the atomic helpers, remove the explicit
.best_encoder assignment and let the core call
drm_atomic_helper_best_encoder().
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com >
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20171010205858.GA4806@Haneen
2017-10-13 17:34:51 +02:00