[PATCH v3 33/33] docs: EDID/HOWTO.txt: convert it and rename to howto.rst

2019-06-08 Thread Mauro Carvalho Chehab
Sphinx need to know when a paragraph ends. So, do some adjustments
at the file for it to be properly parsed.

At its new index.rst, let's add a :orphan: while this is not linked to
the main index.rst file, in order to avoid build warnings.

that's said, I believe that this file should be moved to the
GPU/DRM documentation.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/EDID/{HOWTO.txt => howto.rst}   | 31 ---
 .../admin-guide/kernel-parameters.txt |  2 +-
 drivers/gpu/drm/Kconfig   |  2 +-
 3 files changed, 22 insertions(+), 13 deletions(-)
 rename Documentation/EDID/{HOWTO.txt => howto.rst} (83%)

diff --git a/Documentation/EDID/HOWTO.txt b/Documentation/EDID/howto.rst
similarity index 83%
rename from Documentation/EDID/HOWTO.txt
rename to Documentation/EDID/howto.rst
index 539871c3b785..725fd49a88ca 100644
--- a/Documentation/EDID/HOWTO.txt
+++ b/Documentation/EDID/howto.rst
@@ -1,3 +1,9 @@
+:orphan:
+
+
+EDID
+
+
 In the good old days when graphics parameters were configured explicitly
 in a file called xorg.conf, even broken hardware could be managed.
 
@@ -34,16 +40,19 @@ Makefile. Please note that the EDID data structure expects 
the timing
 values in a different way as compared to the standard X11 format.
 
 X11:
-HTimings:  hdisp hsyncstart hsyncend htotal
-VTimings:  vdisp vsyncstart vsyncend vtotal
+  HTimings:
+hdisp hsyncstart hsyncend htotal
+  VTimings:
+vdisp vsyncstart vsyncend vtotal
 
-EDID:
-#define XPIX hdisp
-#define XBLANK htotal-hdisp
-#define XOFFSET hsyncstart-hdisp
-#define XPULSE hsyncend-hsyncstart
+EDID::
 
-#define YPIX vdisp
-#define YBLANK vtotal-vdisp
-#define YOFFSET vsyncstart-vdisp
-#define YPULSE vsyncend-vsyncstart
+  #define XPIX hdisp
+  #define XBLANK htotal-hdisp
+  #define XOFFSET hsyncstart-hdisp
+  #define XPULSE hsyncend-hsyncstart
+
+  #define YPIX vdisp
+  #define YBLANK vtotal-vdisp
+  #define YOFFSET vsyncstart-vdisp
+  #define YPULSE vsyncend-vsyncstart
diff --git a/Documentation/admin-guide/kernel-parameters.txt 
b/Documentation/admin-guide/kernel-parameters.txt
index 3d072ca532bb..3faf37b8b001 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -930,7 +930,7 @@
edid/1680x1050.bin, or edid/1920x1080.bin is given
and no file with the same name exists. Details and
instructions how to build your own EDID data are
-   available in Documentation/EDID/HOWTO.txt. An EDID
+   available in Documentation/EDID/howto.rst. An EDID
data set will only be used for a particular connector,
if its name and a colon are prepended to the EDID
name. Each connector may use a unique EDID data
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 6b34949416b1..c3a6dd284c91 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -141,7 +141,7 @@ config DRM_LOAD_EDID_FIRMWARE
  monitor are unable to provide appropriate EDID data. Since this
  feature is provided as a workaround for broken hardware, the
  default case is N. Details and instructions how to build your own
- EDID data are given in Documentation/EDID/HOWTO.txt.
+ EDID data are given in Documentation/EDID/howto.rst.
 
 config DRM_DP_CEC
bool "Enable DisplayPort CEC-Tunneling-over-AUX HDMI support"
-- 
2.21.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v3 16/33] docs: locking: convert docs to ReST and rename to *.rst

2019-06-08 Thread Mauro Carvalho Chehab
Convert the locking documents to ReST and add them to the
kernel development book where it belongs.

Most of the stuff here is just to make Sphinx to properly
parse the text file, as they're already in good shape,
not requiring massive changes in order to be parsed.

The conversion is actually:
  - add blank lines and identation in order to identify paragraphs;
  - fix tables markups;
  - add some lists markups;
  - mark literal blocks;
  - adjust title markups.

At its new index.rst, let's add a :orphan: while this is not linked to
the main index.rst file, in order to avoid build warnings.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/kernel-hacking/locking.rst  |   2 +-
 Documentation/locking/index.rst   |  24 ++
 ...{lockdep-design.txt => lockdep-design.rst} |  51 ++--
 .../locking/{lockstat.txt => lockstat.rst}| 221 ++
 .../{locktorture.txt => locktorture.rst}  | 105 +
 .../{mutex-design.txt => mutex-design.rst}|  26 ++-
 ...t-mutex-design.txt => rt-mutex-design.rst} | 139 ++-
 .../locking/{rt-mutex.txt => rt-mutex.rst}|  30 +--
 .../locking/{spinlocks.txt => spinlocks.rst}  |  32 ++-
 ...w-mutex-design.txt => ww-mutex-design.rst} |  82 ---
 Documentation/pi-futex.txt|   2 +-
 .../it_IT/kernel-hacking/locking.rst  |   2 +-
 drivers/gpu/drm/drm_modeset_lock.c|   2 +-
 include/linux/lockdep.h   |   2 +-
 include/linux/mutex.h |   2 +-
 include/linux/rwsem.h |   2 +-
 kernel/locking/mutex.c|   2 +-
 kernel/locking/rtmutex.c  |   2 +-
 lib/Kconfig.debug |   4 +-
 19 files changed, 428 insertions(+), 304 deletions(-)
 create mode 100644 Documentation/locking/index.rst
 rename Documentation/locking/{lockdep-design.txt => lockdep-design.rst} (93%)
 rename Documentation/locking/{lockstat.txt => lockstat.rst} (41%)
 rename Documentation/locking/{locktorture.txt => locktorture.rst} (57%)
 rename Documentation/locking/{mutex-design.txt => mutex-design.rst} (94%)
 rename Documentation/locking/{rt-mutex-design.txt => rt-mutex-design.rst} (91%)
 rename Documentation/locking/{rt-mutex.txt => rt-mutex.rst} (71%)
 rename Documentation/locking/{spinlocks.txt => spinlocks.rst} (89%)
 rename Documentation/locking/{ww-mutex-design.txt => ww-mutex-design.rst} (93%)

diff --git a/Documentation/kernel-hacking/locking.rst 
b/Documentation/kernel-hacking/locking.rst
index 519673df0e82..71a843464ec2 100644
--- a/Documentation/kernel-hacking/locking.rst
+++ b/Documentation/kernel-hacking/locking.rst
@@ -1364,7 +1364,7 @@ Futex API reference
 Further reading
 ===
 
--  ``Documentation/locking/spinlocks.txt``: Linus Torvalds' spinlocking
+-  ``Documentation/locking/spinlocks.rst``: Linus Torvalds' spinlocking
tutorial in the kernel sources.
 
 -  Unix Systems for Modern Architectures: Symmetric Multiprocessing and
diff --git a/Documentation/locking/index.rst b/Documentation/locking/index.rst
new file mode 100644
index ..ef5da7fe9aac
--- /dev/null
+++ b/Documentation/locking/index.rst
@@ -0,0 +1,24 @@
+:orphan:
+
+===
+locking
+===
+
+.. toctree::
+:maxdepth: 1
+
+lockdep-design
+lockstat
+locktorture
+mutex-design
+rt-mutex-design
+rt-mutex
+spinlocks
+ww-mutex-design
+
+.. only::  subproject and html
+
+   Indices
+   ===
+
+   * :ref:`genindex`
diff --git a/Documentation/locking/lockdep-design.txt 
b/Documentation/locking/lockdep-design.rst
similarity index 93%
rename from Documentation/locking/lockdep-design.txt
rename to Documentation/locking/lockdep-design.rst
index f189d130e543..23fcbc4d3fc0 100644
--- a/Documentation/locking/lockdep-design.txt
+++ b/Documentation/locking/lockdep-design.rst
@@ -2,6 +2,7 @@ Runtime locking correctness validator
 =
 
 started by Ingo Molnar 
+
 additions by Arjan van de Ven 
 
 Lock-class
@@ -56,7 +57,7 @@ where the last 1 category is:
 
 When locking rules are violated, these usage bits are presented in the
 locking error messages, inside curlies, with a total of 2 * n STATEs bits.
-A contrived example:
+A contrived example::
 
modprobe/2287 is trying to acquire lock:
 (&sio_locks[i].lock){-.-.}, at: [] mutex_lock+0x21/0x24
@@ -70,12 +71,14 @@ of the lock and readlock (if exists), for each of the n 
STATEs listed
 above respectively, and the character displayed at each bit position
 indicates:
 
+   ===  ===
'.'  acquired while irqs disabled and not in irq context
'-'  acquired in irq context
'+'  acquired with irqs enabled
'?'  acquired in irq context with irqs enabled.
+   ===  ===
 
-The bits are illustrated with an example:
+The bits are illustrated with an example::
 
 (&sio_locks[i].lock){-.-.}, at: [

[Bug 110862] Dual-monitors invalid state after turning on

2019-06-08 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110862

Bug ID: 110862
   Summary: Dual-monitors invalid state after turning on
   Product: DRI
   Version: XOrg git
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: DRM/AMDgpu
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: denisgolo...@yandex.ru

Hi

I experience annoying bug when I turn on my dual-monitor PC after some time is
turned off state.
Basically it results in following:

+---+
|   OK  |
|   |
+---+--+
|   |  |
|   |  |
| GARBAGE   |  GARBAGE |
|   |  |
|   +--+
|   |
|   |
+---+

X Windows render a small part of screen ("OK" area), everything else is
garbage, quite often flicking. Changing VT does not help.

Tested under Linux x64 5.1.6 + xorg-server-1.20.5 + amdgpu driver from git.
Hardware: XFX RX580 8GB

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Bug 110659] pageflipping seems to cause jittering on mouse input when running Hitman 2 in Wine/DXVK with amdgpu.dc=1

2019-06-08 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110659

--- Comment #22 from tempel.jul...@gmail.com ---
The Witcher 3 is affected as well (a bit less obvious, but still quite bad vs.
modesetting or amdgpu.dc=0). So, it seems this is a real dealbreaker for
playing games on Linux, which imho justifies to raise this ticket's priority.
:(

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Bug 110659] pageflipping seems to cause jittering on mouse input when running Hitman 2 in Wine/DXVK with amdgpu.dc=1

2019-06-08 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110659

tempel.jul...@gmail.com changed:

   What|Removed |Added

   Priority|medium  |high

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Bug 110781] Radeon: heavy r300 performance drop regression between 11.x and 19.x

2019-06-08 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110781

--- Comment #61 from Richard Thier  ---
I still get some slowdown when playing Mount&Blade: Warband which worked
before, but there is some chances it is something else or not even in mesa.

On my last system I was playing it with wine 1.8 and now with latest
wine-staging 4.x so there are just too many variables.

I have played a bit of Urban Terror though and it became smooth and playable
once again. Many times I actually get 60FPS top and 18-20 FPS when looking at
big areas.

Before our patches Urban Terror was running like a slideshow and completely
unplayable.

Also I have built my mesa using -O3 now - and updated my blog with knowledge
about how to add params for the compiler such as debug symbols or this. I think
the latter have helped a bit more FPS too, but still there is always room for
improvement.

The original problem this bug was about seems solved now.

PS.: I have issues/glitches with HYPERZ turned on. Should I open a different
bug report for that one? I think it belongs somewhere else as it might be no
even a regession and I feel it never worked for my card.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/fb-helper: Unexport cmdline helpers

2019-06-08 Thread Noralf Trønnes


Den 07.06.2019 20.52, skrev Daniel Vetter:
> No longer needed since the i915 initial config logic was pulled into
> the shared helper by Noralf.
> 

I'm fixing this when I move the modeset code to drm_client. I hope I can
apply the remaining bits this week (sent a v8). The CI gave me a failure
on v7 and the trybot has given me weird/changing failures this week when
I have tried to find which patch it chokes on. I don't think there's any
wrong with the patchset since it has been cleared by the CI several
times, and the patches in question has not been changed. Well, we'll see.

Noralf.

> Spotted while reviewing patches from Ville.
> 
> Cc: Noralf Trønnes 
> Cc: Ville Syrjala 
> Signed-off-by: Daniel Vetter 
> ---
>  drivers/gpu/drm/drm_fb_helper.c | 9 +
>  include/drm/drm_fb_helper.h | 5 -
>  2 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index b9b7c06cbc4f..95079d5c07b8 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -2138,7 +2138,9 @@ static int drm_fb_helper_probe_connector_modes(struct 
> drm_fb_helper *fb_helper,
>   return count;
>  }
>  
> -struct drm_display_mode *drm_has_preferred_mode(struct 
> drm_fb_helper_connector *fb_connector, int width, int height)
> +static struct drm_display_mode *
> +drm_has_preferred_mode(struct drm_fb_helper_connector *fb_connector,
> +int width, int height)
>  {
>   struct drm_display_mode *mode;
>  
> @@ -2151,14 +2153,14 @@ struct drm_display_mode 
> *drm_has_preferred_mode(struct drm_fb_helper_connector *
>   }
>   return NULL;
>  }
> -EXPORT_SYMBOL(drm_has_preferred_mode);
>  
>  static bool drm_has_cmdline_mode(struct drm_fb_helper_connector 
> *fb_connector)
>  {
>   return fb_connector->connector->cmdline_mode.specified;
>  }
>  
> -struct drm_display_mode *drm_pick_cmdline_mode(struct 
> drm_fb_helper_connector *fb_helper_conn)
> +static struct drm_display_mode *
> +drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn)
>  {
>   struct drm_cmdline_mode *cmdline_mode;
>   struct drm_display_mode *mode;
> @@ -2208,7 +2210,6 @@ struct drm_display_mode *drm_pick_cmdline_mode(struct 
> drm_fb_helper_connector *f
>   list_add(&mode->head, &fb_helper_conn->connector->modes);
>   return mode;
>  }
> -EXPORT_SYMBOL(drm_pick_cmdline_mode);
>  
>  static bool drm_connector_enabled(struct drm_connector *connector, bool 
> strict)
>  {
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 6b334f4d8a22..5a7e5d131913 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -289,11 +289,6 @@ int drm_fb_helper_initial_config(struct drm_fb_helper 
> *fb_helper, int bpp_sel);
>  int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper);
>  int drm_fb_helper_debug_enter(struct fb_info *info);
>  int drm_fb_helper_debug_leave(struct fb_info *info);
> -struct drm_display_mode *
> -drm_has_preferred_mode(struct drm_fb_helper_connector *fb_connector,
> - int width, int height);
> -struct drm_display_mode *
> -drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn);
>  
>  int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, struct 
> drm_connector *connector);
>  int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v8 3/5] drm/fb-helper: Move out modeset config code

2019-06-08 Thread Noralf Trønnes
No functional changes, just moving code as-is and fixing includes.

Signed-off-by: Noralf Trønnes 
Reviewed-by: Maxime Ripard 
Reviewed-by: Sam Ravnborg 
---
 drivers/gpu/drm/drm_client_modeset.c | 707 ++-
 drivers/gpu/drm/drm_fb_helper.c  | 692 --
 include/drm/drm_client.h |   5 +-
 3 files changed, 702 insertions(+), 702 deletions(-)

diff --git a/drivers/gpu/drm/drm_client_modeset.c 
b/drivers/gpu/drm/drm_client_modeset.c
index b1984f901a6d..006bf7390e7d 100644
--- a/drivers/gpu/drm/drm_client_modeset.c
+++ b/drivers/gpu/drm/drm_client_modeset.c
@@ -13,13 +13,22 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "drm_crtc_internal.h"
 #include "drm_internal.h"
 
+#define DRM_CLIENT_MAX_CLONED_CONNECTORS   8
+
+struct drm_client_offset {
+   int x, y;
+};
+
 int drm_client_modeset_create(struct drm_client_dev *client)
 {
struct drm_device *dev = client->dev;
@@ -58,7 +67,7 @@ int drm_client_modeset_create(struct drm_client_dev *client)
return -ENOMEM;
 }
 
-void drm_client_modeset_release(struct drm_client_dev *client)
+static void drm_client_modeset_release(struct drm_client_dev *client)
 {
struct drm_mode_set *modeset;
unsigned int i;
@@ -75,8 +84,6 @@ void drm_client_modeset_release(struct drm_client_dev *client)
modeset->num_connectors = 0;
}
 }
-/* TODO: Remove export when modeset code has been moved over */
-EXPORT_SYMBOL(drm_client_modeset_release);
 
 void drm_client_modeset_free(struct drm_client_dev *client)
 {
@@ -95,7 +102,8 @@ void drm_client_modeset_free(struct drm_client_dev *client)
kfree(client->modesets);
 }
 
-struct drm_mode_set *drm_client_find_modeset(struct drm_client_dev *client, 
struct drm_crtc *crtc)
+static struct drm_mode_set *
+drm_client_find_modeset(struct drm_client_dev *client, struct drm_crtc *crtc)
 {
struct drm_mode_set *modeset;
 
@@ -105,8 +113,695 @@ struct drm_mode_set *drm_client_find_modeset(struct 
drm_client_dev *client, stru
 
return NULL;
 }
-/* TODO: Remove export when modeset code has been moved over */
-EXPORT_SYMBOL(drm_client_find_modeset);
+
+static struct drm_display_mode *
+drm_connector_has_preferred_mode(struct drm_connector *connector, int width, 
int height)
+{
+   struct drm_display_mode *mode;
+
+   list_for_each_entry(mode, &connector->modes, head) {
+   if (mode->hdisplay > width ||
+   mode->vdisplay > height)
+   continue;
+   if (mode->type & DRM_MODE_TYPE_PREFERRED)
+   return mode;
+   }
+   return NULL;
+}
+
+static struct drm_display_mode *
+drm_connector_pick_cmdline_mode(struct drm_connector *connector)
+{
+   struct drm_cmdline_mode *cmdline_mode;
+   struct drm_display_mode *mode;
+   bool prefer_non_interlace;
+
+   cmdline_mode = &connector->cmdline_mode;
+   if (cmdline_mode->specified == false)
+   return NULL;
+
+   /* attempt to find a matching mode in the list of modes
+*  we have gotten so far, if not add a CVT mode that conforms
+*/
+   if (cmdline_mode->rb || cmdline_mode->margins)
+   goto create_mode;
+
+   prefer_non_interlace = !cmdline_mode->interlace;
+again:
+   list_for_each_entry(mode, &connector->modes, head) {
+   /* check width/height */
+   if (mode->hdisplay != cmdline_mode->xres ||
+   mode->vdisplay != cmdline_mode->yres)
+   continue;
+
+   if (cmdline_mode->refresh_specified) {
+   if (mode->vrefresh != cmdline_mode->refresh)
+   continue;
+   }
+
+   if (cmdline_mode->interlace) {
+   if (!(mode->flags & DRM_MODE_FLAG_INTERLACE))
+   continue;
+   } else if (prefer_non_interlace) {
+   if (mode->flags & DRM_MODE_FLAG_INTERLACE)
+   continue;
+   }
+   return mode;
+   }
+
+   if (prefer_non_interlace) {
+   prefer_non_interlace = false;
+   goto again;
+   }
+
+create_mode:
+   mode = drm_mode_create_from_cmdline_mode(connector->dev, cmdline_mode);
+   list_add(&mode->head, &connector->modes);
+
+   return mode;
+}
+
+static bool drm_connector_enabled(struct drm_connector *connector, bool strict)
+{
+   bool enable;
+
+   if (connector->display_info.non_desktop)
+   return false;
+
+   if (strict)
+   enable = connector->status == connector_status_connected;
+   else
+   enable = connector->status != connector_status_disconnected;
+
+   return enable;
+}
+
+static void drm_client_connectors_enabled(struct drm_connector **connectors,
+  

[PATCH v8 1/5] drm/fb-helper: Remove drm_fb_helper_connector

2019-06-08 Thread Noralf Trønnes
All drivers add all their connectors so there's no need to keep around an
array of available connectors. Instead we just put the useable (not
writeback) connectors in a temporary array using
drm_client_for_each_connector_iter() everytime we probe the outputs.
Other places where it's necessary to look at the connectors, we just
iterate over them using the same iterator function.

Rename functions which signature is changed since they will be moved to
drm_client in a later patch.

v6: Improve commit message (Sam Ravnborg)

Signed-off-by: Noralf Trønnes 
Reviewed-by: Sam Ravnborg 
---
 Documentation/gpu/todo.rst  |   4 +
 drivers/gpu/drm/drm_fb_helper.c | 498 ++--
 include/drm/drm_client.h|  15 +
 include/drm/drm_fb_helper.h |  80 ++---
 4 files changed, 193 insertions(+), 404 deletions(-)

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 9d4038c50013..ab96ba0600a9 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -292,6 +292,10 @@ drm_fb_helper tasks
 - The max connector argument for drm_fb_helper_init() and
   drm_fb_helper_fbdev_setup() isn't used anymore and can be removed.
 
+- The helper doesn't keep an array of connectors anymore so these can be
+  removed: drm_fb_helper_single_add_all_connectors(),
+  drm_fb_helper_add_one_connector() and drm_fb_helper_remove_one_connector().
+
 Core refactorings
 =
 
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 7b388674a456..b936db6280ac 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -95,12 +95,6 @@ static DEFINE_MUTEX(kernel_fb_helper_lock);
  * Setup fbdev emulation by calling drm_fb_helper_fbdev_setup() and tear it
  * down by calling drm_fb_helper_fbdev_teardown().
  *
- * Drivers that need to handle connector hotplugging (e.g. dp mst) can't use
- * the setup helper and will need to do the whole four-step setup process with
- * drm_fb_helper_prepare(), drm_fb_helper_init(),
- * drm_fb_helper_single_add_all_connectors(), enable hotplugging and
- * drm_fb_helper_initial_config() to avoid a possible race window.
- *
  * At runtime drivers should restore the fbdev console by using
  * drm_fb_helper_lastclose() as their &drm_driver.lastclose callback.
  * They should also notify the fb helper code from updates to the output
@@ -123,8 +117,7 @@ static DEFINE_MUTEX(kernel_fb_helper_lock);
  * encoders and connectors. To finish up the fbdev helper initialization, the
  * drm_fb_helper_init() function is called. To probe for all attached displays
  * and set up an initial configuration using the detected hardware, drivers
- * should call drm_fb_helper_single_add_all_connectors() followed by
- * drm_fb_helper_initial_config().
+ * should call drm_fb_helper_initial_config().
  *
  * If &drm_framebuffer_funcs.dirty is set, the
  * drm_fb_helper_{cfb,sys}_{write,fillrect,copyarea,imageblit} functions will
@@ -137,165 +130,6 @@ static DEFINE_MUTEX(kernel_fb_helper_lock);
  * deferred I/O (coupled with drm_fb_helper_fbdev_teardown()).
  */
 
-#define drm_fb_helper_for_each_connector(fbh, i__) \
-   for (({ lockdep_assert_held(&(fbh)->lock); }), \
-i__ = 0; i__ < (fbh)->connector_count; i__++)
-
-static int __drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper,
-struct drm_connector *connector)
-{
-   struct drm_fb_helper_connector *fb_conn;
-   struct drm_fb_helper_connector **temp;
-   unsigned int count;
-
-   if (!drm_fbdev_emulation)
-   return 0;
-
-   lockdep_assert_held(&fb_helper->lock);
-
-   count = fb_helper->connector_count + 1;
-
-   if (count > fb_helper->connector_info_alloc_count) {
-   size_t size = count * sizeof(fb_conn);
-
-   temp = krealloc(fb_helper->connector_info, size, GFP_KERNEL);
-   if (!temp)
-   return -ENOMEM;
-
-   fb_helper->connector_info_alloc_count = count;
-   fb_helper->connector_info = temp;
-   }
-
-   fb_conn = kzalloc(sizeof(*fb_conn), GFP_KERNEL);
-   if (!fb_conn)
-   return -ENOMEM;
-
-   drm_connector_get(connector);
-   fb_conn->connector = connector;
-   fb_helper->connector_info[fb_helper->connector_count++] = fb_conn;
-
-   return 0;
-}
-
-int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper,
-   struct drm_connector *connector)
-{
-   int err;
-
-   if (!fb_helper)
-   return 0;
-
-   mutex_lock(&fb_helper->lock);
-   err = __drm_fb_helper_add_one_connector(fb_helper, connector);
-   mutex_unlock(&fb_helper->lock);
-
-   return err;
-}
-EXPORT_SYMBOL(drm_fb_helper_add_one_connector);
-
-/**
- * drm_fb_helper_single_add_all_connectors() - add all connectors to fbdev
- *emulation helper
- 

[PATCH v8 5/5] drm/todo: Add bootsplash entry

2019-06-08 Thread Noralf Trønnes
Ease entry for anyone wanting to pick up the bootsplash work by providing
a couple of pointers.

v2: Add Sam as contact (Sam)

Signed-off-by: Noralf Trønnes 
Reviewed-by: Paul Kocialkowski 
Reviewed-by: Sam Ravnborg 
---
 Documentation/gpu/todo.rst | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index ab96ba0600a9..b4a76c2703e5 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -484,5 +484,20 @@ i915
   device_link_add to model the dependency between i915 and snd_had. See
   https://dri.freedesktop.org/docs/drm/driver-api/device_link.html
 
+Bootsplash
+==
+
+There is support in place now for writing internal DRM clients making it
+possible to pick up the bootsplash work that was rejected because it was 
written
+for fbdev.
+
+- [v6,8/8] drm/client: Hack: Add bootsplash example
+  https://patchwork.freedesktop.org/patch/306579/
+
+- [RFC PATCH v2 00/13] Kernel based bootsplash
+  https://lkml.org/lkml/2017/12/13/764
+
+Contact: Sam Ravnborg
+
 Outside DRM
 ===
-- 
2.20.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v8 4/5] drm/client: Hack: Add bootsplash example

2019-06-08 Thread Noralf Trønnes
An example to showcase the client API.

TODO:
- A bootsplash client needs a way to tell drm_fb_helper to stay away,
  otherwise it will chime in on setup and hotplug.
  Most DRM drivers register fbdev before calling drm_dev_register() (the
  generic emulation is an exception). This have to be reversed for
  bootsplash to fend off fbdev.
- Probably need some way to determine which is the primary display/device
  on multi DRM device systems.
- Maybe do handover from early/simple DRM driver

Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/Kconfig  |   5 +
 drivers/gpu/drm/Makefile |   1 +
 drivers/gpu/drm/drm_bootsplash.c | 358 +++
 drivers/gpu/drm/drm_client.c |   7 +
 drivers/gpu/drm/drm_drv.c|   4 +
 include/drm/drm_client.h |   3 +
 6 files changed, 378 insertions(+)
 create mode 100644 drivers/gpu/drm/drm_bootsplash.c

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 6b34949416b1..d77a67cf3a89 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -66,6 +66,11 @@ config DRM_DEBUG_SELFTEST
 
  If in doubt, say "N".
 
+config DRM_CLIENT_BOOTSPLASH
+   bool "DRM Bootsplash"
+   help
+ DRM Bootsplash
+
 config DRM_KMS_HELPER
tristate
depends on DRM
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index d36feb4a6233..86a2ceb95838 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -31,6 +31,7 @@ drm-$(CONFIG_OF) += drm_of.o
 drm-$(CONFIG_AGP) += drm_agpsupport.o
 drm-$(CONFIG_DEBUG_FS) += drm_debugfs.o drm_debugfs_crc.o
 drm-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o
+drm-$(CONFIG_DRM_CLIENT_BOOTSPLASH) += drm_bootsplash.o
 
 drm_vram_helper-y := drm_gem_vram_helper.o \
 drm_vram_helper_common.o \
diff --git a/drivers/gpu/drm/drm_bootsplash.c b/drivers/gpu/drm/drm_bootsplash.c
new file mode 100644
index ..f58ee19e268f
--- /dev/null
+++ b/drivers/gpu/drm/drm_bootsplash.c
@@ -0,0 +1,358 @@
+/* DRM internal client example */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+// drm_lastclose()
+#include "drm_internal.h"
+
+static bool drm_bootsplash_enabled = true;
+module_param_named(bootsplash_enabled, drm_bootsplash_enabled, bool, 0600);
+MODULE_PARM_DESC(bootsplash_enabled, "Enable bootsplash client 
[default=true]");
+
+struct drm_bootsplash {
+   struct drm_client_dev client;
+   struct mutex lock;
+   struct work_struct worker;
+   struct drm_client_buffer *buffers[2];
+   bool started;
+   bool stop;
+};
+
+static bool drm_bootsplash_key_pressed;
+
+static int drm_bootsplash_keyboard_notifier_call(struct notifier_block *blk,
+unsigned long code, void 
*_param)
+{
+   /* Any key is good */
+   drm_bootsplash_key_pressed = true;
+
+   return NOTIFY_OK;
+}
+
+static struct notifier_block drm_bootsplash_keyboard_notifier_block = {
+   .notifier_call = drm_bootsplash_keyboard_notifier_call,
+};
+
+static void drm_bootsplash_buffer_delete(struct drm_bootsplash *splash)
+{
+   unsigned int i;
+
+   for (i = 0; i < 2; i++) {
+   if (!IS_ERR_OR_NULL(splash->buffers[i]))
+   drm_client_framebuffer_delete(splash->buffers[i]);
+   splash->buffers[i] = NULL;
+   }
+}
+
+static int drm_bootsplash_buffer_create(struct drm_bootsplash *splash, u32 
width, u32 height)
+{
+   unsigned int i;
+
+   for (i = 0; i < 2; i++) {
+   splash->buffers[i] = 
drm_client_framebuffer_create(&splash->client, width, height, 
DRM_FORMAT_XRGB);
+   if (IS_ERR(splash->buffers[i])) {
+   drm_bootsplash_buffer_delete(splash);
+   return PTR_ERR(splash->buffers[i]);
+   }
+   }
+
+   return 0;
+}
+
+static int drm_bootsplash_display_probe(struct drm_bootsplash *splash)
+{
+   struct drm_client_dev *client = &splash->client;
+   unsigned int width = 0, height = 0;
+   unsigned int num_non_tiled = 0, i;
+   unsigned int modeset_mask = 0;
+   struct drm_mode_set *modeset;
+   bool tiled = false;
+   int ret;
+
+   ret = drm_client_modeset_probe(client, 0, 0);
+   if (ret)
+   return ret;
+
+   mutex_lock(&client->modeset_mutex);
+
+   drm_client_for_each_modeset(modeset, client) {
+   if (!modeset->mode)
+   continue;
+
+   if (modeset->connectors[0]->has_tile)
+   tiled = true;
+   else
+   num_non_tiled++;
+   }
+
+   if (!tiled && !num_non_tiled) {
+   drm_bootsplash_buffer_delete(splash);
+   ret = -ENOENT;
+   goto out;
+   }
+
+   /* Assume only one tiled monitor is possible */
+   if (ti

[PATCH v8 2/5] drm/fb-helper: Prepare to move out modeset config code

2019-06-08 Thread Noralf Trønnes
This prepares the modeset code so it can be moved out as-is in the next
patch.

v3: Remove stray newline

Signed-off-by: Noralf Trønnes 
Reviewed-by: Maxime Ripard 
Reviewed-by: Sam Ravnborg 
---
 drivers/gpu/drm/drm_fb_helper.c | 62 +++--
 include/drm/drm_fb_helper.h |  4 ---
 2 files changed, 44 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index b936db6280ac..e7f41e5d924c 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -48,6 +48,10 @@
 
 #include "drm_internal.h"
 
+struct drm_client_offset {
+   int x, y;
+};
+
 static bool drm_fbdev_emulation = true;
 module_param_named(fbdev_emulation, drm_fbdev_emulation, bool, 0600);
 MODULE_PARM_DESC(fbdev_emulation,
@@ -1809,7 +1813,7 @@ static bool drm_client_target_cloned(struct drm_device 
*dev,
 struct drm_connector **connectors,
 unsigned int connector_count,
 struct drm_display_mode **modes,
-struct drm_fb_offset *offsets,
+struct drm_client_offset *offsets,
 bool *enabled, int width, int height)
 {
int count, i, j;
@@ -1888,7 +1892,7 @@ static bool drm_client_target_cloned(struct drm_device 
*dev,
 static int drm_client_get_tile_offsets(struct drm_connector **connectors,
   unsigned int connector_count,
   struct drm_display_mode **modes,
-  struct drm_fb_offset *offsets,
+  struct drm_client_offset *offsets,
   int idx,
   int h_idx, int v_idx)
 {
@@ -1921,7 +1925,7 @@ static int drm_client_get_tile_offsets(struct 
drm_connector **connectors,
 static bool drm_client_target_preferred(struct drm_connector **connectors,
unsigned int connector_count,
struct drm_display_mode **modes,
-   struct drm_fb_offset *offsets,
+   struct drm_client_offset *offsets,
bool *enabled, int width, int height)
 {
const u64 mask = BIT_ULL(connector_count) - 1;
@@ -2085,7 +2089,7 @@ static bool drm_client_firmware_config(struct 
drm_client_dev *client,
   unsigned int connector_count,
   struct drm_crtc **crtcs,
   struct drm_display_mode **modes,
-  struct drm_fb_offset *offsets,
+  struct drm_client_offset *offsets,
   bool *enabled, int width, int height)
 {
unsigned int count = min_t(unsigned int, connector_count, 
BITS_PER_LONG);
@@ -2255,30 +2259,47 @@ static bool drm_client_firmware_config(struct 
drm_client_dev *client,
return ret;
 }
 
-static void drm_setup_crtcs(struct drm_fb_helper *fb_helper,
-   u32 width, u32 height)
+/**
+ * drm_client_modeset_probe() - Probe for displays
+ * @client: DRM client
+ * @width: Maximum display mode width (optional)
+ * @height: Maximum display mode height (optional)
+ *
+ * This function sets up display pipelines for enabled connectors and stores 
the
+ * config in the client's modeset array.
+ *
+ * Returns:
+ * Zero on success or negative error code on failure.
+ */
+int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int 
width, unsigned int height)
 {
struct drm_connector *connector, **connectors = NULL;
-   struct drm_client_dev *client = &fb_helper->client;
struct drm_connector_list_iter conn_iter;
-   struct drm_device *dev = fb_helper->dev;
+   struct drm_device *dev = client->dev;
unsigned int total_modes_count = 0;
+   struct drm_client_offset *offsets;
unsigned int connector_count = 0;
struct drm_display_mode **modes;
-   struct drm_fb_offset *offsets;
struct drm_crtc **crtcs;
+   int i, ret = 0;
bool *enabled;
-   int i;
 
DRM_DEBUG_KMS("\n");
 
+   if (!width)
+   width = dev->mode_config.max_width;
+   if (!height)
+   height = dev->mode_config.max_height;
+
drm_connector_list_iter_begin(dev, &conn_iter);
drm_client_for_each_connector_iter(connector, &conn_iter) {
struct drm_connector **tmp;
 
tmp = krealloc(connectors, (connector_count + 1) * 
sizeof(*connectors), GFP_KERNEL);
-   if (!tmp)
+   if (!tmp) {
+   ret = -ENOMEM;
goto free_connectors;
+

[PATCH v8 0/5] drm/fb-helper: Move modesetting code to drm_client

2019-06-08 Thread Noralf Trønnes
This moves the modesetting code from drm_fb_helper to drm_client so it
can be shared by all internal clients.

Let's see what the CI says about the remaining patches. I have added the
bootsplash todo entry patch adding Sam as contact.

Noralf.

Noralf Trønnes (5):
  drm/fb-helper: Remove drm_fb_helper_connector
  drm/fb-helper: Prepare to move out modeset config code
  drm/fb-helper: Move out modeset config code
  drm/client: Hack: Add bootsplash example
  drm/todo: Add bootsplash entry

 Documentation/gpu/todo.rst   |  19 +
 drivers/gpu/drm/Kconfig  |   5 +
 drivers/gpu/drm/Makefile |   1 +
 drivers/gpu/drm/drm_bootsplash.c | 358 +++
 drivers/gpu/drm/drm_client.c |   7 +
 drivers/gpu/drm/drm_client_modeset.c | 707 -
 drivers/gpu/drm/drm_drv.c|   4 +
 drivers/gpu/drm/drm_fb_helper.c  | 886 +--
 include/drm/drm_client.h |  23 +-
 include/drm/drm_fb_helper.h  |  84 +--
 10 files changed, 1149 insertions(+), 945 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_bootsplash.c

-- 
2.20.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 1/2] drm: panels: Add MAINTAINERS entry for LVDS panel driver

2019-06-08 Thread Laurent Pinchart
As the DRM LVDS panel driver uses a different approach to DT bindings
compared to what Thierry Reding advocates, add a specific MAINTAINERS
entry to avoid bothering Thierry with requests related to that driver.

Signed-off-by: Laurent Pinchart 
---
 MAINTAINERS | 8 
 1 file changed, 8 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7a2f487ea49a..713733afec17 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5021,6 +5021,14 @@ S:   Orphan / Obsolete
 F: drivers/gpu/drm/i810/
 F: include/uapi/drm/i810_drm.h
 
+DRM DRIVER FOR LVDS PANELS
+M: Laurent Pinchart 
+L: dri-devel@lists.freedesktop.org
+T: git git://anongit.freedesktop.org/drm/drm
+S: Maintained
+F: drivers/gpu/drm/panel/panel-lvds.c
+F: Documentation/devicetree/bindings/display/panel/panel-lvds.txt
+
 DRM DRIVER FOR MATROX G200/G400 GRAPHICS CARDS
 S: Orphan / Obsolete
 F: drivers/gpu/drm/mga/
-- 
Regards,

Laurent Pinchart

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 2/2] devicetree/bindings: display: Merge panel.txt with panel-common.txt

2019-06-08 Thread Laurent Pinchart
The two files were added concurrently and both store common panel
properties. Merge them together.

Suggested-by: Emil Velikov 
Signed-off-by: Laurent Pinchart 
---
 .../devicetree/bindings/display/panel/panel-common.txt  | 6 ++
 Documentation/devicetree/bindings/display/panel/panel.txt   | 4 
 2 files changed, 6 insertions(+), 4 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/display/panel/panel.txt

diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.txt 
b/Documentation/devicetree/bindings/display/panel/panel-common.txt
index 5d2519af4bb5..cd9d94189d43 100644
--- a/Documentation/devicetree/bindings/display/panel/panel-common.txt
+++ b/Documentation/devicetree/bindings/display/panel/panel-common.txt
@@ -18,6 +18,12 @@ Descriptive Properties
   physical area where images are displayed. These properties are expressed in
   millimeters and rounded to the closest unit.
 
+- rotation: Panels are commonly mounted rotated, with their native orientation
+  not aligned with the device's orientation. The rotation property specifies
+  the angle in degrees between the panel's orientation and the device's
+  orientation (corresponding to a counter-clockwise rotation of the panel).
+  Valid values are  0, 90, 180 and 270.
+
 - label: The label property specifies a symbolic name for the panel as a
   string suitable for use by humans. It typically contains a name inscribed on
   the system (e.g. as an affixed label) or specified in the system's
diff --git a/Documentation/devicetree/bindings/display/panel/panel.txt 
b/Documentation/devicetree/bindings/display/panel/panel.txt
deleted file mode 100644
index e2e6867852b8..
--- a/Documentation/devicetree/bindings/display/panel/panel.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Common display properties
--
-
-- rotation:Display rotation in degrees counter clockwise (0,90,180,270)
-- 
Regards,

Laurent Pinchart

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[GIT PULL FOR v5.3] R-Car DU changes, v2

2019-06-08 Thread Laurent Pinchart
Hi Dave,

If you haven't pulled the previous pull request yet, please disregard it
and process this one instead. It contains additional patches that add
support for more plane formats.

The following changes since commit a188339ca5a396acc588e5851ed7e19f66b0ebd9:

  Linux 5.2-rc1 (2019-05-19 15:47:09 -0700)

are available in the Git repository at:

  git://linuxtv.org/pinchartl/media.git tags/du-next-20190608-2

for you to fetch changes up to cb5f15b711d3ace7b29369657487f1281a4a5eac:

  drm: rcar-du: Add support for missing 16-bit RGB1555 formats (2019-06-08 
16:36:41 +0300)


R-Car DU changes for v5.3:

- R8A774A1 SoC support
- LVDS dual-link mode support
- Support for additional formats
- Misc fixes


Biju Das (4):
  dt-bindings: display: renesas: du: Document the r8a774a1 bindings
  dt-bindings: display: renesas: lvds: Document r8a774a1 bindings
  drm: rcar-du: Add R8A774A1 support
  drm: rcar-du: lvds: Add r8a774a1 support

Kieran Bingham (1):
  drm: rcar-du: writeback: include interface header

Laurent Pinchart (10):
  drm: bridge: Add dual_link field to the drm_bridge_timings structure
  dt-bindings: display: bridge: thc63lvd1024: Document dual-link operation
  drm: bridge: thc63: Report input bus mode through bridge timings
  dt-bindings: display: renesas: lvds: Add renesas,companion property
  drm: rcar-du: lvds: Remove LVDS double-enable checks
  drm: rcar-du: lvds: Add support for dual-link mode
  drm: rcar-du: Skip LVDS1 output on Gen3 when using dual-link LVDS mode
  drm: rcar-du: Add support for missing 32-bit RGB formats
  drm: rcar-du: Add support for missing 16-bit RGB formats
  drm: rcar-du: Add support for missing 16-bit RGB1555 formats

 .../bindings/display/bridge/renesas,lvds.txt   |  19 ++-
 .../bindings/display/bridge/thine,thc63lvd1024.txt |   6 +
 .../devicetree/bindings/display/renesas,du.txt |   2 +
 drivers/gpu/drm/bridge/thc63lvd1024.c  |  54 +++--
 drivers/gpu/drm/rcar-du/rcar_du_drv.c  |  30 +
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c  |  12 ++
 drivers/gpu/drm/rcar-du/rcar_du_kms.c  |  82 -
 drivers/gpu/drm/rcar-du/rcar_du_writeback.c|   1 +
 drivers/gpu/drm/rcar-du/rcar_lvds.c| 127 +++--
 drivers/gpu/drm/rcar-du/rcar_lvds.h|   5 +
 include/drm/drm_bridge.h   |   8 ++
 11 files changed, 298 insertions(+), 48 deletions(-)

-- 
Regards,

Laurent Pinchart


Re: [PATCH 2/3] drm/i915/dsi: Move vlv/icl_dphy_param_init call out of intel_dsi_vbt_init (v2)

2019-06-08 Thread Hans de Goede

Hi all,

On 05-06-19 20:37, Ville Syrjälä wrote:

On Wed, Jun 05, 2019 at 08:17:34PM +0200, Hans de Goede wrote:

The vlv/icl_dphy_param_init calls do various calculations to set dphy
parameters based on the pclk.

Move the calling of vlv/icl_dphy_param_init to vlv_dsi_init to give
vlv_dsi_init a chance to tweak the pclk before these calculations are done.

Changes in v2:
-Also moves the icl and vlv specific dphy_param_init functions from the
  generic intel_dsi_vbt.c file into the icl_ and vlv_dsi.c specific files.

Note icl_dphy_param_init() and vlv_dphy_param_init() are only moved,
otherwise they are completely unchanged.

Signed-off-by: Hans de Goede 


Reviewed-by: Ville Syrjälä 


Thanks, I've just  pushed this series to dinq (now that the CI is done and
happy with it).

Regards,

Hans






---
  drivers/gpu/drm/i915/icl_dsi.c   | 108 ++
  drivers/gpu/drm/i915/intel_dsi.h |   1 +
  drivers/gpu/drm/i915/intel_dsi_vbt.c | 282 +--
  drivers/gpu/drm/i915/vlv_dsi.c   | 170 
  4 files changed, 280 insertions(+), 281 deletions(-)

diff --git a/drivers/gpu/drm/i915/icl_dsi.c b/drivers/gpu/drm/i915/icl_dsi.c
index 9d962ea1e635..511c76e788ef 100644
--- a/drivers/gpu/drm/i915/icl_dsi.c
+++ b/drivers/gpu/drm/i915/icl_dsi.c
@@ -1363,6 +1363,113 @@ static const struct mipi_dsi_host_ops 
gen11_dsi_host_ops = {
.transfer = gen11_dsi_host_transfer,
  };
  
+#define ICL_PREPARE_CNT_MAX	0x7

+#define ICL_CLK_ZERO_CNT_MAX   0xf
+#define ICL_TRAIL_CNT_MAX  0x7
+#define ICL_TCLK_PRE_CNT_MAX   0x3
+#define ICL_TCLK_POST_CNT_MAX  0x7
+#define ICL_HS_ZERO_CNT_MAX0xf
+#define ICL_EXIT_ZERO_CNT_MAX  0x7
+
+static void icl_dphy_param_init(struct intel_dsi *intel_dsi)
+{
+   struct drm_device *dev = intel_dsi->base.base.dev;
+   struct drm_i915_private *dev_priv = to_i915(dev);
+   struct mipi_config *mipi_config = dev_priv->vbt.dsi.config;
+   u32 tlpx_ns;
+   u32 prepare_cnt, exit_zero_cnt, clk_zero_cnt, trail_cnt;
+   u32 ths_prepare_ns, tclk_trail_ns;
+   u32 hs_zero_cnt;
+   u32 tclk_pre_cnt, tclk_post_cnt;
+
+   tlpx_ns = intel_dsi_tlpx_ns(intel_dsi);
+
+   tclk_trail_ns = max(mipi_config->tclk_trail, mipi_config->ths_trail);
+   ths_prepare_ns = max(mipi_config->ths_prepare,
+mipi_config->tclk_prepare);
+
+   /*
+* prepare cnt in escape clocks
+* this field represents a hexadecimal value with a precision
+* of 1.2 – i.e. the most significant bit is the integer
+* and the least significant 2 bits are fraction bits.
+* so, the field can represent a range of 0.25 to 1.75
+*/
+   prepare_cnt = DIV_ROUND_UP(ths_prepare_ns * 4, tlpx_ns);
+   if (prepare_cnt > ICL_PREPARE_CNT_MAX) {
+   DRM_DEBUG_KMS("prepare_cnt out of range (%d)\n", prepare_cnt);
+   prepare_cnt = ICL_PREPARE_CNT_MAX;
+   }
+
+   /* clk zero count in escape clocks */
+   clk_zero_cnt = DIV_ROUND_UP(mipi_config->tclk_prepare_clkzero -
+   ths_prepare_ns, tlpx_ns);
+   if (clk_zero_cnt > ICL_CLK_ZERO_CNT_MAX) {
+   DRM_DEBUG_KMS("clk_zero_cnt out of range (%d)\n", clk_zero_cnt);
+   clk_zero_cnt = ICL_CLK_ZERO_CNT_MAX;
+   }
+
+   /* trail cnt in escape clocks*/
+   trail_cnt = DIV_ROUND_UP(tclk_trail_ns, tlpx_ns);
+   if (trail_cnt > ICL_TRAIL_CNT_MAX) {
+   DRM_DEBUG_KMS("trail_cnt out of range (%d)\n", trail_cnt);
+   trail_cnt = ICL_TRAIL_CNT_MAX;
+   }
+
+   /* tclk pre count in escape clocks */
+   tclk_pre_cnt = DIV_ROUND_UP(mipi_config->tclk_pre, tlpx_ns);
+   if (tclk_pre_cnt > ICL_TCLK_PRE_CNT_MAX) {
+   DRM_DEBUG_KMS("tclk_pre_cnt out of range (%d)\n", tclk_pre_cnt);
+   tclk_pre_cnt = ICL_TCLK_PRE_CNT_MAX;
+   }
+
+   /* tclk post count in escape clocks */
+   tclk_post_cnt = DIV_ROUND_UP(mipi_config->tclk_post, tlpx_ns);
+   if (tclk_post_cnt > ICL_TCLK_POST_CNT_MAX) {
+   DRM_DEBUG_KMS("tclk_post_cnt out of range (%d)\n", 
tclk_post_cnt);
+   tclk_post_cnt = ICL_TCLK_POST_CNT_MAX;
+   }
+
+   /* hs zero cnt in escape clocks */
+   hs_zero_cnt = DIV_ROUND_UP(mipi_config->ths_prepare_hszero -
+  ths_prepare_ns, tlpx_ns);
+   if (hs_zero_cnt > ICL_HS_ZERO_CNT_MAX) {
+   DRM_DEBUG_KMS("hs_zero_cnt out of range (%d)\n", hs_zero_cnt);
+   hs_zero_cnt = ICL_HS_ZERO_CNT_MAX;
+   }
+
+   /* hs exit zero cnt in escape clocks */
+   exit_zero_cnt = DIV_ROUND_UP(mipi_config->ths_exit, tlpx_ns);
+   if (exit_zero_cnt > ICL_EXIT_ZERO_CNT_MAX) {
+   DRM_DEBUG_KMS("exit_zero_cnt out of range (%d)\n", 
exit_zero_cnt);
+   exit_zero_cnt = ICL_EXIT_ZERO_CNT_MAX;
+   }
+
+   /* clock lane dphy timings */
+   intel_dsi->dphy_reg 

Re: [PATCH v2 2/2] drm: panel-orientation-quirks: Add quirk for GPD MicroPC

2019-06-08 Thread Hans de Goede

Hi,

On 07-06-19 16:54, Maxime Ripard wrote:

On Thu, Jun 06, 2019 at 04:03:57PM +0200, Hans de Goede wrote:

Hi,

On 06-06-19 15:38, Maxime Ripard wrote:

On Thu, Jun 06, 2019 at 01:13:40PM +0200, Hans de Goede wrote:

On 06-06-19 11:14, Maxime Ripard wrote:

On Fri, May 24, 2019 at 02:57:59PM +0200, Hans de Goede wrote:

GPD has done it again, make a nice device (good), use way too generic
DMI strings (bad) and use a portrait screen rotated 90 degrees (ugly).

Because of the too generic DMI strings this entry is also doing bios-date
matching, so the gpd_micropc data struct may very well need to be updated
with some extra bios-dates in the future.

Signed-off-by: Hans de Goede 


For both patches,
Acked-by: Maxime Ripard 


Thank you, I've pushed both to drm-misc-next now.

Can you add them to drm-misc-fixes please ?

(AFAIK I'm not supposed to do that myself)


You definitely can :)

Now that it's in next though, it's pretty hard to come back in time. I
guess we could just apply it in fixes and let git figure it out, or
revert the one in next. I'm not sure which one is preferred
though.


I thought that the procedure was to get it in -next and then cherry-pick
into -fixes?


If you feel like something should be in fixes, you can definitely
apply it there only.


Git should sort this out without issues when Linus merges -next; or
when we back-merge Linus' tree.


Yeah, looking at the doc, cherry-picking is the one encouraged, so
feel free to cherry-pick them in drm-misc-fixes.


Ok, cherry-picked and pushed, thanks.

Regards,

Hans

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/amdgpu: Fix bounds checking in amdgpu_ras_is_supported()

2019-06-08 Thread Koenig, Christian
Yes, that is undefined behavior what you do here.

See here as well 
https://stackoverflow.com/questions/11270492/what-does-the-c-standard-say-about-bitshifting-more-bits-than-the-width-of-type.

Christian.

Am 08.06.19 um 14:27 schrieb Pan, Xinhui:
do you mean that something like 1<<65 might be a none zero value?

From: Dan Carpenter 
Sent: Saturday, June 8, 2019 5:23:57 PM
To: Deucher, Alexander; Pan, Xinhui
Cc: Koenig, Christian; Zhou, David(ChunMing); David Airlie; Daniel Vetter; 
Quan, Evan; Zhu, James; 
amd-...@lists.freedesktop.org; 
dri-devel@lists.freedesktop.org; 
kernel-janit...@vger.kernel.org
Subject: [PATCH] drm/amdgpu: Fix bounds checking in amdgpu_ras_is_supported()

The "block" variable can be set by the user through debugfs, so it can
be quite large which leads to shift wrapping here.  This means we report
a "block" as supported when it's not, and that leads to array overflows
later on.

This bug is not really a security issue in real life, because debugfs is
generally root only.

Fixes: 36ea1bd2d084 ("drm/amdgpu: add debugfs ctrl node")
Signed-off-by: Dan Carpenter 

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
index c6b34fbd695f..94c652f5265a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
@@ -173,6 +173,8 @@ static inline int amdgpu_ras_is_supported(struct 
amdgpu_device *adev,
 {
 struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);

+   if (block >= AMDGPU_RAS_BLOCK_COUNT)
+   return 0;
 return ras && (ras->supported & (1 << block));
 }

--
2.20.1


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/amdgpu: Fix bounds checking in amdgpu_ras_is_supported()

2019-06-08 Thread Pan, Xinhui
do you mean that something like 1<<65 might be a none zero value?

From: Dan Carpenter 
Sent: Saturday, June 8, 2019 5:23:57 PM
To: Deucher, Alexander; Pan, Xinhui
Cc: Koenig, Christian; Zhou, David(ChunMing); David Airlie; Daniel Vetter; 
Quan, Evan; Zhu, James; amd-...@lists.freedesktop.org; 
dri-devel@lists.freedesktop.org; kernel-janit...@vger.kernel.org
Subject: [PATCH] drm/amdgpu: Fix bounds checking in amdgpu_ras_is_supported()

The "block" variable can be set by the user through debugfs, so it can
be quite large which leads to shift wrapping here.  This means we report
a "block" as supported when it's not, and that leads to array overflows
later on.

This bug is not really a security issue in real life, because debugfs is
generally root only.

Fixes: 36ea1bd2d084 ("drm/amdgpu: add debugfs ctrl node")
Signed-off-by: Dan Carpenter 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
index c6b34fbd695f..94c652f5265a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
@@ -173,6 +173,8 @@ static inline int amdgpu_ras_is_supported(struct 
amdgpu_device *adev,
 {
 struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);

+   if (block >= AMDGPU_RAS_BLOCK_COUNT)
+   return 0;
 return ras && (ras->supported & (1 << block));
 }

--
2.20.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm: remove the newline for CRC source name.

2019-06-08 Thread Sam Ravnborg
Hi Dingchen.

Patch is much better now.

On Fri, Jun 07, 2019 at 05:38:17PM -0400, Dingchen Zhang wrote:
> userspace may transfer a newline, and this terminating newline
> is replaced by a '\0' to avoid followup issues.
> 
> 'n-1' is the index to replace the newline of CRC source name.
I am a little confused where 'n' comes from here?
I you had written ' len - 1' then there was a clear connection to the
patch.

With this fixed:
Reviewed-by: Sam Ravnborg 
> 
> v2: update patch subject, body and format. (Sam)
> 
> Cc: Leo Li 
> Cc: Harry Wentland 
> Cc: Sam Ravnborg 
> Signed-off-by: Dingchen Zhang 
> ---
>  drivers/gpu/drm/drm_debugfs_crc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_debugfs_crc.c 
> b/drivers/gpu/drm/drm_debugfs_crc.c
> index 585169f0dcc5..dac267e840af 100644
> --- a/drivers/gpu/drm/drm_debugfs_crc.c
> +++ b/drivers/gpu/drm/drm_debugfs_crc.c
> @@ -131,8 +131,8 @@ static ssize_t crc_control_write(struct file *file, const 
> char __user *ubuf,
>   if (IS_ERR(source))
>   return PTR_ERR(source);
>  
> - if (source[len] == '\n')
> - source[len] = '\0';
> + if (source[len - 1] == '\n')
> + source[len - 1] = '\0';
>  
>   ret = crtc->funcs->verify_crc_source(crtc, source, &values_cnt);
>   if (ret)
> -- 
> 2.17.1
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH AUTOSEL 4.19 23/49] drm/etnaviv: lock MMU while dumping core

2019-06-08 Thread Sasha Levin
From: Lucas Stach 

[ Upstream commit 1396500d673bd027683a0609ff84dca7eb6ea2e7 ]

The devcoredump needs to operate on a stable state of the MMU while
it is writing the MMU state to the coredump. The missing lock
allowed both the userspace submit, as well as the GPU job finish
paths to mutate the MMU state while a coredump is under way.

Fixes: a8c21a5451d8 (drm/etnaviv: add initial etnaviv DRM driver)
Reported-by: David Jander 
Signed-off-by: Lucas Stach 
Tested-by: David Jander 
Reviewed-by: Philipp Zabel 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/etnaviv/etnaviv_dump.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_dump.c 
b/drivers/gpu/drm/etnaviv/etnaviv_dump.c
index 9146e30e24a6..468dff2f7904 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_dump.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_dump.c
@@ -124,6 +124,8 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
return;
etnaviv_dump_core = false;
 
+   mutex_lock(&gpu->mmu->lock);
+
mmu_size = etnaviv_iommu_dump_size(gpu->mmu);
 
/* We always dump registers, mmu, ring and end marker */
@@ -166,6 +168,7 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
iter.start = __vmalloc(file_size, GFP_KERNEL | __GFP_NOWARN | 
__GFP_NORETRY,
   PAGE_KERNEL);
if (!iter.start) {
+   mutex_unlock(&gpu->mmu->lock);
dev_warn(gpu->dev, "failed to allocate devcoredump file\n");
return;
}
@@ -233,6 +236,8 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
 obj->base.size);
}
 
+   mutex_unlock(&gpu->mmu->lock);
+
etnaviv_core_dump_header(&iter, ETDUMP_BUF_END, iter.data);
 
dev_coredumpv(gpu->dev, iter.start, iter.data - iter.start, GFP_KERNEL);
-- 
2.20.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 02/34] gpu: drm: bridge: sii9234: simplify getting the adapter of a client

2019-06-08 Thread Laurent Pinchart
Hi Wolfram,

Thank you for the patch.

On Sat, Jun 08, 2019 at 12:55:41PM +0200, Wolfram Sang wrote:
> We have a dedicated pointer for that, so use it. Much easier to read and
> less computation involved.
> 
> Signed-off-by: Wolfram Sang 

Reviewed-by: Laurent Pinchart 

> ---
> 
> Please apply to your subsystem tree.
> 
>  drivers/gpu/drm/bridge/sii9234.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/sii9234.c 
> b/drivers/gpu/drm/bridge/sii9234.c
> index b36bbafb0e43..25d4ad8c7ad6 100644
> --- a/drivers/gpu/drm/bridge/sii9234.c
> +++ b/drivers/gpu/drm/bridge/sii9234.c
> @@ -815,7 +815,7 @@ static irqreturn_t sii9234_irq_thread(int irq, void *data)
>  static int sii9234_init_resources(struct sii9234 *ctx,
> struct i2c_client *client)
>  {
> - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
> + struct i2c_adapter *adapter = client->adapter;
>   int ret;
>  
>   if (!ctx->dev->of_node) {
> @@ -897,7 +897,7 @@ static const struct drm_bridge_funcs sii9234_bridge_funcs 
> = {
>  static int sii9234_probe(struct i2c_client *client,
>const struct i2c_device_id *id)
>  {
> - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
> + struct i2c_adapter *adapter = client->adapter;
>   struct sii9234 *ctx;
>   struct device *dev = &client->dev;
>   int ret;

-- 
Regards,

Laurent Pinchart
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH AUTOSEL 5.1 36/70] drm/etnaviv: lock MMU while dumping core

2019-06-08 Thread Sasha Levin
From: Lucas Stach 

[ Upstream commit 1396500d673bd027683a0609ff84dca7eb6ea2e7 ]

The devcoredump needs to operate on a stable state of the MMU while
it is writing the MMU state to the coredump. The missing lock
allowed both the userspace submit, as well as the GPU job finish
paths to mutate the MMU state while a coredump is under way.

Fixes: a8c21a5451d8 (drm/etnaviv: add initial etnaviv DRM driver)
Reported-by: David Jander 
Signed-off-by: Lucas Stach 
Tested-by: David Jander 
Reviewed-by: Philipp Zabel 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/etnaviv/etnaviv_dump.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_dump.c 
b/drivers/gpu/drm/etnaviv/etnaviv_dump.c
index 33854c94cb85..515515ef24f9 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_dump.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_dump.c
@@ -125,6 +125,8 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
return;
etnaviv_dump_core = false;
 
+   mutex_lock(&gpu->mmu->lock);
+
mmu_size = etnaviv_iommu_dump_size(gpu->mmu);
 
/* We always dump registers, mmu, ring and end marker */
@@ -167,6 +169,7 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
iter.start = __vmalloc(file_size, GFP_KERNEL | __GFP_NOWARN | 
__GFP_NORETRY,
   PAGE_KERNEL);
if (!iter.start) {
+   mutex_unlock(&gpu->mmu->lock);
dev_warn(gpu->dev, "failed to allocate devcoredump file\n");
return;
}
@@ -234,6 +237,8 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
 obj->base.size);
}
 
+   mutex_unlock(&gpu->mmu->lock);
+
etnaviv_core_dump_header(&iter, ETDUMP_BUF_END, iter.data);
 
dev_coredumpv(gpu->dev, iter.start, iter.data - iter.start, GFP_KERNEL);
-- 
2.20.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[1/2] dt-bindings: display: panel: add AUO kd101n80-45na panel bindings

2019-06-08 Thread Jitao Shi
Add documentation for auo kd101n80-45na panel.

Signed-off-by: Jitao Shi 
---
 .../display/panel/auo,kd101n80-45na.txt   | 34 +++
 1 file changed, 34 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/auo,kd101n80-45na.txt

diff --git 
a/Documentation/devicetree/bindings/display/panel/auo,kd101n80-45na.txt 
b/Documentation/devicetree/bindings/display/panel/auo,kd101n80-45na.txt
new file mode 100644
index ..7715cf703431
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/auo,kd101n80-45na.txt
@@ -0,0 +1,34 @@
+AUO Corporation 10.1" WUXGA TFT LCD panel
+
+Required properties:
+- compatible: should be "auo,kd101n80-45na"
+- reg: the virtual channel number of a DSI peripheral
+- enable-gpios: a GPIO spec for the enable pin
+- pp1800-supply: core voltage supply
+- avdd-supply: 
+- avee-supply: 
+- backlight: phandle of the backlight device attached to the panel
+
+The device node can contain one 'port' child node with one child
+'endpoint' node, according to the bindings defined in
+media/video-interfaces.txt. This node should describe panel's video bus.
+
+Example:
+&dsi {
+   ...
+   panel@0 {
+   compatible = "auo,kd101n80-45na";
+   reg = <0>;
+   enable-gpios = <&pio 45 0>;
+   avdd-supply = <&ppvarn_lcd>;
+   avee-supply = <&ppvarp_lcd>;
+   pp1800-supply = <&pp1800_lcd>;
+   backlight = <&backlight_lcd0>;
+   status = "okay";
+   port {
+   panel_in: endpoint {
+   remote-endpoint = <&dsi_out>;
+   };
+   };
+   };
+};
-- 
2.21.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[2/2] drm/panel: support for AUO kd101n80-45na wuxga dsi video mode panel

2019-06-08 Thread Jitao Shi
Add driver for AUO kd101n80-45na panel.
This panel supports the resolution 1200x1920, dsi video mode
and 4 lanes.

Signed-off-by: Jitao Shi 
---
 drivers/gpu/drm/panel/Kconfig |  10 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-auo-kd101n80-45na.c   | 352 ++
 3 files changed, 363 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-auo-kd101n80-45na.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index e36dbb4df867..f5cd5af9ce42 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -272,4 +272,14 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
help
  Say Y here if you want to enable support for Truly NT35597 WQXGA Dual 
DSI
  Video Mode panel
+
+config DRM_PANEL_AUO_KD101N80_45NA
+   tristate "AUO KD101N80_45NA 1200x1920 panel"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   depends on BACKLIGHT_CLASS_DEVICE
+   help
+ Say Y here if you want to support for AUO KD101N80_45NA WUXGA PANEL
+ DSI Video Mode panel
+
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 78e3dc376bdd..1056933bdf2e 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -28,3 +28,4 @@ obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += 
panel-sitronix-st7701.o
 obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o
 obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
 obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
+obj-$(CONFIG_DRM_PANEL_AUO_KD101N80_45NA) += panel-auo-kd101n80-45na.o
diff --git a/drivers/gpu/drm/panel/panel-auo-kd101n80-45na.c 
b/drivers/gpu/drm/panel/panel-auo-kd101n80-45na.c
new file mode 100644
index ..ab7bfc059e8a
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-auo-kd101n80-45na.c
@@ -0,0 +1,352 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2018 MediaTek Inc.
+ * Author: Jitao Shi 
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct auo_panel {
+   struct drm_panel base;
+   struct mipi_dsi_device *dsi;
+
+   struct backlight_device *backlight;
+   struct regulator *pp1800;
+   struct regulator *avee;
+   struct regulator *avdd;
+   struct gpio_desc *enable_gpio;
+
+   bool prepared;
+   bool enabled;
+
+   const struct drm_display_mode *mode;
+};
+
+static inline struct auo_panel *to_auo_panel(struct drm_panel *panel)
+{
+   return container_of(panel, struct auo_panel, base);
+}
+
+static int auo_panel_init(struct auo_panel *auo)
+{
+   struct drm_panel *panel = &auo->base;
+   int err;
+
+   err = mipi_dsi_dcs_exit_sleep_mode(auo->dsi);
+   if (err < 0) {
+   DRM_DEV_ERROR(panel->dev, "failed to exit sleep mode: %d\n",
+ err);
+   return err;
+   }
+
+   /* T3.1*/
+   msleep(120);
+
+   err = mipi_dsi_dcs_set_display_on(auo->dsi);
+   if (err < 0) {
+   DRM_DEV_ERROR(panel->dev, "failed to set display on: %d\n",
+ err);
+   }
+   /* T3.1 + T3.2: > 200ms */
+   msleep(120);
+
+   return err;
+}
+
+static int auo_panel_off(struct auo_panel *auo)
+{
+   struct mipi_dsi_device *dsi = auo->dsi;
+   int ret;
+
+   dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
+
+   ret = mipi_dsi_dcs_set_display_off(dsi);
+   if (ret < 0)
+   return ret;
+
+   ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
+   if (ret < 0)
+   return ret;
+
+   return 0;
+}
+
+static int auo_panel_disable(struct drm_panel *panel)
+{
+   struct auo_panel *auo = to_auo_panel(panel);
+
+   if (!auo->enabled)
+   return 0;
+
+   backlight_disable(auo->backlight);
+
+   auo->enabled = false;
+
+   return 0;
+}
+
+static int auo_panel_unprepare(struct drm_panel *panel)
+{
+   struct auo_panel *auo = to_auo_panel(panel);
+   int ret;
+
+   if (!auo->prepared)
+   return 0;
+
+   ret = auo_panel_off(auo);
+   if (ret < 0) {
+   dev_err(panel->dev, "failed to set panel off: %d\n", ret);
+   return ret;
+   }
+
+   msleep(150);
+   regulator_disable(auo->avee);
+   regulator_disable(auo->avdd);
+   usleep_range(5000, 7000);
+   regulator_disable(auo->pp1800);
+   if (auo->enable_gpio)
+   gpiod_set_value(auo->enable_gpio, 0);
+
+   auo->prepared = false;
+
+   return 0;
+}
+
+static int auo_panel_prepare(struct drm_panel *panel)
+{
+   struct auo_panel *auo = to_auo_panel(panel);
+   int ret;
+
+   if (auo->prepared)
+   return 0;
+
+   if (auo->enable_gpio) {
+   gpiod_set_value(auo->enable_gpio, 0);
+   usleep_range(1000, 1500);
+   }
+
+   ret = re

[Bug 201273] Fatal error during GPU init amdgpu RX560

2019-06-08 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=201273

--- Comment #56 from Marco (rodomar...@protonmail.com) ---
(In reply to quirin.blaeser from comment #55)
> No crash since upgrade to v5.1.0, a month ago.

Same here. Haven’t seen any crashes lately.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: WARNING in bpf_jit_free

2019-06-08 Thread syzbot

syzbot has found a reproducer for the following crash on:

HEAD commit:79c3ba32 Merge tag 'drm-fixes-2019-06-07-1' of git://anong..
git tree:   upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1201b971a0
kernel config:  https://syzkaller.appspot.com/x/.config?x=60564cb52ab29d5b
dashboard link: https://syzkaller.appspot.com/bug?extid=2ff1e7cb738fd3c41113
compiler:   gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=14a3bf51a0
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=120d19f2a0

The bug was bisected to:

commit 0fff724a33917ac581b5825375d0b57affedee76
Author: Paul Kocialkowski 
Date:   Fri Jan 18 14:51:13 2019 +

drm/sun4i: backend: Use explicit fourcc helpers for packed YUV422 check

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=1467550f20
final crash:https://syzkaller.appspot.com/x/report.txt?x=1667550f20
console output: https://syzkaller.appspot.com/x/log.txt?x=1267550f20

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+2ff1e7cb738fd3c41...@syzkaller.appspotmail.com
Fixes: 0fff724a3391 ("drm/sun4i: backend: Use explicit fourcc helpers for  
packed YUV422 check")


WARNING: CPU: 0 PID: 8951 at kernel/bpf/core.c:851 bpf_jit_free+0x157/0x1b0
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 8951 Comm: kworker/0:0 Not tainted 5.2.0-rc3+ #23
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011

Workqueue: events bpf_prog_free_deferred
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x172/0x1f0 lib/dump_stack.c:113
 panic+0x2cb/0x744 kernel/panic.c:219
 __warn.cold+0x20/0x4d kernel/panic.c:576
 report_bug+0x263/0x2b0 lib/bug.c:186
 fixup_bug arch/x86/kernel/traps.c:179 [inline]
 fixup_bug arch/x86/kernel/traps.c:174 [inline]
 do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:272
 do_invalid_op+0x37/0x50 arch/x86/kernel/traps.c:291
 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:986
RIP: 0010:bpf_jit_free+0x157/0x1b0
Code: 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 75 5d 48 b8 00 02 00 00  
00 00 ad de 48 39 43 70 0f 84 05 ff ff ff e8 f9 b5 f4 ff <0f> 0b e9 f9 fe  
ff ff e8 bd 53 2d 00 e9 d9 fe ff ff 48 89 7d e0 e8

RSP: 0018:88808886fcb0 EFLAGS: 00010293
RAX: 88808cb6c480 RBX: 88809051d280 RCX: 817ae68d
RDX:  RSI: 817bf0f7 RDI: 88809051d2f0
RBP: 88808886fcd0 R08: 114ccaa8 R09: fbfff14ccaa9
R10: fbfff14ccaa8 R11: 8a665547 R12: c90001925000
R13: 88809051d2e8 R14: 8880a0e43900 R15: 8880ae834840
 bpf_prog_free_deferred+0x27a/0x350 kernel/bpf/core.c:1984
 process_one_work+0x989/0x1790 kernel/workqueue.c:2269
 worker_thread+0x98/0xe40 kernel/workqueue.c:2415
 kthread+0x354/0x420 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352
Kernel Offset: disabled
Rebooting in 86400 seconds..



[PATCH 00/34] treewide: simplify getting the adapter of an I2C client

2019-06-08 Thread Wolfram Sang
While preparing a refactoring series, I noticed that some drivers use a
complicated way of determining the adapter of a client. The easy way is
to use the intended pointer: client->adapter

These drivers do:
to_i2c_adapter(client->dev.parent);

The I2C core populates the parent pointer as:
client->dev.parent = &client->adapter->dev;

Now take into consideration that
to_i2c_adapter(&adapter->dev);

is a complicated way of saying 'adapter', then we can even formally
prove that the complicated expression can be simplified by using
client->adapter.

The conversion was done using a coccinelle script with some manual
indentation fixes applied on top.

To avoid a brown paper bag mistake, I double checked this on a Renesas
Salvator-XS board (R-Car M3N) and verified both expression result in the
same pointer. Other than that, the series is only build tested.

A branch can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/no_to_adapter

Please apply the patches to the individual subsystem trees. There are no
dependencies.

Thanks and kind regards,

   Wolfram


Wolfram Sang (34):
  clk: clk-cdce706: simplify getting the adapter of a client
  gpu: drm: bridge: sii9234: simplify getting the adapter of a client
  iio: light: bh1780: simplify getting the adapter of a client
  leds: leds-pca955x: simplify getting the adapter of a client
  leds: leds-tca6507: simplify getting the adapter of a client
  media: i2c: ak881x: simplify getting the adapter of a client
  media: i2c: mt9m001: simplify getting the adapter of a client
  media: i2c: mt9m111: simplify getting the adapter of a client
  media: i2c: mt9p031: simplify getting the adapter of a client
  media: i2c: ov2640: simplify getting the adapter of a client
  media: i2c: tw9910: simplify getting the adapter of a client
  misc: fsa9480: simplify getting the adapter of a client
  misc: isl29003: simplify getting the adapter of a client
  misc: tsl2550: simplify getting the adapter of a client
  mtd: maps: pismo: simplify getting the adapter of a client
  power: supply: bq24190_charger: simplify getting the adapter of a client
  power: supply: bq24257_charger: simplify getting the adapter of a client
  power: supply: bq25890_charger: simplify getting the adapter of a client
  power: supply: max14656_charger_detector: simplify getting the adapter
of a client
  power: supply: max17040_battery: simplify getting the adapter of a client
  power: supply: max17042_battery: simplify getting the adapter of a client
  power: supply: rt5033_battery: simplify getting the adapter of a client
  power: supply: rt9455_charger: simplify getting the adapter of a client
  power: supply: sbs-manager: simplify getting the adapter of a client
  regulator: max8952: simplify getting the adapter of a client
  rtc: fm3130: simplify getting the adapter of a client
  rtc: m41t80: simplify getting the adapter of a client
  rtc: rv8803: simplify getting the adapter of a client
  rtc: rx8010: simplify getting the adapter of a client
  rtc: rx8025: simplify getting the adapter of a client
  staging: media: soc_camera: imx074: simplify getting the adapter of a client
  staging: media: soc_camera: mt9t031: simplify getting the adapter of a client
  staging: media: soc_camera: soc_mt9v022: simplify getting the adapter
of a client
  usb: typec: tcpm: fusb302: simplify getting the adapter of a client

 drivers/clk/clk-cdce706.c| 2 +-
 drivers/gpu/drm/bridge/sii9234.c | 4 ++--
 drivers/iio/light/bh1780.c   | 2 +-
 drivers/leds/leds-pca955x.c  | 2 +-
 drivers/leds/leds-tca6507.c  | 2 +-
 drivers/media/i2c/ak881x.c   | 2 +-
 drivers/media/i2c/mt9m001.c  | 2 +-
 drivers/media/i2c/mt9m111.c  | 2 +-
 drivers/media/i2c/mt9p031.c  | 2 +-
 drivers/media/i2c/ov2640.c   | 2 +-
 drivers/media/i2c/tw9910.c   | 3 +--
 drivers/misc/fsa9480.c   | 2 +-
 drivers/misc/isl29003.c  | 2 +-
 drivers/misc/tsl2550.c   | 2 +-
 drivers/mtd/maps/pismo.c | 2 +-
 drivers/power/supply/bq24190_charger.c   | 2 +-
 drivers/power/supply/bq24257_charger.c   | 2 +-
 drivers/power/supply/bq25890_charger.c   | 2 +-
 drivers/power/supply/max14656_charger_detector.c | 2 +-
 drivers/power/supply/max17040_battery.c  | 2 +-
 drivers/power/supply/max17042_battery.c  | 2 +-
 drivers/power/supply/rt5033_battery.c| 2 +-
 drivers/power/supply/rt9455_charger.c| 2 +-
 drivers/power/supply/sbs-manager.c   | 2 +-
 drivers/regulator/max8952.c  | 2 +-
 drivers/rtc/rtc-fm3130.c | 8 +++-
 drivers/rtc/rtc-m41t80.c | 2 +-
 drivers/rtc/rtc-rv8803.c  

[PATCH] drm/amdgpu: Fix bounds checking in amdgpu_ras_is_supported()

2019-06-08 Thread Dan Carpenter
The "block" variable can be set by the user through debugfs, so it can
be quite large which leads to shift wrapping here.  This means we report
a "block" as supported when it's not, and that leads to array overflows
later on.

This bug is not really a security issue in real life, because debugfs is
generally root only.

Fixes: 36ea1bd2d084 ("drm/amdgpu: add debugfs ctrl node")
Signed-off-by: Dan Carpenter 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
index c6b34fbd695f..94c652f5265a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
@@ -173,6 +173,8 @@ static inline int amdgpu_ras_is_supported(struct 
amdgpu_device *adev,
 {
struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
 
+   if (block >= AMDGPU_RAS_BLOCK_COUNT)
+   return 0;
return ras && (ras->supported & (1 << block));
 }
 
-- 
2.20.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Bug 201273] Fatal error during GPU init amdgpu RX560

2019-06-08 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=201273

--- Comment #55 from quirin.blae...@freenet.de ---
No crash since upgrade to v5.1.0, a month ago.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v2 1/1] drm/exynos: drop drmP.h usage

2019-06-08 Thread Sam Ravnborg
Drop use of the deprecated drmP.h file.
Replace with forwards / externals as appropriate.

While touching the list of include files divide
them up in blocks and sort them.

Signed-off-by: Sam Ravnborg 
Cc: Inki Dae 
Cc: Joonyoung Shim 
Cc: Seung-Woo Kim 
Cc: Kyungmin Park 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Kukjin Kim 
Cc: Krzysztof Kozlowski 
Cc: Jingoo Han 
---
 drivers/gpu/drm/exynos/exynos5433_drm_decon.c |  7 +++-
 drivers/gpu/drm/exynos/exynos7_drm_decon.c|  8 ++--
 drivers/gpu/drm/exynos/exynos_dp.c| 13 +++---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_dma.c   |  6 ++-
 drivers/gpu/drm/exynos/exynos_drm_dpi.c   |  8 ++--
 drivers/gpu/drm/exynos/exynos_drm_drv.c   | 12 +++---
 drivers/gpu/drm/exynos/exynos_drm_drv.h   |  8 +++-
 drivers/gpu/drm/exynos/exynos_drm_dsi.c   | 21 +-
 drivers/gpu/drm/exynos/exynos_drm_fb.c|  6 +--
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c |  7 ++--
 drivers/gpu/drm/exynos/exynos_drm_fimc.c  | 15 +++
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 14 ---
 drivers/gpu/drm/exynos/exynos_drm_g2d.c   |  8 ++--
 drivers/gpu/drm/exynos/exynos_drm_gem.c   |  7 ++--
 drivers/gpu/drm/exynos/exynos_drm_gsc.c   | 13 +++---
 drivers/gpu/drm/exynos/exynos_drm_ipp.c   |  3 +-
 drivers/gpu/drm/exynos/exynos_drm_mic.c   | 22 +-
 drivers/gpu/drm/exynos/exynos_drm_plane.c |  4 +-
 drivers/gpu/drm/exynos/exynos_drm_rotator.c   | 10 ++---
 drivers/gpu/drm/exynos/exynos_drm_scaler.c| 12 +++---
 drivers/gpu/drm/exynos/exynos_drm_vidi.c  |  9 ++--
 drivers/gpu/drm/exynos/exynos_hdmi.c  | 41 +--
 drivers/gpu/drm/exynos/exynos_mixer.c | 31 +++---
 24 files changed, 151 insertions(+), 136 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c 
b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
index 73b318a7ef49..40423e237b82 100644
--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
@@ -10,7 +10,6 @@
  * published by the Free Software Foundationr
  */
 
-#include 
 #include 
 #include 
 #include 
@@ -18,11 +17,15 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
-#include "exynos_drm_drv.h"
+#include 
+#include 
+
 #include "exynos_drm_crtc.h"
+#include "exynos_drm_drv.h"
 #include "exynos_drm_fb.h"
 #include "exynos_drm_plane.h"
 #include "regs-decon5433.h"
diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c 
b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
index 0217ee9a118d..98c2debdd053 100644
--- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
@@ -11,8 +11,6 @@
  * option) any later version.
  *
  */
-#include 
-#include 
 
 #include 
 #include 
@@ -26,10 +24,14 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+
 #include "exynos_drm_crtc.h"
-#include "exynos_drm_plane.h"
 #include "exynos_drm_drv.h"
 #include "exynos_drm_fb.h"
+#include "exynos_drm_plane.h"
 #include "regs-decon7.h"
 
 /*
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c 
b/drivers/gpu/drm/exynos/exynos_dp.c
index b0288cf85701..882275e475c9 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -10,25 +10,24 @@
  * option) any later version.
  */
 
-#include 
-#include 
-#include 
 #include 
-#include 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
-
-#include 
 #include 
 
 #include "exynos_drm_crtc.h"
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c 
b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index 96ee83a798c4..201fdc75ec18 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -12,11 +12,11 @@
  * option) any later version.
  */
 
-#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include "exynos_drm_crtc.h"
 #include "exynos_drm_drv.h"
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dma.c 
b/drivers/gpu/drm/exynos/exynos_drm_dma.c
index bef8bc3c8e00..9ebc02768847 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dma.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dma.c
@@ -4,11 +4,13 @@
 // Author: Inki Dae 
 // Author: Andrzej Hajda 
 
-#include 
-#include 
 #include 
 #include 
 #include 
+#include 
+
+#include 
+#include 
 
 #include "exynos_drm_drv.h"
 
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c 
b/drivers/gpu/drm/exynos/exynos_drm_dpi.c
index 6ea92173db9f..87289db12868 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c
@@ -10,14 +10,14 @@
  * published by the Free Software Foundation.
 */
 
-#include 
+#include 
+#include 
+
 #include 
 #include 
+#include 
 #include 
 
-#include 
-#include 
-
 #include 
 #include 
 
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gp

[PATCH v2 0/1] drm/exynos: drop use of drmP.h

2019-06-08 Thread Sam Ravnborg
Drop the use of the deprecated drmP.h header file.

Build tested using allyesconfig, allmodconfig for various
architectures.

v2:
- add missing people to recipient list of mail
- no change in actual patch

Sam

Sam Ravnborg (1):
  drm/exynos: drop drmP.h usage

 drivers/gpu/drm/exynos/exynos5433_drm_decon.c |  7 +++--
 drivers/gpu/drm/exynos/exynos7_drm_decon.c|  8 --
 drivers/gpu/drm/exynos/exynos_dp.c| 13 -
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_dma.c   |  6 ++--
 drivers/gpu/drm/exynos/exynos_drm_dpi.c   |  8 +++---
 drivers/gpu/drm/exynos/exynos_drm_drv.c   | 12 
 drivers/gpu/drm/exynos/exynos_drm_drv.h   |  8 +-
 drivers/gpu/drm/exynos/exynos_drm_dsi.c   | 21 +++---
 drivers/gpu/drm/exynos/exynos_drm_fb.c|  6 ++--
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c |  7 +++--
 drivers/gpu/drm/exynos/exynos_drm_fimc.c  | 15 +-
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 14 +
 drivers/gpu/drm/exynos/exynos_drm_g2d.c   |  8 +++---
 drivers/gpu/drm/exynos/exynos_drm_gem.c   |  7 +++--
 drivers/gpu/drm/exynos/exynos_drm_gsc.c   | 13 +
 drivers/gpu/drm/exynos/exynos_drm_ipp.c   |  3 +-
 drivers/gpu/drm/exynos/exynos_drm_mic.c   | 22 +++---
 drivers/gpu/drm/exynos/exynos_drm_plane.c |  4 +--
 drivers/gpu/drm/exynos/exynos_drm_rotator.c   | 10 +++
 drivers/gpu/drm/exynos/exynos_drm_scaler.c| 12 
 drivers/gpu/drm/exynos/exynos_drm_vidi.c  |  9 +++---
 drivers/gpu/drm/exynos/exynos_hdmi.c  | 41 +--
 drivers/gpu/drm/exynos/exynos_mixer.c | 31 ++--
 24 files changed, 151 insertions(+), 136 deletions(-)


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v1 2/4] drm/mga: make header file self contained

2019-06-08 Thread Sam Ravnborg
This makes migration away from drmP.h simple
as we do not need to duplicate dependencies required by mga_drv.h

Signed-off-by: Sam Ravnborg 
Cc: Thomas Zimmermann 
Cc: Daniel Vetter 
Cc: David Airlie 
---
 drivers/gpu/drm/mga/mga_drv.h | 13 +
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/mga/mga_drv.h b/drivers/gpu/drm/mga/mga_drv.h
index 7844a9e463f6..10169ff4669a 100644
--- a/drivers/gpu/drm/mga/mga_drv.h
+++ b/drivers/gpu/drm/mga/mga_drv.h
@@ -31,7 +31,20 @@
 #ifndef __MGA_DRV_H__
 #define __MGA_DRV_H__
 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
 
 /* General customization:
  */
-- 
2.20.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v1 4/4] drm/mgag200: drop use of drmP.h

2019-06-08 Thread Sam Ravnborg
Drop use of the deprecated drmP.h header file.
Replace with necessary includ files to fix build.

Signed-off-by: Sam Ravnborg 
Cc: Thomas Zimmermann 
Cc: Daniel Vetter 
Cc: David Airlie 
---
 drivers/gpu/drm/mgag200/mgag200_cursor.c |  3 ++-
 drivers/gpu/drm/mgag200/mgag200_drv.c| 10 +++---
 drivers/gpu/drm/mgag200/mgag200_drv.h|  8 +++-
 drivers/gpu/drm/mgag200/mgag200_fb.c |  8 +---
 drivers/gpu/drm/mgag200/mgag200_i2c.c|  6 --
 drivers/gpu/drm/mgag200/mgag200_main.c   |  4 +++-
 drivers/gpu/drm/mgag200/mgag200_mode.c   |  3 ++-
 drivers/gpu/drm/mgag200/mgag200_ttm.c|  3 ++-
 8 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_cursor.c 
b/drivers/gpu/drm/mgag200/mgag200_cursor.c
index 06a8c076cb33..786a30d45900 100644
--- a/drivers/gpu/drm/mgag200/mgag200_cursor.c
+++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c
@@ -8,7 +8,8 @@
  * Author: Christopher Harvey 
  */
 
-#include 
+#include 
+
 #include "mgag200_drv.h"
 
 static bool warn_transparent = true;
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c 
b/drivers/gpu/drm/mgag200/mgag200_drv.c
index 93bd1589e50e..e12a5cab71f2 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.c
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.c
@@ -8,14 +8,18 @@
  * Authors: Matthew Garrett
  *  Dave Airlie
  */
+
 #include 
 #include 
-#include 
-
-#include "mgag200_drv.h"
 
+#include 
+#include 
+#include 
+#include 
 #include 
 
+#include "mgag200_drv.h"
+
 /*
  * This is the generic driver code. This binds the driver to the drm core,
  * which then performs further device association and calls our graphics init
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.h 
b/drivers/gpu/drm/mgag200/mgag200_drv.h
index 6180acbca7ca..5dc577c9f8e6 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.h
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.h
@@ -13,19 +13,17 @@
 #ifndef __MGAG200_DRV_H__
 #define __MGAG200_DRV_H__
 
+#include 
+#include 
+
 #include 
 
 #include 
 #include 
-
 #include 
 #include 
-
 #include 
 
-#include 
-#include 
-
 #include "mgag200_reg.h"
 
 #define DRIVER_AUTHOR  "Matthew Garrett"
diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c 
b/drivers/gpu/drm/mgag200/mgag200_fb.c
index 97c575a9a86f..73f37bced134 100644
--- a/drivers/gpu/drm/mgag200/mgag200_fb.c
+++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
@@ -10,11 +10,13 @@
  *  Matt Turner
  *  Dave Airlie
  */
+
 #include 
-#include 
-#include 
-#include 
+
 #include 
+#include 
+#include 
+#include 
 
 #include "mgag200_drv.h"
 
diff --git a/drivers/gpu/drm/mgag200/mgag200_i2c.c 
b/drivers/gpu/drm/mgag200/mgag200_i2c.c
index 77d1c4771786..51d4037f00d4 100644
--- a/drivers/gpu/drm/mgag200/mgag200_i2c.c
+++ b/drivers/gpu/drm/mgag200/mgag200_i2c.c
@@ -25,10 +25,12 @@
 /*
  * Authors: Dave Airlie 
  */
+
 #include 
-#include 
 #include 
-#include 
+#include 
+
+#include 
 
 #include "mgag200_drv.h"
 
diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c 
b/drivers/gpu/drm/mgag200/mgag200_main.c
index f3687fed4075..fcd11ef50bd9 100644
--- a/drivers/gpu/drm/mgag200/mgag200_main.c
+++ b/drivers/gpu/drm/mgag200/mgag200_main.c
@@ -10,8 +10,10 @@
  *  Matt Turner
  *  Dave Airlie
  */
-#include 
+
 #include 
+#include 
+
 #include "mgag200_drv.h"
 
 static void mga_user_framebuffer_destroy(struct drm_framebuffer *fb)
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c 
b/drivers/gpu/drm/mgag200/mgag200_mode.c
index 1c8e0bfac015..32a6fab44eee 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -13,8 +13,9 @@
 
 #include 
 
-#include 
 #include 
+#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/gpu/drm/mgag200/mgag200_ttm.c 
b/drivers/gpu/drm/mgag200/mgag200_ttm.c
index 59294c0fd24a..73a6b848601c 100644
--- a/drivers/gpu/drm/mgag200/mgag200_ttm.c
+++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c
@@ -25,7 +25,8 @@
 /*
  * Authors: Dave Airlie 
  */
-#include 
+
+#include 
 
 #include "mgag200_drv.h"
 
-- 
2.20.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v1 3/4] drm/mga: drop use of drmP.h

2019-06-08 Thread Sam Ravnborg
Drop the use of the deprecated drmP.h header file.
Clean up list of include files and sort them.

Signed-off-by: Sam Ravnborg 
Cc: Thomas Zimmermann 
Cc: Daniel Vetter 
Cc: David Airlie 
---
 drivers/gpu/drm/mga/mga_dma.c   | 2 --
 drivers/gpu/drm/mga/mga_drv.c   | 7 +++
 drivers/gpu/drm/mga/mga_ioc32.c | 3 +--
 drivers/gpu/drm/mga/mga_irq.c   | 2 --
 drivers/gpu/drm/mga/mga_state.c | 2 --
 drivers/gpu/drm/mga/mga_warp.c  | 4 +---
 6 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/mga/mga_dma.c b/drivers/gpu/drm/mga/mga_dma.c
index 123be2f3a151..139554a3733d 100644
--- a/drivers/gpu/drm/mga/mga_dma.c
+++ b/drivers/gpu/drm/mga/mga_dma.c
@@ -37,8 +37,6 @@
 
 #include 
 
-#include 
-#include 
 #include "mga_drv.h"
 
 #define MGA_DEFAULT_USEC_TIMEOUT   1
diff --git a/drivers/gpu/drm/mga/mga_drv.c b/drivers/gpu/drm/mga/mga_drv.c
index 6e1d1054ad06..71128e6f6ae9 100644
--- a/drivers/gpu/drm/mga/mga_drv.c
+++ b/drivers/gpu/drm/mga/mga_drv.c
@@ -31,12 +31,11 @@
 
 #include 
 
-#include 
-#include 
-#include "mga_drv.h"
-
+#include 
 #include 
 
+#include "mga_drv.h"
+
 static struct pci_device_id pciidlist[] = {
mga_PCI_IDS
 };
diff --git a/drivers/gpu/drm/mga/mga_ioc32.c b/drivers/gpu/drm/mga/mga_ioc32.c
index 245fb2e359cf..6ccd270789c6 100644
--- a/drivers/gpu/drm/mga/mga_ioc32.c
+++ b/drivers/gpu/drm/mga/mga_ioc32.c
@@ -30,10 +30,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  * IN THE SOFTWARE.
  */
+
 #include 
 
-#include 
-#include 
 #include "mga_drv.h"
 
 typedef struct drm32_mga_init {
diff --git a/drivers/gpu/drm/mga/mga_irq.c b/drivers/gpu/drm/mga/mga_irq.c
index c6a3fab5b0c4..7c48f4d090ac 100644
--- a/drivers/gpu/drm/mga/mga_irq.c
+++ b/drivers/gpu/drm/mga/mga_irq.c
@@ -31,8 +31,6 @@
  *Eric Anholt 
  */
 
-#include 
-#include 
 #include "mga_drv.h"
 
 u32 mga_get_vblank_counter(struct drm_device *dev, unsigned int pipe)
diff --git a/drivers/gpu/drm/mga/mga_state.c b/drivers/gpu/drm/mga/mga_state.c
index 296a1db7e5ee..77a0b006f066 100644
--- a/drivers/gpu/drm/mga/mga_state.c
+++ b/drivers/gpu/drm/mga/mga_state.c
@@ -32,8 +32,6 @@
  *Gareth Hughes 
  */
 
-#include 
-#include 
 #include "mga_drv.h"
 
 /* 
diff --git a/drivers/gpu/drm/mga/mga_warp.c b/drivers/gpu/drm/mga/mga_warp.c
index 0b76352260a9..b5ef1d2c8b1c 100644
--- a/drivers/gpu/drm/mga/mga_warp.c
+++ b/drivers/gpu/drm/mga/mga_warp.c
@@ -29,11 +29,9 @@
 
 #include 
 #include 
-#include 
 #include 
+#include 
 
-#include 
-#include 
 #include "mga_drv.h"
 
 #define FIRMWARE_G200 "matrox/g200_warp.fw"
-- 
2.20.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v1 0/4] drm/{mga,mgag200}: drop use of drmP.h

2019-06-08 Thread Sam Ravnborg
Drop use of the deprecated drmP.h header file.
Also drop use of drm_os_linux.h as it is deprecated too,
and was pulled in via drmP.h

Build tested with allmodconfig, allyesconfig on
various architectures.

Signed-off-by: Sam Ravnborg 

Sam Ravnborg (4):
  drm/mga: drop dependency on drm_os_linux.h
  drm/mga: make header file self contained
  drm/mga: drop use of drmP.h
  drm/mgag200: drop use of drmP.h

 drivers/gpu/drm/mga/mga_dma.c| 14 --
 drivers/gpu/drm/mga/mga_drv.c|  7 +++
 drivers/gpu/drm/mga/mga_drv.h| 25 +
 drivers/gpu/drm/mga/mga_ioc32.c  |  3 +--
 drivers/gpu/drm/mga/mga_irq.c| 10 --
 drivers/gpu/drm/mga/mga_state.c  |  8 +++-
 drivers/gpu/drm/mga/mga_warp.c   |  4 +---
 drivers/gpu/drm/mgag200/mgag200_cursor.c |  3 ++-
 drivers/gpu/drm/mgag200/mgag200_drv.c| 10 +++---
 drivers/gpu/drm/mgag200/mgag200_drv.h|  8 +++-
 drivers/gpu/drm/mgag200/mgag200_fb.c |  8 +---
 drivers/gpu/drm/mgag200/mgag200_i2c.c|  6 --
 drivers/gpu/drm/mgag200/mgag200_main.c   |  4 +++-
 drivers/gpu/drm/mgag200/mgag200_mode.c   |  3 ++-
 drivers/gpu/drm/mgag200/mgag200_ttm.c|  3 ++-
 15 files changed, 69 insertions(+), 47 deletions(-)


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v1 1/4] drm/mga: drop dependency on drm_os_linux.h

2019-06-08 Thread Sam Ravnborg
Opencode all macros used from the deprecated drm_os_linux.h header file.
The DRM_WAIT_ON used 3 * HZ as timeout.
This was translated to 30 msec.

Signed-off-by: Sam Ravnborg 
Cc: Thomas Zimmermann 
Cc: Daniel Vetter 
Cc: David Airlie 
---
 drivers/gpu/drm/mga/mga_dma.c   | 12 
 drivers/gpu/drm/mga/mga_drv.h   | 12 
 drivers/gpu/drm/mga/mga_irq.c   |  8 
 drivers/gpu/drm/mga/mga_state.c |  6 +++---
 4 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/mga/mga_dma.c b/drivers/gpu/drm/mga/mga_dma.c
index 1ffdafea27e4..123be2f3a151 100644
--- a/drivers/gpu/drm/mga/mga_dma.c
+++ b/drivers/gpu/drm/mga/mga_dma.c
@@ -35,6 +35,8 @@
  * \author Gareth Hughes 
  */
 
+#include 
+
 #include 
 #include 
 #include "mga_drv.h"
@@ -62,7 +64,7 @@ int mga_do_wait_for_idle(drm_mga_private_t *dev_priv)
MGA_WRITE8(MGA_CRTC_INDEX, 0);
return 0;
}
-   DRM_UDELAY(1);
+   udelay(1);
}
 
 #if MGA_DMA_DEBUG
@@ -114,7 +116,7 @@ void mga_do_dma_flush(drm_mga_private_t *dev_priv)
status = MGA_READ(MGA_STATUS) & MGA_ENGINE_IDLE_MASK;
if (status == MGA_ENDPRDMASTS)
break;
-   DRM_UDELAY(1);
+   udelay(1);
}
 
if (primary->tail == primary->last_flush) {
@@ -1120,7 +1122,7 @@ int mga_dma_buffers(struct drm_device *dev, void *data,
 */
if (d->send_count != 0) {
DRM_ERROR("Process %d trying to send %d buffers via drmDMA\n",
- DRM_CURRENTPID, d->send_count);
+ task_pid_nr(current), d->send_count);
return -EINVAL;
}
 
@@ -1128,7 +1130,9 @@ int mga_dma_buffers(struct drm_device *dev, void *data,
 */
if (d->request_count < 0 || d->request_count > dma->buf_count) {
DRM_ERROR("Process %d trying to get %d buffers (of %d max)\n",
- DRM_CURRENTPID, d->request_count, dma->buf_count);
+ task_pid_nr(current),
+ d->request_count,
+ dma->buf_count);
return -EINVAL;
}
 
diff --git a/drivers/gpu/drm/mga/mga_drv.h b/drivers/gpu/drm/mga/mga_drv.h
index a45bb22275a7..7844a9e463f6 100644
--- a/drivers/gpu/drm/mga/mga_drv.h
+++ b/drivers/gpu/drm/mga/mga_drv.h
@@ -199,10 +199,14 @@ extern long mga_compat_ioctl(struct file *filp, unsigned 
int cmd,
 
 #define mga_flush_write_combine()  wmb()
 
-#define MGA_READ8(reg) DRM_READ8(dev_priv->mmio, (reg))
-#define MGA_READ(reg)  DRM_READ32(dev_priv->mmio, (reg))
-#define MGA_WRITE8(reg, val)   DRM_WRITE8(dev_priv->mmio, (reg), (val))
-#define MGA_WRITE(reg, val)DRM_WRITE32(dev_priv->mmio, (reg), (val))
+#define MGA_READ8(reg) \
+   readb(((void __iomem *)dev_priv->mmio->handle) + (reg))
+#define MGA_READ(reg) \
+   readl(((void __iomem *)dev_priv->mmio->handle) + (reg))
+#define MGA_WRITE8(reg, val) \
+   writeb(val, ((void __iomem *)dev_priv->mmio->handle) + (reg))
+#define MGA_WRITE(reg, val) \
+   writel(val, ((void __iomem *)dev_priv->mmio->handle) + (reg))
 
 #define DWGREG00x1c00
 #define DWGREG0_END0x1dff
diff --git a/drivers/gpu/drm/mga/mga_irq.c b/drivers/gpu/drm/mga/mga_irq.c
index 693ba708cfed..c6a3fab5b0c4 100644
--- a/drivers/gpu/drm/mga/mga_irq.c
+++ b/drivers/gpu/drm/mga/mga_irq.c
@@ -122,19 +122,19 @@ int mga_driver_fence_wait(struct drm_device *dev, 
unsigned int *sequence)
 {
drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private;
unsigned int cur_fence;
-   int ret = 0;
 
/* Assume that the user has missed the current sequence number
 * by about a day rather than she wants to wait for years
 * using fences.
 */
-   DRM_WAIT_ON(ret, dev_priv->fence_queue, 3 * HZ,
+   wait_event_timeout(dev_priv->fence_queue,
(((cur_fence = atomic_read(&dev_priv->last_fence_retired))
- - *sequence) <= (1 << 23)));
+ - *sequence) <= (1 << 23)),
+   msecs_to_jiffies(30));
 
*sequence = cur_fence;
 
-   return ret;
+   return 0;
 }
 
 void mga_driver_irq_preinstall(struct drm_device *dev)
diff --git a/drivers/gpu/drm/mga/mga_state.c b/drivers/gpu/drm/mga/mga_state.c
index e5f6b735f575..296a1db7e5ee 100644
--- a/drivers/gpu/drm/mga/mga_state.c
+++ b/drivers/gpu/drm/mga/mga_state.c
@@ -1016,7 +1016,7 @@ int mga_getparam(struct drm_device *dev, void *data, 
struct drm_file *file_priv)
return -EINVAL;
}
 
-   DRM_DEBUG("pid=%d\n", DRM_CURRENTPID);
+   DRM_DEBUG("pid=%d\n", task_pid_nr(current));
 
switch (param->param) {
case MGA_PARAM_IRQ_NR:
@@ -1048,7 +1048,7 @@ static int mga_set_fence(struct drm_device *dev, void 
*data, struct drm_file *fi
  

[PATCH v1 5/7] drm/radeon: prepare header files for drmP.h removal

2019-06-08 Thread Sam Ravnborg
While removing drmP.h from all .c files the list of
header files are also sorted alphabetically.
To allow this adjust the header files to pull in
the dependencies they needed to allow this.

Signed-off-by: Sam Ravnborg 
Cc: Alex Deucher 
Cc: "Christian König" 
Cc: "David (ChunMing) Zhou" 
Cc: David Airlie 
Cc: Daniel Vetter 
---
 drivers/gpu/drm/radeon/btc_dpm.h   | 3 +++
 drivers/gpu/drm/radeon/ci_dpm.h| 1 +
 drivers/gpu/drm/radeon/clearstate_cayman.h | 2 ++
 drivers/gpu/drm/radeon/clearstate_ci.h | 2 ++
 drivers/gpu/drm/radeon/clearstate_si.h | 2 ++
 drivers/gpu/drm/radeon/r100_track.h| 2 ++
 drivers/gpu/drm/radeon/r600_dpm.h  | 2 ++
 drivers/gpu/drm/radeon/radeon_trace.h  | 4 +++-
 drivers/gpu/drm/radeon/rv770_dpm.h | 1 +
 drivers/gpu/drm/radeon/sumo_dpm.h  | 1 +
 10 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/btc_dpm.h b/drivers/gpu/drm/radeon/btc_dpm.h
index 3b6f12b7760b..ec4cbb4aa77c 100644
--- a/drivers/gpu/drm/radeon/btc_dpm.h
+++ b/drivers/gpu/drm/radeon/btc_dpm.h
@@ -23,6 +23,9 @@
 #ifndef __BTC_DPM_H__
 #define __BTC_DPM_H__
 
+#include "radeon.h"
+#include "rv770_dpm.h"
+
 #define BTC_RLP_UVD_DFLT  20
 #define BTC_RMP_UVD_DFLT  50
 #define BTC_LHP_UVD_DFLT  50
diff --git a/drivers/gpu/drm/radeon/ci_dpm.h b/drivers/gpu/drm/radeon/ci_dpm.h
index dff2a63df38f..ac12db5f2cf7 100644
--- a/drivers/gpu/drm/radeon/ci_dpm.h
+++ b/drivers/gpu/drm/radeon/ci_dpm.h
@@ -24,6 +24,7 @@
 #define __CI_DPM_H__
 
 #include "ppsmc.h"
+#include "radeon.h"
 
 #define SMU__NUM_SCLK_DPM_STATE  8
 #define SMU__NUM_MCLK_DPM_LEVELS 6
diff --git a/drivers/gpu/drm/radeon/clearstate_cayman.h 
b/drivers/gpu/drm/radeon/clearstate_cayman.h
index e48a14037b76..4774e04c4da6 100644
--- a/drivers/gpu/drm/radeon/clearstate_cayman.h
+++ b/drivers/gpu/drm/radeon/clearstate_cayman.h
@@ -21,6 +21,8 @@
  *
  */
 
+#include "clearstate_defs.h"
+
 static const u32 SECT_CONTEXT_def_1[] =
 {
 0x, // DB_RENDER_CONTROL
diff --git a/drivers/gpu/drm/radeon/clearstate_ci.h 
b/drivers/gpu/drm/radeon/clearstate_ci.h
index f55d06664e31..c1b6c22dbed7 100644
--- a/drivers/gpu/drm/radeon/clearstate_ci.h
+++ b/drivers/gpu/drm/radeon/clearstate_ci.h
@@ -21,6 +21,8 @@
  *
  */
 
+#include "clearstate_defs.h"
+
 static const unsigned int ci_SECT_CONTEXT_def_1[] =
 {
 0x, // DB_RENDER_CONTROL
diff --git a/drivers/gpu/drm/radeon/clearstate_si.h 
b/drivers/gpu/drm/radeon/clearstate_si.h
index 66e39cdb5cb0..356219c6c7f2 100644
--- a/drivers/gpu/drm/radeon/clearstate_si.h
+++ b/drivers/gpu/drm/radeon/clearstate_si.h
@@ -21,6 +21,8 @@
  *
  */
 
+#include "clearstate_defs.h"
+
 static const u32 si_SECT_CONTEXT_def_1[] =
 {
 0x, // DB_RENDER_CONTROL
diff --git a/drivers/gpu/drm/radeon/r100_track.h 
b/drivers/gpu/drm/radeon/r100_track.h
index 57e2b09784be..1b5ff3f816db 100644
--- a/drivers/gpu/drm/radeon/r100_track.h
+++ b/drivers/gpu/drm/radeon/r100_track.h
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: MIT */
 
+#include "radeon.h"
+
 #define R100_TRACK_MAX_TEXTURE 3
 #define R200_TRACK_MAX_TEXTURE 6
 #define R300_TRACK_MAX_TEXTURE 16
diff --git a/drivers/gpu/drm/radeon/r600_dpm.h 
b/drivers/gpu/drm/radeon/r600_dpm.h
index bd499d749bc9..6e4d22ed2a00 100644
--- a/drivers/gpu/drm/radeon/r600_dpm.h
+++ b/drivers/gpu/drm/radeon/r600_dpm.h
@@ -23,6 +23,8 @@
 #ifndef __R600_DPM_H__
 #define __R600_DPM_H__
 
+#include "radeon.h"
+
 #define R600_ASI_DFLT1
 #define R600_BSP_DFLT0x41EB
 #define R600_BSU_DFLT0x2
diff --git a/drivers/gpu/drm/radeon/radeon_trace.h 
b/drivers/gpu/drm/radeon/radeon_trace.h
index f7346db33b86..c93f3ab3c4e3 100644
--- a/drivers/gpu/drm/radeon/radeon_trace.h
+++ b/drivers/gpu/drm/radeon/radeon_trace.h
@@ -3,8 +3,10 @@
 #define _RADEON_TRACE_H_
 
 #include 
-#include 
 #include 
+#include 
+
+#include 
 
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM radeon
diff --git a/drivers/gpu/drm/radeon/rv770_dpm.h 
b/drivers/gpu/drm/radeon/rv770_dpm.h
index d12beab7f3e6..d81ccf153c33 100644
--- a/drivers/gpu/drm/radeon/rv770_dpm.h
+++ b/drivers/gpu/drm/radeon/rv770_dpm.h
@@ -23,6 +23,7 @@
 #ifndef __RV770_DPM_H__
 #define __RV770_DPM_H__
 
+#include "radeon.h"
 #include "rv770_smc.h"
 
 struct rv770_clock_registers {
diff --git a/drivers/gpu/drm/radeon/sumo_dpm.h 
b/drivers/gpu/drm/radeon/sumo_dpm.h
index 07dda299c784..f1651135a47a 100644
--- a/drivers/gpu/drm/radeon/sumo_dpm.h
+++ b/drivers/gpu/drm/radeon/sumo_dpm.h
@@ -24,6 +24,7 @@
 #define __SUMO_DPM_H__
 
 #include "atom.h"
+#include "radeon.h"
 
 #define SUMO_MAX_HARDWARE_POWERLEVELS 5
 #define SUMO_PM_NUMBER_OF_TC 15
-- 
2.20.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v1 4/7] drm/radeon: drop drmP.h from header files

2019-06-08 Thread Sam Ravnborg
To ease conversion of .c files drop include of
drmP.h from all header files.
And fix-up build errors caused by this.

Signed-off-by: Sam Ravnborg 
Cc: Alex Deucher 
Cc: "Christian König" 
Cc: "David (ChunMing) Zhou" 
Cc: David Airlie 
Cc: Daniel Vetter 
---
 drivers/gpu/drm/radeon/atom.c | 2 ++
 drivers/gpu/drm/radeon/atom.h | 1 -
 drivers/gpu/drm/radeon/radeon_trace.h | 2 --
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index ac98ad561870..2c27627b6659 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -25,8 +25,10 @@
 #include 
 #include 
 #include 
+
 #include 
 
+#include 
 #include 
 
 #define ATOM_DEBUG
diff --git a/drivers/gpu/drm/radeon/atom.h b/drivers/gpu/drm/radeon/atom.h
index 6d014ddb6b78..364b895e7ebb 100644
--- a/drivers/gpu/drm/radeon/atom.h
+++ b/drivers/gpu/drm/radeon/atom.h
@@ -26,7 +26,6 @@
 #define ATOM_H
 
 #include 
-#include 
 
 #define ATOM_BIOS_MAGIC0xAA55
 #define ATOM_ATI_MAGIC_PTR 0x30
diff --git a/drivers/gpu/drm/radeon/radeon_trace.h 
b/drivers/gpu/drm/radeon/radeon_trace.h
index 0d84b8aafab3..f7346db33b86 100644
--- a/drivers/gpu/drm/radeon/radeon_trace.h
+++ b/drivers/gpu/drm/radeon/radeon_trace.h
@@ -6,8 +6,6 @@
 #include 
 #include 
 
-#include 
-
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM radeon
 #define TRACE_INCLUDE_FILE radeon_trace
-- 
2.20.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v1 2/7] drm: drm_debugfs.h self-contained

2019-06-08 Thread Sam Ravnborg
While removing drmP.h from drm/radeon a few files ended
up including drm_debugfs.h as the first file.
This failed build due to missing dependencies in drm_debugfs.h.

Add the missing include files.

Signed-off-by: Sam Ravnborg 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
---
 include/drm/drm_debugfs.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/drm/drm_debugfs.h b/include/drm/drm_debugfs.h
index ac0f75df1ac9..7501e323d383 100644
--- a/include/drm/drm_debugfs.h
+++ b/include/drm/drm_debugfs.h
@@ -32,6 +32,8 @@
 #ifndef _DRM_DEBUGFS_H_
 #define _DRM_DEBUGFS_H_
 
+#include 
+#include 
 /**
  * struct drm_info_list - debugfs info list entry
  *
-- 
2.20.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v1 6/7] drm/radeon: drop use of drmP.h (1/2)

2019-06-08 Thread Sam Ravnborg
Drop use of drmP.h in all .c files named radeon*c.
To ease review a little drmP.h removal was divided in two commits.

Signed-off-by: Sam Ravnborg 
Cc: Alex Deucher 
Cc: "Christian König" 
Cc: "David (ChunMing) Zhou" 
Cc: David Airlie 
Cc: Daniel Vetter 
---
 drivers/gpu/drm/radeon/radeon_acpi.c  | 13 ++
 drivers/gpu/drm/radeon/radeon_agp.c   |  8 --
 drivers/gpu/drm/radeon/radeon_asic.c  | 10 ---
 drivers/gpu/drm/radeon/radeon_atombios.c  |  5 +++-
 drivers/gpu/drm/radeon/radeon_audio.c |  2 +-
 drivers/gpu/drm/radeon/radeon_benchmark.c |  2 +-
 drivers/gpu/drm/radeon/radeon_bios.c  | 12 ++---
 drivers/gpu/drm/radeon/radeon_clocks.c|  9 ---
 drivers/gpu/drm/radeon/radeon_combios.c   |  5 +++-
 drivers/gpu/drm/radeon/radeon_connectors.c|  2 +-
 drivers/gpu/drm/radeon/radeon_cs.c| 10 +--
 drivers/gpu/drm/radeon/radeon_cursor.c|  4 ++-
 drivers/gpu/drm/radeon/radeon_device.c| 18 -
 drivers/gpu/drm/radeon/radeon_display.c   | 21 +--
 drivers/gpu/drm/radeon/radeon_dp_auxch.c  |  2 +-
 drivers/gpu/drm/radeon/radeon_dp_mst.c|  6 +++--
 drivers/gpu/drm/radeon/radeon_drv.c   | 19 +-
 drivers/gpu/drm/radeon/radeon_encoders.c  |  5 +++-
 drivers/gpu/drm/radeon/radeon_fb.c| 13 +-
 drivers/gpu/drm/radeon/radeon_fence.c |  6 +++--
 drivers/gpu/drm/radeon/radeon_gart.c  |  5 +++-
 drivers/gpu/drm/radeon/radeon_gem.c   |  7 -
 drivers/gpu/drm/radeon/radeon_i2c.c   |  5 +++-
 drivers/gpu/drm/radeon/radeon_ib.c|  5 +++-
 drivers/gpu/drm/radeon/radeon_irq_kms.c   | 14 +++---
 drivers/gpu/drm/radeon/radeon_kms.c   | 17 +++-
 drivers/gpu/drm/radeon/radeon_legacy_crtc.c   |  9 ---
 .../gpu/drm/radeon/radeon_legacy_encoders.c   | 11 +---
 drivers/gpu/drm/radeon/radeon_legacy_tv.c |  4 ++-
 drivers/gpu/drm/radeon/radeon_mn.c|  2 +-
 drivers/gpu/drm/radeon/radeon_object.c|  9 ---
 drivers/gpu/drm/radeon/radeon_pm.c| 17 +++-
 drivers/gpu/drm/radeon/radeon_prime.c |  8 +++---
 drivers/gpu/drm/radeon/radeon_ring.c  |  6 -
 drivers/gpu/drm/radeon/radeon_sa.c|  2 +-
 drivers/gpu/drm/radeon/radeon_semaphore.c |  2 +-
 drivers/gpu/drm/radeon/radeon_sync.c  |  2 +-
 drivers/gpu/drm/radeon/radeon_test.c  |  2 +-
 drivers/gpu/drm/radeon/radeon_trace_points.c  |  2 +-
 drivers/gpu/drm/radeon/radeon_ttm.c   | 26 ---
 drivers/gpu/drm/radeon/radeon_ucode.c |  2 +-
 drivers/gpu/drm/radeon/radeon_uvd.c   |  2 +-
 drivers/gpu/drm/radeon/radeon_vce.c   |  2 +-
 drivers/gpu/drm/radeon/radeon_vm.c|  2 +-
 44 files changed, 223 insertions(+), 112 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_acpi.c 
b/drivers/gpu/drm/radeon/radeon_acpi.c
index 224cc21bbe38..6cf1645e7a1a 100644
--- a/drivers/gpu/drm/radeon/radeon_acpi.c
+++ b/drivers/gpu/drm/radeon/radeon_acpi.c
@@ -21,18 +21,21 @@
  *
  */
 
-#include 
 #include 
-#include 
-#include 
+#include 
 #include 
+#include 
+#include 
+
+#include 
 #include 
-#include 
+
 #include 
 #include 
+
+#include "atom.h"
 #include "radeon.h"
 #include "radeon_acpi.h"
-#include "atom.h"
 
 #if defined(CONFIG_VGA_SWITCHEROO)
 bool radeon_atpx_dgpu_req_power_for_displays(void);
diff --git a/drivers/gpu/drm/radeon/radeon_agp.c 
b/drivers/gpu/drm/radeon/radeon_agp.c
index c77d349c561c..4de16f3badb4 100644
--- a/drivers/gpu/drm/radeon/radeon_agp.c
+++ b/drivers/gpu/drm/radeon/radeon_agp.c
@@ -24,10 +24,14 @@
  *Dave Airlie
  *Jerome Glisse 
  */
-#include 
-#include "radeon.h"
+
+#include 
+#include 
+#include 
 #include 
 
+#include "radeon.h"
+
 #if IS_ENABLED(CONFIG_AGP)
 
 struct radeon_agpmode_quirk {
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c 
b/drivers/gpu/drm/radeon/radeon_asic.c
index bc5121d1a7bc..dc3c2227e06a 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -27,14 +27,16 @@
  */
 
 #include 
-#include 
+#include 
+
 #include 
+#include 
 #include 
-#include 
-#include "radeon_reg.h"
+
+#include "atom.h"
 #include "radeon.h"
 #include "radeon_asic.h"
-#include "atom.h"
+#include "radeon_reg.h"
 
 /*
  * Registers accessors functions.
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c 
b/drivers/gpu/drm/radeon/radeon_atombios.c
index f422a8d6aec4..226a7bf0eb7a 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -23,8 +23,11 @@
  * Authors: Dave Airlie
  *  Alex Deucher
  */
-#include 
+
+#include 
+#include 
 #include 
+
 #include "radeon.h"
 
 #include "atom.h"
diff --git a/drivers/gpu/drm/radeon/radeon_audio.c 
b/drivers/gpu/drm/radeon/radeon_audio.c
index 96f71114237a..b9aea5776d3d 100644
--- a/drivers/gpu/drm/radeon/radeon_audio.c
+++ b/dr

[PATCH v1 7/7] drm/radeon: drop use of drmP.h (2/2)

2019-06-08 Thread Sam Ravnborg
Drop use of drmP.h in remaining .c files.
To ease review a little the drmP.h removal was divided in two commits.

Signed-off-by: Sam Ravnborg 
Cc: Alex Deucher 
Cc: "Christian König" 
Cc: "David (ChunMing) Zhou" 
Cc: David Airlie 
Cc: Daniel Vetter 
---
 drivers/gpu/drm/radeon/atombios_crtc.c |  7 --
 drivers/gpu/drm/radeon/atombios_dp.c   |  2 +-
 drivers/gpu/drm/radeon/atombios_encoders.c | 14 +++-
 drivers/gpu/drm/radeon/atombios_i2c.c  |  2 +-
 drivers/gpu/drm/radeon/btc_dpm.c   | 16 +++--
 drivers/gpu/drm/radeon/ci_dpm.c| 14 +++-
 drivers/gpu/drm/radeon/ci_smc.c|  2 +-
 drivers/gpu/drm/radeon/cik.c   | 14 +++-
 drivers/gpu/drm/radeon/cik_sdma.c  |  2 +-
 drivers/gpu/drm/radeon/cypress_dpm.c   | 11 -
 drivers/gpu/drm/radeon/dce3_1_afmt.c   |  2 +-
 drivers/gpu/drm/radeon/dce6_afmt.c |  2 +-
 drivers/gpu/drm/radeon/evergreen.c | 16 -
 drivers/gpu/drm/radeon/evergreen_cs.c  |  2 +-
 drivers/gpu/drm/radeon/evergreen_dma.c |  2 +-
 drivers/gpu/drm/radeon/evergreen_hdmi.c|  2 +-
 drivers/gpu/drm/radeon/kv_dpm.c| 10 +
 drivers/gpu/drm/radeon/kv_smc.c|  2 +-
 drivers/gpu/drm/radeon/ni.c| 17 --
 drivers/gpu/drm/radeon/ni_dma.c|  2 +-
 drivers/gpu/drm/radeon/ni_dpm.c| 16 +++--
 drivers/gpu/drm/radeon/r100.c  | 26 +-
 drivers/gpu/drm/radeon/r200.c  |  2 +-
 drivers/gpu/drm/radeon/r300.c  | 16 -
 drivers/gpu/drm/radeon/r420.c  | 16 -
 drivers/gpu/drm/radeon/r520.c  |  2 +-
 drivers/gpu/drm/radeon/r600.c  | 14 
 drivers/gpu/drm/radeon/r600_cs.c   |  2 +-
 drivers/gpu/drm/radeon/r600_dma.c  |  2 +-
 drivers/gpu/drm/radeon/r600_dpm.c  |  2 +-
 drivers/gpu/drm/radeon/r600_hdmi.c |  2 +-
 drivers/gpu/drm/radeon/rs400.c |  7 +-
 drivers/gpu/drm/radeon/rs600.c | 10 +
 drivers/gpu/drm/radeon/rs690.c |  6 +++--
 drivers/gpu/drm/radeon/rs780_dpm.c | 12 +-
 drivers/gpu/drm/radeon/rv515.c | 11 ++---
 drivers/gpu/drm/radeon/rv6xx_dpm.c |  2 +-
 drivers/gpu/drm/radeon/rv730_dpm.c |  2 +-
 drivers/gpu/drm/radeon/rv740_dpm.c |  2 +-
 drivers/gpu/drm/radeon/rv770.c | 12 ++
 drivers/gpu/drm/radeon/rv770_dma.c |  2 +-
 drivers/gpu/drm/radeon/rv770_dpm.c |  2 +-
 drivers/gpu/drm/radeon/rv770_smc.c |  2 +-
 drivers/gpu/drm/radeon/si.c| 16 -
 drivers/gpu/drm/radeon/si_dma.c|  2 +-
 drivers/gpu/drm/radeon/si_dpm.c| 14 +++-
 drivers/gpu/drm/radeon/si_smc.c|  2 +-
 drivers/gpu/drm/radeon/sumo_dpm.c  |  2 +-
 drivers/gpu/drm/radeon/sumo_smc.c  |  2 +-
 drivers/gpu/drm/radeon/trinity_dpm.c   | 10 +
 drivers/gpu/drm/radeon/trinity_smc.c   |  2 +-
 drivers/gpu/drm/radeon/uvd_v1_0.c  |  2 +-
 drivers/gpu/drm/radeon/uvd_v2_2.c  |  2 +-
 drivers/gpu/drm/radeon/uvd_v3_1.c  |  2 +-
 drivers/gpu/drm/radeon/uvd_v4_2.c  |  2 +-
 drivers/gpu/drm/radeon/vce_v1_0.c  |  2 +-
 drivers/gpu/drm/radeon/vce_v2_0.c  |  2 +-
 57 files changed, 226 insertions(+), 147 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c 
b/drivers/gpu/drm/radeon/atombios_crtc.c
index d75ae17ff3ad..da2c9e295408 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -23,11 +23,14 @@
  * Authors: Dave Airlie
  *  Alex Deucher
  */
-#include 
+
 #include 
 #include 
-#include 
 #include 
+#include 
+#include 
+#include 
+
 #include "radeon.h"
 #include "atom.h"
 #include "atom-bits.h"
diff --git a/drivers/gpu/drm/radeon/atombios_dp.c 
b/drivers/gpu/drm/radeon/atombios_dp.c
index 3e798593e042..6f38375c77c8 100644
--- a/drivers/gpu/drm/radeon/atombios_dp.c
+++ b/drivers/gpu/drm/radeon/atombios_dp.c
@@ -24,7 +24,7 @@
  *  Alex Deucher
  *  Jerome Glisse
  */
-#include 
+
 #include 
 #include "radeon.h"
 
diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c 
b/drivers/gpu/drm/radeon/atombios_encoders.c
index e67ed383e11b..cc8f32a1b03c 100644
--- a/drivers/gpu/drm/radeon/atombios_encoders.c
+++ b/drivers/gpu/drm/radeon/atombios_encoders.c
@@ -23,15 +23,19 @@
  * Authors: Dave Airlie
  *  Alex Deucher
  */
-#include 
+
+#include 
+#include 
+
 #include 
+#include 
+#include 
 #include 
+
+#include "atom.h"
 #include "radeon.h"
-#include "radeon_audio.h"
 #include "radeon_asic.h"
-#include "atom.h"
-#include 
-#include 
+#include "radeon_audio.h"
 
 extern int atom_debug;
 
diff --git a/drivers/gpu/drm/radeon/atombios_i2c.c 
b/drivers/gpu/drm/radeon/atombios_i2c.c
index 9022e9af11a0..a570ce40af19 100644

[PATCH v1 3/7] drm/radeon: drop dependency on drm_os_linux.h

2019-06-08 Thread Sam Ravnborg
The drm_os_linux.h header file is deprecated.
Drop all uses of symbols from this file.
All macros are just opencoded.
A few adjustments to include files was required as the obsolete
drm_os_linux.h included these headers.

Signed-off-by: Sam Ravnborg 
Cc: Alex Deucher 
Cc: "Christian König" 
Cc: "David (ChunMing) Zhou" 
Cc: David Airlie 
Cc: Daniel Vetter 
---
 drivers/gpu/drm/radeon/cik.c  |  4 ++--
 drivers/gpu/drm/radeon/cik_sdma.c |  4 ++--
 drivers/gpu/drm/radeon/r100.c | 10 +-
 drivers/gpu/drm/radeon/r300.c |  2 +-
 drivers/gpu/drm/radeon/r520.c |  2 +-
 drivers/gpu/drm/radeon/r600.c |  4 ++--
 drivers/gpu/drm/radeon/r600_dma.c |  4 ++--
 drivers/gpu/drm/radeon/radeon_fence.c | 10 +++---
 drivers/gpu/drm/radeon/radeon_vce.c   |  2 +-
 drivers/gpu/drm/radeon/rs400.c|  4 ++--
 drivers/gpu/drm/radeon/rs600.c|  3 +++
 drivers/gpu/drm/radeon/rv515.c|  2 +-
 drivers/gpu/drm/radeon/uvd_v1_0.c |  2 +-
 13 files changed, 30 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index ab7b4e2ffcd2..f20bced8ca99 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -3480,7 +3480,7 @@ int cik_ring_test(struct radeon_device *rdev, struct 
radeon_ring *ring)
tmp = RREG32(scratch);
if (tmp == 0xDEADBEEF)
break;
-   DRM_UDELAY(1);
+   udelay(1);
}
if (i < rdev->usec_timeout) {
DRM_INFO("ring test on %d succeeded in %d usecs\n", ring->idx, 
i);
@@ -3825,7 +3825,7 @@ int cik_ib_test(struct radeon_device *rdev, struct 
radeon_ring *ring)
tmp = RREG32(scratch);
if (tmp == 0xDEADBEEF)
break;
-   DRM_UDELAY(1);
+   udelay(1);
}
if (i < rdev->usec_timeout) {
DRM_INFO("ib test on ring %d succeeded in %u usecs\n", 
ib.fence->ring, i);
diff --git a/drivers/gpu/drm/radeon/cik_sdma.c 
b/drivers/gpu/drm/radeon/cik_sdma.c
index 9c351dc8a9e0..bbabaa87119b 100644
--- a/drivers/gpu/drm/radeon/cik_sdma.c
+++ b/drivers/gpu/drm/radeon/cik_sdma.c
@@ -677,7 +677,7 @@ int cik_sdma_ring_test(struct radeon_device *rdev,
tmp = le32_to_cpu(rdev->wb.wb[index/4]);
if (tmp == 0xDEADBEEF)
break;
-   DRM_UDELAY(1);
+   udelay(1);
}
 
if (i < rdev->usec_timeout) {
@@ -751,7 +751,7 @@ int cik_sdma_ib_test(struct radeon_device *rdev, struct 
radeon_ring *ring)
tmp = le32_to_cpu(rdev->wb.wb[index/4]);
if (tmp == 0xDEADBEEF)
break;
-   DRM_UDELAY(1);
+   udelay(1);
}
if (i < rdev->usec_timeout) {
DRM_INFO("ib test on ring %d succeeded in %u usecs\n", 
ib.fence->ring, i);
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 7d39ed63e5be..913938808511 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -2470,7 +2470,7 @@ static int r100_rbbm_fifo_wait_for_entry(struct 
radeon_device *rdev, unsigned n)
if (tmp >= n) {
return 0;
}
-   DRM_UDELAY(1);
+   udelay(1);
}
return -1;
 }
@@ -2488,7 +2488,7 @@ int r100_gui_wait_for_idle(struct radeon_device *rdev)
if (!(tmp & RADEON_RBBM_ACTIVE)) {
return 0;
}
-   DRM_UDELAY(1);
+   udelay(1);
}
return -1;
 }
@@ -2504,7 +2504,7 @@ int r100_mc_wait_for_idle(struct radeon_device *rdev)
if (tmp & RADEON_MC_IDLE) {
return 0;
}
-   DRM_UDELAY(1);
+   udelay(1);
}
return -1;
 }
@@ -3669,7 +3669,7 @@ int r100_ring_test(struct radeon_device *rdev, struct 
radeon_ring *ring)
if (tmp == 0xDEADBEEF) {
break;
}
-   DRM_UDELAY(1);
+   udelay(1);
}
if (i < rdev->usec_timeout) {
DRM_INFO("ring test succeeded in %d usecs\n", i);
@@ -3746,7 +3746,7 @@ int r100_ib_test(struct radeon_device *rdev, struct 
radeon_ring *ring)
if (tmp == 0xDEADBEEF) {
break;
}
-   DRM_UDELAY(1);
+   udelay(1);
}
if (i < rdev->usec_timeout) {
DRM_INFO("ib test succeeded in %u usecs\n", i);
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 652126fd6dd4..6db0a2aa87ab 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -350,7 +350,7 @@ int r300_mc_wait_for_idle(struct radeon_device *rdev)
if (tmp & R300_MC_IDLE) {
r

[PATCH v1 1/7] drm: drm_crtc.h self-contained

2019-06-08 Thread Sam Ravnborg
While removing drmP.h from drm/radeon a few files ended
up including drm_crtc.h as the first file.
This failed build due to a missing dependency in drm_crtc.h.

Add the missing include file.

Signed-off-by: Sam Ravnborg 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
---
 include/drm/drm_crtc.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 58ad983d7cd6..dc42b9e35333 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.20.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v1 0/7] drm/radeon: drop obsolete header files

2019-06-08 Thread Sam Ravnborg
This patchset contains updates to two header files
in include/drm/.
The header files caused build errors due to missing dependencies.
Fixed this so others will not be hit by the same.

The header file drm_os_linux.h is deprecated and should
no longer be used.
For radeon it was a simple 1:1 replacement of the
used macros + a adding missing include files.

The remaining patches perpare for and remove the use
of drmP.h in the rest of the driver.

The patches was all build tested on various architectures,
and as usual alpha resulted in a few extra build issues.

The patches are made on top of drm-misc-next, but applies
clean to drm-next-5.3-wip branch of the agd5f git tree.

Sam

Sam Ravnborg (7):
  drm: drm_crtc.h self-contained
  drm: drm_debugfs.h self-contained
  drm/radeon: drop dependency on drm_os_linux.h
  drm/radeon: drop drmP.h from header files
  drm/radeon: prepare header files for drmP.h removal
  drm/radeon: drop use of drmP.h (1/2)
  drm/radeon: drop use of drmP.h (2/2)

 drivers/gpu/drm/radeon/atom.c   |  2 ++
 drivers/gpu/drm/radeon/atom.h   |  1 -
 drivers/gpu/drm/radeon/atombios_crtc.c  |  7 +++--
 drivers/gpu/drm/radeon/atombios_dp.c|  2 +-
 drivers/gpu/drm/radeon/atombios_encoders.c  | 14 ++
 drivers/gpu/drm/radeon/atombios_i2c.c   |  2 +-
 drivers/gpu/drm/radeon/btc_dpm.c| 16 ++-
 drivers/gpu/drm/radeon/btc_dpm.h|  3 +++
 drivers/gpu/drm/radeon/ci_dpm.c | 14 +-
 drivers/gpu/drm/radeon/ci_dpm.h |  1 +
 drivers/gpu/drm/radeon/ci_smc.c |  2 +-
 drivers/gpu/drm/radeon/cik.c| 18 -
 drivers/gpu/drm/radeon/cik_sdma.c   |  6 ++---
 drivers/gpu/drm/radeon/clearstate_cayman.h  |  2 ++
 drivers/gpu/drm/radeon/clearstate_ci.h  |  2 ++
 drivers/gpu/drm/radeon/clearstate_si.h  |  2 ++
 drivers/gpu/drm/radeon/cypress_dpm.c| 11 
 drivers/gpu/drm/radeon/dce3_1_afmt.c|  2 +-
 drivers/gpu/drm/radeon/dce6_afmt.c  |  2 +-
 drivers/gpu/drm/radeon/evergreen.c  | 16 ++-
 drivers/gpu/drm/radeon/evergreen_cs.c   |  2 +-
 drivers/gpu/drm/radeon/evergreen_dma.c  |  2 +-
 drivers/gpu/drm/radeon/evergreen_hdmi.c |  2 +-
 drivers/gpu/drm/radeon/kv_dpm.c | 10 ---
 drivers/gpu/drm/radeon/kv_smc.c |  2 +-
 drivers/gpu/drm/radeon/ni.c | 17 +++-
 drivers/gpu/drm/radeon/ni_dma.c |  2 +-
 drivers/gpu/drm/radeon/ni_dpm.c | 16 ++-
 drivers/gpu/drm/radeon/r100.c   | 36 ++---
 drivers/gpu/drm/radeon/r100_track.h |  2 ++
 drivers/gpu/drm/radeon/r200.c   |  2 +-
 drivers/gpu/drm/radeon/r300.c   | 18 -
 drivers/gpu/drm/radeon/r420.c   | 16 +++
 drivers/gpu/drm/radeon/r520.c   |  4 +--
 drivers/gpu/drm/radeon/r600.c   | 18 -
 drivers/gpu/drm/radeon/r600_cs.c|  2 +-
 drivers/gpu/drm/radeon/r600_dma.c   |  6 ++---
 drivers/gpu/drm/radeon/r600_dpm.c   |  2 +-
 drivers/gpu/drm/radeon/r600_dpm.h   |  2 ++
 drivers/gpu/drm/radeon/r600_hdmi.c  |  2 +-
 drivers/gpu/drm/radeon/radeon_acpi.c| 13 +
 drivers/gpu/drm/radeon/radeon_agp.c |  8 --
 drivers/gpu/drm/radeon/radeon_asic.c| 10 ---
 drivers/gpu/drm/radeon/radeon_atombios.c|  5 +++-
 drivers/gpu/drm/radeon/radeon_audio.c   |  2 +-
 drivers/gpu/drm/radeon/radeon_benchmark.c   |  2 +-
 drivers/gpu/drm/radeon/radeon_bios.c| 12 ++---
 drivers/gpu/drm/radeon/radeon_clocks.c  |  9 ---
 drivers/gpu/drm/radeon/radeon_combios.c |  5 +++-
 drivers/gpu/drm/radeon/radeon_connectors.c  |  2 +-
 drivers/gpu/drm/radeon/radeon_cs.c  | 10 +--
 drivers/gpu/drm/radeon/radeon_cursor.c  |  4 ++-
 drivers/gpu/drm/radeon/radeon_device.c  | 18 -
 drivers/gpu/drm/radeon/radeon_display.c | 21 +--
 drivers/gpu/drm/radeon/radeon_dp_auxch.c|  2 +-
 drivers/gpu/drm/radeon/radeon_dp_mst.c  |  6 +++--
 drivers/gpu/drm/radeon/radeon_drv.c | 19 -
 drivers/gpu/drm/radeon/radeon_encoders.c|  5 +++-
 drivers/gpu/drm/radeon/radeon_fb.c  | 13 -
 drivers/gpu/drm/radeon/radeon_fence.c   | 16 +++
 drivers/gpu/drm/radeon/radeon_gart.c|  5 +++-
 drivers/gpu/drm/radeon/radeon_gem.c |  7 -
 drivers/gpu/drm/radeon/radeon_i2c.c |  5 +++-
 drivers/gpu/drm/radeon/radeon_ib.c  |  5 +++-
 drivers/gpu/drm/radeon/radeon_irq_kms.c | 14 +++---
 drivers/gpu

[2/2] drm/panel: support for BOE tv101wum-n16 wuxga dsi video mode panel

2019-06-08 Thread Jitao Shi
Add driver for BOE tv101wum-nl6 panel is a 10.1" 1200x1920 panel.

Signed-off-by: Jitao Shi 
---
 drivers/gpu/drm/panel/Kconfig |  10 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-boe-tv101wum-nl6.c| 700 ++
 3 files changed, 711 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index e36dbb4df867..5dad028e35f0 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -272,4 +272,14 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
help
  Say Y here if you want to enable support for Truly NT35597 WQXGA Dual 
DSI
  Video Mode panel
+
+config DRM_PANEL_BOE_TV101WUM_NL6
+   tristate "BOE TV101WUM 1200x1920 panel"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   depends on BACKLIGHT_CLASS_DEVICE
+   help
+ Say Y here if you want to support for BOE TV101WUM WUXGA PANEL
+ DSI Video Mode panel
+
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 78e3dc376bdd..fc5944231aa8 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -28,3 +28,4 @@ obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += 
panel-sitronix-st7701.o
 obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o
 obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
 obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
+obj-$(CONFIG_DRM_PANEL_BOE_TV101WUM_NL6) += panel-boe-tv101wum-nl6.o
diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c 
b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
new file mode 100644
index ..19590664c337
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -0,0 +1,700 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2018 MediaTek Inc.
+ * Author: Jitao Shi 
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct boe_panel {
+   struct drm_panel base;
+   struct mipi_dsi_device *dsi;
+
+   struct backlight_device *backlight;
+   struct regulator *pp1800;
+   struct regulator *avee;
+   struct regulator *avdd;
+   struct gpio_desc *enable_gpio;
+
+   bool prepared;
+   bool enabled;
+
+   const struct drm_display_mode *mode;
+};
+
+enum dsi_cmd_type {
+   INIT_GENENIC_CMD,
+   INIT_DCS_CMD,
+   DELAY_CMD,
+};
+
+struct panel_init_cmd {
+   enum dsi_cmd_type type;
+   size_t len;
+   const char *data;
+};
+
+#define _INIT_CMD(...) { \
+   .type = INIT_GENENIC_CMD,\
+   .len = sizeof((char[]){__VA_ARGS__}), \
+   .data = (char[]){__VA_ARGS__} }
+
+#define _INIT_DCS_CMD(...) { \
+   .type = INIT_DCS_CMD, \
+   .len = sizeof((char[]){__VA_ARGS__}), \
+   .data = (char[]){__VA_ARGS__} }
+
+#define _INIT_DELAY_CMD(...) { \
+   .type = DELAY_CMD,\
+   .len = sizeof((char[]){__VA_ARGS__}), \
+   .data = (char[]){__VA_ARGS__} }
+
+static const struct panel_init_cmd boe_init_cmd[] = {
+   _INIT_DELAY_CMD(24),
+   _INIT_DCS_CMD(0xB0, 0x05),
+   _INIT_DCS_CMD(0xB1, 0xE5),
+   _INIT_DCS_CMD(0xB3, 0x52),
+
+   _INIT_DCS_CMD(0xB0, 0x00),
+   _INIT_DCS_CMD(0xB3, 0x88),
+   _INIT_DCS_CMD(0xB0, 0x04),
+   _INIT_DCS_CMD(0xB8, 0x00),
+
+   _INIT_DCS_CMD(0xB0, 0x00),
+   _INIT_DCS_CMD(0xB6, 0x03),
+   _INIT_DCS_CMD(0xBA, 0x8B),
+   _INIT_DCS_CMD(0xBF, 0x1A),
+   _INIT_DCS_CMD(0xC0, 0x0F),
+   _INIT_DCS_CMD(0xC2, 0x0C),
+   _INIT_DCS_CMD(0xC3, 0x02),
+   _INIT_DCS_CMD(0xC4, 0x0C),
+   _INIT_DCS_CMD(0xC5, 0x02),
+
+   _INIT_DCS_CMD(0xB0, 0x01),
+   _INIT_DCS_CMD(0xE0, 0x26),
+   _INIT_DCS_CMD(0xE1, 0x26),
+   _INIT_DCS_CMD(0xDC, 0x00),
+   _INIT_DCS_CMD(0xDD, 0x00),
+   _INIT_DCS_CMD(0xCC, 0x26),
+   _INIT_DCS_CMD(0xCD, 0x26),
+   _INIT_DCS_CMD(0xC8, 0x00),
+   _INIT_DCS_CMD(0xC9, 0x00),
+   _INIT_DCS_CMD(0xD2, 0x03),
+   _INIT_DCS_CMD(0xD3, 0x03),
+   _INIT_DCS_CMD(0xE6, 0x04),
+   _INIT_DCS_CMD(0xE7, 0x04),
+   _INIT_DCS_CMD(0xC4, 0x09),
+   _INIT_DCS_CMD(0xC5, 0x09),
+   _INIT_DCS_CMD(0xD8, 0x0A),
+   _INIT_DCS_CMD(0xD9, 0x0A),
+   _INIT_DCS_CMD(0xC2, 0x0B),
+   _INIT_DCS_CMD(0xC3, 0x0B),
+   _INIT_DCS_CMD(0xD6, 0x0C),
+   _INIT_DCS_CMD(0xD7, 0x0C),
+   _INIT_DCS_CMD(0xC0, 0x05),
+   _INIT_DCS_CMD(0xC1, 0x05),
+   _INIT_DCS_CMD(0xD4, 0x06),
+   _INIT_DCS_CMD(0xD5, 0x06),
+   _INIT_DCS_CMD(0xCA, 0x07),
+   _INIT_DCS_CMD(0xCB, 0x07),
+   _INIT_DCS_CMD(0xDE, 0x08),
+   _INIT_DCS_CMD(0xDF, 0x08),
+
+   _INIT_DCS_CMD(0xB0, 0x02),
+   _INIT_DCS_CMD(0xC0, 0x00),
+   _INIT_DCS_CMD(0xC1, 0x0D),
+   _INIT_DCS_CMD(0xC2, 0x17),
+   _INIT_DCS_CMD(0xC3, 0x26),
+   _INIT_DCS_CMD(0xC4, 0x31),
+   _

[1/2] dt-bindngs: display: panel: Add BOE tv101wum-nl6 panel bindings

2019-06-08 Thread Jitao Shi
Add documentation for boe tv101wum-n16 panel.

Signed-off-by: Jitao Shi 
---
 .../display/panel/boe,tv101wum-nl6.txt| 34 +++
 1 file changed, 34 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.txt

diff --git 
a/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.txt 
b/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.txt
new file mode 100644
index ..2a84735d742d
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/boe,tv101wum-nl6.txt
@@ -0,0 +1,34 @@
+Boe Corporation 10.1" WUXGA TFT LCD panel
+
+Required properties:
+- compatible: should be "boe,tv101wum"
+- reg: the virtual channel number of a DSI peripheral
+- enable-gpios: a GPIO spec for the enable pin
+- pp1800-supply: core voltage supply
+- avdd-supply: 
+- avee-supply: 
+- backlight: phandle of the backlight device attached to the panel
+
+The device node can contain one 'port' child node with one child
+'endpoint' node, according to the bindings defined in
+media/video-interfaces.txt. This node should describe panel's video bus.
+
+Example:
+&dsi {
+   ...
+   panel@0 {
+   compatible = "boe,tv101wum-nl6";
+   reg = <0>;
+   enable-gpios = <&pio 45 0>;
+   avdd-supply = <&ppvarn_lcd>;
+   avee-supply = <&ppvarp_lcd>;
+   pp1800-supply = <&pp1800_lcd>;
+   backlight = <&backlight_lcd0>;
+   status = "okay";
+   port {
+   panel_in: endpoint {
+   remote-endpoint = <&dsi_out>;
+   };
+   };
+   };
+};
\ No newline at end of file
-- 
2.21.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel