[PATCH 06/11] drm: i915: i915_oa_hsw: constify attribute_group structures.

2017-08-04 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/gpu/drm/i915/i915_oa_hsw.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_oa_hsw.c 
b/drivers/gpu/drm/i915/i915_oa_hsw.c
index 10f169f..93fbe33 100644
--- a/drivers/gpu/drm/i915/i915_oa_hsw.c
+++ b/drivers/gpu/drm/i915/i915_oa_hsw.c
@@ -668,7 +668,7 @@ int i915_oa_select_metric_set_hsw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_basic = {
+static const struct attribute_group group_render_basic = {
.name = "403d8832-1a27-4aa6-a64e-f5389ce7b212",
.attrs =  attrs_render_basic,
 };
@@ -690,7 +690,7 @@ int i915_oa_select_metric_set_hsw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_basic = {
+static const struct attribute_group group_compute_basic = {
.name = "39ad14bc-2380-45c4-91eb-fbcb3aa7ae7b",
.attrs =  attrs_compute_basic,
 };
@@ -712,7 +712,7 @@ int i915_oa_select_metric_set_hsw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_extended = {
+static const struct attribute_group group_compute_extended = {
.name = "3865be28-6982-49fe-9494-e4d1b4795413",
.attrs =  attrs_compute_extended,
 };
@@ -734,7 +734,7 @@ int i915_oa_select_metric_set_hsw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_reads = {
+static const struct attribute_group group_memory_reads = {
.name = "bb5ed49b-2497-4095-94f6-26ba294db88a",
.attrs =  attrs_memory_reads,
 };
@@ -756,7 +756,7 @@ int i915_oa_select_metric_set_hsw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_writes = {
+static const struct attribute_group group_memory_writes = {
.name = "3358d639-9b5f-45ab-976d-9b08cbfc6240",
.attrs =  attrs_memory_writes,
 };
@@ -778,7 +778,7 @@ int i915_oa_select_metric_set_hsw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_sampler_balance = {
+static const struct attribute_group group_sampler_balance = {
.name = "bc274488-b4b6-40c7-90da-b77d7ad16189",
.attrs =  attrs_sampler_balance,
 };
-- 
1.9.1

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


[PATCH 09/11] drm: i915: i915_oa_sklgt3: constify attribute_group structures.

2017-08-04 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/gpu/drm/i915/i915_oa_sklgt3.c | 36 +--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_oa_sklgt3.c 
b/drivers/gpu/drm/i915/i915_oa_sklgt3.c
index 7765e22..e26f300 100644
--- a/drivers/gpu/drm/i915/i915_oa_sklgt3.c
+++ b/drivers/gpu/drm/i915/i915_oa_sklgt3.c
@@ -2460,7 +2460,7 @@ int i915_oa_select_metric_set_sklgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_basic = {
+static const struct attribute_group group_render_basic = {
.name = "4616d450-2393-4836-8146-53c5ed84d359",
.attrs =  attrs_render_basic,
 };
@@ -2482,7 +2482,7 @@ int i915_oa_select_metric_set_sklgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_basic = {
+static const struct attribute_group group_compute_basic = {
.name = "4320492b-fd03-42ac-922f-dbe1ef3b7b58",
.attrs =  attrs_compute_basic,
 };
@@ -2504,7 +2504,7 @@ int i915_oa_select_metric_set_sklgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_pipe_profile = {
+static const struct attribute_group group_render_pipe_profile = {
.name = "bd2d9cae-b9ec-4f5b-9d2f-934bed398a2d",
.attrs =  attrs_render_pipe_profile,
 };
@@ -2526,7 +2526,7 @@ int i915_oa_select_metric_set_sklgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_reads = {
+static const struct attribute_group group_memory_reads = {
.name = "4ca0f3fe-7fd3-4924-98cb-1807d9879767",
.attrs =  attrs_memory_reads,
 };
@@ -2548,7 +2548,7 @@ int i915_oa_select_metric_set_sklgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_writes = {
+static const struct attribute_group group_memory_writes = {
.name = "a0c0172c-ee13-403d-99ff-2bdf6936cf14",
.attrs =  attrs_memory_writes,
 };
@@ -2570,7 +2570,7 @@ int i915_oa_select_metric_set_sklgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_extended = {
+static const struct attribute_group group_compute_extended = {
.name = "52435e0b-f188-42ea-8680-21a56ee20dee",
.attrs =  attrs_compute_extended,
 };
@@ -2592,7 +2592,7 @@ int i915_oa_select_metric_set_sklgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_l3_cache = {
+static const struct attribute_group group_compute_l3_cache = {
.name = "27076eeb-49f3-4fed-8423-c66506005c63",
.attrs =  attrs_compute_l3_cache,
 };
@@ -2614,7 +2614,7 @@ int i915_oa_select_metric_set_sklgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_hdc_and_sf = {
+static const struct attribute_group group_hdc_and_sf = {
.name = "8071b409-c39a-4674-94d7-32962ecfb512",
.attrs =  attrs_hdc_and_sf,
 };
@@ -2636,7 +2636,7 @@ int i915_oa_select_metric_set_sklgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_1 = {
+static const struct attribute_group group_l3_1 = {
.name = "5e0b391e-9ea8-4901-b2ff-b64ff616c7ed",
.attrs =  attrs_l3_1,
 };
@@ -2658,7 +2658,7 @@ int i915_oa_select_metric_set_sklgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_2 = {
+static const struct attribute_group group_l3_2 = {
.name = "25dc828e-1d2d-426e-9546-a1d4233cdf16",
.attrs =  attrs_l3_2,
 };
@@ -2680,7 +2680,7 @@ int i915_oa_select_metric_set_sklgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_3 = {
+static const struct attribute_group group_l3_3 = {
.name = "3dba9405-2d7e-4d70-8199-e734e82fd6bf",
.attrs =  attrs_l3_3,
 };
@@ -2702,7 +2702,7 @@ int i915_oa_select_metric_set_sklgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_rasterizer_and_pixel_backend = {
+static const struct attribute_group group_rasterizer_and_pixel_backend = {
.name = "76935d7b-09c9-46bf-87f1-c18b4a86ebe5",
.attrs =  attrs_rasterizer_and_pixel_backend,
 };
@@ -2724,7 +2724,7 @@ int i915_oa_select_metric_set_sklgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_sampler = {
+static const struct attribute_group group_sampler = {
.name = "1b34c0d6-4f4c-4d7b-833f-4aaf236d87a6",
.attrs =  attrs_sampler,
 };
@@ -2746,7 +2746,7 @@ int i915_oa_select_metric_set_sklgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group 

Re: [Intel-gfx] [PATCH 00/11] constify i915 attribute_group structures.

2017-08-04 Thread Arvind Yadav

Hi Lionel,


On Friday 04 August 2017 02:33 PM, Lionel Landwerlin wrote:

Hi Arwind,

These files were generated by a script maintained in this repository : 
https://github.com/rib/gputop/blob/master/scripts/i915-perf-kernelgen.py
It would best to update this script first to make sure future 
platforms get the fixes too.


Some changes have just been merged, deleted most configs but the test 
ones.

You'll need to update your series.

I have done the changes. Please review it. :) Shared patch is 
0001-i915-perf-kernelgen.py-constify-attribute_group-stru.patch.



Otherwise it looks like a good change.

Thanks,

-
Lionel

On 04/08/17 06:03, Arvind Yadav wrote:

attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Arvind Yadav (11):
   [PATCH 01/11] drm: i915: i915_oa_kblgt2: constify attribute_group 
structures.
   [PATCH 02/11] drm: i915: i915_oa_bdw: constify attribute_group 
structures.
   [PATCH 03/11] drm: i915: i915_oa_bxt: constify attribute_group 
structures.
   [PATCH 04/11] drm: i915: i915_oa_chv: constify attribute_group 
structures.
   [PATCH 05/11] drm: i915: i915_oa_glk: constify attribute_group 
structures.
   [PATCH 06/11] drm: i915: i915_oa_hsw: constify attribute_group 
structures.
   [PATCH 07/11] drm: i915: i915_oa_kblgt3: constify attribute_group 
structures.
   [PATCH 08/11] drm: i915: i915_oa_sklgt2: constify attribute_group 
structures.
   [PATCH 09/11] drm: i915: i915_oa_sklgt3: constify attribute_group 
structures.
   [PATCH 10/11] drm: i915: i915_oa_sklgt4: constify attribute_group 
structures.
   [PATCH 11/11] drm: i915: i915_sysfs: constify attribute_group 
structures.


  drivers/gpu/drm/i915/i915_oa_bdw.c| 44 
+--

  drivers/gpu/drm/i915/i915_oa_bxt.c| 30 
  drivers/gpu/drm/i915/i915_oa_chv.c| 28 +++---
  drivers/gpu/drm/i915/i915_oa_glk.c| 30 
  drivers/gpu/drm/i915/i915_oa_hsw.c| 12 +-
  drivers/gpu/drm/i915/i915_oa_kblgt2.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_kblgt3.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_sklgt2.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_sklgt3.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_sklgt4.c | 36 
++--

  drivers/gpu/drm/i915/i915_sysfs.c |  6 ++---
  11 files changed, 165 insertions(+), 165 deletions(-)




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


[PATCH] staging: vboxvideo: remove dead gamma lut code

2017-08-04 Thread Peter Rosin
The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code that was not doing anything
sensible anyway.

Signed-off-by: Peter Rosin 
---
 drivers/staging/vboxvideo/vbox_fb.c   | 15 ---
 drivers/staging/vboxvideo/vbox_mode.c |  5 -
 2 files changed, 20 deletions(-)

Hi Daniel,

Here it goes, but do you really need me to resend v5 14/14?

Cheers,
peda

diff --git a/drivers/staging/vboxvideo/vbox_fb.c 
b/drivers/staging/vboxvideo/vbox_fb.c
index 35f6d9f8c203..bf6635826159 100644
--- a/drivers/staging/vboxvideo/vbox_fb.c
+++ b/drivers/staging/vboxvideo/vbox_fb.c
@@ -317,22 +317,7 @@ static int vboxfb_create(struct drm_fb_helper *helper,
return 0;
 }
 
-static void vbox_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
- u16 blue, int regno)
-{
-}
-
-static void vbox_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
- u16 *blue, int regno)
-{
-   *red = regno;
-   *green = regno;
-   *blue = regno;
-}
-
 static struct drm_fb_helper_funcs vbox_fb_helper_funcs = {
-   .gamma_set = vbox_fb_gamma_set,
-   .gamma_get = vbox_fb_gamma_get,
.fb_probe = vboxfb_create,
 };
 
diff --git a/drivers/staging/vboxvideo/vbox_mode.c 
b/drivers/staging/vboxvideo/vbox_mode.c
index f2b85f3256fa..996da1c79158 100644
--- a/drivers/staging/vboxvideo/vbox_mode.c
+++ b/drivers/staging/vboxvideo/vbox_mode.c
@@ -134,10 +134,6 @@ static int vbox_set_view(struct drm_crtc *crtc)
return 0;
 }
 
-static void vbox_crtc_load_lut(struct drm_crtc *crtc)
-{
-}
-
 static void vbox_crtc_dpms(struct drm_crtc *crtc, int mode)
 {
struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtc);
@@ -330,7 +326,6 @@ static const struct drm_crtc_helper_funcs 
vbox_crtc_helper_funcs = {
.mode_set = vbox_crtc_mode_set,
/* .mode_set_base = vbox_crtc_mode_set_base, */
.disable = vbox_crtc_disable,
-   .load_lut = vbox_crtc_load_lut,
.prepare = vbox_crtc_prepare,
.commit = vbox_crtc_commit,
 };
-- 
2.11.0

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


[RESEND PATCH] staging: vboxvideo: remove dead gamma lut code

2017-08-04 Thread Peter Rosin
The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code that was not doing anything
sensible anyway.

Signed-off-by: Peter Rosin 
---
 drivers/staging/vboxvideo/vbox_fb.c   | 15 ---
 drivers/staging/vboxvideo/vbox_mode.c |  5 -
 2 files changed, 20 deletions(-)

[This time with an improved Cc list, sorry for the noise. For new
 people, please refer to https://lkml.org/lkml/2017/7/13/593 for
 context]

Hi Daniel,

Here it goes, but do you really need me to resend v5 14/14?

Cheers,
peda

diff --git a/drivers/staging/vboxvideo/vbox_fb.c 
b/drivers/staging/vboxvideo/vbox_fb.c
index 35f6d9f8c203..bf6635826159 100644
--- a/drivers/staging/vboxvideo/vbox_fb.c
+++ b/drivers/staging/vboxvideo/vbox_fb.c
@@ -317,22 +317,7 @@ static int vboxfb_create(struct drm_fb_helper *helper,
return 0;
 }
 
-static void vbox_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
- u16 blue, int regno)
-{
-}
-
-static void vbox_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
- u16 *blue, int regno)
-{
-   *red = regno;
-   *green = regno;
-   *blue = regno;
-}
-
 static struct drm_fb_helper_funcs vbox_fb_helper_funcs = {
-   .gamma_set = vbox_fb_gamma_set,
-   .gamma_get = vbox_fb_gamma_get,
.fb_probe = vboxfb_create,
 };
 
diff --git a/drivers/staging/vboxvideo/vbox_mode.c 
b/drivers/staging/vboxvideo/vbox_mode.c
index f2b85f3256fa..996da1c79158 100644
--- a/drivers/staging/vboxvideo/vbox_mode.c
+++ b/drivers/staging/vboxvideo/vbox_mode.c
@@ -134,10 +134,6 @@ static int vbox_set_view(struct drm_crtc *crtc)
return 0;
 }
 
-static void vbox_crtc_load_lut(struct drm_crtc *crtc)
-{
-}
-
 static void vbox_crtc_dpms(struct drm_crtc *crtc, int mode)
 {
struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtc);
@@ -330,7 +326,6 @@ static const struct drm_crtc_helper_funcs 
vbox_crtc_helper_funcs = {
.mode_set = vbox_crtc_mode_set,
/* .mode_set_base = vbox_crtc_mode_set_base, */
.disable = vbox_crtc_disable,
-   .load_lut = vbox_crtc_load_lut,
.prepare = vbox_crtc_prepare,
.commit = vbox_crtc_commit,
 };
-- 
2.11.0

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


[PATCH 03/11] drm: i915: i915_oa_bxt: constify attribute_group structures.

2017-08-04 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/gpu/drm/i915/i915_oa_bxt.c | 30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_oa_bxt.c 
b/drivers/gpu/drm/i915/i915_oa_bxt.c
index 93864d8..db80045 100644
--- a/drivers/gpu/drm/i915/i915_oa_bxt.c
+++ b/drivers/gpu/drm/i915/i915_oa_bxt.c
@@ -2207,7 +2207,7 @@ int i915_oa_select_metric_set_bxt(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_basic = {
+static const struct attribute_group group_render_basic = {
.name = "22b9519a-e9ba-4c41-8b54-f4f8ca14fa0a",
.attrs =  attrs_render_basic,
 };
@@ -2229,7 +2229,7 @@ int i915_oa_select_metric_set_bxt(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_basic = {
+static const struct attribute_group group_compute_basic = {
.name = "012d72cf-82a9-4d25-8ddf-74076fd30797",
.attrs =  attrs_compute_basic,
 };
@@ -2251,7 +2251,7 @@ int i915_oa_select_metric_set_bxt(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_pipe_profile = {
+static const struct attribute_group group_render_pipe_profile = {
.name = "ce416533-e49e-4211-80af-ec513590a914",
.attrs =  attrs_render_pipe_profile,
 };
@@ -2273,7 +2273,7 @@ int i915_oa_select_metric_set_bxt(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_reads = {
+static const struct attribute_group group_memory_reads = {
.name = "398e2452-18d7-42d0-b241-e4d0a9148ada",
.attrs =  attrs_memory_reads,
 };
@@ -2295,7 +2295,7 @@ int i915_oa_select_metric_set_bxt(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_writes = {
+static const struct attribute_group group_memory_writes = {
.name = "d324a0d6-7269-4847-a5c2-6f71ddc7fed5",
.attrs =  attrs_memory_writes,
 };
@@ -2317,7 +2317,7 @@ int i915_oa_select_metric_set_bxt(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_extended = {
+static const struct attribute_group group_compute_extended = {
.name = "caf3596a-7bb1-4dec-b3b3-2a080d283b49",
.attrs =  attrs_compute_extended,
 };
@@ -2339,7 +2339,7 @@ int i915_oa_select_metric_set_bxt(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_l3_cache = {
+static const struct attribute_group group_compute_l3_cache = {
.name = "49b956e2-d5b9-47e0-9d8a-cee5e8cec527",
.attrs =  attrs_compute_l3_cache,
 };
@@ -2361,7 +2361,7 @@ int i915_oa_select_metric_set_bxt(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_hdc_and_sf = {
+static const struct attribute_group group_hdc_and_sf = {
.name = "f64ef50a-bdba-4b35-8f09-203c13d8ee5a",
.attrs =  attrs_hdc_and_sf,
 };
@@ -2383,7 +2383,7 @@ int i915_oa_select_metric_set_bxt(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_1 = {
+static const struct attribute_group group_l3_1 = {
.name = "00ad5a41-7eab-4f7a-9103-49d411c67219",
.attrs =  attrs_l3_1,
 };
@@ -2405,7 +2405,7 @@ int i915_oa_select_metric_set_bxt(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_rasterizer_and_pixel_backend = {
+static const struct attribute_group group_rasterizer_and_pixel_backend = {
.name = "46dc44ca-491c-4cc1-a951-e7b3e62bf02b",
.attrs =  attrs_rasterizer_and_pixel_backend,
 };
@@ -2427,7 +2427,7 @@ int i915_oa_select_metric_set_bxt(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_sampler = {
+static const struct attribute_group group_sampler = {
.name = "8364e2a8-af63-40af-b0d5-42969a255654",
.attrs =  attrs_sampler,
 };
@@ -2449,7 +2449,7 @@ int i915_oa_select_metric_set_bxt(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_tdl_1 = {
+static const struct attribute_group group_tdl_1 = {
.name = "175c8092-cb25-4d1e-8dc7-b4fdd39e2d92",
.attrs =  attrs_tdl_1,
 };
@@ -2471,7 +2471,7 @@ int i915_oa_select_metric_set_bxt(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_tdl_2 = {
+static const struct attribute_group group_tdl_2 = {
.name = "d260f03f-b34d-4b49-a44e-436819117332",
.attrs =  attrs_tdl_2,
 };
@@ -2493,7 +2493,7 @@ int i915_oa_select_metric_set_bxt(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_extra = {
+static const struct attribute_group 

[PATCH RESEND 2/2] dt/bindings: display: move rotation into a common place

2017-08-04 Thread Baruch Siach
Commit b60c1be74741 (dt-bindings: display/panel: Add common rotation property)
added the rotation property description in a new file. We have a place for
common display panel properties already. Move there the rotation property.

Acked-by: Noralf Trønnes 
Acked-by: Rob Herring 
Signed-off-by: Baruch Siach 
---
 Documentation/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 0603af877155..c92dcfd8c32f 100644
--- a/Documentation/devicetree/bindings/display/panel/panel-common.txt
+++ b/Documentation/devicetree/bindings/display/panel/panel-common.txt
@@ -89,3 +89,9 @@ backlight controller.
 
 - backlight: For panels whose backlight is controlled by an external backlight
   controller, this property contains a phandle that references the controller.
+
+
+Rotation
+
+
+- rotation: Display rotation in degrees counter clockwise (0,90,180,270)
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)
-- 
2.13.2

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


Re: [Intel-gfx] [PATCH 00/11] constify i915 attribute_group structures.

2017-08-04 Thread Arvind Yadav



On Friday 04 August 2017 04:04 PM, Lionel Landwerlin wrote:

On 04/08/17 11:22, Arvind Yadav wrote:

Hi Lionel,


On Friday 04 August 2017 02:33 PM, Lionel Landwerlin wrote:

Hi Arwind,

These files were generated by a script maintained in this repository 
: 
https://github.com/rib/gputop/blob/master/scripts/i915-perf-kernelgen.py 

It would best to update this script first to make sure future 
platforms get the fixes too.


Some changes have just been merged, deleted most configs but the 
test ones.

You'll need to update your series.

I have done the changes. Please review it. :) Shared patch is 
0001-i915-perf-kernelgen.py-constify-attribute_group-stru.patch.


Hm... Where is it? (I can't see it on the mailing list nor attached)
The best would be to submit a PR on the github project directly.

I have push directly on github project. I have send patch to you. Is 
there  any different way to send mail.?

 Changes are looks like this.

---
 scripts/i915-perf-kernelgen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/i915-perf-kernelgen.
py b/scripts/i915-perf-kernelgen.py
index 7178f47..7633624 100755
--- a/scripts/i915-perf-kernelgen.py
+++ b/scripts/i915-perf-kernelgen.py
@@ -382,7 +382,7 @@ def output_sysfs_code(sets):
 c("};")

 c("\n")
-c("static struct attribute_group group_" + perf_name_lc + " = {")
+c("static const struct attribute_group group_" + perf_name_lc + 
" = {")

 c.indent(8)
 c(".name = \"" + metric_set['guid'] + "\",")
 c(".attrs =  attrs_" + perf_name_lc + ",")

---



Otherwise it looks like a good change.

Thanks,

-
Lionel

On 04/08/17 06:03, Arvind Yadav wrote:

attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Arvind Yadav (11):
   [PATCH 01/11] drm: i915: i915_oa_kblgt2: constify 
attribute_group structures.
   [PATCH 02/11] drm: i915: i915_oa_bdw: constify attribute_group 
structures.
   [PATCH 03/11] drm: i915: i915_oa_bxt: constify attribute_group 
structures.
   [PATCH 04/11] drm: i915: i915_oa_chv: constify attribute_group 
structures.
   [PATCH 05/11] drm: i915: i915_oa_glk: constify attribute_group 
structures.
   [PATCH 06/11] drm: i915: i915_oa_hsw: constify attribute_group 
structures.
   [PATCH 07/11] drm: i915: i915_oa_kblgt3: constify 
attribute_group structures.
   [PATCH 08/11] drm: i915: i915_oa_sklgt2: constify 
attribute_group structures.
   [PATCH 09/11] drm: i915: i915_oa_sklgt3: constify 
attribute_group structures.
   [PATCH 10/11] drm: i915: i915_oa_sklgt4: constify 
attribute_group structures.
   [PATCH 11/11] drm: i915: i915_sysfs: constify attribute_group 
structures.


  drivers/gpu/drm/i915/i915_oa_bdw.c| 44 
+--

  drivers/gpu/drm/i915/i915_oa_bxt.c| 30 
  drivers/gpu/drm/i915/i915_oa_chv.c| 28 +++---
  drivers/gpu/drm/i915/i915_oa_glk.c| 30 
  drivers/gpu/drm/i915/i915_oa_hsw.c| 12 +-
  drivers/gpu/drm/i915/i915_oa_kblgt2.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_kblgt3.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_sklgt2.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_sklgt3.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_sklgt4.c | 36 
++--

  drivers/gpu/drm/i915/i915_sysfs.c |  6 ++---
  11 files changed, 165 insertions(+), 165 deletions(-)




~arvind





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


Re: [PATCH 2/2] ARM: dts: exynos: Add HDMI and Sil9234 to Trats2 board

2017-08-04 Thread Krzysztof Kozlowski
On Fri, Aug 4, 2017 at 8:32 AM, Marek Szyprowski
 wrote:
>
> Hi Krzysztof,
>
>
> On 2017-08-03 21:20, Krzysztof Kozlowski wrote:
>>
>> On Thu, Aug 03, 2017 at 09:45:23AM +0200, Maciej Purski wrote:
>>>
>>> This patch adds HDMI and Sil9234 MHL converter to Trats2 board.
>>
>> Just "Add HDMI...", without this patch.
>>
>> Except few minor nitpicks below, looks good. After fixing I will take it
>> once bindings got accepted.
>>
>>> Based on previous work by:
>>> Tomasz Stanislawski 
>>>
>>> Signed-off-by: Maciej Purski 
>>> ---
>>>   arch/arm/boot/dts/exynos4412-trats2.dts | 93 
>>> +
>>>   1 file changed, 93 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts 
>>> b/arch/arm/boot/dts/exynos4412-trats2.dts
>>> index 35e9b94..39940f6 100644
>>> --- a/arch/arm/boot/dts/exynos4412-trats2.dts
>>> +++ b/arch/arm/boot/dts/exynos4412-trats2.dts
>>> @@ -97,6 +97,16 @@
>>> gpio = < 5 GPIO_ACTIVE_HIGH>;
>>> enable-active-high;
>>> };
>>> +
>>> +   vsil: voltage-regulator-vsil {
>>> +   compatible = "regulator-fixed";
>>> +   regulator-name = "HDMI_5V";
>>> +   regulator-min-microvolt = <500>;
>>> +   regulator-max-microvolt = <500>;
>>> +   gpio = < 4 GPIO_ACTIVE_HIGH>;
>>> +   enable-active-high;
>>> +   vin-supply = <_reg>;
>>
>> I think the supply is V_BAT, not buck7.
>
>
> Well, according to the the schematic, VSIL is derived from VCC_SUB_2.0V
> (buck7) by the RP114K121D-TR chip, which is controlled by gpl0-4 (HDMI_EN)
> pin.
> The only thing that has to be fixed is the voltage value for that regulator.
> VSIL is 1.2V and regulator-name should be adjusted too. The HDMI_V5 name
> and voltage value seems to be copy/paste error done long time ago...
>

OK, thanks for explanation.

(...)

>>
>> Could you describe more what is on i2c_5 and i2c_8? Is it relevant to
>> this patch?
>
>
> Yes. i2c_5 is used for HDMI DDC and i2c_8 is used for HDMI_PHY. None of
> the other exynos*.dts, which enable HDMI has any comment on them...

Actually now I see that this information can be get from the source
(see i2c_8 in exyos4.dtsi and here i2c_5 is used in hdmi node as ddc).
Still it would be nice to see this information for example in commit
message.

Best regards,
Krzysztof

>
>
>>> +
>>>   _7 {
>>> samsung,i2c-sda-delay = <100>;
>>> samsung,i2c-slave-addr = <0x10>;
>>> @@ -894,12 +962,20 @@
>>> };
>>>   };
>>>   +_8 {
>>> +   status = "okay";
>>> +};
>>> +
>>>{
>>> pinctrl-0 = <_bus>;
>>> pinctrl-names = "default";
>>> status = "okay";
>>>   };
>>>   + {
>>> +   status = "okay";
>>> +};
>>> +
>>>   _0 {
>>> num-slots = <1>;
>>> broken-cd;
>>> @@ -926,6 +1002,18 @@
>>> pinctrl-names = "default";
>>> pinctrl-0 = <>;
>>>   + mhl_int: mhl-int {
>>> +   samsung,pins = "gpf3-5";
>>> +   samsung,pin-pud = <0>;
>>
>> Please use defines from dt-bindings/pinctrl/samsung.h
>>
>>> +   };
>>> +
>>> +   i2c_mhl_bus: i2c-mhl-bus {
>>> +   samsung,pins = "gpf0-4", "gpf0-6";
>>> +   samsung,pin-function = <2>;
>>> +   samsung,pin-pud = <1>;
>>> +   samsung,pin-drv = <0>;
>>
>> The same.
>>
>
> Best regards
> --
> Marek Szyprowski, PhD
> Samsung R Institute Poland
>
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 11/11] drm: i915: i915_sysfs: constify attribute_group structures.

2017-08-04 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/gpu/drm/i915/i915_sysfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_sysfs.c 
b/drivers/gpu/drm/i915/i915_sysfs.c
index 1eef3fa..3fe3e56 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -96,7 +96,7 @@ static u32 calc_residency(struct drm_i915_private *dev_priv,
NULL
 };
 
-static struct attribute_group rc6_attr_group = {
+static const struct attribute_group rc6_attr_group = {
.name = power_group_name,
.attrs =  rc6_attrs
 };
@@ -107,7 +107,7 @@ static u32 calc_residency(struct drm_i915_private *dev_priv,
NULL
 };
 
-static struct attribute_group rc6p_attr_group = {
+static const struct attribute_group rc6p_attr_group = {
.name = power_group_name,
.attrs =  rc6p_attrs
 };
@@ -117,7 +117,7 @@ static u32 calc_residency(struct drm_i915_private *dev_priv,
NULL
 };
 
-static struct attribute_group media_rc6_attr_group = {
+static const struct attribute_group media_rc6_attr_group = {
.name = power_group_name,
.attrs =  media_rc6_attrs
 };
-- 
1.9.1

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


[PATCH 05/11] drm: i915: i915_oa_glk: constify attribute_group structures.

2017-08-04 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/gpu/drm/i915/i915_oa_glk.c | 30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_oa_glk.c 
b/drivers/gpu/drm/i915/i915_oa_glk.c
index 2f356d5..a8eea3a 100644
--- a/drivers/gpu/drm/i915/i915_oa_glk.c
+++ b/drivers/gpu/drm/i915/i915_oa_glk.c
@@ -2119,7 +2119,7 @@ int i915_oa_select_metric_set_glk(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_basic = {
+static const struct attribute_group group_render_basic = {
.name = "d72df5c7-5b4a-4274-a43f-00b0fd51fc68",
.attrs =  attrs_render_basic,
 };
@@ -2141,7 +2141,7 @@ int i915_oa_select_metric_set_glk(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_basic = {
+static const struct attribute_group group_compute_basic = {
.name = "814285f6-354d-41d2-ba49-e24e622714a0",
.attrs =  attrs_compute_basic,
 };
@@ -2163,7 +2163,7 @@ int i915_oa_select_metric_set_glk(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_pipe_profile = {
+static const struct attribute_group group_render_pipe_profile = {
.name = "07d397a6-b3e6-49f6-9433-a4f293d55978",
.attrs =  attrs_render_pipe_profile,
 };
@@ -2185,7 +2185,7 @@ int i915_oa_select_metric_set_glk(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_reads = {
+static const struct attribute_group group_memory_reads = {
.name = "1a356946-5428-450b-a2f0-89f8783a302d",
.attrs =  attrs_memory_reads,
 };
@@ -2207,7 +2207,7 @@ int i915_oa_select_metric_set_glk(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_writes = {
+static const struct attribute_group group_memory_writes = {
.name = "5299be9d-7a61-4c99-9f81-f87e6c5aaca9",
.attrs =  attrs_memory_writes,
 };
@@ -2229,7 +2229,7 @@ int i915_oa_select_metric_set_glk(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_extended = {
+static const struct attribute_group group_compute_extended = {
.name = "bc9bcff2-459a-4cbc-986d-a84b077153f3",
.attrs =  attrs_compute_extended,
 };
@@ -2251,7 +2251,7 @@ int i915_oa_select_metric_set_glk(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_l3_cache = {
+static const struct attribute_group group_compute_l3_cache = {
.name = "88ec931f-5b4a-453a-9db6-a61232b6143d",
.attrs =  attrs_compute_l3_cache,
 };
@@ -2273,7 +2273,7 @@ int i915_oa_select_metric_set_glk(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_hdc_and_sf = {
+static const struct attribute_group group_hdc_and_sf = {
.name = "530d176d-2a18-4014-adf8-1500c6c60835",
.attrs =  attrs_hdc_and_sf,
 };
@@ -2295,7 +2295,7 @@ int i915_oa_select_metric_set_glk(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_1 = {
+static const struct attribute_group group_l3_1 = {
.name = "fdee5a5a-f23c-43d1-aa73-f6257c71671d",
.attrs =  attrs_l3_1,
 };
@@ -2317,7 +2317,7 @@ int i915_oa_select_metric_set_glk(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_rasterizer_and_pixel_backend = {
+static const struct attribute_group group_rasterizer_and_pixel_backend = {
.name = "6617623e-ca73-4791-b2b7-ddedd0846a0c",
.attrs =  attrs_rasterizer_and_pixel_backend,
 };
@@ -2339,7 +2339,7 @@ int i915_oa_select_metric_set_glk(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_sampler = {
+static const struct attribute_group group_sampler = {
.name = "f3b2ea63-e82e-4234-b418-44dd20dd34d0",
.attrs =  attrs_sampler,
 };
@@ -2361,7 +2361,7 @@ int i915_oa_select_metric_set_glk(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_tdl_1 = {
+static const struct attribute_group group_tdl_1 = {
.name = "14411d35-cbf6-4f5e-b68b-190faf9a1a83",
.attrs =  attrs_tdl_1,
 };
@@ -2383,7 +2383,7 @@ int i915_oa_select_metric_set_glk(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_tdl_2 = {
+static const struct attribute_group group_tdl_2 = {
.name = "ffa3f263-0478-4724-8c9f-c911c5ec0f1d",
.attrs =  attrs_tdl_2,
 };
@@ -2405,7 +2405,7 @@ int i915_oa_select_metric_set_glk(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_extra = {
+static const struct attribute_group 

[PATCH 02/11] drm: i915: i915_oa_bdw: constify attribute_group structures.

2017-08-04 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/gpu/drm/i915/i915_oa_bdw.c | 44 +++---
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_oa_bdw.c 
b/drivers/gpu/drm/i915/i915_oa_bdw.c
index d4462c2..90c96c2 100644
--- a/drivers/gpu/drm/i915/i915_oa_bdw.c
+++ b/drivers/gpu/drm/i915/i915_oa_bdw.c
@@ -4669,7 +4669,7 @@ int i915_oa_select_metric_set_bdw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_basic = {
+static const struct attribute_group group_render_basic = {
.name = "b541bd57-0e0f-4154-b4c0-5858010a2bf7",
.attrs =  attrs_render_basic,
 };
@@ -4691,7 +4691,7 @@ int i915_oa_select_metric_set_bdw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_basic = {
+static const struct attribute_group group_compute_basic = {
.name = "35fbc9b2-a891-40a6-a38d-022bb7057552",
.attrs =  attrs_compute_basic,
 };
@@ -4713,7 +4713,7 @@ int i915_oa_select_metric_set_bdw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_pipe_profile = {
+static const struct attribute_group group_render_pipe_profile = {
.name = "233d0544-fff7-4281-8291-e02f222aff72",
.attrs =  attrs_render_pipe_profile,
 };
@@ -4735,7 +4735,7 @@ int i915_oa_select_metric_set_bdw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_reads = {
+static const struct attribute_group group_memory_reads = {
.name = "2b255d48-2117-4fef-a8f7-f151e1d25a2c",
.attrs =  attrs_memory_reads,
 };
@@ -4757,7 +4757,7 @@ int i915_oa_select_metric_set_bdw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_writes = {
+static const struct attribute_group group_memory_writes = {
.name = "f7fd3220-b466-4a4d-9f98-b0caf3f2394c",
.attrs =  attrs_memory_writes,
 };
@@ -4779,7 +4779,7 @@ int i915_oa_select_metric_set_bdw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_extended = {
+static const struct attribute_group group_compute_extended = {
.name = "e99ccaca-821c-4df9-97a7-96bdb7204e43",
.attrs =  attrs_compute_extended,
 };
@@ -4801,7 +4801,7 @@ int i915_oa_select_metric_set_bdw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_l3_cache = {
+static const struct attribute_group group_compute_l3_cache = {
.name = "27a364dc-8225-4ecb-b607-d6f1925598d9",
.attrs =  attrs_compute_l3_cache,
 };
@@ -4823,7 +4823,7 @@ int i915_oa_select_metric_set_bdw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_data_port_reads_coalescing = {
+static const struct attribute_group group_data_port_reads_coalescing = {
.name = "857fc630-2f09-4804-85f1-084adfadd5ab",
.attrs =  attrs_data_port_reads_coalescing,
 };
@@ -4845,7 +4845,7 @@ int i915_oa_select_metric_set_bdw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_data_port_writes_coalescing = {
+static const struct attribute_group group_data_port_writes_coalescing = {
.name = "343ebc99-4a55-414c-8c17-d8e259cf5e20",
.attrs =  attrs_data_port_writes_coalescing,
 };
@@ -4867,7 +4867,7 @@ int i915_oa_select_metric_set_bdw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_hdc_and_sf = {
+static const struct attribute_group group_hdc_and_sf = {
.name = "7bdafd88-a4fa-4ed5-bc09-1a977aa5be3e",
.attrs =  attrs_hdc_and_sf,
 };
@@ -4889,7 +4889,7 @@ int i915_oa_select_metric_set_bdw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_1 = {
+static const struct attribute_group group_l3_1 = {
.name = "9385ebb2-f34f-4aa5-aec5-7e9cbbea0f0b",
.attrs =  attrs_l3_1,
 };
@@ -4911,7 +4911,7 @@ int i915_oa_select_metric_set_bdw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_2 = {
+static const struct attribute_group group_l3_2 = {
.name = "446ae59b-ff2e-41c9-b49e-0184a54bf00a",
.attrs =  attrs_l3_2,
 };
@@ -4933,7 +4933,7 @@ int i915_oa_select_metric_set_bdw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_3 = {
+static const struct attribute_group group_l3_3 = {
.name = "84a7956f-1ea4-4d0d-837f-e39a0376e38c",
.attrs =  attrs_l3_3,
 };
@@ -4955,7 +4955,7 @@ int i915_oa_select_metric_set_bdw(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group 

[PATCH 00/11] constify i915 attribute_group structures.

2017-08-04 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Arvind Yadav (11):
  [PATCH 01/11] drm: i915: i915_oa_kblgt2: constify attribute_group structures.
  [PATCH 02/11] drm: i915: i915_oa_bdw: constify attribute_group structures.
  [PATCH 03/11] drm: i915: i915_oa_bxt: constify attribute_group structures.
  [PATCH 04/11] drm: i915: i915_oa_chv: constify attribute_group structures.
  [PATCH 05/11] drm: i915: i915_oa_glk: constify attribute_group structures.
  [PATCH 06/11] drm: i915: i915_oa_hsw: constify attribute_group structures.
  [PATCH 07/11] drm: i915: i915_oa_kblgt3: constify attribute_group structures.
  [PATCH 08/11] drm: i915: i915_oa_sklgt2: constify attribute_group structures.
  [PATCH 09/11] drm: i915: i915_oa_sklgt3: constify attribute_group structures.
  [PATCH 10/11] drm: i915: i915_oa_sklgt4: constify attribute_group structures.
  [PATCH 11/11] drm: i915: i915_sysfs: constify attribute_group structures.

 drivers/gpu/drm/i915/i915_oa_bdw.c| 44 +--
 drivers/gpu/drm/i915/i915_oa_bxt.c| 30 
 drivers/gpu/drm/i915/i915_oa_chv.c| 28 +++---
 drivers/gpu/drm/i915/i915_oa_glk.c| 30 
 drivers/gpu/drm/i915/i915_oa_hsw.c| 12 +-
 drivers/gpu/drm/i915/i915_oa_kblgt2.c | 36 ++--
 drivers/gpu/drm/i915/i915_oa_kblgt3.c | 36 ++--
 drivers/gpu/drm/i915/i915_oa_sklgt2.c | 36 ++--
 drivers/gpu/drm/i915/i915_oa_sklgt3.c | 36 ++--
 drivers/gpu/drm/i915/i915_oa_sklgt4.c | 36 ++--
 drivers/gpu/drm/i915/i915_sysfs.c |  6 ++---
 11 files changed, 165 insertions(+), 165 deletions(-)

-- 
1.9.1

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


[PATCH v1 2/2] drm: Update framework with new video formats

2017-08-04 Thread Jeffrey Mouroux
The following new fourcc codes introduced in patch 514b144b2dd7 (uapi: drm:
New fourcc codes needed by Xilinx Video IP) to DRM framework:
* AVUY
* VUY888
* XVUY
* XVUY2101010
* Y8
* Y10
* XV15

Signed-off-by: Jeffrey Mouroux 
---
 drivers/gpu/drm/drm_fourcc.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
index 90d2cc8..951cebb 100644
--- a/drivers/gpu/drm/drm_fourcc.c
+++ b/drivers/gpu/drm/drm_fourcc.c
@@ -160,11 +160,18 @@ const struct drm_format_info *__drm_format_info(u32 
format)
{ .format = DRM_FORMAT_NV61,.depth = 0,  
.num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 1 },
{ .format = DRM_FORMAT_NV24,.depth = 0,  
.num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 1, .vsub = 1 },
{ .format = DRM_FORMAT_NV42,.depth = 0,  
.num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 1, .vsub = 1 },
+   { .format = DRM_FORMAT_XV15,.depth = 0,  
.num_planes = 2, .cpp = { 2, 3, 0 }, .hsub = 2, .vsub = 2 },
{ .format = DRM_FORMAT_YUYV,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
{ .format = DRM_FORMAT_YVYU,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
{ .format = DRM_FORMAT_UYVY,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
{ .format = DRM_FORMAT_VYUY,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
{ .format = DRM_FORMAT_AYUV,.depth = 0,  
.num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+   { .format = DRM_FORMAT_AVUY,.depth = 0,  
.num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+   { .format = DRM_FORMAT_VUY888,  .depth = 0,  
.num_planes = 1, .cpp = { 3, 0, 0 }, .hsub = 1, .vsub = 1 },
+   { .format = DRM_FORMAT_XVUY,.depth = 0,  
.num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+   { .format = DRM_FORMAT_XVUY2101010, .depth = 0,  
.num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+   { .format = DRM_FORMAT_Y8,  .depth = 0,  
.num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1 },
+   { .format = DRM_FORMAT_Y10, .depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
};
 
unsigned int i;
-- 
1.9.1

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


[PATCH v1 1/2] uapi: drm: Add fourcc codes needed by Xilinx Video IP

2017-08-04 Thread Jeffrey Mouroux
The Xilinx Video Mixer andn Xilinx Video Framebuffer DMA IP
support video memory formats that are not represented in the
current DRM fourcc library.  This patch adds those missing
fourcc codes.

Signed-off-by: Jeffrey Mouroux 
---
 include/uapi/drm/drm_fourcc.h | 9 +
 1 file changed, 9 insertions(+)

diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index ef20abb..3e80130 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -112,6 +112,14 @@
 #define DRM_FORMAT_VYUYfourcc_code('V', 'Y', 'U', 'Y') /* 
[31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */
 
 #define DRM_FORMAT_AYUVfourcc_code('A', 'Y', 'U', 'V') /* 
[31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
+#define DRM_FORMAT_AVUYfourcc_code('A', 'V', 'U', 'Y') /* 
[31:0] A:Cr:Cb:Y 8:8:8:8 little endian */
+#define DRM_FORMAT_VUY888  fourcc_code('V', 'U', '2', '4') /* [23:0] 
Cr:Cb:Y little endian */
+#define DRM_FORMAT_XVUYfourcc_code('X', 'V', '2', '4') /* [31:0] 
x:Cr:Cb:Y 8:8:8:8 little endian */
+#define DRM_FORMAT_XVUY2101010 fourcc_code('X', 'V', '3', '0') /* [31:0] 
x:Cr:Cb:Y 2:10:10:10 little endian */
+
+/* Grey scale */
+#define DRM_FORMAT_Y8  fourcc_code('G', 'R', 'E', 'Y') /* 8  Greyscale 
*/
+#define DRM_FORMAT_Y10 fourcc_code('Y', '1', '0', ' ') /* 10 Greyscale 
*/
 
 /*
  * 2 plane YCbCr
@@ -126,6 +134,7 @@
 #define DRM_FORMAT_NV61fourcc_code('N', 'V', '6', '1') /* 2x1 
subsampled Cb:Cr plane */
 #define DRM_FORMAT_NV24fourcc_code('N', 'V', '2', '4') /* 
non-subsampled Cr:Cb plane */
 #define DRM_FORMAT_NV42fourcc_code('N', 'V', '4', '2') /* 
non-subsampled Cb:Cr plane */
+#define DRM_FORMAT_XV15fourcc_code('X', 'V', '2', '0') /* 2x2 
subsampled Cb:Cr plane 2:10:10:10 */
 
 /*
  * 3 plane YCbCr
-- 
1.9.1

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


[PATCH 08/11] drm: i915: i915_oa_sklgt2: constify attribute_group structures.

2017-08-04 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/gpu/drm/i915/i915_oa_sklgt2.c | 36 +--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_oa_sklgt2.c 
b/drivers/gpu/drm/i915/i915_oa_sklgt2.c
index 1268bed..80e6054 100644
--- a/drivers/gpu/drm/i915/i915_oa_sklgt2.c
+++ b/drivers/gpu/drm/i915/i915_oa_sklgt2.c
@@ -2900,7 +2900,7 @@ int i915_oa_select_metric_set_sklgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_basic = {
+static const struct attribute_group group_render_basic = {
.name = "f519e481-24d2-4d42-87c9-3fdd12c00202",
.attrs =  attrs_render_basic,
 };
@@ -2922,7 +2922,7 @@ int i915_oa_select_metric_set_sklgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_basic = {
+static const struct attribute_group group_compute_basic = {
.name = "fe47b29d-ae51-423e-bff4-27d965a95b60",
.attrs =  attrs_compute_basic,
 };
@@ -2944,7 +2944,7 @@ int i915_oa_select_metric_set_sklgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_pipe_profile = {
+static const struct attribute_group group_render_pipe_profile = {
.name = "e0ad5ae0-84ba-4f29-a723-1906c12cb774",
.attrs =  attrs_render_pipe_profile,
 };
@@ -2966,7 +2966,7 @@ int i915_oa_select_metric_set_sklgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_reads = {
+static const struct attribute_group group_memory_reads = {
.name = "9bc436dd-6130-4add-affc-283eb6eaa864",
.attrs =  attrs_memory_reads,
 };
@@ -2988,7 +2988,7 @@ int i915_oa_select_metric_set_sklgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_writes = {
+static const struct attribute_group group_memory_writes = {
.name = "2ea0da8f-3527-4669-9d9d-13099a7435bf",
.attrs =  attrs_memory_writes,
 };
@@ -3010,7 +3010,7 @@ int i915_oa_select_metric_set_sklgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_extended = {
+static const struct attribute_group group_compute_extended = {
.name = "d97d16af-028b-4cd1-a672-6210cb5513dd",
.attrs =  attrs_compute_extended,
 };
@@ -3032,7 +3032,7 @@ int i915_oa_select_metric_set_sklgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_l3_cache = {
+static const struct attribute_group group_compute_l3_cache = {
.name = "9fb22842-e708-43f7-9752-e0e41670c39e",
.attrs =  attrs_compute_l3_cache,
 };
@@ -3054,7 +3054,7 @@ int i915_oa_select_metric_set_sklgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_hdc_and_sf = {
+static const struct attribute_group group_hdc_and_sf = {
.name = "5378e2a1-4248-4188-a4ae-da25a794c603",
.attrs =  attrs_hdc_and_sf,
 };
@@ -3076,7 +3076,7 @@ int i915_oa_select_metric_set_sklgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_1 = {
+static const struct attribute_group group_l3_1 = {
.name = "f42cdd6a-b000-42cb-870f-5eb423a7f514",
.attrs =  attrs_l3_1,
 };
@@ -3098,7 +3098,7 @@ int i915_oa_select_metric_set_sklgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_2 = {
+static const struct attribute_group group_l3_2 = {
.name = "b9bf2423-d88c-4a7b-a051-627611d00dcc",
.attrs =  attrs_l3_2,
 };
@@ -3120,7 +3120,7 @@ int i915_oa_select_metric_set_sklgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_3 = {
+static const struct attribute_group group_l3_3 = {
.name = "2414a93d-d84f-406e-99c0-472161194b40",
.attrs =  attrs_l3_3,
 };
@@ -3142,7 +3142,7 @@ int i915_oa_select_metric_set_sklgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_rasterizer_and_pixel_backend = {
+static const struct attribute_group group_rasterizer_and_pixel_backend = {
.name = "53a45d2d-170b-4cf5-b7bb-585120c8e2f5",
.attrs =  attrs_rasterizer_and_pixel_backend,
 };
@@ -3164,7 +3164,7 @@ int i915_oa_select_metric_set_sklgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_sampler = {
+static const struct attribute_group group_sampler = {
.name = "b4cff514-a91e-4798-a0b3-426ca13fc9c1",
.attrs =  attrs_sampler,
 };
@@ -3186,7 +3186,7 @@ int i915_oa_select_metric_set_sklgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group 

[PATCH v1 0/2] New DRM fourcc codes needed by Video DMA Driver

2017-08-04 Thread Jeffrey Mouroux
This patch set is introduced to support a driver we are developing
for our new Video Framebuffer DMA IP, a DMA device that is "video format aware".
Clients need only specify memory layout information for a single plane
(i.e. luma) and then provide a video format code (e.g. YUV420) which will permit
for intelligent reads or writes (depending on the IP configuration) to host
memory with only a minimal set of video memory configuration data.

The IP supports a variety of 8-bit and 10-bit video formats, some of which
are not represented in the current DRM user api or framework.  This patch
set introduces these needed video format codes and updates the DRM
framework with the metadata required.

We've endeavored to follow the existing DRM conventions for the new
fourcc codes and, where no comparable examples were present
(e.g. Y8 and Y10), we adopted the V4L2 conventions.

The DMA driver requiring these updates is not being submitted as part of this
patch set as it is still undergoing final development.

We are submitting this patch series for review and comment with regard to
ensuring we haven't missed any required framework updates and/or in regards to
the choices we've made to the fourcc string values.

Jeffrey Mouroux (2):
  uapi: drm: Add fourcc codes needed by Xilinx Video IP
  drm: Update framework with new video formats

 drivers/gpu/drm/drm_fourcc.c  | 7 +++
 include/uapi/drm/drm_fourcc.h | 9 +
 2 files changed, 16 insertions(+)

-- 
1.9.1

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


[drm/vmwgfx] invalid read access at vmw_du_primary_plane_atomic_check()

2017-08-04 Thread Tetsuo Handa
Code added by commit 060e2ad57041b42c ("drm/vmwgfx: Add and connect plane helper
functions") is hitting KASAN error shown below. I guess that either *vcs is
invalid or vcs->is_implicit is off-by-one.

--
[   19.654429] Linux agpgart interface v0.103
[   19.657444] agpgart-intel :00:00.0: Intel 440BX Chipset
[   19.661704] agpgart-intel :00:00.0: AGP aperture is 256M @ 0x0
[   19.694269] [drm] DMA map mode: Using physical TTM page addresses.
[   19.696460] [drm] Capabilities:
[   19.697595] [drm]   Rect copy.
[   19.698678] [drm]   Cursor.
[   19.699661] [drm]   Cursor bypass.
[   19.700835] [drm]   Cursor bypass 2.
[   19.702044] [drm]   8bit emulation.
[   19.703331] [drm]   Alpha cursor.
[   19.704446] [drm]   Extended Fifo.
[   19.705537] [drm]   Multimon.
[   19.706546] [drm]   Pitchlock.
[   19.707671] [drm]   Irq mask.
[   19.708676] [drm]   Display Topology.
[   19.710023] [drm]   GMR.
[   19.710972] [drm]   Traces.
[   19.711971] [drm]   GMR2.
[   19.712897] [drm]   Screen Object 2.
[   19.714082] [drm]   Command Buffers.
[   19.715315] [drm] Max GMR ids is 64
[   19.716496] [drm] Max number of GMR pages is 196608
[   19.718127] [drm] Max dedicated hypervisor surface memory is 786432 kiB
[   19.720173] [drm] Maximum display memory size is 32768 kiB
[   19.721999] [drm] VRAM at 0xe800 size is 32768 kiB
[   19.723672] [drm] MMIO at 0xfe00 size is 2048 kiB
[   19.725354] [drm] global init.
[   19.727593] [TTM] Zone  kernel: Available graphics memory: 1588976 kiB
[   19.729694] [TTM] Initializing pool allocator
[   19.731319] [TTM] Initializing DMA pool allocator
[   19.734882] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[   19.736920] [drm] No driver support for vblank timestamp query.
[   19.756622] [drm] Screen Objects Display Unit initialized
[   19.759163] [drm] width 1280
[   19.760211] [drm] height 768
[   19.761238] [drm] bpp 32
[   19.788213] [drm] Fifo max 0x0020 min 0x1000 cap 0x077f
[   19.791354] [drm] Using command buffers with DMA pool.
[   19.793213] [drm] DX: no.
[   19.794084] [drm] Atomic: yes
[   19.860077] fbcon: svgadrmfb (fb0) is primary device
[   19.885281] Console: switching to colour frame buffer device 160x48
[   19.896566] 
==
[   19.897136] BUG: KASAN: slab-out-of-bounds in 
vmw_du_primary_plane_atomic_check+0x26b/0x360
[   19.897136] Read of size 1 at addr 880118a69fe8 by task swapper/0/1
[   19.897136] 
[   19.897136] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 
4.13.0-rc3-next-20170801 #140
[   19.897136] Hardware name: VMware, Inc. VMware Virtual Platform/440BX 
Desktop Reference Platform, BIOS 6.00 07/02/2015
[   19.897136] Call Trace:
[   19.897136]  dump_stack+0x86/0xc9
[   19.897136]  print_address_description+0xcb/0x250
[   19.897136]  kasan_report+0x24d/0x360
[   19.897136]  ? vmw_du_primary_plane_atomic_check+0x26b/0x360
[   19.897136]  __asan_load1+0x47/0x50
[   19.897136]  vmw_du_primary_plane_atomic_check+0x26b/0x360 /* 
vmw_du_primary_plane_atomic_check at drivers/gpu/drm/vmwgfx/vmwgfx_kms.c:487 */
[   19.897136]  ? wait_for_completion+0x200/0x200
[   19.897136]  ? vmw_du_cursor_plane_atomic_update+0x520/0x520
[   19.897136]  ? __radix_tree_lookup+0x21/0x170
[   19.897136]  ? __drm_mode_object_find+0x5a/0xc0
[   19.897136]  ? drm_atomic_helper_check_modeset+0xd80/0x1350
[   19.897136]  drm_atomic_helper_check_planes+0x1a7/0x3c0 /* 
drm_atomic_helper_check_planes at drivers/gpu/drm/drm_atomic_helper.c:737 */
[   19.897136]  drm_atomic_helper_check+0x32/0x90 /* drm_atomic_helper_check at 
drivers/gpu/drm/drm_atomic_helper.c:795 */
[   19.897136]  vmw_kms_atomic_check_modeset+0x186/0x1a0 /* 
vmw_kms_atomic_check_modeset at drivers/gpu/drm/vmwgfx/vmwgfx_kms.c:1566 */
[   19.897136]  drm_atomic_check_only+0x8cd/0xa70 /* drm_atomic_check_only at 
drivers/gpu/drm/drm_atomic.c:1666 */
[   19.897136]  ? drm_atomic_legacy_backoff+0xe0/0xe0
[   19.897136]  ? drm_atomic_helper_disable_plane+0xf0/0xf0
[   19.897136]  ? drm_atomic_helper_best_encoder+0x70/0x70
[   19.897136]  drm_atomic_commit+0x24/0x80 /* drm_atomic_commit at 
drivers/gpu/drm/drm_atomic.c:1702 */
[   19.897136]  drm_atomic_helper_set_config+0x7e/0xa0 /* 
drm_atomic_helper_set_config at drivers/gpu/drm/drm_atomic_helper.c:2607 */
[   19.897136]  ? ww_mutex_lock+0x43/0x70
[   19.897136]  vmw_kms_set_config+0x44/0x50 /* vmw_kms_set_config at 
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c:2849 */
[   19.897136]  vmwgfx_set_config_internal.constprop.4+0x122/0x2d0 /* 
vmwgfx_set_config_internal at drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:444 */
[   19.897136]  vmw_fb_set_par+0x528/0xb00 /* vmw_fb_set_par at 
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:636 */
[   19.897136]  ? find_held_lock+0x117/0x150
[   19.897136]  ? vmw_fb_kms_detach+0x300/0x300
[   19.897136]  ? lock_downgrade+0x2d0/0x2d0
[   19.897136]  ? __mutex_unlock_slowpath+0xd4/0x3e0
[   19.897136]  ? wait_for_completion+0x200/0x200
[   19.897136]  ? 

[PATCH 07/11] drm: i915: i915_oa_kblgt3: constify attribute_group structures.

2017-08-04 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/gpu/drm/i915/i915_oa_kblgt3.c | 36 +--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_oa_kblgt3.c 
b/drivers/gpu/drm/i915/i915_oa_kblgt3.c
index 6ed0925..f234801 100644
--- a/drivers/gpu/drm/i915/i915_oa_kblgt3.c
+++ b/drivers/gpu/drm/i915/i915_oa_kblgt3.c
@@ -2461,7 +2461,7 @@ int i915_oa_select_metric_set_kblgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_basic = {
+static const struct attribute_group group_render_basic = {
.name = "0286c920-2f6d-493b-b22d-7a5280df43de",
.attrs =  attrs_render_basic,
 };
@@ -2483,7 +2483,7 @@ int i915_oa_select_metric_set_kblgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_basic = {
+static const struct attribute_group group_compute_basic = {
.name = "9823aaa1-b06f-40ce-884b-cd798c79f0c2",
.attrs =  attrs_compute_basic,
 };
@@ -2505,7 +2505,7 @@ int i915_oa_select_metric_set_kblgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_pipe_profile = {
+static const struct attribute_group group_render_pipe_profile = {
.name = "c7c735f3-ce58-45cf-aa04-30b183f1faff",
.attrs =  attrs_render_pipe_profile,
 };
@@ -2527,7 +2527,7 @@ int i915_oa_select_metric_set_kblgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_reads = {
+static const struct attribute_group group_memory_reads = {
.name = "96ec2219-040b-428a-856a-6bc03363a057",
.attrs =  attrs_memory_reads,
 };
@@ -2549,7 +2549,7 @@ int i915_oa_select_metric_set_kblgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_writes = {
+static const struct attribute_group group_memory_writes = {
.name = "03372b64-4996-4d3b-aa18-790e75eeb9c2",
.attrs =  attrs_memory_writes,
 };
@@ -2571,7 +2571,7 @@ int i915_oa_select_metric_set_kblgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_extended = {
+static const struct attribute_group group_compute_extended = {
.name = "31b4ce5a-bd61-4c1f-bb5d-f2e731412150",
.attrs =  attrs_compute_extended,
 };
@@ -2593,7 +2593,7 @@ int i915_oa_select_metric_set_kblgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_l3_cache = {
+static const struct attribute_group group_compute_l3_cache = {
.name = "2ce0911a-27fc-4887-96f0-11084fa807c3",
.attrs =  attrs_compute_l3_cache,
 };
@@ -2615,7 +2615,7 @@ int i915_oa_select_metric_set_kblgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_hdc_and_sf = {
+static const struct attribute_group group_hdc_and_sf = {
.name = "546c4c1d-99b8-42fb-a107-5aaabb5314a8",
.attrs =  attrs_hdc_and_sf,
 };
@@ -2637,7 +2637,7 @@ int i915_oa_select_metric_set_kblgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_1 = {
+static const struct attribute_group group_l3_1 = {
.name = "4e93d156-9b39-4268-8544-a8e0480806d7",
.attrs =  attrs_l3_1,
 };
@@ -2659,7 +2659,7 @@ int i915_oa_select_metric_set_kblgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_2 = {
+static const struct attribute_group group_l3_2 = {
.name = "de1bec86-ca92-4b43-89fa-147653221cc0",
.attrs =  attrs_l3_2,
 };
@@ -2681,7 +2681,7 @@ int i915_oa_select_metric_set_kblgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_3 = {
+static const struct attribute_group group_l3_3 = {
.name = "e63537bb-10be-4d4a-92c4-c6b0c65e02ef",
.attrs =  attrs_l3_3,
 };
@@ -2703,7 +2703,7 @@ int i915_oa_select_metric_set_kblgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_rasterizer_and_pixel_backend = {
+static const struct attribute_group group_rasterizer_and_pixel_backend = {
.name = "7a03a9f8-ec5e-46bb-8b67-1f0ff1476281",
.attrs =  attrs_rasterizer_and_pixel_backend,
 };
@@ -2725,7 +2725,7 @@ int i915_oa_select_metric_set_kblgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_sampler = {
+static const struct attribute_group group_sampler = {
.name = "b25d2ebf-a6e0-4b29-96be-a9b010edeeda",
.attrs =  attrs_sampler,
 };
@@ -2747,7 +2747,7 @@ int i915_oa_select_metric_set_kblgt3(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group 

Re: [linux-sunxi] [PATCH 10/13] [NOT FOR REVIEW NOW] clk: sunxi: Add CLK_SET_RATE_PARENT flag for H3 HDMI clock

2017-08-04 Thread Icenowy Zheng


于 2017年8月4日 GMT+08:00 下午12:15:27, Chen-Yu Tsai  写到:
>Hi,
>
>On Tue, Aug 1, 2017 at 9:13 PM, Icenowy Zheng  wrote:
>> From: Jernej Skrabec 
>>
>> When setting the HDMI clock of H3, the PLL_VIDEO clock needs to be
>set.
>>
>> Add CLK_SET_RATE_PARENT flag for H3 HDMI clock.
>>
>> Signed-off-by: Jernej Skrabec 
>> Signed-off-by: Icenowy Zheng 
>> ---
>>  drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
>b/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
>> index b1127e8629d9..2ebb3d865b01 100644
>> --- a/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
>> +++ b/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
>> @@ -474,7 +474,7 @@ static SUNXI_CCU_GATE(avs_clk, 
>"avs",  "osc24M",
>>
>>  static const char * const hdmi_parents[] = { "pll-video" };
>>  static SUNXI_CCU_M_WITH_MUX_GATE(hdmi_clk, "hdmi", hdmi_parents,
>> -0x150, 0, 4, 24, 2, BIT(31), 0);
>> +0x150, 0, 4, 24, 2, BIT(31),
>CLK_SET_RATE_PARENT);
>
>Line is longer than 80 characters.
>
>This looks independent enough so I've merged this for 4.14 with the
>offending line wrapped and the following tag added:
>
>Fixes: 0577e4853bfb ("clk: sunxi-ng: Add H3 clocks")

Please don't merge this now until Jernej send it.

>
>ChenYu
>
>>
>>  static SUNXI_CCU_GATE(hdmi_ddc_clk,"hdmi-ddc", "osc24M",
>>   0x154, BIT(31), 0);
>> --
>> 2.13.0
>>
>> --
>> You received this message because you are subscribed to the Google
>Groups "linux-sunxi" group.
>> To unsubscribe from this group and stop receiving emails from it,
>send an email to linux-sunxi+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 04/11] drm: i915: i915_oa_chv: constify attribute_group structures.

2017-08-04 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/gpu/drm/i915/i915_oa_chv.c | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_oa_chv.c 
b/drivers/gpu/drm/i915/i915_oa_chv.c
index aa6bece..85c6c36 100644
--- a/drivers/gpu/drm/i915/i915_oa_chv.c
+++ b/drivers/gpu/drm/i915/i915_oa_chv.c
@@ -2422,7 +2422,7 @@ int i915_oa_select_metric_set_chv(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_basic = {
+static const struct attribute_group group_render_basic = {
.name = "9d8a3af5-c02c-4a4a-b947-f1672469e0fb",
.attrs =  attrs_render_basic,
 };
@@ -2444,7 +2444,7 @@ int i915_oa_select_metric_set_chv(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_basic = {
+static const struct attribute_group group_compute_basic = {
.name = "f522a89c-ecd1-4522-8331-3383c54af5f5",
.attrs =  attrs_compute_basic,
 };
@@ -2466,7 +2466,7 @@ int i915_oa_select_metric_set_chv(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_pipe_profile = {
+static const struct attribute_group group_render_pipe_profile = {
.name = "a9ccc03d-a943-4e6b-9cd6-13e063075927",
.attrs =  attrs_render_pipe_profile,
 };
@@ -2488,7 +2488,7 @@ int i915_oa_select_metric_set_chv(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_hdc_and_sf = {
+static const struct attribute_group group_hdc_and_sf = {
.name = "2cf0c064-68df-4fac-9b3f-57f51ca8a069",
.attrs =  attrs_hdc_and_sf,
 };
@@ -2510,7 +2510,7 @@ int i915_oa_select_metric_set_chv(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_1 = {
+static const struct attribute_group group_l3_1 = {
.name = "78a87ff9-543a-49ce-95ea-26d86071ea93",
.attrs =  attrs_l3_1,
 };
@@ -2532,7 +2532,7 @@ int i915_oa_select_metric_set_chv(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_2 = {
+static const struct attribute_group group_l3_2 = {
.name = "9f2cece5-7bfe-4320-ad66-8c7cc526bec5",
.attrs =  attrs_l3_2,
 };
@@ -2554,7 +2554,7 @@ int i915_oa_select_metric_set_chv(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_3 = {
+static const struct attribute_group group_l3_3 = {
.name = "d890ef38-d309-47e4-b8b5-aa779bb19ab0",
.attrs =  attrs_l3_3,
 };
@@ -2576,7 +2576,7 @@ int i915_oa_select_metric_set_chv(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_4 = {
+static const struct attribute_group group_l3_4 = {
.name = "5fdff4a6-9dc8-45e1-bfda-ef54869fbdd4",
.attrs =  attrs_l3_4,
 };
@@ -2598,7 +2598,7 @@ int i915_oa_select_metric_set_chv(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_rasterizer_and_pixel_backend = {
+static const struct attribute_group group_rasterizer_and_pixel_backend = {
.name = "2c0e45e1-7e2c-4a14-ae00-0b7ec868b8aa",
.attrs =  attrs_rasterizer_and_pixel_backend,
 };
@@ -2620,7 +2620,7 @@ int i915_oa_select_metric_set_chv(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_sampler_1 = {
+static const struct attribute_group group_sampler_1 = {
.name = "71148d78-baf5-474f-878a-e23158d0265d",
.attrs =  attrs_sampler_1,
 };
@@ -2642,7 +2642,7 @@ int i915_oa_select_metric_set_chv(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_sampler_2 = {
+static const struct attribute_group group_sampler_2 = {
.name = "b996a2b7-c59c-492d-877a-8cd54fd6df84",
.attrs =  attrs_sampler_2,
 };
@@ -2664,7 +2664,7 @@ int i915_oa_select_metric_set_chv(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_tdl_1 = {
+static const struct attribute_group group_tdl_1 = {
.name = "eb2fecba-b431-42e7-8261-fe9429a6e67a",
.attrs =  attrs_tdl_1,
 };
@@ -2686,7 +2686,7 @@ int i915_oa_select_metric_set_chv(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_tdl_2 = {
+static const struct attribute_group group_tdl_2 = {
.name = "60749470-a648-4a4b-9f10-dbfe1e36e44d",
.attrs =  attrs_tdl_2,
 };
@@ -2708,7 +2708,7 @@ int i915_oa_select_metric_set_chv(struct drm_i915_private 
*dev_priv)
NULL,
 };
 
-static struct attribute_group group_test_oa = {
+static const struct attribute_group group_test_oa = {
.name = "4a534b07-cba3-414d-8d60-874830e883aa",
.attrs =  attrs_test_oa,
 };
-- 

[PATCH 01/11] drm: i915: i915_oa_kblgt2: constify attribute_group structures.

2017-08-04 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/gpu/drm/i915/i915_oa_kblgt2.c | 36 +--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_oa_kblgt2.c 
b/drivers/gpu/drm/i915/i915_oa_kblgt2.c
index 87dbd0a..c9b6751 100644
--- a/drivers/gpu/drm/i915/i915_oa_kblgt2.c
+++ b/drivers/gpu/drm/i915/i915_oa_kblgt2.c
@@ -2412,7 +2412,7 @@ int i915_oa_select_metric_set_kblgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_basic = {
+static const struct attribute_group group_render_basic = {
.name = "f8d677e9-ff6f-4df1-9310-0334c6efacce",
.attrs =  attrs_render_basic,
 };
@@ -2434,7 +2434,7 @@ int i915_oa_select_metric_set_kblgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_basic = {
+static const struct attribute_group group_compute_basic = {
.name = "e17fc42a-e614-41b6-90c4-1074841a6c77",
.attrs =  attrs_compute_basic,
 };
@@ -2456,7 +2456,7 @@ int i915_oa_select_metric_set_kblgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_pipe_profile = {
+static const struct attribute_group group_render_pipe_profile = {
.name = "d7a17a3a-ca71-40d2-a919-ace80d50633f",
.attrs =  attrs_render_pipe_profile,
 };
@@ -2478,7 +2478,7 @@ int i915_oa_select_metric_set_kblgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_reads = {
+static const struct attribute_group group_memory_reads = {
.name = "57b59202-172b-477a-87de-33f85572c589",
.attrs =  attrs_memory_reads,
 };
@@ -2500,7 +2500,7 @@ int i915_oa_select_metric_set_kblgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_writes = {
+static const struct attribute_group group_memory_writes = {
.name = "3addf8ef-8e9b-40f5-a448-3dbb5d5128b0",
.attrs =  attrs_memory_writes,
 };
@@ -2522,7 +2522,7 @@ int i915_oa_select_metric_set_kblgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_extended = {
+static const struct attribute_group group_compute_extended = {
.name = "4af0400a-81c3-47db-a6b6-deddbd75680e",
.attrs =  attrs_compute_extended,
 };
@@ -2544,7 +2544,7 @@ int i915_oa_select_metric_set_kblgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_l3_cache = {
+static const struct attribute_group group_compute_l3_cache = {
.name = "0e22f995-79ca-4f67-83ab-e9d9772488d8",
.attrs =  attrs_compute_l3_cache,
 };
@@ -2566,7 +2566,7 @@ int i915_oa_select_metric_set_kblgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_hdc_and_sf = {
+static const struct attribute_group group_hdc_and_sf = {
.name = "bc2a00f7-cb8a-4ff2-8ad0-e241dad16937",
.attrs =  attrs_hdc_and_sf,
 };
@@ -2588,7 +2588,7 @@ int i915_oa_select_metric_set_kblgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_1 = {
+static const struct attribute_group group_l3_1 = {
.name = "d2bbe790-f058-42d9-81c6-cdedcf655bc2",
.attrs =  attrs_l3_1,
 };
@@ -2610,7 +2610,7 @@ int i915_oa_select_metric_set_kblgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_2 = {
+static const struct attribute_group group_l3_2 = {
.name = "2f8e32e4-5956-46e2-af31-c8ea95887332",
.attrs =  attrs_l3_2,
 };
@@ -2632,7 +2632,7 @@ int i915_oa_select_metric_set_kblgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_3 = {
+static const struct attribute_group group_l3_3 = {
.name = "ca046aad-b5fb-4101-adce-6473ee6e5b14",
.attrs =  attrs_l3_3,
 };
@@ -2654,7 +2654,7 @@ int i915_oa_select_metric_set_kblgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_rasterizer_and_pixel_backend = {
+static const struct attribute_group group_rasterizer_and_pixel_backend = {
.name = "605f388f-24bb-455c-88e3-8d57ae0d7e9f",
.attrs =  attrs_rasterizer_and_pixel_backend,
 };
@@ -2676,7 +2676,7 @@ int i915_oa_select_metric_set_kblgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_sampler = {
+static const struct attribute_group group_sampler = {
.name = "31dd157c-bf4e-4bab-bf2b-f5c8174af1af",
.attrs =  attrs_sampler,
 };
@@ -2698,7 +2698,7 @@ int i915_oa_select_metric_set_kblgt2(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group 

[PATCH RESEND 1/2] dt/bindings: display: fix display-timing reference

2017-08-04 Thread Baruch Siach
Fixes: 14da3ed8dd08 ("devicetree/bindings: display: Document common panel 
properties")
Cc: Laurent Pinchart 
Acked-by: Rob Herring 
Signed-off-by: Baruch Siach 
---
 Documentation/devicetree/bindings/display/panel/panel-common.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.txt 
b/Documentation/devicetree/bindings/display/panel/panel-common.txt
index ec52c472c845..0603af877155 100644
--- a/Documentation/devicetree/bindings/display/panel/panel-common.txt
+++ b/Documentation/devicetree/bindings/display/panel/panel-common.txt
@@ -38,7 +38,7 @@ Display Timings
   require specific display timings. The panel-timing subnode expresses those
   timings as specified in the timing subnode section of the display timing
   bindings defined in
-  Documentation/devicetree/bindings/display/display-timing.txt.
+  Documentation/devicetree/bindings/display/panel/display-timing.txt.
 
 
 Connectivity
-- 
2.13.2

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


[PATCH 10/11] drm: i915: i915_oa_sklgt4: constify attribute_group structures.

2017-08-04 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/gpu/drm/i915/i915_oa_sklgt4.c | 36 +--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_oa_sklgt4.c 
b/drivers/gpu/drm/i915/i915_oa_sklgt4.c
index 9ddab43..0671899 100644
--- a/drivers/gpu/drm/i915/i915_oa_sklgt4.c
+++ b/drivers/gpu/drm/i915/i915_oa_sklgt4.c
@@ -2514,7 +2514,7 @@ int i915_oa_select_metric_set_sklgt4(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_basic = {
+static const struct attribute_group group_render_basic = {
.name = "bad77c24-cc64-480d-99bf-e7b740713800",
.attrs =  attrs_render_basic,
 };
@@ -2536,7 +2536,7 @@ int i915_oa_select_metric_set_sklgt4(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_basic = {
+static const struct attribute_group group_compute_basic = {
.name = "7277228f-e7f3-4743-945a-6a2049d11377",
.attrs =  attrs_compute_basic,
 };
@@ -2558,7 +2558,7 @@ int i915_oa_select_metric_set_sklgt4(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_render_pipe_profile = {
+static const struct attribute_group group_render_pipe_profile = {
.name = "463c668c-3f60-49b6-8f85-d995b635b3b2",
.attrs =  attrs_render_pipe_profile,
 };
@@ -2580,7 +2580,7 @@ int i915_oa_select_metric_set_sklgt4(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_reads = {
+static const struct attribute_group group_memory_reads = {
.name = "3ae6e74c-72c3-4040-9bd0-7961430b8cc8",
.attrs =  attrs_memory_reads,
 };
@@ -2602,7 +2602,7 @@ int i915_oa_select_metric_set_sklgt4(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_memory_writes = {
+static const struct attribute_group group_memory_writes = {
.name = "055f256d-4052-467c-8dec-6064a4806433",
.attrs =  attrs_memory_writes,
 };
@@ -2624,7 +2624,7 @@ int i915_oa_select_metric_set_sklgt4(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_extended = {
+static const struct attribute_group group_compute_extended = {
.name = "753972d4-87cd-4460-824d-754463ac5054",
.attrs =  attrs_compute_extended,
 };
@@ -2646,7 +2646,7 @@ int i915_oa_select_metric_set_sklgt4(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_compute_l3_cache = {
+static const struct attribute_group group_compute_l3_cache = {
.name = "4e4392e9-8f73-457b-ab44-b49f7a0c733b",
.attrs =  attrs_compute_l3_cache,
 };
@@ -2668,7 +2668,7 @@ int i915_oa_select_metric_set_sklgt4(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_hdc_and_sf = {
+static const struct attribute_group group_hdc_and_sf = {
.name = "730d95dd-7da8-4e1c-ab8d-c0eb1e4c1805",
.attrs =  attrs_hdc_and_sf,
 };
@@ -2690,7 +2690,7 @@ int i915_oa_select_metric_set_sklgt4(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_1 = {
+static const struct attribute_group group_l3_1 = {
.name = "d9e86d70-462b-462a-851e-fd63e8c13d63",
.attrs =  attrs_l3_1,
 };
@@ -2712,7 +2712,7 @@ int i915_oa_select_metric_set_sklgt4(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_2 = {
+static const struct attribute_group group_l3_2 = {
.name = "52200424-6ee9-48b3-b7fa-0afcf1975e4d",
.attrs =  attrs_l3_2,
 };
@@ -2734,7 +2734,7 @@ int i915_oa_select_metric_set_sklgt4(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_l3_3 = {
+static const struct attribute_group group_l3_3 = {
.name = "1988315f-0a26-44df-acb0-df7ec86b1456",
.attrs =  attrs_l3_3,
 };
@@ -2756,7 +2756,7 @@ int i915_oa_select_metric_set_sklgt4(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_rasterizer_and_pixel_backend = {
+static const struct attribute_group group_rasterizer_and_pixel_backend = {
.name = "f1f17ca7-286e-4ae5-9d15-9fccad6c665d",
.attrs =  attrs_rasterizer_and_pixel_backend,
 };
@@ -2778,7 +2778,7 @@ int i915_oa_select_metric_set_sklgt4(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group group_sampler = {
+static const struct attribute_group group_sampler = {
.name = "00a9e0fb-3d2e-4405-852c-dce6334ffb3b",
.attrs =  attrs_sampler,
 };
@@ -2800,7 +2800,7 @@ int i915_oa_select_metric_set_sklgt4(struct 
drm_i915_private *dev_priv)
NULL,
 };
 
-static struct attribute_group 

[PATCH v4] drm: kirin: Add mode_valid logic to avoid mode clocks we can't generate

2017-08-04 Thread John Stultz
Currently the hikey dsi logic cannot generate accurate byte
clocks values for all pixel clock values. Thus if a mode clock
is selected that cannot match the calculated byte clock, the
device will boot with a blank screen.

This patch uses the new mode_valid callback (many thanks to
Jose Abreu for upstreaming it!) to ensure we don't select
modes we cannot generate.

Also, since the ade crtc code will adjust the mode in mode_set,
this patch also adds a mode_fixup callback which we use to make
sure we are validating the mode clock that will eventually be
used.

Cc: Daniel Vetter 
Cc: Jani Nikula 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Rob Clark 
Cc: Xinliang Liu 
Cc: Xinliang Liu 
Cc: Rongrong Zou 
Cc: Xinwei Kong 
Cc: Chen Feng 
Cc: Jose Abreu 
Cc: Archit Taneja 
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: John Stultz 
---
v2: Reworked to calculate if modeclock matches the phy's
byteclock, rather then using a whitelist of known modes.

v3: Reworked to check across all possible crtcs (even though for
us there is only one), and use mode_fixup instead of a custom
function, as suggested by Jose and Daniel.

v4: Fixes and improved error handling as suggested by Jose.
---
 drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c| 67 +
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 14 ++
 2 files changed, 81 insertions(+)

diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c 
b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
index f77dcfa..043a50d 100644
--- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
+++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
@@ -603,6 +603,72 @@ static void dsi_encoder_enable(struct drm_encoder *encoder)
dsi->enable = true;
 }
 
+static enum drm_mode_status dsi_encoder_phy_mode_valid(
+   struct drm_encoder *encoder,
+   const struct drm_display_mode *mode)
+{
+   struct dw_dsi *dsi = encoder_to_dsi(encoder);
+   struct mipi_phy_params phy;
+   u32 bpp = mipi_dsi_pixel_format_to_bpp(dsi->format);
+   u32 req_kHz, act_kHz, lane_byte_clk_kHz;
+
+   /* Calculate the lane byte clk using the adjusted mode clk */
+   memset(, 0, sizeof(phy));
+   req_kHz = mode->clock * bpp / dsi->lanes;
+   act_kHz = dsi_calc_phy_rate(req_kHz, );
+   lane_byte_clk_kHz = act_kHz / 8;
+
+   DRM_DEBUG_DRIVER("Checking mode %ix%i-%i@%i clock: %i...",
+   mode->hdisplay, mode->vdisplay, bpp,
+   drm_mode_vrefresh(mode), mode->clock);
+
+   /*
+* Make sure the adjused mode clock and the lane byte clk
+* have a common denominator base frequency
+*/
+   if (mode->clock/dsi->lanes == lane_byte_clk_kHz/3) {
+   DRM_DEBUG_DRIVER("OK!\n");
+   return MODE_OK;
+   }
+
+   DRM_DEBUG_DRIVER("BAD!\n");
+   return MODE_BAD;
+}
+
+static enum drm_mode_status dsi_encoder_mode_valid(struct drm_encoder *encoder,
+   const struct drm_display_mode *mode)
+
+{
+   const struct drm_crtc_helper_funcs *crtc_funcs = NULL;
+   struct drm_crtc *crtc = NULL;
+   struct drm_display_mode adj_mode;
+   enum drm_mode_status ret;
+
+   /*
+* The crtc might adjust the mode, so go through the
+* possible crtcs (technically just one) and call
+* mode_fixup to figure out the adjusted mode before we
+* validate it.
+*/
+   drm_for_each_crtc(crtc, encoder->dev) {
+   /*
+* reset adj_mode to the mode value each time,
+* so we don't adjust the mode twice
+*/
+   drm_mode_copy(_mode, mode);
+
+   crtc_funcs = crtc->helper_private;
+   if (crtc_funcs && crtc_funcs->mode_fixup)
+   if (!crtc_funcs->mode_fixup(crtc, mode, _mode))
+   return MODE_BAD;
+
+   ret = dsi_encoder_phy_mode_valid(encoder, _mode);
+   if (ret != MODE_OK)
+   return ret;
+   }
+   return MODE_OK;
+}
+
 static void dsi_encoder_mode_set(struct drm_encoder *encoder,
 struct drm_display_mode *mode,
 struct drm_display_mode *adj_mode)
@@ -622,6 +688,7 @@ static int dsi_encoder_atomic_check(struct drm_encoder 
*encoder,
 
 static const struct drm_encoder_helper_funcs dw_encoder_helper_funcs = {
.atomic_check   = dsi_encoder_atomic_check,
+   .mode_valid = dsi_encoder_mode_valid,
.mode_set   = dsi_encoder_mode_set,

Re: [PATCH] drm/syncobj: add sync obj wait interface. (v7)

2017-08-04 Thread Jason Ekstrand
I'm working on a VK_KHR_external_fence implementation based on this and
have found some issues. :-)

On Mon, Jul 17, 2017 at 11:44 PM, Dave Airlie  wrote:

> From: Dave Airlie 
>
> This interface will allow sync object to be used to back
> Vulkan fences. This API is pretty much the vulkan fence waiting
> API, and I've ported the code from amdgpu.
>
> v2: accept relative timeout, pass remaining time back
> to userspace.
> v3: return to absolute timeouts.
> v4: absolute zero = poll,
> rewrite any/all code to have same operation for arrays
> return -EINVAL for 0 fences.
> v4.1: fixup fences allocation check, use u64_to_user_ptr
> v5: move to sec/nsec, and use timespec64 for calcs.
> v6: use -ETIME and drop the out status flag. (-ETIME
> is suggested by ickle, I can feel a shed painting)
> v7: talked to Daniel/Arnd, use ktime and ns everywhere.
>
> Signed-off-by: Dave Airlie 
> ---
>  drivers/gpu/drm/drm_internal.h |   2 +
>  drivers/gpu/drm/drm_ioctl.c|   2 +
>  drivers/gpu/drm/drm_syncobj.c  | 135 ++
> +++
>  include/uapi/drm/drm.h |  12 
>  4 files changed, 151 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal
> .h
> index 5cecc97..d71b50d 100644
> --- a/drivers/gpu/drm/drm_internal.h
> +++ b/drivers/gpu/drm/drm_internal.h
> @@ -157,3 +157,5 @@ int drm_syncobj_handle_to_fd_ioctl(struct drm_device
> *dev, void *data,
>struct drm_file *file_private);
>  int drm_syncobj_fd_to_handle_ioctl(struct drm_device *dev, void *data,
>struct drm_file *file_private);
> +int drm_syncobj_wait_ioctl(struct drm_device *dev, void *data,
> +  struct drm_file *file_private);
> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> index f1e5681..385ce74 100644
> --- a/drivers/gpu/drm/drm_ioctl.c
> +++ b/drivers/gpu/drm/drm_ioctl.c
> @@ -657,6 +657,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
>   DRM_UNLOCKED|DRM_RENDER_ALLOW),
> DRM_IOCTL_DEF(DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE,
> drm_syncobj_fd_to_handle_ioctl,
>   DRM_UNLOCKED|DRM_RENDER_ALLOW),
> +   DRM_IOCTL_DEF(DRM_IOCTL_SYNCOBJ_WAIT, drm_syncobj_wait_ioctl,
> + DRM_UNLOCKED|DRM_RENDER_ALLOW),
>  };
>
>  #define DRM_CORE_IOCTL_COUNT   ARRAY_SIZE( drm_ioctls )
> diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
> index 89441bc..d23dcc6 100644
> --- a/drivers/gpu/drm/drm_syncobj.c
> +++ b/drivers/gpu/drm/drm_syncobj.c
> @@ -1,5 +1,7 @@
>  /*
>   * Copyright 2017 Red Hat
> + * Parts ported from amdgpu (fence wait code).
> + * Copyright 2016 Advanced Micro Devices, Inc.
>   *
>   * Permission is hereby granted, free of charge, to any person obtaining a
>   * copy of this software and associated documentation files (the
> "Software"),
> @@ -31,6 +33,9 @@
>   * that contain an optional fence. The fence can be updated with a new
>   * fence, or be NULL.
>   *
> + * syncobj's can be waited upon, where it will wait for the underlying
> + * fence.
> + *
>   * syncobj's can be export to fd's and back, these fd's are opaque and
>   * have no other use case, except passing the syncobj between processes.
>   *
> @@ -451,3 +456,133 @@ drm_syncobj_fd_to_handle_ioctl(struct drm_device
> *dev, void *data,
> return drm_syncobj_fd_to_handle(file_private, args->fd,
> >handle);
>  }
> +
> +/**
> + * drm_timeout_abs_to_jiffies - calculate jiffies timeout from absolute
> value
> + *
> + * @timeout_sec: timeout sec component, 0 for poll
> + * @timeout_nsec: timeout nsec component in ns, 0 for poll
> + * both must be 0 for poll.
> + *
> + * Calculate the timeout in jiffies from an absolute time in sec/nsec.
> + */
> +static unsigned long drm_timeout_abs_to_jiffies(int64_t timeout_nsec)
> +{
> +   ktime_t abs_timeout, timeout, max_jiffy_ktime;
> +   unsigned long timeout_jiffies;
> +
> +   /* make 0 timeout means poll - absolute 0 doesn't seem valid */
> +   if (timeout_nsec == 0)
> +   return 0;
> +
> +   abs_timeout = ns_to_ktime(timeout_nsec);
> +
> +   timeout = ktime_sub(abs_timeout, ktime_get());
>

This can end you up with a negative timeout.  dma_fence_wait_timeout will
WARN_ON a negative timeout.


> +
> +   max_jiffy_ktime = ns_to_ktime(jiffies_to_nsecs(MAX_JIFFY_OFFSET));
> +   if (ktime_compare(timeout, max_jiffy_ktime))
>

I think you want a > 0 here because otherwise this is a "!=" comparison
which isn't what you want.  Either that or use ktime_after().


> +   return MAX_SCHEDULE_TIMEOUT - 1;
> +
> +   timeout_jiffies = nsecs_to_jiffies(ktime_to_ns(timeout));
> +   /*  clamp timeout to avoid infinite timeout */
> +   if (timeout_jiffies >= MAX_SCHEDULE_TIMEOUT)
> +   return 

Re: [PATCH v3 00/35] omapdrm: Deconstruct DSS features

2017-08-04 Thread Laurent Pinchart
On Saturday 05 Aug 2017 01:43:44 Laurent Pinchart wrote:
> Hello,
> 
> This patch series is a third version of the code previously posted as
> "[PATCH v2 00/29] Remove the omapdrm and omapdss devices from platform
> code".
> 
> The omapdss/omapdrm initialization code is quite a mess. The physical
> devices are instantiated from DT, but two virtual devices named omapdrm and
> omapdss are instanciated from platform code to pass various pieces of
> platform data to the drivers.
> 
> The omapdrm and omapdss platform devices are currently used to pass data and
> function pointers from board code to the drivers for the purpose of
> 
> - identifying the OMAP SoC revision
> - controlling the DSI pads
> - configuring bus throughput
> 
> It turns out that all these can be handled in the omapdrm and omapdss
> drivers without the need for platform data.
> 
> - The SoC revision is used to identify the version of various DSS IP cores,
> which can instead be done through compatible string matching (with the help
> of soc_device_match() in two cases where ES version is needed).
> 
> - The DSI pads control can be performed by the driver directly without
> calling board code, accessing the related registers through syscon.
> 
> - Bus throughput control is implemented in mach-omap2 as a no-op, so we can
> just drop the code.
> 
> This patch series starts with a new patch that fixes soc_device_match()
> usage on OMAP2+. It turned out that OMAP2+ registers SoC device attributes
> at late init time, making soc_device_match() impossible to use for drivers
> at probe time, which is unfortunately the location where the feature is
> most needed.
> 
> The next five patches (02/35 to 06/35) are small and simple unneeded or
> unused code removal. The next two patches (07/35 and 08/35) are cleanups
> that make sense by themselves and will be needed by later refactoring.
> 
> The series then starts removing usage of the DSS platform data. It first
> removes callbacks to platform code in patches 09/35 and 10/35, and then
> tackles the larger task of replacing DSS version usage with model data
> stored in OF or SoC device match entries (patches 11/35 to 14/35).
> 
> The next large user of the DSS version is the omap_dss_features
> infrastructure not to be confused with the similarly named dss_features.
> The former is a dirty mix of data related to all IP cores in the while
> display device, while the latter contains data related to the DSS itself.
> The next patches deconstruct omap_dss_features by removing one unneeded
> features field (15/35), and slowly moving features to where they belong
> (patches 16/35 to 34/35). Patch 35/35 finally removes the omap_dss_features
> altogether as they're then empty.
> 
> Note that patches 17/35 and 18/35 are not strictly related to
> omap_dss_features deconstruction, but they pave the road to removing the
> omapdss platform driver (for the virtual omapdss platform device, also known
> as core code, not to be confused with the omapdss_dss driver for the DSS
> hardware device) which is the ultimate goal of this effort and should be
> ready for upstreaming.
> 
> Compared to v2, the DSS version usage in the HDMI4 and HDMI5 drivers is
> still present, as the related patches were more controversial and require
> more work. I will tackle that next as a separate patch series that will
> finally remove omapdss platform driver
> 
> This version should be simpler to merge given that it doesn't touch the
> FBDEV and ALSA subsystems, but still carries an annoying dependency on
> OMAP2+ platform code. The easiest solution would be to merge the single
> OMAP2+ patch (01/35) through the DRM tree as that's where the bulk of
> changes lies.
> 
> The patches are currently based on top of v4.13-rc2 (-rc1 doesn't boot on
> the AM57xx board I use for testing) and have been tested on OMAP3
> (BeagleBoard-xM, DM3730), OMAP4 (pandaboard, OMAP4460) and OMAP5 (AM572x
> EVM, AM572x). Many regressions were found, and fixed :-)

This should of course have read DRA7, not OMAP5.

> Laurent Pinchart (35):
>   ARM: OMAP2+: Register SoC device attributes from machine .init()
>   drm: omapdrm: acx565akm: Remove unneeded check for OF node
>   drm: omapdrm: connector-analog-tv: Remove unneeded check for OF node
>   drm: omapdrm: panel-dpi: Remove unneeded check for OF node
>   drm: omapdrm: dpi: Remove unneeded regulator check
>   drm: omapdrm: venc: Don't export omap_dss_pal_vm and omap_dss_ntsc_vm
>   drm: omapdrm: hdmi: Store PHY features in PHY data structure
>   drm: omapdrm: dss: Split operations out of dss_features structure
>   drm: omapdrm: dsi: Handle pin muxing internally
>   drm: omapdrm: Don't forward set_min_bus_tput() to no-op platform code
>   drm: omapdrm: dispc: Select features based on compatible string
>   drm: omapdrm: dpi: Replace OMAP SoC model checks with DSS model
>   drm: omapdrm: dsi: Store DSI model and PLL hardware data in OF data
>   drm: omapdrm: dss: Select features based on compatible string
>   drm: 

[PATCH v3 35/35] drm: omapdrm: Remove dss_features.h

2017-08-04 Thread Laurent Pinchart
The header file only contains four macros, two of which are never used.
Move the other two to dss.h and remove dss_features.h.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/core.c |  1 -
 drivers/gpu/drm/omapdrm/dss/dispc.c|  1 -
 drivers/gpu/drm/omapdrm/dss/dpi.c  |  1 -
 drivers/gpu/drm/omapdrm/dss/dsi.c  |  1 -
 drivers/gpu/drm/omapdrm/dss/dss.c  |  1 -
 drivers/gpu/drm/omapdrm/dss/dss.h  |  3 +++
 drivers/gpu/drm/omapdrm/dss/dss_features.h | 28 
 drivers/gpu/drm/omapdrm/dss/hdmi4.c|  1 -
 drivers/gpu/drm/omapdrm/dss/hdmi4_core.c   |  1 -
 drivers/gpu/drm/omapdrm/dss/hdmi5.c|  1 -
 drivers/gpu/drm/omapdrm/dss/venc.c |  1 -
 drivers/gpu/drm/omapdrm/dss/video-pll.c|  1 -
 12 files changed, 3 insertions(+), 38 deletions(-)
 delete mode 100644 drivers/gpu/drm/omapdrm/dss/dss_features.h

diff --git a/drivers/gpu/drm/omapdrm/dss/core.c 
b/drivers/gpu/drm/omapdrm/dss/core.c
index 4f15f2d76ba0..4dabe32c7098 100644
--- a/drivers/gpu/drm/omapdrm/dss/core.c
+++ b/drivers/gpu/drm/omapdrm/dss/core.c
@@ -35,7 +35,6 @@
 
 #include "omapdss.h"
 #include "dss.h"
-#include "dss_features.h"
 
 static struct {
struct platform_device *pdev;
diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 4160d11e0930..0f4fdb221498 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -47,7 +47,6 @@
 
 #include "omapdss.h"
 #include "dss.h"
-#include "dss_features.h"
 #include "dispc.h"
 
 /* DISPC */
diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c 
b/drivers/gpu/drm/omapdrm/dss/dpi.c
index d15d17ff16d1..daf286fc8a40 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -36,7 +36,6 @@
 
 #include "omapdss.h"
 #include "dss.h"
-#include "dss_features.h"
 
 struct dpi_data {
struct platform_device *pdev;
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 0b8409d9b74b..a66d2b1a6c74 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -50,7 +50,6 @@
 
 #include "omapdss.h"
 #include "dss.h"
-#include "dss_features.h"
 
 #define DSI_CATCH_MISSING_TE
 
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c 
b/drivers/gpu/drm/omapdrm/dss/dss.c
index fa686070b6b0..d1755f12236b 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -48,7 +48,6 @@
 
 #include "omapdss.h"
 #include "dss.h"
-#include "dss_features.h"
 
 #define DSS_SZ_REGSSZ_512
 
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h 
b/drivers/gpu/drm/omapdrm/dss/dss.h
index a46d8e8a9b4b..085486024089 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss.h
@@ -27,6 +27,9 @@
 
 #include "omapdss.h"
 
+#define MAX_DSS_LCD_MANAGERS   3
+#define MAX_NUM_DSI2
+
 #ifdef pr_fmt
 #undef pr_fmt
 #endif
diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.h 
b/drivers/gpu/drm/omapdrm/dss/dss_features.h
deleted file mode 100644
index 058c30269764..
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * linux/drivers/video/omap2/dss/dss_features.h
- *
- * Copyright (C) 2010 Texas Instruments
- * Author: Archit Taneja 
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program.  If not, see .
- */
-
-#ifndef __OMAP2_DSS_FEATURES_H
-#define __OMAP2_DSS_FEATURES_H
-
-#define MAX_DSS_MANAGERS   4
-#define MAX_DSS_OVERLAYS   4
-#define MAX_DSS_LCD_MANAGERS   3
-#define MAX_NUM_DSI2
-
-#endif
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index 284b4942b9ac..2a99b11c8b5e 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -40,7 +40,6 @@
 #include "omapdss.h"
 #include "hdmi4_core.h"
 #include "dss.h"
-#include "dss_features.h"
 #include "hdmi.h"
 
 static struct omap_hdmi hdmi;
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
index 5aef83c270da..365cf07daa01 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
@@ -36,7 +36,6 @@
 #include 
 
 #include "hdmi4_core.h"
-#include "dss_features.h"
 
 #define HDMI_CORE_AV   0x500
 
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c 

[PATCH v3 34/35] drm: omapdrm: Move supported outputs feature to dss driver

2017-08-04 Thread Laurent Pinchart
The supported outputs feature is specific to the DSS, move it from the
omap_dss_features structure to the dss driver.

The omap_dss_features structure is now empty and can be removed.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/Makefile   |   2 +-
 drivers/gpu/drm/omapdrm/dss/core.c |   2 -
 drivers/gpu/drm/omapdrm/dss/dispc.c|   2 +-
 drivers/gpu/drm/omapdrm/dss/dss.c  |  86 +++--
 drivers/gpu/drm/omapdrm/dss/dss.h  |   1 +
 drivers/gpu/drm/omapdrm/dss/dss_features.c | 195 -
 drivers/gpu/drm/omapdrm/dss/dss_features.h |   4 -
 7 files changed, 81 insertions(+), 211 deletions(-)
 delete mode 100644 drivers/gpu/drm/omapdrm/dss/dss_features.c

diff --git a/drivers/gpu/drm/omapdrm/dss/Makefile 
b/drivers/gpu/drm/omapdrm/dss/Makefile
index 688195e448c5..142ce5a02542 100644
--- a/drivers/gpu/drm/omapdrm/dss/Makefile
+++ b/drivers/gpu/drm/omapdrm/dss/Makefile
@@ -5,7 +5,7 @@ omapdss-base-y := base.o display.o dss-of.o output.o
 
 obj-$(CONFIG_OMAP2_DSS) += omapdss.o
 # Core DSS files
-omapdss-y := core.o dss.o dss_features.o dispc.o dispc_coefs.o \
+omapdss-y := core.o dss.o dispc.o dispc_coefs.o \
pll.o video-pll.o
 omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o
 omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o
diff --git a/drivers/gpu/drm/omapdrm/dss/core.c 
b/drivers/gpu/drm/omapdrm/dss/core.c
index db4419b31327..4f15f2d76ba0 100644
--- a/drivers/gpu/drm/omapdrm/dss/core.c
+++ b/drivers/gpu/drm/omapdrm/dss/core.c
@@ -54,8 +54,6 @@ static int __init omap_dss_probe(struct platform_device *pdev)
 {
core.pdev = pdev;
 
-   dss_features_init(omapdss_get_version());
-
return 0;
 }
 
diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 39a10665a91f..4160d11e0930 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -2736,7 +2736,7 @@ static int dispc_ovl_enable(enum omap_plane_id plane, 
bool enable)
 
 static enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum 
omap_channel channel)
 {
-   return dss_feat_get_supported_outputs(channel);
+   return dss_get_supported_outputs(channel);
 }
 
 static void dispc_lcd_enable_signal_polarity(bool act_high)
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c 
b/drivers/gpu/drm/omapdrm/dss/dss.c
index 89bb41f42a06..fa686070b6b0 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -86,6 +86,7 @@ struct dss_features {
const char *parent_clk_name;
const enum omap_display_type *ports;
int num_ports;
+   const enum omap_dss_output_id *outputs;
const struct dss_ops *ops;
struct dss_reg_field dispc_clk_switch;
bool has_lcd_clk_src;
@@ -150,8 +151,7 @@ static void dss_save_context(void)
 
SR(CONTROL);
 
-   if (dss_feat_get_supported_outputs(OMAP_DSS_CHANNEL_LCD) &
-   OMAP_DSS_OUTPUT_SDI) {
+   if (dss.feat->outputs[OMAP_DSS_CHANNEL_LCD] & OMAP_DSS_OUTPUT_SDI) {
SR(SDI_CONTROL);
SR(PLL_CONTROL);
}
@@ -170,8 +170,7 @@ static void dss_restore_context(void)
 
RR(CONTROL);
 
-   if (dss_feat_get_supported_outputs(OMAP_DSS_CHANNEL_LCD) &
-   OMAP_DSS_OUTPUT_SDI) {
+   if (dss.feat->outputs[OMAP_DSS_CHANNEL_LCD] & OMAP_DSS_OUTPUT_SDI) {
RR(SDI_CONTROL);
RR(PLL_CONTROL);
}
@@ -401,8 +400,7 @@ static void dss_dump_regs(struct seq_file *s)
DUMPREG(DSS_SYSSTATUS);
DUMPREG(DSS_CONTROL);
 
-   if (dss_feat_get_supported_outputs(OMAP_DSS_CHANNEL_LCD) &
-   OMAP_DSS_OUTPUT_SDI) {
+   if (dss.feat->outputs[OMAP_DSS_CHANNEL_LCD] & OMAP_DSS_OUTPUT_SDI) {
DUMPREG(DSS_SDI_CONTROL);
DUMPREG(DSS_PLL_CONTROL);
DUMPREG(DSS_SDI_STATUS);
@@ -687,6 +685,11 @@ unsigned long dss_get_max_fck_rate(void)
return dss.feat->fck_freq_max;
 }
 
+enum omap_dss_output_id dss_get_supported_outputs(enum omap_channel channel)
+{
+   return dss.feat->outputs[channel];
+}
+
 static int dss_setup_default_clock(void)
 {
unsigned long max_dss_fck, prate;
@@ -737,7 +740,7 @@ void dss_select_hdmi_venc_clk_source(enum 
dss_hdmi_venc_clk_source_select src)
 {
enum omap_dss_output_id outputs;
 
-   outputs = dss_feat_get_supported_outputs(OMAP_DSS_CHANNEL_DIGIT);
+   outputs = dss.feat->outputs[OMAP_DSS_CHANNEL_DIGIT];
 
/* Complain about invalid selections */
WARN_ON((src == DSS_VENC_TV_CLK) && !(outputs & OMAP_DSS_OUTPUT_VENC));
@@ -753,7 +756,7 @@ enum dss_hdmi_venc_clk_source_select 
dss_get_hdmi_venc_clk_source(void)
 {
enum omap_dss_output_id outputs;
 
-   outputs = dss_feat_get_supported_outputs(OMAP_DSS_CHANNEL_DIGIT);
+   outputs = dss.feat->outputs[OMAP_DSS_CHANNEL_DIGIT];
if ((outputs 

[PATCH v3 28/35] drm: omapdrm: Move FEAT_DPI_USES_VDDS_DSI feature to dpi code

2017-08-04 Thread Laurent Pinchart
The FEAT_DPI_USES_VDDS_DSI feature is specific to the DPI, move it from
the omap_dss_features structure to the dpi code.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dpi.c  | 13 -
 drivers/gpu/drm/omapdrm/dss/dss_features.c |  2 --
 drivers/gpu/drm/omapdrm/dss/dss_features.h |  1 -
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c 
b/drivers/gpu/drm/omapdrm/dss/dpi.c
index 857d462b3786..ed057bdee855 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "omapdss.h"
 #include "dss.h"
@@ -565,11 +566,21 @@ static int dpi_verify_pll(struct dss_pll *pll)
return 0;
 }
 
+static const struct soc_device_attribute dpi_soc_devices[] = {
+   { .family = "OMAP3[456]*" },
+   { .family = "[AD]M37*" },
+   { /* sentinel */ }
+};
+
 static int dpi_init_regulator(struct dpi_data *dpi)
 {
struct regulator *vdds_dsi;
 
-   if (!dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
+   /*
+* The DPI uses the DSI VDDS on OMAP34xx, OMAP35xx, OMAP36xx, AM37xx and
+* DM37xx only.
+*/
+   if (!soc_device_match(dpi_soc_devices))
return 0;
 
if (dpi->vdds_dsi_reg)
diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.c 
b/drivers/gpu/drm/omapdrm/dss/dss_features.c
index 3d0bee95fb46..69da2f3e46f6 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss_features.c
@@ -171,7 +171,6 @@ static const enum dss_feat_id omap3430_dss_feat_list[] = {
FEAT_ALPHA_FIXED_ZORDER,
FEAT_FIFO_MERGE,
FEAT_OMAP3_DSI_FIFO_BUG,
-   FEAT_DPI_USES_VDDS_DSI,
 };
 
 static const enum dss_feat_id am35xx_dss_feat_list[] = {
@@ -219,7 +218,6 @@ static const enum dss_feat_id omap3630_dss_feat_list[] = {
FEAT_ALPHA_FIXED_ZORDER,
FEAT_FIFO_MERGE,
FEAT_OMAP3_DSI_FIFO_BUG,
-   FEAT_DPI_USES_VDDS_DSI,
 };
 
 static const enum dss_feat_id omap4430_es1_0_dss_feat_list[] = {
diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.h 
b/drivers/gpu/drm/omapdrm/dss/dss_features.h
index f5320c392077..5c6658782dda 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss_features.h
@@ -39,7 +39,6 @@ enum dss_feat_id {
/* Independent core clk divider */
FEAT_CORE_CLK_DIV,
FEAT_LCD_CLK_SRC,
-   FEAT_DPI_USES_VDDS_DSI,
FEAT_HANDLE_UV_SEPARATE,
FEAT_ATTR2,
FEAT_CPR,
-- 
Regards,

Laurent Pinchart

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


[PATCH v3 27/35] drm: omapdrm: Move FEAT_HDMI_* features to hdmi4 driver

2017-08-04 Thread Laurent Pinchart
The FEAT_HDMI_* features are specific to the HDMI4, move them from the
omap_dss_features structure to the hdmi4 driver.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dss_features.c |  5 
 drivers/gpu/drm/omapdrm/dss/dss_features.h |  2 --
 drivers/gpu/drm/omapdrm/dss/hdmi.h |  2 ++
 drivers/gpu/drm/omapdrm/dss/hdmi4_core.c   | 37 --
 4 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.c 
b/drivers/gpu/drm/omapdrm/dss/dss_features.c
index f2c61bcb617a..3d0bee95fb46 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss_features.c
@@ -240,7 +240,6 @@ static const enum dss_feat_id 
omap4430_es2_0_1_2_dss_feat_list[] = {
FEAT_MGR_LCD2,
FEAT_CORE_CLK_DIV,
FEAT_LCD_CLK_SRC,
-   FEAT_HDMI_CTS_SWMODE,
FEAT_HANDLE_UV_SEPARATE,
FEAT_ATTR2,
FEAT_CPR,
@@ -255,8 +254,6 @@ static const enum dss_feat_id omap4_dss_feat_list[] = {
FEAT_MGR_LCD2,
FEAT_CORE_CLK_DIV,
FEAT_LCD_CLK_SRC,
-   FEAT_HDMI_CTS_SWMODE,
-   FEAT_HDMI_AUDIO_USE_MCLK,
FEAT_HANDLE_UV_SEPARATE,
FEAT_ATTR2,
FEAT_CPR,
@@ -272,8 +269,6 @@ static const enum dss_feat_id omap5_dss_feat_list[] = {
FEAT_MGR_LCD3,
FEAT_CORE_CLK_DIV,
FEAT_LCD_CLK_SRC,
-   FEAT_HDMI_CTS_SWMODE,
-   FEAT_HDMI_AUDIO_USE_MCLK,
FEAT_HANDLE_UV_SEPARATE,
FEAT_ATTR2,
FEAT_CPR,
diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.h 
b/drivers/gpu/drm/omapdrm/dss/dss_features.h
index 61c419ac0517..f5320c392077 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss_features.h
@@ -40,8 +40,6 @@ enum dss_feat_id {
FEAT_CORE_CLK_DIV,
FEAT_LCD_CLK_SRC,
FEAT_DPI_USES_VDDS_DSI,
-   FEAT_HDMI_CTS_SWMODE,
-   FEAT_HDMI_AUDIO_USE_MCLK,
FEAT_HANDLE_UV_SEPARATE,
FEAT_ATTR2,
FEAT_CPR,
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi.h 
b/drivers/gpu/drm/omapdrm/dss/hdmi.h
index 851e5e6f6820..3738a5b397d9 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi.h
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi.h
@@ -261,6 +261,8 @@ struct hdmi_phy_data {
 
 struct hdmi_core_data {
void __iomem *base;
+   bool cts_swmode;
+   bool audio_use_mclk;
 };
 
 static inline void hdmi_write_reg(void __iomem *base_addr, const u32 idx,
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
index ed6001613405..5aef83c270da 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -757,10 +758,10 @@ int hdmi4_audio_config(struct hdmi_core_data *core, 
struct hdmi_wp_data *wp,
/* Audio clock regeneration settings */
acore.n = n;
acore.cts = cts;
-   if (dss_has_feature(FEAT_HDMI_CTS_SWMODE)) {
+   if (core->cts_swmode) {
acore.aud_par_busclk = 0;
acore.cts_mode = HDMI_AUDIO_CTS_MODE_SW;
-   acore.use_mclk = dss_has_feature(FEAT_HDMI_AUDIO_USE_MCLK);
+   acore.use_mclk = core->audio_use_mclk;
} else {
acore.aud_par_busclk = (((128 * 31) - 1) << 8);
acore.cts_mode = HDMI_AUDIO_CTS_MODE_HW;
@@ -884,10 +885,42 @@ void hdmi4_audio_stop(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp)
hdmi_wp_audio_core_req_enable(wp, false);
 }
 
+struct hdmi4_features {
+   bool cts_swmode;
+   bool audio_use_mclk;
+};
+
+static const struct hdmi4_features hdmi4_es1_features = {
+   .cts_swmode = false,
+   .audio_use_mclk = false,
+};
+
+static const struct hdmi4_features hdmi4_es2_features = {
+   .cts_swmode = true,
+   .audio_use_mclk = false,
+};
+
+static const struct hdmi4_features hdmi4_es3_features = {
+   .cts_swmode = true,
+   .audio_use_mclk = true,
+};
+
+static const struct soc_device_attribute hdmi4_soc_devices[] = {
+   { .family = "OMAP4", .revision = "ES1.?", .data = _es1_features },
+   { .family = "OMAP4", .revision = "ES2.?", .data = _es2_features },
+   { .family = "OMAP4",  .data = _es3_features },
+   { /* sentinel */ }
+};
+
 int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core)
 {
+   const struct hdmi4_features *features;
struct resource *res;
 
+   features = soc_device_match(hdmi4_soc_devices)->data;
+   core->cts_swmode = features->cts_swmode;
+   core->audio_use_mclk = features->audio_use_mclk;
+
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core");
core->base = devm_ioremap_resource(>dev, res);
if (IS_ERR(core->base))
-- 
Regards,

Laurent Pinchart

___
dri-devel mailing 

[PATCH v3 32/35] drm: omapdrm: Move PCD, LINEWIDTH and DOWNSCALE features to dispc driver

2017-08-04 Thread Laurent Pinchart
The FEAT_PARAM_DSS_PCD, FEAT_PARAM_LINEWIDTH and FEAT_PARAM_DOWNSCALE
features are specific to the DISPC, move them from the omap_dss_features
structure to the dispc driver.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dispc.c| 53 ++
 drivers/gpu/drm/omapdrm/dss/dss_features.c | 19 ---
 drivers/gpu/drm/omapdrm/dss/dss_features.h |  3 --
 3 files changed, 39 insertions(+), 36 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 23f887ce4936..49c9c46428f9 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -105,6 +105,9 @@ struct dispc_features {
u16 mgr_height_max;
unsigned long max_lcd_pclk;
unsigned long max_tv_pclk;
+   unsigned int max_downscale;
+   unsigned int max_line_width;
+   unsigned int min_pcd;
int (*calc_scaling) (unsigned long pclk, unsigned long lclk,
const struct videomode *vm,
u16 width, u16 height, u16 out_width, u16 out_height,
@@ -2207,8 +2210,7 @@ static int dispc_ovl_calc_scaling_24xx(unsigned long 
pclk, unsigned long lclk,
int error;
u16 in_width, in_height;
int min_factor = min(*decim_x, *decim_y);
-   const int maxsinglelinewidth =
-   dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
+   const int maxsinglelinewidth = dispc.feat->max_line_width;
 
*five_taps = false;
 
@@ -2252,8 +2254,7 @@ static int dispc_ovl_calc_scaling_34xx(unsigned long 
pclk, unsigned long lclk,
 {
int error;
u16 in_width, in_height;
-   const int maxsinglelinewidth =
-   dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
+   const int maxsinglelinewidth = dispc.feat->max_line_width;
 
do {
in_height = height / *decim_y;
@@ -2338,9 +2339,8 @@ static int dispc_ovl_calc_scaling_44xx(unsigned long 
pclk, unsigned long lclk,
u16 in_width, in_width_max;
int decim_x_min = *decim_x;
u16 in_height = height / *decim_y;
-   const int maxsinglelinewidth =
-   dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
-   const int maxdownscale = dss_feat_get_param_max(FEAT_PARAM_DOWNSCALE);
+   const int maxsinglelinewidth = dispc.feat->max_line_width;
+   const int maxdownscale = dispc.feat->max_downscale;
 
if (mem_to_mem) {
in_width_max = out_width * maxdownscale;
@@ -2400,7 +2400,7 @@ static int dispc_ovl_calc_scaling(unsigned long pclk, 
unsigned long lclk,
int *x_predecim, int *y_predecim, u16 pos_x,
enum omap_dss_rotation_type rotation_type, bool mem_to_mem)
 {
-   const int maxdownscale = dss_feat_get_param_max(FEAT_PARAM_DOWNSCALE);
+   const int maxdownscale = dispc.feat->max_downscale;
const int max_decim_limit = 16;
unsigned long core_clk = 0;
int decim_x, decim_y, ret;
@@ -3481,7 +3481,7 @@ int dispc_calc_clock_rates(unsigned long dispc_fclk_rate,
return 0;
 }
 
-bool dispc_div_calc(unsigned long dispc,
+bool dispc_div_calc(unsigned long dispc_freq,
unsigned long pck_min, unsigned long pck_max,
dispc_div_calc_func func, void *data)
 {
@@ -3499,19 +3499,19 @@ bool dispc_div_calc(unsigned long dispc,
min_fck_per_pck = 0;
 #endif
 
-   pckd_hw_min = dss_feat_get_param_min(FEAT_PARAM_DSS_PCD);
-   pckd_hw_max = dss_feat_get_param_max(FEAT_PARAM_DSS_PCD);
+   pckd_hw_min = dispc.feat->min_pcd;
+   pckd_hw_max = 255;
 
lck_max = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK);
 
pck_min = pck_min ? pck_min : 1;
pck_max = pck_max ? pck_max : ULONG_MAX;
 
-   lckd_start = max(DIV_ROUND_UP(dispc, lck_max), 1ul);
-   lckd_stop = min(dispc / pck_min, 255ul);
+   lckd_start = max(DIV_ROUND_UP(dispc_freq, lck_max), 1ul);
+   lckd_stop = min(dispc_freq / pck_min, 255ul);
 
for (lckd = lckd_start; lckd <= lckd_stop; ++lckd) {
-   lck = dispc / lckd;
+   lck = dispc_freq / lckd;
 
pckd_start = max(DIV_ROUND_UP(lck, pck_max), pckd_hw_min);
pckd_stop = min(lck / pck_min, pckd_hw_max);
@@ -4047,6 +4047,13 @@ static const struct dispc_features omap24xx_dispc_feats 
= {
.mgr_width_max  =   2048,
.mgr_height_max =   2048,
.max_lcd_pclk   =   6650,
+   .max_downscale  =   2,
+   /*
+* Assume the line width buffer to be 768 pixels as OMAP2 DISPC scaler
+* cannot scale an image width larger than 768.
+*/
+   .max_line_width =   768,
+   .min_pcd=   2,
.calc_scaling   =   dispc_ovl_calc_scaling_24xx,
.calc_core_clk  =   calc_core_clk_24xx,
.num_fifos 

[PATCH v3 33/35] drm: omapdrm: Move DSS_FCK feature to dss driver

2017-08-04 Thread Laurent Pinchart
The FEAT_PARAM_DSS_FCK feature is specific to the DSS, move it from the
omap_dss_features structure to the dss driver.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dispc.c|  2 +-
 drivers/gpu/drm/omapdrm/dss/dpi.c  |  2 +-
 drivers/gpu/drm/omapdrm/dss/dss.c  | 17 +--
 drivers/gpu/drm/omapdrm/dss/dss.h  |  1 +
 drivers/gpu/drm/omapdrm/dss/dss_features.c | 45 --
 drivers/gpu/drm/omapdrm/dss/dss_features.h |  8 --
 6 files changed, 18 insertions(+), 57 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 49c9c46428f9..39a10665a91f 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -3502,7 +3502,7 @@ bool dispc_div_calc(unsigned long dispc_freq,
pckd_hw_min = dispc.feat->min_pcd;
pckd_hw_max = 255;
 
-   lck_max = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK);
+   lck_max = dss_get_max_fck_rate();
 
pck_min = pck_min ? pck_min : 1;
pck_max = pck_max ? pck_max : ULONG_MAX;
diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c 
b/drivers/gpu/drm/omapdrm/dss/dpi.c
index ed057bdee855..d15d17ff16d1 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -211,7 +211,7 @@ static bool dpi_calc_pll_cb(int n, int m, unsigned long 
fint,
ctx->pll_cinfo.clkdco = clkdco;
 
return dss_pll_hsdiv_calc_a(ctx->pll, clkdco,
-   ctx->pck_min, dss_feat_get_param_max(FEAT_PARAM_DSS_FCK),
+   ctx->pck_min, dss_get_max_fck_rate(),
dpi_calc_hsdiv_cb, ctx);
 }
 
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c 
b/drivers/gpu/drm/omapdrm/dss/dss.c
index 8bb9f8de46f0..89bb41f42a06 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -81,6 +81,7 @@ struct dss_ops {
 struct dss_features {
enum dss_model model;
u8 fck_div_max;
+   unsigned int fck_freq_max;
u8 dss_fck_multiplier;
const char *parent_clk_name;
const enum omap_display_type *ports;
@@ -623,7 +624,7 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,
unsigned long prate;
unsigned m;
 
-   fck_hw_max = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK);
+   fck_hw_max = dss.feat->fck_freq_max;
 
if (dss.parent_clk == NULL) {
unsigned pckd;
@@ -681,6 +682,11 @@ unsigned long dss_get_dispc_clk_rate(void)
return dss.dss_clk_rate;
 }
 
+unsigned long dss_get_max_fck_rate(void)
+{
+   return dss.feat->fck_freq_max;
+}
+
 static int dss_setup_default_clock(void)
 {
unsigned long max_dss_fck, prate;
@@ -688,7 +694,7 @@ static int dss_setup_default_clock(void)
unsigned fck_div;
int r;
 
-   max_dss_fck = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK);
+   max_dss_fck = dss.feat->fck_freq_max;
 
if (dss.parent_clk == NULL) {
fck = clk_round_rate(dss.dss_clk, max_dss_fck);
@@ -1005,6 +1011,7 @@ static const struct dss_features omap24xx_dss_feats = {
 * from 1 to 6 has no gaps, so let's use that as a max.
 */
.fck_div_max=   6,
+   .fck_freq_max   =   13300,
.dss_fck_multiplier =   2,
.parent_clk_name=   "core_ck",
.ports  =   omap2plus_ports,
@@ -1017,6 +1024,7 @@ static const struct dss_features omap24xx_dss_feats = {
 static const struct dss_features omap34xx_dss_feats = {
.model  =   DSS_MODEL_OMAP3,
.fck_div_max=   16,
+   .fck_freq_max   =   17300,
.dss_fck_multiplier =   2,
.parent_clk_name=   "dpll4_ck",
.ports  =   omap34xx_ports,
@@ -1029,6 +1037,7 @@ static const struct dss_features omap34xx_dss_feats = {
 static const struct dss_features omap3630_dss_feats = {
.model  =   DSS_MODEL_OMAP3,
.fck_div_max=   32,
+   .fck_freq_max   =   17300,
.dss_fck_multiplier =   1,
.parent_clk_name=   "dpll4_ck",
.ports  =   omap2plus_ports,
@@ -1041,6 +1050,7 @@ static const struct dss_features omap3630_dss_feats = {
 static const struct dss_features omap44xx_dss_feats = {
.model  =   DSS_MODEL_OMAP4,
.fck_div_max=   32,
+   .fck_freq_max   =   18600,
.dss_fck_multiplier =   1,
.parent_clk_name=   "dpll_per_x2_ck",
.ports  =   omap2plus_ports,
@@ -1053,6 +1063,7 @@ static const struct dss_features omap44xx_dss_feats = {
 static const struct dss_features omap54xx_dss_feats = {
.model  =   DSS_MODEL_OMAP5,

[PATCH v3 29/35] drm: omapdrm: Move FEAT_LCD_CLK_SRC feature to dss_features structure

2017-08-04 Thread Laurent Pinchart
The FEAT_LCD_CLK_SRC feature is specific to the DSS, move it from the
omap_dss_features structure to the dss_features structure.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dss.c  | 15 +++
 drivers/gpu/drm/omapdrm/dss/dss_features.c |  4 
 drivers/gpu/drm/omapdrm/dss/dss_features.h |  1 -
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c 
b/drivers/gpu/drm/omapdrm/dss/dss.c
index d145d9eedfa7..8bb9f8de46f0 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -87,6 +87,7 @@ struct dss_features {
int num_ports;
const struct dss_ops *ops;
struct dss_reg_field dispc_clk_switch;
+   bool has_lcd_clk_src;
 };
 
 static struct {
@@ -433,8 +434,7 @@ static void dss_select_dispc_clk_source(enum dss_clk_source 
clk_src)
 * We always use PRCM clock as the DISPC func clock, except on DSS3,
 * where we don't have separate DISPC and LCD clock sources.
 */
-   if (WARN_ON(dss_has_feature(FEAT_LCD_CLK_SRC) &&
-   clk_src != DSS_CLK_SRC_FCK))
+   if (WARN_ON(dss.feat->has_lcd_clk_src && clk_src != DSS_CLK_SRC_FCK))
return;
 
switch (clk_src) {
@@ -578,7 +578,7 @@ void dss_select_lcd_clk_source(enum omap_channel channel,
int idx = dss_get_channel_index(channel);
int r;
 
-   if (!dss_has_feature(FEAT_LCD_CLK_SRC)) {
+   if (!dss.feat->has_lcd_clk_src) {
dss_select_dispc_clk_source(clk_src);
dss.lcd_clk_source[idx] = clk_src;
return;
@@ -603,7 +603,7 @@ enum dss_clk_source dss_get_dsi_clk_source(int dsi_module)
 
 enum dss_clk_source dss_get_lcd_clk_source(enum omap_channel channel)
 {
-   if (dss_has_feature(FEAT_LCD_CLK_SRC)) {
+   if (dss.feat->has_lcd_clk_src) {
int idx = dss_get_channel_index(channel);
return dss.lcd_clk_source[idx];
} else {
@@ -1011,6 +1011,7 @@ static const struct dss_features omap24xx_dss_feats = {
.num_ports  =   ARRAY_SIZE(omap2plus_ports),
.ops=   _ops_omap2_omap3,
.dispc_clk_switch   =   { 0, 0 },
+   .has_lcd_clk_src=   false,
 };
 
 static const struct dss_features omap34xx_dss_feats = {
@@ -1022,6 +1023,7 @@ static const struct dss_features omap34xx_dss_feats = {
.num_ports  =   ARRAY_SIZE(omap34xx_ports),
.ops=   _ops_omap2_omap3,
.dispc_clk_switch   =   { 0, 0 },
+   .has_lcd_clk_src=   false,
 };
 
 static const struct dss_features omap3630_dss_feats = {
@@ -1033,6 +1035,7 @@ static const struct dss_features omap3630_dss_feats = {
.num_ports  =   ARRAY_SIZE(omap2plus_ports),
.ops=   _ops_omap2_omap3,
.dispc_clk_switch   =   { 0, 0 },
+   .has_lcd_clk_src=   false,
 };
 
 static const struct dss_features omap44xx_dss_feats = {
@@ -1044,6 +1047,7 @@ static const struct dss_features omap44xx_dss_feats = {
.num_ports  =   ARRAY_SIZE(omap2plus_ports),
.ops=   _ops_omap4,
.dispc_clk_switch   =   { 9, 8 },
+   .has_lcd_clk_src=   true,
 };
 
 static const struct dss_features omap54xx_dss_feats = {
@@ -1055,6 +1059,7 @@ static const struct dss_features omap54xx_dss_feats = {
.num_ports  =   ARRAY_SIZE(omap2plus_ports),
.ops=   _ops_omap5,
.dispc_clk_switch   =   { 9, 7 },
+   .has_lcd_clk_src=   true,
 };
 
 static const struct dss_features am43xx_dss_feats = {
@@ -1066,6 +1071,7 @@ static const struct dss_features am43xx_dss_feats = {
.num_ports  =   ARRAY_SIZE(omap2plus_ports),
.ops=   _ops_omap2_omap3,
.dispc_clk_switch   =   { 0, 0 },
+   .has_lcd_clk_src=   true,
 };
 
 static const struct dss_features dra7xx_dss_feats = {
@@ -1077,6 +1083,7 @@ static const struct dss_features dra7xx_dss_feats = {
.num_ports  =   ARRAY_SIZE(dra7xx_ports),
.ops=   _ops_dra7,
.dispc_clk_switch   =   { 9, 7 },
+   .has_lcd_clk_src=   true,
 };
 
 static int dss_init_ports(struct platform_device *pdev)
diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.c 
b/drivers/gpu/drm/omapdrm/dss/dss_features.c
index 69da2f3e46f6..24870c1137fe 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss_features.c
@@ -223,7 +223,6 @@ static const enum dss_feat_id omap3630_dss_feat_list[] = {
 static const enum dss_feat_id omap4430_es1_0_dss_feat_list[] = {
FEAT_MGR_LCD2,
FEAT_CORE_CLK_DIV,
-  

[PATCH v3 30/35] drm: omapdrm: Move FEAT_* features to dispc driver

2017-08-04 Thread Laurent Pinchart
All the remaining FEAT_* features are specific to the DISPC, move them
from the omap_dss_features structure to the dispc driver.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dispc.c| 257 +
 drivers/gpu/drm/omapdrm/dss/dss_features.c | 171 ---
 drivers/gpu/drm/omapdrm/dss/dss_features.h |  28 
 3 files changed, 190 insertions(+), 266 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 3ad52c04a299..23f887ce4936 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -65,6 +65,33 @@ enum omap_burst_size {
 #define REG_FLD_MOD(idx, val, start, end)  \
dispc_write_reg(idx, FLD_MOD(dispc_read_reg(idx), val, start, end))
 
+/* DISPC has feature id */
+enum dispc_feature_id {
+   FEAT_LCDENABLEPOL,
+   FEAT_LCDENABLESIGNAL,
+   FEAT_PCKFREEENABLE,
+   FEAT_FUNCGATED,
+   FEAT_MGR_LCD2,
+   FEAT_MGR_LCD3,
+   FEAT_LINEBUFFERSPLIT,
+   FEAT_ROWREPEATENABLE,
+   FEAT_RESIZECONF,
+   /* Independent core clk divider */
+   FEAT_CORE_CLK_DIV,
+   FEAT_HANDLE_UV_SEPARATE,
+   FEAT_ATTR2,
+   FEAT_CPR,
+   FEAT_PRELOAD,
+   FEAT_FIR_COEF_V,
+   FEAT_ALPHA_FIXED_ZORDER,
+   FEAT_ALPHA_FREE_ZORDER,
+   FEAT_FIFO_MERGE,
+   /* An unknown HW bug causing the normal FIFO thresholds not to work */
+   FEAT_OMAP3_DSI_FIFO_BUG,
+   FEAT_BURST_2D,
+   FEAT_MFLAG,
+};
+
 struct dispc_features {
u8 sw_start;
u8 fp_start;
@@ -88,6 +115,8 @@ struct dispc_features {
u16 width, u16 height, u16 out_width, u16 out_height,
bool mem_to_mem);
u8 num_fifos;
+   const enum dispc_feature_id *features;
+   unsigned int num_features;
const struct dss_reg_field *reg_fields;
const unsigned int num_reg_fields;
const enum omap_overlay_caps *overlay_caps;
@@ -384,6 +413,18 @@ static void dispc_get_reg_field(enum dispc_feat_reg_field 
id,
*end = dispc.feat->reg_fields[id].end;
 }
 
+static bool dispc_has_feature(enum dispc_feature_id id)
+{
+   unsigned int i;
+
+   for (i = 0; i < dispc.feat->num_features; i++) {
+   if (dispc.feat->features[i] == id)
+   return true;
+   }
+
+   return false;
+}
+
 #define SR(reg) \
dispc.ctx[DISPC_##reg / sizeof(u32)] = dispc_read_reg(DISPC_##reg)
 #define RR(reg) \
@@ -399,14 +440,14 @@ static void dispc_save_context(void)
SR(CONTROL);
SR(CONFIG);
SR(LINE_NUMBER);
-   if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER) ||
-   dss_has_feature(FEAT_ALPHA_FREE_ZORDER))
+   if (dispc_has_feature(FEAT_ALPHA_FIXED_ZORDER) ||
+   dispc_has_feature(FEAT_ALPHA_FREE_ZORDER))
SR(GLOBAL_ALPHA);
-   if (dss_has_feature(FEAT_MGR_LCD2)) {
+   if (dispc_has_feature(FEAT_MGR_LCD2)) {
SR(CONTROL2);
SR(CONFIG2);
}
-   if (dss_has_feature(FEAT_MGR_LCD3)) {
+   if (dispc_has_feature(FEAT_MGR_LCD3)) {
SR(CONTROL3);
SR(CONFIG3);
}
@@ -426,7 +467,7 @@ static void dispc_save_context(void)
SR(DATA_CYCLE2(i));
SR(DATA_CYCLE3(i));
 
-   if (dss_has_feature(FEAT_CPR)) {
+   if (dispc_has_feature(FEAT_CPR)) {
SR(CPR_COEF_R(i));
SR(CPR_COEF_G(i));
SR(CPR_COEF_B(i));
@@ -442,7 +483,7 @@ static void dispc_save_context(void)
SR(OVL_FIFO_THRESHOLD(i));
SR(OVL_ROW_INC(i));
SR(OVL_PIXEL_INC(i));
-   if (dss_has_feature(FEAT_PRELOAD))
+   if (dispc_has_feature(FEAT_PRELOAD))
SR(OVL_PRELOAD(i));
if (i == OMAP_DSS_GFX) {
SR(OVL_WINDOW_SKIP(i));
@@ -463,12 +504,12 @@ static void dispc_save_context(void)
for (j = 0; j < 5; j++)
SR(OVL_CONV_COEF(i, j));
 
-   if (dss_has_feature(FEAT_FIR_COEF_V)) {
+   if (dispc_has_feature(FEAT_FIR_COEF_V)) {
for (j = 0; j < 8; j++)
SR(OVL_FIR_COEF_V(i, j));
}
 
-   if (dss_has_feature(FEAT_HANDLE_UV_SEPARATE)) {
+   if (dispc_has_feature(FEAT_HANDLE_UV_SEPARATE)) {
SR(OVL_BA0_UV(i));
SR(OVL_BA1_UV(i));
SR(OVL_FIR2(i));
@@ -484,11 +525,11 @@ static void dispc_save_context(void)
for (j = 0; j < 8; j++)
SR(OVL_FIR_COEF_V2(i, j));
}
-   if (dss_has_feature(FEAT_ATTR2))
+   if 

[PATCH v3 31/35] drm: omapdrm: Move FEAT_PARAM_DSI* features to dsi driver

2017-08-04 Thread Laurent Pinchart
The FEAT_PARAM_DSI* features are specific to the DSI, move them from the
omap_dss_features structure to the dsi driver.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dsi.c  | 25 +++--
 drivers/gpu/drm/omapdrm/dss/dss_features.c |  6 --
 drivers/gpu/drm/omapdrm/dss/dss_features.h |  2 --
 3 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 1af2c5329c99..0b8409d9b74b 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -326,6 +326,8 @@ struct dsi_of_data {
enum dsi_model model;
const struct dss_pll_hw *pll_hw;
const struct dsi_module_id_data *modules;
+   unsigned int max_fck_freq;
+   unsigned int max_pll_lpdiv;
enum dsi_quirks quirks;
 };
 
@@ -1323,7 +1325,7 @@ static int dsi_set_lp_clk_divisor(struct platform_device 
*dsidev)
unsigned long dsi_fclk;
unsigned lp_clk_div;
unsigned long lp_clk;
-   unsigned lpdiv_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_LPDIV);
+   unsigned lpdiv_max = dsi->data->max_pll_lpdiv;
 
 
lp_clk_div = dsi->user_lp_cinfo.lp_clk_div;
@@ -1400,11 +1402,12 @@ static int dsi_pll_power(struct platform_device *dsidev,
 }
 
 
-static void dsi_pll_calc_dsi_fck(struct dss_pll_clock_info *cinfo)
+static void dsi_pll_calc_dsi_fck(struct dsi_data *dsi,
+struct dss_pll_clock_info *cinfo)
 {
unsigned long max_dsi_fck;
 
-   max_dsi_fck = dss_feat_get_param_max(FEAT_PARAM_DSI_FCK);
+   max_dsi_fck = dsi->data->max_fck_freq;
 
cinfo->mX[HSDIV_DSI] = DIV_ROUND_UP(cinfo->clkdco, max_dsi_fck);
cinfo->clkout[HSDIV_DSI] = cinfo->clkdco / cinfo->mX[HSDIV_DSI];
@@ -4537,6 +4540,7 @@ static bool dsi_cm_calc_pll_cb(int n, int m, unsigned 
long fint,
unsigned long clkdco, void *data)
 {
struct dsi_clk_calc_ctx *ctx = data;
+   struct dsi_data *dsi = dsi_get_dsidrv_data(ctx->dsidev);
 
ctx->dsi_cinfo.n = n;
ctx->dsi_cinfo.m = m;
@@ -4544,7 +4548,7 @@ static bool dsi_cm_calc_pll_cb(int n, int m, unsigned 
long fint,
ctx->dsi_cinfo.clkdco = clkdco;
 
return dss_pll_hsdiv_calc_a(ctx->pll, clkdco, ctx->req_pck_min,
-   dss_feat_get_param_max(FEAT_PARAM_DSS_FCK),
+   dsi->data->max_fck_freq,
dsi_cm_calc_hsdiv_cb, ctx);
 }
 
@@ -4836,6 +4840,7 @@ static bool dsi_vm_calc_pll_cb(int n, int m, unsigned 
long fint,
unsigned long clkdco, void *data)
 {
struct dsi_clk_calc_ctx *ctx = data;
+   struct dsi_data *dsi = dsi_get_dsidrv_data(ctx->dsidev);
 
ctx->dsi_cinfo.n = n;
ctx->dsi_cinfo.m = m;
@@ -4843,7 +4848,7 @@ static bool dsi_vm_calc_pll_cb(int n, int m, unsigned 
long fint,
ctx->dsi_cinfo.clkdco = clkdco;
 
return dss_pll_hsdiv_calc_a(ctx->pll, clkdco, ctx->req_pck_min,
-   dss_feat_get_param_max(FEAT_PARAM_DSS_FCK),
+   dsi->data->max_fck_freq,
dsi_vm_calc_hsdiv_cb, ctx);
 }
 
@@ -4914,7 +4919,7 @@ static int dsi_set_config(struct omap_dss_device *dssdev,
goto err;
}
 
-   dsi_pll_calc_dsi_fck(_cinfo);
+   dsi_pll_calc_dsi_fck(dsi, _cinfo);
 
r = dsi_lp_clock_calc(ctx.dsi_cinfo.clkout[HSDIV_DSI],
config->lp_clk_min, config->lp_clk_max, >user_lp_cinfo);
@@ -5335,6 +5340,8 @@ static const struct dsi_of_data dsi_of_data_omap34xx = {
{ .address = 0x4804fc00, .id = 0, },
{ },
},
+   .max_fck_freq = 17300,
+   .max_pll_lpdiv = (1 << 13) - 1,
.quirks = DSI_QUIRK_REVERSE_TXCLKESC,
 };
 
@@ -5345,6 +5352,8 @@ static const struct dsi_of_data dsi_of_data_omap36xx = {
{ .address = 0x4804fc00, .id = 0, },
{ },
},
+   .max_fck_freq = 17300,
+   .max_pll_lpdiv = (1 << 13) - 1,
.quirks = DSI_QUIRK_PLL_PWR_BUG,
 };
 
@@ -5356,6 +5365,8 @@ static const struct dsi_of_data dsi_of_data_omap4 = {
{ .address = 0x58005000, .id = 1, },
{ },
},
+   .max_fck_freq = 17000,
+   .max_pll_lpdiv = (1 << 13) - 1,
.quirks = DSI_QUIRK_DCS_CMD_CONFIG_VC | DSI_QUIRK_VC_OCP_WIDTH
| DSI_QUIRK_GNQ,
 };
@@ -5368,6 +5379,8 @@ static const struct dsi_of_data dsi_of_data_omap5 = {
{ .address = 0x58009000, .id = 1, },
{ },
},
+   .max_fck_freq = 20925,
+   .max_pll_lpdiv = (1 << 13) - 1,
.quirks = DSI_QUIRK_DCS_CMD_CONFIG_VC | DSI_QUIRK_VC_OCP_WIDTH
| DSI_QUIRK_GNQ | DSI_QUIRK_PHY_DCC,
 };
diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.c 
b/drivers/gpu/drm/omapdrm/dss/dss_features.c
index e28c9f2d35fb..1d35cc80b363 100644
--- 

[PATCH v3 25/35] drm: omapdrm: Move FEAT_VENC_REQUIRES_TV_DAC_CLK to venc driver

2017-08-04 Thread Laurent Pinchart
The FEAT_VENC_REQUIRES_TV_DAC_CLK is specific to the VENC, move it from
the omap_dss_features structure to the venc driver.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dss_features.c |  2 --
 drivers/gpu/drm/omapdrm/dss/dss_features.h |  1 -
 drivers/gpu/drm/omapdrm/dss/venc.c | 14 +-
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.c 
b/drivers/gpu/drm/omapdrm/dss/dss_features.c
index b0a07c6558cd..dcdc66be28de 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss_features.c
@@ -166,7 +166,6 @@ static const enum dss_feat_id omap3430_dss_feat_list[] = {
FEAT_ROWREPEATENABLE,
FEAT_RESIZECONF,
FEAT_DSI_REVERSE_TXCLKESC,
-   FEAT_VENC_REQUIRES_TV_DAC_CLK,
FEAT_CPR,
FEAT_PRELOAD,
FEAT_FIR_COEF_V,
@@ -185,7 +184,6 @@ static const enum dss_feat_id am35xx_dss_feat_list[] = {
FEAT_ROWREPEATENABLE,
FEAT_RESIZECONF,
FEAT_DSI_REVERSE_TXCLKESC,
-   FEAT_VENC_REQUIRES_TV_DAC_CLK,
FEAT_CPR,
FEAT_PRELOAD,
FEAT_FIR_COEF_V,
diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.h 
b/drivers/gpu/drm/omapdrm/dss/dss_features.h
index 24c57c55e785..f296bc77f220 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss_features.h
@@ -50,7 +50,6 @@ enum dss_feat_id {
FEAT_HDMI_AUDIO_USE_MCLK,
FEAT_HANDLE_UV_SEPARATE,
FEAT_ATTR2,
-   FEAT_VENC_REQUIRES_TV_DAC_CLK,
FEAT_CPR,
FEAT_PRELOAD,
FEAT_FIR_COEF_V,
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c 
b/drivers/gpu/drm/omapdrm/dss/venc.c
index 9e4fc000e961..b0a85b10fa38 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "omapdss.h"
 #include "dss.h"
@@ -309,6 +310,7 @@ static struct {
struct videomode vm;
enum omap_dss_venc_type type;
bool invert_polarity;
+   bool requires_tv_dac_clk;
 
struct omap_dss_device output;
 } venc;
@@ -691,7 +693,7 @@ static int venc_get_clocks(struct platform_device *pdev)
 {
struct clk *clk;
 
-   if (dss_has_feature(FEAT_VENC_REQUIRES_TV_DAC_CLK)) {
+   if (venc.requires_tv_dac_clk) {
clk = devm_clk_get(>dev, "tv_dac_clk");
if (IS_ERR(clk)) {
DSSERR("can't get tv_dac_clk\n");
@@ -826,6 +828,12 @@ static int venc_probe_of(struct platform_device *pdev)
 }
 
 /* VENC HW IP initialisation */
+static const struct soc_device_attribute venc_soc_devices[] = {
+   { .machine = "OMAP3[45]*" },
+   { .machine = "AM35*" },
+   { /* sentinel */ }
+};
+
 static int venc_bind(struct device *dev, struct device *master, void *data)
 {
struct platform_device *pdev = to_platform_device(dev);
@@ -835,6 +843,10 @@ static int venc_bind(struct device *dev, struct device 
*master, void *data)
 
venc.pdev = pdev;
 
+   /* The OMAP34xx, OMAP35xx and AM35xx VENC require the TV DAC clock. */
+   if (soc_device_match(venc_soc_devices))
+   venc.requires_tv_dac_clk = true;
+
mutex_init(_lock);
 
venc.wss_data = 0;
-- 
Regards,

Laurent Pinchart

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


[PATCH v3 24/35] drm: omapdrm: Move reg_fields to dispc_features structure

2017-08-04 Thread Laurent Pinchart
The reg_fields feature describes DISPC registers only. Move it from the
omap_dss_features structure to the dispc_features structure.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dispc.c| 87 +
 drivers/gpu/drm/omapdrm/dss/dss_features.c | 89 --
 drivers/gpu/drm/omapdrm/dss/dss_features.h | 12 
 3 files changed, 76 insertions(+), 112 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 839425ad8a75..3ad52c04a299 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -88,6 +88,8 @@ struct dispc_features {
u16 width, u16 height, u16 out_width, u16 out_height,
bool mem_to_mem);
u8 num_fifos;
+   const struct dss_reg_field *reg_fields;
+   const unsigned int num_reg_fields;
const enum omap_overlay_caps *overlay_caps;
const u32 **supported_color_modes;
unsigned int num_mgrs;
@@ -188,6 +190,17 @@ enum mgr_reg_fields {
DISPC_MGR_FLD_NUM,
 };
 
+/* DISPC register field id */
+enum dispc_feat_reg_field {
+   FEAT_REG_FIRHINC,
+   FEAT_REG_FIRVINC,
+   FEAT_REG_FIFOHIGHTHRESHOLD,
+   FEAT_REG_FIFOLOWTHRESHOLD,
+   FEAT_REG_FIFOSIZE,
+   FEAT_REG_HORIZONTALACCU,
+   FEAT_REG_VERTICALACCU,
+};
+
 struct dispc_reg_field {
u16 reg;
u8 high;
@@ -361,6 +374,16 @@ static int dispc_get_num_mgrs(void)
return dispc.feat->num_mgrs;
 }
 
+static void dispc_get_reg_field(enum dispc_feat_reg_field id,
+   u8 *start, u8 *end)
+{
+   if (id >= dispc.feat->num_reg_fields)
+   BUG();
+
+   *start = dispc.feat->reg_fields[id].start;
+   *end = dispc.feat->reg_fields[id].end;
+}
+
 #define SR(reg) \
dispc.ctx[DISPC_##reg / sizeof(u32)] = dispc_read_reg(DISPC_##reg)
 #define RR(reg) \
@@ -1252,7 +1275,7 @@ static void dispc_init_fifos(void)
 
unit = dispc.feat->buffer_size_unit;
 
-   dss_feat_get_reg_field(FEAT_REG_FIFOSIZE, , );
+   dispc_get_reg_field(FEAT_REG_FIFOSIZE, , );
 
for (fifo = 0; fifo < dispc.feat->num_fifos; ++fifo) {
size = REG_GET(DISPC_OVL_FIFO_SIZE_STATUS(fifo), start, end);
@@ -1342,8 +1365,8 @@ void dispc_ovl_set_fifo_threshold(enum omap_plane_id 
plane, u32 low,
low /= unit;
high /= unit;
 
-   dss_feat_get_reg_field(FEAT_REG_FIFOHIGHTHRESHOLD, _start, _end);
-   dss_feat_get_reg_field(FEAT_REG_FIFOLOWTHRESHOLD, _start, _end);
+   dispc_get_reg_field(FEAT_REG_FIFOHIGHTHRESHOLD, _start, _end);
+   dispc_get_reg_field(FEAT_REG_FIFOLOWTHRESHOLD, _start, _end);
 
DSSDBG("fifo(%d) threshold (bytes), old %u/%u, new %u/%u\n",
plane,
@@ -1510,10 +1533,8 @@ static void dispc_ovl_set_fir(enum omap_plane_id plane,
if (color_comp == DISPC_COLOR_COMPONENT_RGB_Y) {
u8 hinc_start, hinc_end, vinc_start, vinc_end;
 
-   dss_feat_get_reg_field(FEAT_REG_FIRHINC,
-   _start, _end);
-   dss_feat_get_reg_field(FEAT_REG_FIRVINC,
-   _start, _end);
+   dispc_get_reg_field(FEAT_REG_FIRHINC, _start, _end);
+   dispc_get_reg_field(FEAT_REG_FIRVINC, _start, _end);
val = FLD_VAL(vinc, vinc_start, vinc_end) |
FLD_VAL(hinc, hinc_start, hinc_end);
 
@@ -1530,8 +1551,8 @@ static void dispc_ovl_set_vid_accu0(enum omap_plane_id 
plane, int haccu,
u32 val;
u8 hor_start, hor_end, vert_start, vert_end;
 
-   dss_feat_get_reg_field(FEAT_REG_HORIZONTALACCU, _start, _end);
-   dss_feat_get_reg_field(FEAT_REG_VERTICALACCU, _start, _end);
+   dispc_get_reg_field(FEAT_REG_HORIZONTALACCU, _start, _end);
+   dispc_get_reg_field(FEAT_REG_VERTICALACCU, _start, _end);
 
val = FLD_VAL(vaccu, vert_start, vert_end) |
FLD_VAL(haccu, hor_start, hor_end);
@@ -1545,8 +1566,8 @@ static void dispc_ovl_set_vid_accu1(enum omap_plane_id 
plane, int haccu,
u32 val;
u8 hor_start, hor_end, vert_start, vert_end;
 
-   dss_feat_get_reg_field(FEAT_REG_HORIZONTALACCU, _start, _end);
-   dss_feat_get_reg_field(FEAT_REG_VERTICALACCU, _start, _end);
+   dispc_get_reg_field(FEAT_REG_HORIZONTALACCU, _start, _end);
+   dispc_get_reg_field(FEAT_REG_VERTICALACCU, _start, _end);
 
val = FLD_VAL(vaccu, vert_start, vert_end) |
FLD_VAL(haccu, hor_start, hor_end);
@@ -3711,6 +3732,36 @@ static void _omap_dispc_initial_config(void)
dispc_init_mflag();
 }
 
+static const struct dss_reg_field omap2_dispc_reg_fields[] = {
+   [FEAT_REG_FIRHINC]  = { 11, 0 },
+   [FEAT_REG_FIRVINC]  = { 27, 16 },
+   

[PATCH v3 21/35] drm: omapdrm: Move overlay caps features to dispc_features structure

2017-08-04 Thread Laurent Pinchart
The overlay_caps is a dispc feature. Move it from the omap_dss_features
structure to the dispc_features structure.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dispc.c| 106 +++--
 drivers/gpu/drm/omapdrm/dss/dss_features.c |  79 -
 drivers/gpu/drm/omapdrm/dss/dss_features.h |   1 -
 3 files changed, 102 insertions(+), 84 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
b/drivers/gpu/drm/omapdrm/dss/dispc.c
index f3ae7f16e65c..c013bfd66865 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -88,6 +88,7 @@ struct dispc_features {
u16 width, u16 height, u16 out_width, u16 out_height,
bool mem_to_mem);
u8 num_fifos;
+   const enum omap_overlay_caps *overlay_caps;
const u32 **supported_color_modes;
unsigned int buffer_size_unit;
unsigned int burst_size_unit;
@@ -2568,7 +2569,7 @@ static int dispc_ovl_setup(enum omap_plane_id plane,
enum omap_channel channel)
 {
int r;
-   enum omap_overlay_caps caps = dss_feat_get_overlay_caps(plane);
+   enum omap_overlay_caps caps = dispc.feat->overlay_caps[plane];
const bool replication = true;
 
DSSDBG("dispc_ovl_setup %d, pa %pad, pa_uv %pad, sw %d, %d,%d, %dx%d ->"
@@ -3708,6 +3709,70 @@ static void _omap_dispc_initial_config(void)
dispc_init_mflag();
 }
 
+static const enum omap_overlay_caps omap2_dispc_overlay_caps[] = {
+   /* OMAP_DSS_GFX */
+   OMAP_DSS_OVL_CAP_POS | OMAP_DSS_OVL_CAP_REPLICATION,
+
+   /* OMAP_DSS_VIDEO1 */
+   OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_POS |
+   OMAP_DSS_OVL_CAP_REPLICATION,
+
+   /* OMAP_DSS_VIDEO2 */
+   OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_POS |
+   OMAP_DSS_OVL_CAP_REPLICATION,
+};
+
+static const enum omap_overlay_caps omap3430_dispc_overlay_caps[] = {
+   /* OMAP_DSS_GFX */
+   OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | OMAP_DSS_OVL_CAP_POS |
+   OMAP_DSS_OVL_CAP_REPLICATION,
+
+   /* OMAP_DSS_VIDEO1 */
+   OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_POS |
+   OMAP_DSS_OVL_CAP_REPLICATION,
+
+   /* OMAP_DSS_VIDEO2 */
+   OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
+   OMAP_DSS_OVL_CAP_POS | OMAP_DSS_OVL_CAP_REPLICATION,
+};
+
+static const enum omap_overlay_caps omap3630_dispc_overlay_caps[] = {
+   /* OMAP_DSS_GFX */
+   OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA |
+   OMAP_DSS_OVL_CAP_POS | OMAP_DSS_OVL_CAP_REPLICATION,
+
+   /* OMAP_DSS_VIDEO1 */
+   OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_POS |
+   OMAP_DSS_OVL_CAP_REPLICATION,
+
+   /* OMAP_DSS_VIDEO2 */
+   OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
+   OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_POS |
+   OMAP_DSS_OVL_CAP_REPLICATION,
+};
+
+static const enum omap_overlay_caps omap4_dispc_overlay_caps[] = {
+   /* OMAP_DSS_GFX */
+   OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA |
+   OMAP_DSS_OVL_CAP_ZORDER | OMAP_DSS_OVL_CAP_POS |
+   OMAP_DSS_OVL_CAP_REPLICATION,
+
+   /* OMAP_DSS_VIDEO1 */
+   OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
+   OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER |
+   OMAP_DSS_OVL_CAP_POS | OMAP_DSS_OVL_CAP_REPLICATION,
+
+   /* OMAP_DSS_VIDEO2 */
+   OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
+   OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER |
+   OMAP_DSS_OVL_CAP_POS | OMAP_DSS_OVL_CAP_REPLICATION,
+
+   /* OMAP_DSS_VIDEO3 */
+   OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
+   OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER |
+   OMAP_DSS_OVL_CAP_POS | OMAP_DSS_OVL_CAP_REPLICATION,
+};
+
 #define COLOR_ARRAY(arr...) (const u32[]) { arr, 0 }
 
 static const u32 *omap2_dispc_supported_color_modes[] = {
@@ -3823,6 +3888,7 @@ static const struct dispc_features omap24xx_dispc_feats = 
{
.calc_scaling   =   dispc_ovl_calc_scaling_24xx,
.calc_core_clk  =   calc_core_clk_24xx,
.num_fifos  =   3,
+   .overlay_caps   =   omap2_dispc_overlay_caps,
.supported_color_modes  =   omap2_dispc_supported_color_modes,
.buffer_size_unit   =   1,
.burst_size_unit=   8,
@@ -3847,6 +3913,7 @@ static const struct dispc_features 
omap34xx_rev1_0_dispc_feats = {
.calc_scaling   =   dispc_ovl_calc_scaling_34xx,
.calc_core_clk  =   calc_core_clk_34xx,
.num_fifos  =   3,
+   .overlay_caps   =   omap3430_dispc_overlay_caps,

[PATCH v3 26/35] drm: omapdrm: Move FEAT_DSI_* features to dsi driver

2017-08-04 Thread Laurent Pinchart
The FEAT_DSI_* features are specific to the DSI, move them from the
omap_dss_features structure to the dsi driver.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dsi.c  | 137 ++---
 drivers/gpu/drm/omapdrm/dss/dss_features.c |  16 
 drivers/gpu/drm/omapdrm/dss/dss_features.h |   7 --
 3 files changed, 88 insertions(+), 72 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 3d98e9ce9a43..1af2c5329c99 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -44,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -312,10 +313,20 @@ struct dsi_module_id_data {
int id;
 };
 
+enum dsi_quirks {
+   DSI_QUIRK_PLL_PWR_BUG = (1 << 0),   /* DSI-PLL power command 0x3 is 
not working */
+   DSI_QUIRK_DCS_CMD_CONFIG_VC = (1 << 1),
+   DSI_QUIRK_VC_OCP_WIDTH = (1 << 2),
+   DSI_QUIRK_REVERSE_TXCLKESC = (1 << 3),
+   DSI_QUIRK_GNQ = (1 << 4),
+   DSI_QUIRK_PHY_DCC = (1 << 5),
+};
+
 struct dsi_of_data {
enum dsi_model model;
const struct dss_pll_hw *pll_hw;
const struct dsi_module_id_data *modules;
+   enum dsi_quirks quirks;
 };
 
 struct dsi_data {
@@ -418,8 +429,6 @@ struct dsi_packet_sent_handler_data {
struct completion *completion;
 };
 
-static const struct of_device_id dsi_of_match[];
-
 #ifdef DSI_PERF_MEASURE
 static bool dsi_perf;
 module_param(dsi_perf, bool, 0644);
@@ -1202,6 +1211,7 @@ static int dsi_regulator_init(struct platform_device 
*dsidev)
 
 static void _dsi_print_reset_status(struct platform_device *dsidev)
 {
+   struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
u32 l;
int b0, b1, b2;
 
@@ -1210,7 +1220,7 @@ static void _dsi_print_reset_status(struct 
platform_device *dsidev)
 * I/O. */
l = dsi_read_reg(dsidev, DSI_DSIPHY_CFG5);
 
-   if (dss_has_feature(FEAT_DSI_REVERSE_TXCLKESC)) {
+   if (dsi->data->quirks & DSI_QUIRK_REVERSE_TXCLKESC) {
b0 = 28;
b1 = 27;
b2 = 26;
@@ -1365,11 +1375,12 @@ enum dsi_pll_power_state {
 static int dsi_pll_power(struct platform_device *dsidev,
enum dsi_pll_power_state state)
 {
+   struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
int t = 0;
 
/* DSI-PLL power command 0x3 is not working */
-   if (dss_has_feature(FEAT_DSI_PLL_PWR_BUG) &&
-   state == DSI_PLL_POWER_ON_DIV)
+   if ((dsi->data->quirks & DSI_QUIRK_PLL_PWR_BUG) &&
+   state == DSI_PLL_POWER_ON_DIV)
state = DSI_PLL_POWER_ON_ALL;
 
/* PLL_PWR_CMD */
@@ -1789,13 +1800,14 @@ static int dsi_cio_power(struct platform_device *dsidev,
 
 static unsigned dsi_get_line_buf_size(struct platform_device *dsidev)
 {
+   struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
int val;
 
/* line buffer on OMAP3 is 1024 x 24bits */
/* XXX: for some reason using full buffer size causes
 * considerable TX slowdown with update sizes that fill the
 * whole buffer */
-   if (!dss_has_feature(FEAT_DSI_GNQ))
+   if (!(dsi->data->quirks & DSI_QUIRK_GNQ))
return 1023 * 3;
 
val = REG_GET(dsidev, DSI_GNQ, 14, 12); /* VP1_LINE_BUFFER_SIZE */
@@ -1888,6 +1900,7 @@ static inline unsigned ddr2ns(struct platform_device 
*dsidev, unsigned ddr)
 
 static void dsi_cio_timings(struct platform_device *dsidev)
 {
+   struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
u32 r;
u32 ths_prepare, ths_prepare_ths_zero, ths_trail, ths_exit;
u32 tlpx_half, tclk_trail, tclk_zero;
@@ -1950,7 +1963,7 @@ static void dsi_cio_timings(struct platform_device 
*dsidev)
r = FLD_MOD(r, tclk_trail, 15, 8);
r = FLD_MOD(r, tclk_zero, 7, 0);
 
-   if (dss_has_feature(FEAT_DSI_PHY_DCC)) {
+   if (dsi->data->quirks & DSI_QUIRK_PHY_DCC) {
r = FLD_MOD(r, 0, 21, 21);  /* DCCEN = disable */
r = FLD_MOD(r, 1, 22, 22);  /* CLKINP_DIVBY2EN = enable */
r = FLD_MOD(r, 1, 23, 23);  /* CLKINP_SEL = enable */
@@ -2022,7 +2035,7 @@ static int dsi_cio_wait_tx_clk_esc_reset(struct 
platform_device *dsidev)
static const u8 offsets_new[] = { 24, 25, 26, 27, 28 };
const u8 *offsets;
 
-   if (dss_has_feature(FEAT_DSI_REVERSE_TXCLKESC))
+   if (dsi->data->quirks & DSI_QUIRK_REVERSE_TXCLKESC)
offsets = offsets_old;
else
offsets = offsets_new;
@@ -2513,7 +2526,7 @@ static void dsi_vc_initial_config(struct platform_device 
*dsidev, int channel)
r = FLD_MOD(r, 1, 7, 7); /* CS_TX_EN */
r = FLD_MOD(r, 1, 8, 8); /* ECC_TX_EN */
r = FLD_MOD(r, 0, 9, 9); /* MODE_SPEED, high speed on/off */
-   if (dss_has_feature(FEAT_DSI_VC_OCP_WIDTH))
+   if (dsi->data->quirks & 

[PATCH v3 20/35] drm: omapdrm: Move color modes feature to dispc_features structure

2017-08-04 Thread Laurent Pinchart
The supported_color_modes is a dispc feature. Move it from the
omap_dss_features structure to the dispc_features structure.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dispc.c| 127 +++-
 drivers/gpu/drm/omapdrm/dss/dss_features.c | 130 -
 drivers/gpu/drm/omapdrm/dss/dss_features.h |   3 -
 3 files changed, 124 insertions(+), 136 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 99a308446283..f3ae7f16e65c 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -88,6 +88,7 @@ struct dispc_features {
u16 width, u16 height, u16 out_width, u16 out_height,
bool mem_to_mem);
u8 num_fifos;
+   const u32 **supported_color_modes;
unsigned int buffer_size_unit;
unsigned int burst_size_unit;
 
@@ -1144,9 +1145,24 @@ static u32 dispc_ovl_get_burst_size(enum omap_plane_id 
plane)
return dispc.feat->burst_size_unit * 8;
 }
 
+static bool dispc_ovl_color_mode_supported(enum omap_plane_id plane, u32 
fourcc)
+{
+   const u32 *modes;
+   unsigned int i;
+
+   modes = dispc.feat->supported_color_modes[plane];
+
+   for (i = 0; modes[i]; ++i) {
+   if (modes[i] == fourcc)
+   return true;
+   }
+
+   return false;
+}
+
 static const u32 *dispc_ovl_get_color_modes(enum omap_plane_id plane)
 {
-   return dss_feat_get_supported_color_modes(plane);
+   return dispc.feat->supported_color_modes[plane];
 }
 
 static int dispc_get_num_ovls(void)
@@ -1867,7 +1883,7 @@ static void dispc_ovl_set_rotation_attrs(enum 
omap_plane_id plane, u8 rotation,
REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane),
row_repeat ? 1 : 0, 18, 18);
 
-   if (dss_feat_color_mode_supported(plane, DRM_FORMAT_NV12)) {
+   if (dispc_ovl_color_mode_supported(plane, DRM_FORMAT_NV12)) {
bool doublestride =
fourcc == DRM_FORMAT_NV12 &&
rotation_type == OMAP_DSS_ROT_TILER &&
@@ -2431,7 +2447,7 @@ static int dispc_ovl_setup_common(enum omap_plane_id 
plane,
out_height);
}
 
-   if (!dss_feat_color_mode_supported(plane, fourcc))
+   if (!dispc_ovl_color_mode_supported(plane, fourcc))
return -EINVAL;
 
r = dispc_ovl_calc_scaling(pclk, lclk, caps, vm, in_width,
@@ -3692,6 +3708,106 @@ static void _omap_dispc_initial_config(void)
dispc_init_mflag();
 }
 
+#define COLOR_ARRAY(arr...) (const u32[]) { arr, 0 }
+
+static const u32 *omap2_dispc_supported_color_modes[] = {
+
+   /* OMAP_DSS_GFX */
+   COLOR_ARRAY(
+   DRM_FORMAT_RGBX, DRM_FORMAT_RGB565,
+   DRM_FORMAT_XRGB, DRM_FORMAT_RGB888),
+
+   /* OMAP_DSS_VIDEO1 */
+   COLOR_ARRAY(
+   DRM_FORMAT_RGB565, DRM_FORMAT_XRGB,
+   DRM_FORMAT_RGB888, DRM_FORMAT_YUYV,
+   DRM_FORMAT_UYVY),
+
+   /* OMAP_DSS_VIDEO2 */
+   COLOR_ARRAY(
+   DRM_FORMAT_RGB565, DRM_FORMAT_XRGB,
+   DRM_FORMAT_RGB888, DRM_FORMAT_YUYV,
+   DRM_FORMAT_UYVY),
+};
+
+static const u32 *omap3_dispc_supported_color_modes[] = {
+   /* OMAP_DSS_GFX */
+   COLOR_ARRAY(
+   DRM_FORMAT_RGBX, DRM_FORMAT_ARGB,
+   DRM_FORMAT_RGB565, DRM_FORMAT_XRGB,
+   DRM_FORMAT_RGB888, DRM_FORMAT_ARGB,
+   DRM_FORMAT_RGBA, DRM_FORMAT_RGBX),
+
+   /* OMAP_DSS_VIDEO1 */
+   COLOR_ARRAY(
+   DRM_FORMAT_XRGB, DRM_FORMAT_RGB888,
+   DRM_FORMAT_RGBX, DRM_FORMAT_RGB565,
+   DRM_FORMAT_YUYV, DRM_FORMAT_UYVY),
+
+   /* OMAP_DSS_VIDEO2 */
+   COLOR_ARRAY(
+   DRM_FORMAT_RGBX, DRM_FORMAT_ARGB,
+   DRM_FORMAT_RGB565, DRM_FORMAT_XRGB,
+   DRM_FORMAT_RGB888, DRM_FORMAT_YUYV,
+   DRM_FORMAT_UYVY, DRM_FORMAT_ARGB,
+   DRM_FORMAT_RGBA, DRM_FORMAT_RGBX),
+};
+
+static const u32 *omap4_dispc_supported_color_modes[] = {
+   /* OMAP_DSS_GFX */
+   COLOR_ARRAY(
+   DRM_FORMAT_RGBX, DRM_FORMAT_ARGB,
+   DRM_FORMAT_RGB565, DRM_FORMAT_XRGB,
+   DRM_FORMAT_RGB888, DRM_FORMAT_ARGB,
+   DRM_FORMAT_RGBA, DRM_FORMAT_RGBX,
+   DRM_FORMAT_ARGB1555, DRM_FORMAT_XRGB,
+   DRM_FORMAT_RGBA, DRM_FORMAT_XRGB1555),
+
+   /* OMAP_DSS_VIDEO1 */
+   COLOR_ARRAY(
+   DRM_FORMAT_RGB565, DRM_FORMAT_RGBX,
+   DRM_FORMAT_YUYV, DRM_FORMAT_ARGB1555,
+   DRM_FORMAT_RGBA, DRM_FORMAT_NV12,
+   DRM_FORMAT_RGBA, DRM_FORMAT_XRGB,
+   DRM_FORMAT_RGB888, DRM_FORMAT_UYVY,
+   DRM_FORMAT_ARGB, DRM_FORMAT_XRGB1555,
+   DRM_FORMAT_ARGB, DRM_FORMAT_XRGB,
+   DRM_FORMAT_RGBX),
+
+   /* OMAP_DSS_VIDEO2 */
+   COLOR_ARRAY(
+   DRM_FORMAT_RGB565, DRM_FORMAT_RGBX,
+   

[PATCH v3 23/35] drm: omapdrm: Move DISPC_CLK_SWITCH reg feature to struct dss_features

2017-08-04 Thread Laurent Pinchart
The register belongs to the DSS, move the feature to the dss_features
structure.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dss.c  | 15 +++
 drivers/gpu/drm/omapdrm/dss/dss.h  |  5 +
 drivers/gpu/drm/omapdrm/dss/dss_features.c | 10 --
 drivers/gpu/drm/omapdrm/dss/dss_features.h |  1 -
 4 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c 
b/drivers/gpu/drm/omapdrm/dss/dss.c
index 3d6b1e8ec0c0..d145d9eedfa7 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -86,6 +86,7 @@ struct dss_features {
const enum omap_display_type *ports;
int num_ports;
const struct dss_ops *ops;
+   struct dss_reg_field dispc_clk_switch;
 };
 
 static struct {
@@ -427,7 +428,6 @@ static int dss_get_channel_index(enum omap_channel channel)
 static void dss_select_dispc_clk_source(enum dss_clk_source clk_src)
 {
int b;
-   u8 start, end;
 
/*
 * We always use PRCM clock as the DISPC func clock, except on DSS3,
@@ -452,9 +452,9 @@ static void dss_select_dispc_clk_source(enum dss_clk_source 
clk_src)
return;
}
 
-   dss_feat_get_reg_field(FEAT_REG_DISPC_CLK_SWITCH, , );
-
-   REG_FLD_MOD(DSS_CONTROL, b, start, end);/* DISPC_CLK_SWITCH */
+   REG_FLD_MOD(DSS_CONTROL, b, /* DISPC_CLK_SWITCH */
+   dss.feat->dispc_clk_switch.start,
+   dss.feat->dispc_clk_switch.end);
 
dss.dispc_clk_source = clk_src;
 }
@@ -1010,6 +1010,7 @@ static const struct dss_features omap24xx_dss_feats = {
.ports  =   omap2plus_ports,
.num_ports  =   ARRAY_SIZE(omap2plus_ports),
.ops=   _ops_omap2_omap3,
+   .dispc_clk_switch   =   { 0, 0 },
 };
 
 static const struct dss_features omap34xx_dss_feats = {
@@ -1020,6 +1021,7 @@ static const struct dss_features omap34xx_dss_feats = {
.ports  =   omap34xx_ports,
.num_ports  =   ARRAY_SIZE(omap34xx_ports),
.ops=   _ops_omap2_omap3,
+   .dispc_clk_switch   =   { 0, 0 },
 };
 
 static const struct dss_features omap3630_dss_feats = {
@@ -1030,6 +1032,7 @@ static const struct dss_features omap3630_dss_feats = {
.ports  =   omap2plus_ports,
.num_ports  =   ARRAY_SIZE(omap2plus_ports),
.ops=   _ops_omap2_omap3,
+   .dispc_clk_switch   =   { 0, 0 },
 };
 
 static const struct dss_features omap44xx_dss_feats = {
@@ -1040,6 +1043,7 @@ static const struct dss_features omap44xx_dss_feats = {
.ports  =   omap2plus_ports,
.num_ports  =   ARRAY_SIZE(omap2plus_ports),
.ops=   _ops_omap4,
+   .dispc_clk_switch   =   { 9, 8 },
 };
 
 static const struct dss_features omap54xx_dss_feats = {
@@ -1050,6 +1054,7 @@ static const struct dss_features omap54xx_dss_feats = {
.ports  =   omap2plus_ports,
.num_ports  =   ARRAY_SIZE(omap2plus_ports),
.ops=   _ops_omap5,
+   .dispc_clk_switch   =   { 9, 7 },
 };
 
 static const struct dss_features am43xx_dss_feats = {
@@ -1060,6 +1065,7 @@ static const struct dss_features am43xx_dss_feats = {
.ports  =   omap2plus_ports,
.num_ports  =   ARRAY_SIZE(omap2plus_ports),
.ops=   _ops_omap2_omap3,
+   .dispc_clk_switch   =   { 0, 0 },
 };
 
 static const struct dss_features dra7xx_dss_feats = {
@@ -1070,6 +1076,7 @@ static const struct dss_features dra7xx_dss_feats = {
.ports  =   dra7xx_ports,
.num_ports  =   ARRAY_SIZE(dra7xx_ports),
.ops=   _ops_dra7,
+   .dispc_clk_switch   =   { 9, 7 },
 };
 
 static int dss_init_ports(struct platform_device *pdev)
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h 
b/drivers/gpu/drm/omapdrm/dss/dss.h
index b7ce0eacdd0e..ac642607321e 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss.h
@@ -200,6 +200,11 @@ struct dss_pll {
struct dss_pll_clock_info cinfo;
 };
 
+/* Defines a generic omap register field */
+struct dss_reg_field {
+   u8 start, end;
+};
+
 struct dispc_clock_info {
/* rates that we get with dividers below */
unsigned long lck;
diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.c 
b/drivers/gpu/drm/omapdrm/dss/dss_features.c
index faa9bc3c03b2..04848196780e 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss_features.c
@@ -28,11 +28,6 @@
 #include "dss.h"
 

[PATCH v3 18/35] drm: omapdrm: Move shutdown() handler from core to dss

2017-08-04 Thread Laurent Pinchart
In preparation for removal of the core module, move the shutdown()
handler from core to dss.

Signed-off-by: Laurent Pinchart 
Reviewed-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/core.c | 20 
 drivers/gpu/drm/omapdrm/dss/dss.c  | 16 
 2 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/core.c 
b/drivers/gpu/drm/omapdrm/dss/core.c
index 6ace3d5e44af..db4419b31327 100644
--- a/drivers/gpu/drm/omapdrm/dss/core.c
+++ b/drivers/gpu/drm/omapdrm/dss/core.c
@@ -50,19 +50,6 @@ EXPORT_SYMBOL(omapdss_get_version);
 
 /* PLATFORM DEVICE */
 
-static void dss_disable_all_devices(void)
-{
-   struct omap_dss_device *dssdev = NULL;
-
-   for_each_dss_dev(dssdev) {
-   if (!dssdev->driver)
-   continue;
-
-   if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-   dssdev->driver->disable(dssdev);
-   }
-}
-
 static int __init omap_dss_probe(struct platform_device *pdev)
 {
core.pdev = pdev;
@@ -77,15 +64,8 @@ static int omap_dss_remove(struct platform_device *pdev)
return 0;
 }
 
-static void omap_dss_shutdown(struct platform_device *pdev)
-{
-   DSSDBG("shutdown\n");
-   dss_disable_all_devices();
-}
-
 static struct platform_driver omap_dss_driver = {
.remove = omap_dss_remove,
-   .shutdown   = omap_dss_shutdown,
.driver = {
.name   = "omapdss",
},
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c 
b/drivers/gpu/drm/omapdrm/dss/dss.c
index e44b5077f140..3d6b1e8ec0c0 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -1380,6 +1380,21 @@ static int dss_remove(struct platform_device *pdev)
return 0;
 }
 
+static void dss_shutdown(struct platform_device *pdev)
+{
+   struct omap_dss_device *dssdev = NULL;
+
+   DSSDBG("shutdown\n");
+
+   for_each_dss_dev(dssdev) {
+   if (!dssdev->driver)
+   continue;
+
+   if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
+   dssdev->driver->disable(dssdev);
+   }
+}
+
 static int dss_runtime_suspend(struct device *dev)
 {
dss_save_context();
@@ -1419,6 +1434,7 @@ static const struct dev_pm_ops dss_pm_ops = {
 static struct platform_driver omap_dsshw_driver = {
.probe  = dss_probe,
.remove = dss_remove,
+   .shutdown   = dss_shutdown,
.driver = {
.name   = "omapdss_dss",
.pm = _pm_ops,
-- 
Regards,

Laurent Pinchart

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


[PATCH v3 16/35] drm: omapdrm: dss: Initialize DSS internal features at probe time

2017-08-04 Thread Laurent Pinchart
The DSS internal features are derived from the platform device
compatible string which is available at probe time. Don't delay
initialization until bind time. This prepares for the merge of the two
DSS features structures that will be needed before the DSS is bound.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dss.c | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c 
b/drivers/gpu/drm/omapdrm/dss/dss.c
index c3fab0ddcde9..7384e473875b 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -1142,23 +1142,10 @@ static const struct soc_device_attribute 
dss_soc_devices[] = {
 static int dss_bind(struct device *dev)
 {
struct platform_device *pdev = to_platform_device(dev);
-   const struct soc_device_attribute *soc;
struct resource *dss_mem;
u32 rev;
int r;
 
-   dss.pdev = pdev;
-
-   /*
-* The various OMAP3-based SoCs can't be told apart using the compatible
-* string, use SoC device matching.
-*/
-   soc = soc_device_match(dss_soc_devices);
-   if (soc)
-   dss.feat = soc->data;
-   else
-   dss.feat = of_match_device(dss_of_match, >dev)->data;
-
dss_mem = platform_get_resource(dss.pdev, IORESOURCE_MEM, 0);
dss.base = devm_ioremap_resource(>dev, dss_mem);
if (IS_ERR(dss.base))
@@ -1290,9 +1277,22 @@ static int dss_add_child_component(struct device *dev, 
void *data)
 
 static int dss_probe(struct platform_device *pdev)
 {
+   const struct soc_device_attribute *soc;
struct component_match *match = NULL;
int r;
 
+   dss.pdev = pdev;
+
+   /*
+* The various OMAP3-based SoCs can't be told apart using the compatible
+* string, use SoC device matching.
+*/
+   soc = soc_device_match(dss_soc_devices);
+   if (soc)
+   dss.feat = soc->data;
+   else
+   dss.feat = of_match_device(dss_of_match, >dev)->data;
+
/* add all the child devices as components */
device_for_each_child(>dev, , dss_add_child_component);
 
-- 
Regards,

Laurent Pinchart

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


[PATCH v3 15/35] drm: omapdrm: dss: Use supported outputs instead of display types

2017-08-04 Thread Laurent Pinchart
The dss driver uses the supported display types to check whether the DSS
has SDI, VENC or HDMI outputs. We can instead use the supported outputs
the provide the same information. This removes the last use of the
supported display types, that we can then remove as well.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dss.c  | 32 +++---
 drivers/gpu/drm/omapdrm/dss/dss_features.c | 71 --
 drivers/gpu/drm/omapdrm/dss/dss_features.h |  1 -
 3 files changed, 17 insertions(+), 87 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c 
b/drivers/gpu/drm/omapdrm/dss/dss.c
index 06c6e0145703..c3fab0ddcde9 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -146,8 +146,8 @@ static void dss_save_context(void)
 
SR(CONTROL);
 
-   if (dss_feat_get_supported_displays(OMAP_DSS_CHANNEL_LCD) &
-   OMAP_DISPLAY_TYPE_SDI) {
+   if (dss_feat_get_supported_outputs(OMAP_DSS_CHANNEL_LCD) &
+   OMAP_DSS_OUTPUT_SDI) {
SR(SDI_CONTROL);
SR(PLL_CONTROL);
}
@@ -166,8 +166,8 @@ static void dss_restore_context(void)
 
RR(CONTROL);
 
-   if (dss_feat_get_supported_displays(OMAP_DSS_CHANNEL_LCD) &
-   OMAP_DISPLAY_TYPE_SDI) {
+   if (dss_feat_get_supported_outputs(OMAP_DSS_CHANNEL_LCD) &
+   OMAP_DSS_OUTPUT_SDI) {
RR(SDI_CONTROL);
RR(PLL_CONTROL);
}
@@ -397,8 +397,8 @@ static void dss_dump_regs(struct seq_file *s)
DUMPREG(DSS_SYSSTATUS);
DUMPREG(DSS_CONTROL);
 
-   if (dss_feat_get_supported_displays(OMAP_DSS_CHANNEL_LCD) &
-   OMAP_DISPLAY_TYPE_SDI) {
+   if (dss_feat_get_supported_outputs(OMAP_DSS_CHANNEL_LCD) &
+   OMAP_DSS_OUTPUT_SDI) {
DUMPREG(DSS_SDI_CONTROL);
DUMPREG(DSS_PLL_CONTROL);
DUMPREG(DSS_SDI_STATUS);
@@ -728,27 +728,29 @@ void dss_set_dac_pwrdn_bgz(bool enable)
 
 void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select src)
 {
-   enum omap_display_type dp;
-   dp = dss_feat_get_supported_displays(OMAP_DSS_CHANNEL_DIGIT);
+   enum omap_dss_output_id outputs;
+
+   outputs = dss_feat_get_supported_outputs(OMAP_DSS_CHANNEL_DIGIT);
 
/* Complain about invalid selections */
-   WARN_ON((src == DSS_VENC_TV_CLK) && !(dp & OMAP_DISPLAY_TYPE_VENC));
-   WARN_ON((src == DSS_HDMI_M_PCLK) && !(dp & OMAP_DISPLAY_TYPE_HDMI));
+   WARN_ON((src == DSS_VENC_TV_CLK) && !(outputs & OMAP_DSS_OUTPUT_VENC));
+   WARN_ON((src == DSS_HDMI_M_PCLK) && !(outputs & OMAP_DSS_OUTPUT_HDMI));
 
/* Select only if we have options */
-   if ((dp & OMAP_DISPLAY_TYPE_VENC) && (dp & OMAP_DISPLAY_TYPE_HDMI))
+   if ((outputs & OMAP_DSS_OUTPUT_VENC) &&
+   (outputs & OMAP_DSS_OUTPUT_HDMI))
REG_FLD_MOD(DSS_CONTROL, src, 15, 15);  /* VENC_HDMI_SWITCH */
 }
 
 enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void)
 {
-   enum omap_display_type displays;
+   enum omap_dss_output_id outputs;
 
-   displays = dss_feat_get_supported_displays(OMAP_DSS_CHANNEL_DIGIT);
-   if ((displays & OMAP_DISPLAY_TYPE_HDMI) == 0)
+   outputs = dss_feat_get_supported_outputs(OMAP_DSS_CHANNEL_DIGIT);
+   if ((outputs & OMAP_DSS_OUTPUT_HDMI) == 0)
return DSS_VENC_TV_CLK;
 
-   if ((displays & OMAP_DISPLAY_TYPE_VENC) == 0)
+   if ((outputs & OMAP_DSS_OUTPUT_VENC) == 0)
return DSS_HDMI_M_PCLK;
 
return REG_GET(DSS_CONTROL, 15, 15);
diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.c 
b/drivers/gpu/drm/omapdrm/dss/dss_features.c
index 0e599710dd95..4172fb3bf106 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss_features.c
@@ -46,7 +46,6 @@ struct omap_dss_features {
 
const int num_mgrs;
const int num_ovls;
-   const enum omap_display_type *supported_displays;
const enum omap_dss_output_id *supported_outputs;
const u32 **supported_color_modes;
const enum omap_overlay_caps *overlay_caps;
@@ -114,62 +113,6 @@ static const struct dss_reg_field omap5_dss_reg_fields[] = 
{
[FEAT_REG_DISPC_CLK_SWITCH] = { 9, 7 },
 };
 
-static const enum omap_display_type omap2_dss_supported_displays[] = {
-   /* OMAP_DSS_CHANNEL_LCD */
-   OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI,
-
-   /* OMAP_DSS_CHANNEL_DIGIT */
-   OMAP_DISPLAY_TYPE_VENC,
-};
-
-static const enum omap_display_type omap3430_dss_supported_displays[] = {
-   /* OMAP_DSS_CHANNEL_LCD */
-   OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI |
-   OMAP_DISPLAY_TYPE_SDI | OMAP_DISPLAY_TYPE_DSI,
-
-   /* OMAP_DSS_CHANNEL_DIGIT */
-   OMAP_DISPLAY_TYPE_VENC,
-};
-
-static const 

[PATCH v3 19/35] drm: omapdrm: Move size unit features to dispc_features structure

2017-08-04 Thread Laurent Pinchart
The buffer_size_unit and burst_size_unit are dispc features. Move them
from the omap_dss_features structure to the dispc_features structure.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dispc.c| 25 +---
 drivers/gpu/drm/omapdrm/dss/dss_features.c | 31 --
 drivers/gpu/drm/omapdrm/dss/dss_features.h |  3 ---
 3 files changed, 18 insertions(+), 41 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 7053e3fdc9e2..99a308446283 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -88,6 +88,8 @@ struct dispc_features {
u16 width, u16 height, u16 out_width, u16 out_height,
bool mem_to_mem);
u8 num_fifos;
+   unsigned int buffer_size_unit;
+   unsigned int burst_size_unit;
 
/* swap GFX & WB fifos */
bool gfx_fifo_workaround:1;
@@ -1138,9 +1140,8 @@ static void dispc_configure_burst_sizes(void)
 
 static u32 dispc_ovl_get_burst_size(enum omap_plane_id plane)
 {
-   unsigned unit = dss_feat_get_burst_size_unit();
/* burst multiplier is always x8 (see dispc_configure_burst_sizes()) */
-   return unit * 8;
+   return dispc.feat->burst_size_unit * 8;
 }
 
 static const u32 *dispc_ovl_get_color_modes(enum omap_plane_id plane)
@@ -1225,7 +1226,7 @@ static void dispc_init_fifos(void)
u32 unit;
int i;
 
-   unit = dss_feat_get_buffer_size_unit();
+   unit = dispc.feat->buffer_size_unit;
 
dss_feat_get_reg_field(FEAT_REG_FIFOSIZE, , );
 
@@ -1309,7 +1310,7 @@ void dispc_ovl_set_fifo_threshold(enum omap_plane_id 
plane, u32 low,
u8 hi_start, hi_end, lo_start, lo_end;
u32 unit;
 
-   unit = dss_feat_get_buffer_size_unit();
+   unit = dispc.feat->buffer_size_unit;
 
WARN_ON(low % unit != 0);
WARN_ON(high % unit != 0);
@@ -1362,7 +1363,7 @@ void dispc_ovl_compute_fifo_thresholds(enum omap_plane_id 
plane,
 * buffer_units, and the fifo thresholds must be buffer_unit aligned.
 */
 
-   unsigned buf_unit = dss_feat_get_buffer_size_unit();
+   unsigned buf_unit = dispc.feat->buffer_size_unit;
unsigned ovl_fifo_size, total_fifo_size, burst_size;
int i;
 
@@ -1439,7 +1440,7 @@ static void dispc_init_mflag(void)
 
for (i = 0; i < dss_feat_get_num_ovls(); ++i) {
u32 size = dispc_ovl_get_fifo_size(i);
-   u32 unit = dss_feat_get_buffer_size_unit();
+   u32 unit = dispc.feat->buffer_size_unit;
u32 low, high;
 
dispc_ovl_set_mflag(i, true);
@@ -1458,7 +1459,7 @@ static void dispc_init_mflag(void)
 
if (dispc.feat->has_writeback) {
u32 size = dispc_ovl_get_fifo_size(OMAP_DSS_WB);
-   u32 unit = dss_feat_get_buffer_size_unit();
+   u32 unit = dispc.feat->buffer_size_unit;
u32 low, high;
 
dispc_ovl_set_mflag(OMAP_DSS_WB, true);
@@ -3706,6 +3707,8 @@ static const struct dispc_features omap24xx_dispc_feats = 
{
.calc_scaling   =   dispc_ovl_calc_scaling_24xx,
.calc_core_clk  =   calc_core_clk_24xx,
.num_fifos  =   3,
+   .buffer_size_unit   =   1,
+   .burst_size_unit=   8,
.no_framedone_tv=   true,
.set_max_preload=   false,
.last_pixel_inc_missing =   true,
@@ -3727,6 +3730,8 @@ static const struct dispc_features 
omap34xx_rev1_0_dispc_feats = {
.calc_scaling   =   dispc_ovl_calc_scaling_34xx,
.calc_core_clk  =   calc_core_clk_34xx,
.num_fifos  =   3,
+   .buffer_size_unit   =   1,
+   .burst_size_unit=   8,
.no_framedone_tv=   true,
.set_max_preload=   false,
.last_pixel_inc_missing =   true,
@@ -3748,6 +3753,8 @@ static const struct dispc_features 
omap34xx_rev3_0_dispc_feats = {
.calc_scaling   =   dispc_ovl_calc_scaling_34xx,
.calc_core_clk  =   calc_core_clk_34xx,
.num_fifos  =   3,
+   .buffer_size_unit   =   1,
+   .burst_size_unit=   8,
.no_framedone_tv=   true,
.set_max_preload=   false,
.last_pixel_inc_missing =   true,
@@ -3769,6 +3776,8 @@ static const struct dispc_features omap44xx_dispc_feats = 
{
.calc_scaling   =   dispc_ovl_calc_scaling_44xx,
.calc_core_clk  =   calc_core_clk_44xx,
.num_fifos  =   5,
+   .buffer_size_unit   =   16,
+   .burst_size_unit=   16,
.gfx_fifo_workaround=   true,
.set_max_preload=   true,
 

[PATCH v3 22/35] drm: omapdrm: Move num_ovls and num_mgrs to dispc_features structure

2017-08-04 Thread Laurent Pinchart
The num_ovls and num_mgrs are dispc features. Move them from the
omap_dss_features structure to the dispc_features structure.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dispc.c| 91 ++
 drivers/gpu/drm/omapdrm/dss/dss_features.c | 30 --
 drivers/gpu/drm/omapdrm/dss/dss_features.h |  3 -
 3 files changed, 66 insertions(+), 58 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
b/drivers/gpu/drm/omapdrm/dss/dispc.c
index c013bfd66865..839425ad8a75 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -90,6 +90,8 @@ struct dispc_features {
u8 num_fifos;
const enum omap_overlay_caps *overlay_caps;
const u32 **supported_color_modes;
+   unsigned int num_mgrs;
+   unsigned int num_ovls;
unsigned int buffer_size_unit;
unsigned int burst_size_unit;
 
@@ -349,6 +351,16 @@ static void mgr_fld_write(enum omap_channel channel,
spin_unlock_irqrestore(_lock, flags);
 }
 
+static int dispc_get_num_ovls(void)
+{
+   return dispc.feat->num_ovls;
+}
+
+static int dispc_get_num_mgrs(void)
+{
+   return dispc.feat->num_mgrs;
+}
+
 #define SR(reg) \
dispc.ctx[DISPC_##reg / sizeof(u32)] = dispc_read_reg(DISPC_##reg)
 #define RR(reg) \
@@ -376,7 +388,7 @@ static void dispc_save_context(void)
SR(CONFIG3);
}
 
-   for (i = 0; i < dss_feat_get_num_mgrs(); i++) {
+   for (i = 0; i < dispc_get_num_mgrs(); i++) {
SR(DEFAULT_COLOR(i));
SR(TRANS_COLOR(i));
SR(SIZE_MGR(i));
@@ -398,7 +410,7 @@ static void dispc_save_context(void)
}
}
 
-   for (i = 0; i < dss_feat_get_num_ovls(); i++) {
+   for (i = 0; i < dispc_get_num_ovls(); i++) {
SR(OVL_BA0(i));
SR(OVL_BA1(i));
SR(OVL_POSITION(i));
@@ -482,7 +494,7 @@ static void dispc_restore_context(void)
if (dss_has_feature(FEAT_MGR_LCD3))
RR(CONFIG3);
 
-   for (i = 0; i < dss_feat_get_num_mgrs(); i++) {
+   for (i = 0; i < dispc_get_num_mgrs(); i++) {
RR(DEFAULT_COLOR(i));
RR(TRANS_COLOR(i));
RR(SIZE_MGR(i));
@@ -504,7 +516,7 @@ static void dispc_restore_context(void)
}
}
 
-   for (i = 0; i < dss_feat_get_num_ovls(); i++) {
+   for (i = 0; i < dispc_get_num_ovls(); i++) {
RR(OVL_BA0(i));
RR(OVL_BA1(i));
RR(OVL_POSITION(i));
@@ -785,7 +797,7 @@ static void dispc_ovl_write_color_conv_coef(enum 
omap_plane_id plane,
 static void dispc_setup_color_conv_coef(void)
 {
int i;
-   int num_ovl = dss_feat_get_num_ovls();
+   int num_ovl = dispc_get_num_ovls();
const struct color_conv_coef ctbl_bt601_5_ovl = {
/* YUV -> RGB */
298, 409, 0, 298, -208, -100, 298, 0, 517, 0,
@@ -877,7 +889,7 @@ static void dispc_ovl_enable_zorder_planes(void)
if (!dss_has_feature(FEAT_ALPHA_FREE_ZORDER))
return;
 
-   for (i = 0; i < dss_feat_get_num_ovls(); i++)
+   for (i = 0; i < dispc_get_num_ovls(); i++)
REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(i), 1, 25, 25);
 }
 
@@ -1134,7 +1146,7 @@ static void dispc_configure_burst_sizes(void)
const int burst_size = BURST_SIZE_X8;
 
/* Configure burst size always to maximum size */
-   for (i = 0; i < dss_feat_get_num_ovls(); ++i)
+   for (i = 0; i < dispc_get_num_ovls(); ++i)
dispc_ovl_set_burst_size(i, burst_size);
if (dispc.feat->has_writeback)
dispc_ovl_set_burst_size(OMAP_DSS_WB, burst_size);
@@ -1166,11 +1178,6 @@ static const u32 *dispc_ovl_get_color_modes(enum 
omap_plane_id plane)
return dispc.feat->supported_color_modes[plane];
 }
 
-static int dispc_get_num_ovls(void)
-{
-   return dss_feat_get_num_ovls();
-}
-
 static void dispc_mgr_enable_cpr(enum omap_channel channel, bool enable)
 {
if (channel == OMAP_DSS_CHANNEL_DIGIT)
@@ -1285,7 +1292,7 @@ static void dispc_init_fifos(void)
/*
 * Setup default fifo thresholds.
 */
-   for (i = 0; i < dss_feat_get_num_ovls(); ++i) {
+   for (i = 0; i < dispc_get_num_ovls(); ++i) {
u32 low, high;
const bool use_fifomerge = false;
const bool manual_update = false;
@@ -1389,7 +1396,7 @@ void dispc_ovl_compute_fifo_thresholds(enum omap_plane_id 
plane,
 
if (use_fifomerge) {
total_fifo_size = 0;
-   for (i = 0; i < dss_feat_get_num_ovls(); ++i)
+   for (i = 0; i < dispc_get_num_ovls(); ++i)
total_fifo_size += dispc_ovl_get_fifo_size(i);
} else {
total_fifo_size = ovl_fifo_size;
@@ -1455,7 +1462,7 @@ static void dispc_init_mflag(void)

[PATCH v3 14/35] drm: omapdrm: dss: Select features based on compatible string

2017-08-04 Thread Laurent Pinchart
Use the compatible string instead of the OMAP SoC revision to determine
device features. The various OMAP3-based SoCs can't be told apart using
the compatible string, use soc_device_match() to tell them apart.

Signed-off-by: Laurent Pinchart 
Reviewed-by: Tomi Valkeinen 
---
Changes since v2:

- Fixed can -> can't typo in commit message and code comment
---
 drivers/gpu/drm/omapdrm/dss/dss.c | 97 ---
 1 file changed, 29 insertions(+), 68 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c 
b/drivers/gpu/drm/omapdrm/dss/dss.c
index 7be69b1d535a..06c6e0145703 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -38,10 +38,12 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include "omapdss.h"
 #include "dss.h"
@@ -1006,60 +1008,6 @@ static const struct dss_features dra7xx_dss_feats = {
.ops=   _ops_dra7,
 };
 
-static int dss_init_features(struct platform_device *pdev)
-{
-   const struct dss_features *src;
-   struct dss_features *dst;
-
-   dst = devm_kzalloc(>dev, sizeof(*dst), GFP_KERNEL);
-   if (!dst) {
-   dev_err(>dev, "Failed to allocate local DSS Features\n");
-   return -ENOMEM;
-   }
-
-   switch (omapdss_get_version()) {
-   case OMAPDSS_VER_OMAP24xx:
-   src = _dss_feats;
-   break;
-
-   case OMAPDSS_VER_OMAP34xx_ES1:
-   case OMAPDSS_VER_OMAP34xx_ES3:
-   case OMAPDSS_VER_AM35xx:
-   src = _dss_feats;
-   break;
-
-   case OMAPDSS_VER_OMAP3630:
-   src = _dss_feats;
-   break;
-
-   case OMAPDSS_VER_OMAP4430_ES1:
-   case OMAPDSS_VER_OMAP4430_ES2:
-   case OMAPDSS_VER_OMAP4:
-   src = _dss_feats;
-   break;
-
-   case OMAPDSS_VER_OMAP5:
-   src = _dss_feats;
-   break;
-
-   case OMAPDSS_VER_AM43xx:
-   src = _dss_feats;
-   break;
-
-   case OMAPDSS_VER_DRA7xx:
-   src = _dss_feats;
-   break;
-
-   default:
-   return -ENODEV;
-   }
-
-   memcpy(dst, src, sizeof(*dst));
-   dss.feat = dst;
-
-   return 0;
-}
-
 static int dss_init_ports(struct platform_device *pdev)
 {
struct device_node *parent = pdev->dev.of_node;
@@ -1172,18 +1120,42 @@ static int dss_video_pll_probe(struct platform_device 
*pdev)
 }
 
 /* DSS HW IP initialisation */
+static const struct of_device_id dss_of_match[] = {
+   { .compatible = "ti,omap2-dss", .data = _dss_feats },
+   { .compatible = "ti,omap3-dss", .data = _dss_feats },
+   { .compatible = "ti,omap4-dss", .data = _dss_feats },
+   { .compatible = "ti,omap5-dss", .data = _dss_feats },
+   { .compatible = "ti,dra7-dss",  .data = _dss_feats },
+   {},
+};
+MODULE_DEVICE_TABLE(of, dss_of_match);
+
+static const struct soc_device_attribute dss_soc_devices[] = {
+   { .machine = "OMAP3430/3530", .data = _dss_feats },
+   { .machine = "AM35??",.data = _dss_feats },
+   { .family  = "AM43xx",.data = _dss_feats },
+   { /* sentinel */ }
+};
+
 static int dss_bind(struct device *dev)
 {
struct platform_device *pdev = to_platform_device(dev);
+   const struct soc_device_attribute *soc;
struct resource *dss_mem;
u32 rev;
int r;
 
dss.pdev = pdev;
 
-   r = dss_init_features(dss.pdev);
-   if (r)
-   return r;
+   /*
+* The various OMAP3-based SoCs can't be told apart using the compatible
+* string, use SoC device matching.
+*/
+   soc = soc_device_match(dss_soc_devices);
+   if (soc)
+   dss.feat = soc->data;
+   else
+   dss.feat = of_match_device(dss_of_match, >dev)->data;
 
dss_mem = platform_get_resource(dss.pdev, IORESOURCE_MEM, 0);
dss.base = devm_ioremap_resource(>dev, dss_mem);
@@ -1371,17 +1343,6 @@ static const struct dev_pm_ops dss_pm_ops = {
.runtime_resume = dss_runtime_resume,
 };
 
-static const struct of_device_id dss_of_match[] = {
-   { .compatible = "ti,omap2-dss", },
-   { .compatible = "ti,omap3-dss", },
-   { .compatible = "ti,omap4-dss", },
-   { .compatible = "ti,omap5-dss", },
-   { .compatible = "ti,dra7-dss", },
-   {},
-};
-
-MODULE_DEVICE_TABLE(of, dss_of_match);
-
 static struct platform_driver omap_dsshw_driver = {
.probe  = dss_probe,
.remove = dss_remove,
-- 
Regards,

Laurent Pinchart

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


[PATCH v3 17/35] drm: omapdrm: Move all debugfs code from core to dss

2017-08-04 Thread Laurent Pinchart
debugfs code is spread between the core and dss drivers. In preparation
for removal of the core driver, move it all to the dss driver.

Signed-off-by: Laurent Pinchart 
---
Changes since v2:

- Call dss_uninitialize_debugfs() in probe error path
- Remove empty #if defined() .. #endif leftover
---
 drivers/gpu/drm/omapdrm/dss/core.c | 80 --
 drivers/gpu/drm/omapdrm/dss/dss.c  | 77 ++--
 drivers/gpu/drm/omapdrm/dss/dss.h  | 16 +---
 3 files changed, 84 insertions(+), 89 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/core.c 
b/drivers/gpu/drm/omapdrm/dss/core.c
index 706f354b5fa8..6ace3d5e44af 100644
--- a/drivers/gpu/drm/omapdrm/dss/core.c
+++ b/drivers/gpu/drm/omapdrm/dss/core.c
@@ -27,8 +27,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -50,72 +48,6 @@ enum omapdss_version omapdss_get_version(void)
 }
 EXPORT_SYMBOL(omapdss_get_version);
 
-#if defined(CONFIG_OMAP2_DSS_DEBUGFS)
-static int dss_debug_show(struct seq_file *s, void *unused)
-{
-   void (*func)(struct seq_file *) = s->private;
-   func(s);
-   return 0;
-}
-
-static int dss_debug_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, dss_debug_show, inode->i_private);
-}
-
-static const struct file_operations dss_debug_fops = {
-   .open   = dss_debug_open,
-   .read   = seq_read,
-   .llseek = seq_lseek,
-   .release= single_release,
-};
-
-static struct dentry *dss_debugfs_dir;
-
-static int dss_initialize_debugfs(void)
-{
-   dss_debugfs_dir = debugfs_create_dir("omapdss", NULL);
-   if (IS_ERR(dss_debugfs_dir)) {
-   int err = PTR_ERR(dss_debugfs_dir);
-   dss_debugfs_dir = NULL;
-   return err;
-   }
-
-   debugfs_create_file("clk", S_IRUGO, dss_debugfs_dir,
-   _debug_dump_clocks, _debug_fops);
-
-   return 0;
-}
-
-static void dss_uninitialize_debugfs(void)
-{
-   if (dss_debugfs_dir)
-   debugfs_remove_recursive(dss_debugfs_dir);
-}
-
-int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))
-{
-   struct dentry *d;
-
-   d = debugfs_create_file(name, S_IRUGO, dss_debugfs_dir,
-   write, _debug_fops);
-
-   return PTR_ERR_OR_ZERO(d);
-}
-#else /* CONFIG_OMAP2_DSS_DEBUGFS */
-static inline int dss_initialize_debugfs(void)
-{
-   return 0;
-}
-static inline void dss_uninitialize_debugfs(void)
-{
-}
-int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))
-{
-   return 0;
-}
-#endif /* CONFIG_OMAP2_DSS_DEBUGFS */
-
 /* PLATFORM DEVICE */
 
 static void dss_disable_all_devices(void)
@@ -133,27 +65,15 @@ static void dss_disable_all_devices(void)
 
 static int __init omap_dss_probe(struct platform_device *pdev)
 {
-   int r;
-
core.pdev = pdev;
 
dss_features_init(omapdss_get_version());
 
-   r = dss_initialize_debugfs();
-   if (r)
-   goto err_debugfs;
-
return 0;
-
-err_debugfs:
-
-   return r;
 }
 
 static int omap_dss_remove(struct platform_device *pdev)
 {
-   dss_uninitialize_debugfs();
-
return 0;
 }
 
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c 
b/drivers/gpu/drm/omapdrm/dss/dss.c
index 7384e473875b..e44b5077f140 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -22,6 +22,7 @@
 
 #define DSS_SUBSYS_NAME "DSS"
 
+#include 
 #include 
 #include 
 #include 
@@ -891,7 +892,7 @@ void dss_runtime_put(void)
 
 /* DEBUGFS */
 #if defined(CONFIG_OMAP2_DSS_DEBUGFS)
-void dss_debug_dump_clocks(struct seq_file *s)
+static void dss_debug_dump_clocks(struct seq_file *s)
 {
dss_dump_clocks(s);
dispc_dump_clocks(s);
@@ -899,8 +900,69 @@ void dss_debug_dump_clocks(struct seq_file *s)
dsi_dump_clocks(s);
 #endif
 }
-#endif
 
+static int dss_debug_show(struct seq_file *s, void *unused)
+{
+   void (*func)(struct seq_file *) = s->private;
+
+   func(s);
+   return 0;
+}
+
+static int dss_debug_open(struct inode *inode, struct file *file)
+{
+   return single_open(file, dss_debug_show, inode->i_private);
+}
+
+static const struct file_operations dss_debug_fops = {
+   .open   = dss_debug_open,
+   .read   = seq_read,
+   .llseek = seq_lseek,
+   .release= single_release,
+};
+
+static struct dentry *dss_debugfs_dir;
+
+static int dss_initialize_debugfs(void)
+{
+   dss_debugfs_dir = debugfs_create_dir("omapdss", NULL);
+   if (IS_ERR(dss_debugfs_dir)) {
+   int err = PTR_ERR(dss_debugfs_dir);
+
+   dss_debugfs_dir = NULL;
+   return err;
+   }
+
+   debugfs_create_file("clk", S_IRUGO, dss_debugfs_dir,
+   _debug_dump_clocks, _debug_fops);
+
+   return 0;
+}
+

[PATCH v3 13/35] drm: omapdrm: dsi: Store DSI model and PLL hardware data in OF data

2017-08-04 Thread Laurent Pinchart
The DSI PLL hardware data and DSS channels are selected based on the
OMAP SoC model. There's no need for fine-grained model information, as
the driver only needs to differentiate between OMAP3, OMAP4 and OMAP5.
As this can be done through the DSI compatible string, store the
corresponding information in OF match data instead to avoid accessing
the OMAP SoC model.

Signed-off-by: Laurent Pinchart 
---
Changes since v2:

- Rename dsi_device_type to dsi_model
---
 drivers/gpu/drm/omapdrm/dss/dsi.c | 116 ++
 1 file changed, 55 insertions(+), 61 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index d32e56c5f657..3d98e9ce9a43 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -230,6 +230,12 @@ static int dsi_vc_send_null(struct omap_dss_device 
*dssdev, int channel);
 #define DSI_MAX_NR_ISRS2
 #define DSI_MAX_NR_LANES   5
 
+enum dsi_model {
+   DSI_MODEL_OMAP3,
+   DSI_MODEL_OMAP4,
+   DSI_MODEL_OMAP5,
+};
+
 enum dsi_lane_function {
DSI_LANE_UNUSED = 0,
DSI_LANE_CLK,
@@ -301,12 +307,24 @@ struct dsi_lp_clock_info {
u16 lp_clk_div;
 };
 
+struct dsi_module_id_data {
+   u32 address;
+   int id;
+};
+
+struct dsi_of_data {
+   enum dsi_model model;
+   const struct dss_pll_hw *pll_hw;
+   const struct dsi_module_id_data *modules;
+};
+
 struct dsi_data {
struct platform_device *pdev;
void __iomem *proto_base;
void __iomem *phy_base;
void __iomem *pll_base;
 
+   const struct dsi_of_data *data;
int module_id;
 
int irq;
@@ -400,11 +418,6 @@ struct dsi_packet_sent_handler_data {
struct completion *completion;
 };
 
-struct dsi_module_id_data {
-   u32 address;
-   int id;
-};
-
 static const struct of_device_id dsi_of_match[];
 
 #ifdef DSI_PERF_MEASURE
@@ -4918,24 +4931,14 @@ static int dsi_set_config(struct omap_dss_device 
*dssdev,
  * the channel in some more dynamic manner, or get the channel as a user
  * parameter.
  */
-static enum omap_channel dsi_get_channel(int module_id)
+static enum omap_channel dsi_get_channel(struct dsi_data *dsi)
 {
-   switch (omapdss_get_version()) {
-   case OMAPDSS_VER_OMAP24xx:
-   case OMAPDSS_VER_AM43xx:
-   DSSWARN("DSI not supported\n");
-   return OMAP_DSS_CHANNEL_LCD;
-
-   case OMAPDSS_VER_OMAP34xx_ES1:
-   case OMAPDSS_VER_OMAP34xx_ES3:
-   case OMAPDSS_VER_OMAP3630:
-   case OMAPDSS_VER_AM35xx:
+   switch (dsi->data->model) {
+   case DSI_MODEL_OMAP3:
return OMAP_DSS_CHANNEL_LCD;
 
-   case OMAPDSS_VER_OMAP4430_ES1:
-   case OMAPDSS_VER_OMAP4430_ES2:
-   case OMAPDSS_VER_OMAP4:
-   switch (module_id) {
+   case DSI_MODEL_OMAP4:
+   switch (dsi->module_id) {
case 0:
return OMAP_DSS_CHANNEL_LCD;
case 1:
@@ -4945,8 +4948,8 @@ static enum omap_channel dsi_get_channel(int module_id)
return OMAP_DSS_CHANNEL_LCD;
}
 
-   case OMAPDSS_VER_OMAP5:
-   switch (module_id) {
+   case DSI_MODEL_OMAP5:
+   switch (dsi->module_id) {
case 0:
return OMAP_DSS_CHANNEL_LCD;
case 1:
@@ -5126,7 +5129,7 @@ static void dsi_init_output(struct platform_device 
*dsidev)
 
out->output_type = OMAP_DISPLAY_TYPE_DSI;
out->name = dsi->module_id == 0 ? "dsi.0" : "dsi.1";
-   out->dispc_channel = dsi_get_channel(dsi->module_id);
+   out->dispc_channel = dsi_get_channel(dsi);
out->ops.dsi = _ops;
out->owner = THIS_MODULE;
 
@@ -5301,29 +5304,7 @@ static int dsi_init_pll_data(struct platform_device 
*dsidev)
pll->id = dsi->module_id == 0 ? DSS_PLL_DSI1 : DSS_PLL_DSI2;
pll->clkin = clk;
pll->base = dsi->pll_base;
-
-   switch (omapdss_get_version()) {
-   case OMAPDSS_VER_OMAP34xx_ES1:
-   case OMAPDSS_VER_OMAP34xx_ES3:
-   case OMAPDSS_VER_OMAP3630:
-   case OMAPDSS_VER_AM35xx:
-   pll->hw = _omap3_dsi_pll_hw;
-   break;
-
-   case OMAPDSS_VER_OMAP4430_ES1:
-   case OMAPDSS_VER_OMAP4430_ES2:
-   case OMAPDSS_VER_OMAP4:
-   pll->hw = _omap4_dsi_pll_hw;
-   break;
-
-   case OMAPDSS_VER_OMAP5:
-   pll->hw = _omap5_dsi_pll_hw;
-   break;
-
-   default:
-   return -ENODEV;
-   }
-
+   pll->hw = dsi->data->pll_hw;
pll->ops = _pll_ops;
 
r = dss_pll_register(pll);
@@ -5400,7 +5381,8 @@ static int dsi_bind(struct device *dev, struct device 
*master, void *data)
return r;
}
 
-   d = of_match_node(dsi_of_match, dsidev->dev.of_node)->data;
+   dsi->data = 

[PATCH v3 10/35] drm: omapdrm: Don't forward set_min_bus_tput() to no-op platform code

2017-08-04 Thread Laurent Pinchart
The OMAP implementation of the set_min_bus_tput() API is a no-op.
There's no point in forwarding the driver calls to the platform code.
Remove the use of the related platform data callback, but keep the
internal function as a reminder that the feature will need to be
implemented when the OMAP platform will provide support.

Signed-off-by: Laurent Pinchart 
Reviewed-by: Tomi Valkeinen 
---
Changes since v1:

- Make the function inline
---
 drivers/gpu/drm/omapdrm/dss/core.c | 10 --
 drivers/gpu/drm/omapdrm/dss/dss.h  |  7 ++-
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/core.c 
b/drivers/gpu/drm/omapdrm/dss/core.c
index a6baa0a0a973..706f354b5fa8 100644
--- a/drivers/gpu/drm/omapdrm/dss/core.c
+++ b/drivers/gpu/drm/omapdrm/dss/core.c
@@ -50,16 +50,6 @@ enum omapdss_version omapdss_get_version(void)
 }
 EXPORT_SYMBOL(omapdss_get_version);
 
-int dss_set_min_bus_tput(struct device *dev, unsigned long tput)
-{
-   struct omap_dss_board_info *pdata = core.pdev->dev.platform_data;
-
-   if (pdata->set_min_bus_tput)
-   return pdata->set_min_bus_tput(dev, tput);
-   else
-   return 0;
-}
-
 #if defined(CONFIG_OMAP2_DSS_DEBUGFS)
 static int dss_debug_show(struct seq_file *s, void *unused)
 {
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h 
b/drivers/gpu/drm/omapdrm/dss/dss.h
index 668ff93512db..136977cb1aeb 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss.h
@@ -219,7 +219,12 @@ struct seq_file;
 struct platform_device;
 
 /* core */
-int dss_set_min_bus_tput(struct device *dev, unsigned long tput);
+static inline int dss_set_min_bus_tput(struct device *dev, unsigned long tput)
+{
+   /* To be implemented when the OMAP platform will provide this feature */
+   return 0;
+}
+
 int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file 
*));
 
 static inline bool dss_mgr_is_lcd(enum omap_channel id)
-- 
Regards,

Laurent Pinchart

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


[PATCH v3 11/35] drm: omapdrm: dispc: Select features based on compatible string

2017-08-04 Thread Laurent Pinchart
Use the compatible string instead of the OMAP SoC revision to determine
device features. On OMAP34xx the features depend on the ES revision that
can not be determined from the compatible string. Use soc_device_match()
in that case.

Signed-off-by: Laurent Pinchart 
Reviewed-by: Tomi Valkeinen 
---
Changes since v2:

- Fix the soc_device_match() entry for OMAP34xx ES1
---
 drivers/gpu/drm/omapdrm/dss/dispc.c | 87 -
 1 file changed, 27 insertions(+), 60 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
b/drivers/gpu/drm/omapdrm/dss/dispc.c
index fd7504b37e3b..7053e3fdc9e2 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -39,7 +39,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 
@@ -3804,54 +3806,6 @@ static const struct dispc_features omap54xx_dispc_feats 
= {
.has_gamma_i734_bug =   true,
 };
 
-static int dispc_init_features(struct platform_device *pdev)
-{
-   const struct dispc_features *src;
-   struct dispc_features *dst;
-
-   dst = devm_kzalloc(>dev, sizeof(*dst), GFP_KERNEL);
-   if (!dst) {
-   dev_err(>dev, "Failed to allocate DISPC Features\n");
-   return -ENOMEM;
-   }
-
-   switch (omapdss_get_version()) {
-   case OMAPDSS_VER_OMAP24xx:
-   src = _dispc_feats;
-   break;
-
-   case OMAPDSS_VER_OMAP34xx_ES1:
-   src = _rev1_0_dispc_feats;
-   break;
-
-   case OMAPDSS_VER_OMAP34xx_ES3:
-   case OMAPDSS_VER_OMAP3630:
-   case OMAPDSS_VER_AM35xx:
-   case OMAPDSS_VER_AM43xx:
-   src = _rev3_0_dispc_feats;
-   break;
-
-   case OMAPDSS_VER_OMAP4430_ES1:
-   case OMAPDSS_VER_OMAP4430_ES2:
-   case OMAPDSS_VER_OMAP4:
-   src = _dispc_feats;
-   break;
-
-   case OMAPDSS_VER_OMAP5:
-   case OMAPDSS_VER_DRA7xx:
-   src = _dispc_feats;
-   break;
-
-   default:
-   return -ENODEV;
-   }
-
-   memcpy(dst, src, sizeof(*dst));
-   dispc.feat = dst;
-
-   return 0;
-}
-
 static irqreturn_t dispc_irq_handler(int irq, void *arg)
 {
if (!dispc.is_enabled)
@@ -4083,9 +4037,25 @@ static const struct dispc_ops dispc_ops = {
 };
 
 /* DISPC HW IP initialisation */
+static const struct of_device_id dispc_of_match[] = {
+   { .compatible = "ti,omap2-dispc", .data = _dispc_feats },
+   { .compatible = "ti,omap3-dispc", .data = _rev3_0_dispc_feats 
},
+   { .compatible = "ti,omap4-dispc", .data = _dispc_feats },
+   { .compatible = "ti,omap5-dispc", .data = _dispc_feats },
+   { .compatible = "ti,dra7-dispc",  .data = _dispc_feats },
+   {},
+};
+
+static const struct soc_device_attribute dispc_soc_devices[] = {
+   { .machine = "OMAP3[45]*",
+ .revision = "ES[12].?",   .data = _rev1_0_dispc_feats },
+   { /* sentinel */ }
+};
+
 static int dispc_bind(struct device *dev, struct device *master, void *data)
 {
struct platform_device *pdev = to_platform_device(dev);
+   const struct soc_device_attribute *soc;
u32 rev;
int r = 0;
struct resource *dispc_mem;
@@ -4095,9 +4065,15 @@ static int dispc_bind(struct device *dev, struct device 
*master, void *data)
 
spin_lock_init(_lock);
 
-   r = dispc_init_features(dispc.pdev);
-   if (r)
-   return r;
+   /*
+* The OMAP34xx ES1.x and ES2.x can't be identified through the
+* compatible string, use SoC device matching.
+*/
+   soc = soc_device_match(dispc_soc_devices);
+   if (soc)
+   dispc.feat = soc->data;
+   else
+   dispc.feat = of_match_device(dispc_of_match, >dev)->data;
 
r = dispc_errata_i734_wa_init();
if (r)
@@ -4226,15 +4202,6 @@ static const struct dev_pm_ops dispc_pm_ops = {
.runtime_resume = dispc_runtime_resume,
 };
 
-static const struct of_device_id dispc_of_match[] = {
-   { .compatible = "ti,omap2-dispc", },
-   { .compatible = "ti,omap3-dispc", },
-   { .compatible = "ti,omap4-dispc", },
-   { .compatible = "ti,omap5-dispc", },
-   { .compatible = "ti,dra7-dispc", },
-   {},
-};
-
 static struct platform_driver omap_dispchw_driver = {
.probe  = dispc_probe,
.remove = dispc_remove,
-- 
Regards,

Laurent Pinchart

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


[PATCH v3 12/35] drm: omapdrm: dpi: Replace OMAP SoC model checks with DSS model

2017-08-04 Thread Laurent Pinchart
The DPI code only needs to differentiate between major OMAP revisions,
which can be obtained from the DSS compatible string. Replace the OMAP
SoC model checks to prepare for removal of the OMAP SoC version platform
data.

Signed-off-by: Laurent Pinchart 
---
Changes since v2:

- Rename dss_device_type to dss_model
---
 drivers/gpu/drm/omapdrm/dss/dpi.c | 59 +--
 drivers/gpu/drm/omapdrm/dss/dss.c | 10 ++-
 drivers/gpu/drm/omapdrm/dss/dss.h | 13 +++--
 3 files changed, 45 insertions(+), 37 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c 
b/drivers/gpu/drm/omapdrm/dss/dpi.c
index 2828b1c1f625..857d462b3786 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -39,6 +39,7 @@
 
 struct dpi_data {
struct platform_device *pdev;
+   enum dss_model dss_model;
 
struct regulator *vdds_dsi_reg;
enum dss_clk_source clk_src;
@@ -99,25 +100,21 @@ static enum dss_clk_source dpi_get_clk_src_dra7xx(enum 
omap_channel channel)
return DSS_CLK_SRC_FCK;
 }
 
-static enum dss_clk_source dpi_get_clk_src(enum omap_channel channel)
+static enum dss_clk_source dpi_get_clk_src(struct dpi_data *dpi)
 {
+   enum omap_channel channel = dpi->output.dispc_channel;
+
/*
 * XXX we can't currently use DSI PLL for DPI with OMAP3, as the DSI PLL
 * would also be used for DISPC fclk. Meaning, when the DPI output is
 * disabled, DISPC clock will be disabled, and TV out will stop.
 */
-   switch (omapdss_get_version()) {
-   case OMAPDSS_VER_OMAP24xx:
-   case OMAPDSS_VER_OMAP34xx_ES1:
-   case OMAPDSS_VER_OMAP34xx_ES3:
-   case OMAPDSS_VER_OMAP3630:
-   case OMAPDSS_VER_AM35xx:
-   case OMAPDSS_VER_AM43xx:
+   switch (dpi->dss_model) {
+   case DSS_MODEL_OMAP2:
+   case DSS_MODEL_OMAP3:
return DSS_CLK_SRC_FCK;
 
-   case OMAPDSS_VER_OMAP4430_ES1:
-   case OMAPDSS_VER_OMAP4430_ES2:
-   case OMAPDSS_VER_OMAP4:
+   case DSS_MODEL_OMAP4:
switch (channel) {
case OMAP_DSS_CHANNEL_LCD:
return DSS_CLK_SRC_PLL1_1;
@@ -127,7 +124,7 @@ static enum dss_clk_source dpi_get_clk_src(enum 
omap_channel channel)
return DSS_CLK_SRC_FCK;
}
 
-   case OMAPDSS_VER_OMAP5:
+   case DSS_MODEL_OMAP5:
switch (channel) {
case OMAP_DSS_CHANNEL_LCD:
return DSS_CLK_SRC_PLL1_1;
@@ -138,7 +135,7 @@ static enum dss_clk_source dpi_get_clk_src(enum 
omap_channel channel)
return DSS_CLK_SRC_FCK;
}
 
-   case OMAPDSS_VER_DRA7xx:
+   case DSS_MODEL_DRA7:
return dpi_get_clk_src_dra7xx(channel);
 
default:
@@ -597,7 +594,7 @@ static void dpi_init_pll(struct dpi_data *dpi)
if (dpi->pll)
return;
 
-   dpi->clk_src = dpi_get_clk_src(dpi->output.dispc_channel);
+   dpi->clk_src = dpi_get_clk_src(dpi);
 
pll = dss_pll_find_by_src(dpi->clk_src);
if (!pll)
@@ -617,18 +614,14 @@ static void dpi_init_pll(struct dpi_data *dpi)
  * the channel in some more dynamic manner, or get the channel as a user
  * parameter.
  */
-static enum omap_channel dpi_get_channel(int port_num)
+static enum omap_channel dpi_get_channel(struct dpi_data *dpi, int port_num)
 {
-   switch (omapdss_get_version()) {
-   case OMAPDSS_VER_OMAP24xx:
-   case OMAPDSS_VER_OMAP34xx_ES1:
-   case OMAPDSS_VER_OMAP34xx_ES3:
-   case OMAPDSS_VER_OMAP3630:
-   case OMAPDSS_VER_AM35xx:
-   case OMAPDSS_VER_AM43xx:
+   switch (dpi->dss_model) {
+   case DSS_MODEL_OMAP2:
+   case DSS_MODEL_OMAP3:
return OMAP_DSS_CHANNEL_LCD;
 
-   case OMAPDSS_VER_DRA7xx:
+   case DSS_MODEL_DRA7:
switch (port_num) {
case 2:
return OMAP_DSS_CHANNEL_LCD3;
@@ -639,12 +632,10 @@ static enum omap_channel dpi_get_channel(int port_num)
return OMAP_DSS_CHANNEL_LCD;
}
 
-   case OMAPDSS_VER_OMAP4430_ES1:
-   case OMAPDSS_VER_OMAP4430_ES2:
-   case OMAPDSS_VER_OMAP4:
+   case DSS_MODEL_OMAP4:
return OMAP_DSS_CHANNEL_LCD2;
 
-   case OMAPDSS_VER_OMAP5:
+   case DSS_MODEL_OMAP5:
return OMAP_DSS_CHANNEL_LCD3;
 
default:
@@ -709,10 +700,8 @@ static const struct omapdss_dpi_ops dpi_ops = {
.get_timings = dpi_get_timings,
 };
 
-static void dpi_init_output_port(struct platform_device *pdev,
-   struct device_node *port)
+static void dpi_init_output_port(struct dpi_data *dpi, struct device_node 
*port)
 {
-   struct dpi_data *dpi = port->data;
struct omap_dss_device *out = >output;
int r;
u32 port_num;
@@ -734,10 +723,10 @@ static void 

[PATCH v3 09/35] drm: omapdrm: dsi: Handle pin muxing internally

2017-08-04 Thread Laurent Pinchart
Don't rely on callback functions provided by the platform, but access
the syscon internally to mux the DSI pins.

Signed-off-by: Laurent Pinchart 
Reviewed-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/core.c | 20 --
 drivers/gpu/drm/omapdrm/dss/dsi.c  | 82 --
 drivers/gpu/drm/omapdrm/dss/dss.h  |  2 -
 3 files changed, 79 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/core.c 
b/drivers/gpu/drm/omapdrm/dss/core.c
index bdce4bfdf6e0..a6baa0a0a973 100644
--- a/drivers/gpu/drm/omapdrm/dss/core.c
+++ b/drivers/gpu/drm/omapdrm/dss/core.c
@@ -50,26 +50,6 @@ enum omapdss_version omapdss_get_version(void)
 }
 EXPORT_SYMBOL(omapdss_get_version);
 
-int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask)
-{
-   struct omap_dss_board_info *board_data = core.pdev->dev.platform_data;
-
-   if (!board_data->dsi_enable_pads)
-   return -ENOENT;
-
-   return board_data->dsi_enable_pads(dsi_id, lane_mask);
-}
-
-void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask)
-{
-   struct omap_dss_board_info *board_data = core.pdev->dev.platform_data;
-
-   if (!board_data->dsi_disable_pads)
-   return;
-
-   return board_data->dsi_disable_pads(dsi_id, lane_mask);
-}
-
 int dss_set_min_bus_tput(struct device *dev, unsigned long tput)
 {
struct omap_dss_board_info *pdata = core.pdev->dev.platform_data;
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 835f49004bc3..d32e56c5f657 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -20,6 +20,8 @@
 #define DSS_SUBSYS_NAME "DSI"
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -312,6 +314,7 @@ struct dsi_data {
bool is_enabled;
 
struct clk *dss_clk;
+   struct regmap *syscon;
 
struct dispc_clock_info user_dispc_cinfo;
struct dss_pll_clock_info user_dsi_cinfo;
@@ -2060,6 +2063,64 @@ static unsigned dsi_get_lane_mask(struct platform_device 
*dsidev)
return mask;
 }
 
+/* OMAP4 CONTROL_DSIPHY */
+#define OMAP4_DSIPHY_SYSCON_OFFSET 0x78
+
+#define OMAP4_DSI2_LANEENABLE_SHIFT29
+#define OMAP4_DSI2_LANEENABLE_MASK (0x7 << 29)
+#define OMAP4_DSI1_LANEENABLE_SHIFT24
+#define OMAP4_DSI1_LANEENABLE_MASK (0x1f << 24)
+#define OMAP4_DSI1_PIPD_SHIFT  19
+#define OMAP4_DSI1_PIPD_MASK   (0x1f << 19)
+#define OMAP4_DSI2_PIPD_SHIFT  14
+#define OMAP4_DSI2_PIPD_MASK   (0x1f << 14)
+
+static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes)
+{
+   u32 enable_mask, enable_shift;
+   u32 pipd_mask, pipd_shift;
+   u32 reg;
+
+   if (!dsi->syscon)
+   return 0;
+
+   if (dsi->module_id == 0) {
+   enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
+   enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT;
+   pipd_mask = OMAP4_DSI1_PIPD_MASK;
+   pipd_shift = OMAP4_DSI1_PIPD_SHIFT;
+   } else if (dsi->module_id == 1) {
+   enable_mask = OMAP4_DSI2_LANEENABLE_MASK;
+   enable_shift = OMAP4_DSI2_LANEENABLE_SHIFT;
+   pipd_mask = OMAP4_DSI2_PIPD_MASK;
+   pipd_shift = OMAP4_DSI2_PIPD_SHIFT;
+   } else {
+   return -ENODEV;
+   }
+
+   regmap_read(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET, );
+
+   reg &= ~enable_mask;
+   reg &= ~pipd_mask;
+
+   reg |= (lanes << enable_shift) & enable_mask;
+   reg |= (lanes << pipd_shift) & pipd_mask;
+
+   regmap_write(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET, reg);
+
+   return 0;
+}
+
+static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask)
+{
+   return dsi_omap4_mux_pads(dsi, lane_mask);
+}
+
+static void dsi_disable_pads(struct dsi_data *dsi)
+{
+   dsi_omap4_mux_pads(dsi, 0);
+}
+
 static int dsi_cio_init(struct platform_device *dsidev)
 {
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
@@ -2068,7 +2129,7 @@ static int dsi_cio_init(struct platform_device *dsidev)
 
DSSDBG("DSI CIO init starts");
 
-   r = dss_dsi_enable_pads(dsi->module_id, dsi_get_lane_mask(dsidev));
+   r = dsi_enable_pads(dsi, dsi_get_lane_mask(dsidev));
if (r)
return r;
 
@@ -2178,7 +2239,7 @@ static int dsi_cio_init(struct platform_device *dsidev)
dsi_cio_disable_lane_override(dsidev);
 err_scp_clk_dom:
dsi_disable_scp_clk(dsidev);
-   dss_dsi_disable_pads(dsi->module_id, dsi_get_lane_mask(dsidev));
+   dsi_disable_pads(dsi);
return r;
 }
 
@@ -2191,7 +2252,7 @@ static void dsi_cio_uninit(struct platform_device *dsidev)
 
dsi_cio_power(dsidev, DSI_COMPLEXIO_POWER_OFF);

[PATCH v3 05/35] drm: omapdrm: dpi: Remove unneeded regulator check

2017-08-04 Thread Laurent Pinchart
The dpi_display_enable() function ensures that a VDDS_DSI regulator is
available if the DSI uses the VDDS_DSI supply. This is not needed, as a
failure to get the VDDS_DSI supply will result in a probe failure,
dpi_display_enable() will thus never be called in that case.

Remove the check, and replace tests for the FEAT_DPI_USES_VDDS_DSI
feature with a test for the regulator object.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/dpi.c | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c 
b/drivers/gpu/drm/omapdrm/dss/dpi.c
index 86dbb65a6c28..2828b1c1f625 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -403,19 +403,13 @@ static int dpi_display_enable(struct omap_dss_device 
*dssdev)
 
mutex_lock(>lock);
 
-   if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI) && !dpi->vdds_dsi_reg) {
-   DSSERR("no VDSS_DSI regulator\n");
-   r = -ENODEV;
-   goto err_no_reg;
-   }
-
if (!out->dispc_channel_connected) {
DSSERR("failed to enable display: no output/manager\n");
r = -ENODEV;
goto err_no_out_mgr;
}
 
-   if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI)) {
+   if (dpi->vdds_dsi_reg) {
r = regulator_enable(dpi->vdds_dsi_reg);
if (r)
goto err_reg_enable;
@@ -459,11 +453,10 @@ static int dpi_display_enable(struct omap_dss_device 
*dssdev)
 err_src_sel:
dispc_runtime_put();
 err_get_dispc:
-   if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
+   if (dpi->vdds_dsi_reg)
regulator_disable(dpi->vdds_dsi_reg);
 err_reg_enable:
 err_no_out_mgr:
-err_no_reg:
mutex_unlock(>lock);
return r;
 }
@@ -484,7 +477,7 @@ static void dpi_display_disable(struct omap_dss_device 
*dssdev)
 
dispc_runtime_put();
 
-   if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
+   if (dpi->vdds_dsi_reg)
regulator_disable(dpi->vdds_dsi_reg);
 
mutex_unlock(>lock);
-- 
Regards,

Laurent Pinchart

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


[PATCH v3 08/35] drm: omapdrm: dss: Split operations out of dss_features structure

2017-08-04 Thread Laurent Pinchart
Move the two function pointers to a new dss_ops structure. This will
allow merging the dss_features and omap_dss_features structures without
having to expose the DPI source selection and LCD clock muxing functions
in header files.

Signed-off-by: Laurent Pinchart 
---
Changes since v2:

- Correctly use dss_ops_omap4 instead of dss_ops_dra7 for OMAP44xx
---
 drivers/gpu/drm/omapdrm/dss/dss.c | 50 +++
 1 file changed, 35 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c 
b/drivers/gpu/drm/omapdrm/dss/dss.c
index 99e22ca972c7..b8a2f92efcba 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -69,15 +69,19 @@ struct dss_reg {
 #define REG_FLD_MOD(idx, val, start, end) \
dss_write_reg(idx, FLD_MOD(dss_read_reg(idx), val, start, end))
 
+struct dss_ops {
+   int (*dpi_select_source)(int port, enum omap_channel channel);
+   int (*select_lcd_source)(enum omap_channel channel,
+   enum dss_clk_source clk_src);
+};
+
 struct dss_features {
u8 fck_div_max;
u8 dss_fck_multiplier;
const char *parent_clk_name;
const enum omap_display_type *ports;
int num_ports;
-   int (*dpi_select_source)(int port, enum omap_channel channel);
-   int (*select_lcd_source)(enum omap_channel channel,
-   enum dss_clk_source clk_src);
+   const struct dss_ops *ops;
 };
 
 static struct {
@@ -576,7 +580,7 @@ void dss_select_lcd_clk_source(enum omap_channel channel,
return;
}
 
-   r = dss.feat->select_lcd_source(channel, clk_src);
+   r = dss.feat->ops->select_lcd_source(channel, clk_src);
if (r)
return;
 
@@ -823,7 +827,7 @@ static int dss_dpi_select_source_dra7xx(int port, enum 
omap_channel channel)
 
 int dss_dpi_select_source(int port, enum omap_channel channel)
 {
-   return dss.feat->dpi_select_source(port, channel);
+   return dss.feat->ops->dpi_select_source(port, channel);
 }
 
 static int dss_get_clocks(void)
@@ -893,6 +897,25 @@ void dss_debug_dump_clocks(struct seq_file *s)
 #endif
 
 
+static const struct dss_ops dss_ops_omap2_omap3 = {
+   .dpi_select_source = _dpi_select_source_omap2_omap3,
+};
+
+static const struct dss_ops dss_ops_omap4 = {
+   .dpi_select_source = _dpi_select_source_omap4,
+   .select_lcd_source = _lcd_clk_mux_omap4,
+};
+
+static const struct dss_ops dss_ops_omap5 = {
+   .dpi_select_source = _dpi_select_source_omap5,
+   .select_lcd_source = _lcd_clk_mux_omap5,
+};
+
+static const struct dss_ops dss_ops_dra7 = {
+   .dpi_select_source = _dpi_select_source_dra7xx,
+   .select_lcd_source = _lcd_clk_mux_dra7,
+};
+
 static const enum omap_display_type omap2plus_ports[] = {
OMAP_DISPLAY_TYPE_DPI,
 };
@@ -916,66 +939,63 @@ static const struct dss_features omap24xx_dss_feats = {
.fck_div_max=   6,
.dss_fck_multiplier =   2,
.parent_clk_name=   "core_ck",
-   .dpi_select_source  =   _dpi_select_source_omap2_omap3,
.ports  =   omap2plus_ports,
.num_ports  =   ARRAY_SIZE(omap2plus_ports),
+   .ops=   _ops_omap2_omap3,
 };
 
 static const struct dss_features omap34xx_dss_feats = {
.fck_div_max=   16,
.dss_fck_multiplier =   2,
.parent_clk_name=   "dpll4_ck",
-   .dpi_select_source  =   _dpi_select_source_omap2_omap3,
.ports  =   omap34xx_ports,
.num_ports  =   ARRAY_SIZE(omap34xx_ports),
+   .ops=   _ops_omap2_omap3,
 };
 
 static const struct dss_features omap3630_dss_feats = {
.fck_div_max=   32,
.dss_fck_multiplier =   1,
.parent_clk_name=   "dpll4_ck",
-   .dpi_select_source  =   _dpi_select_source_omap2_omap3,
.ports  =   omap2plus_ports,
.num_ports  =   ARRAY_SIZE(omap2plus_ports),
+   .ops=   _ops_omap2_omap3,
 };
 
 static const struct dss_features omap44xx_dss_feats = {
.fck_div_max=   32,
.dss_fck_multiplier =   1,
.parent_clk_name=   "dpll_per_x2_ck",
-   .dpi_select_source  =   _dpi_select_source_omap4,
.ports  =   omap2plus_ports,
.num_ports  =   ARRAY_SIZE(omap2plus_ports),
-   .select_lcd_source  =   _lcd_clk_mux_omap4,
+   .ops=   _ops_omap4,
 };
 
 static const struct dss_features omap54xx_dss_feats = {
.fck_div_max=   64,
.dss_fck_multiplier =   1,
.parent_clk_name=   "dpll_per_x2_ck",
-   

[PATCH v3 06/35] drm: omapdrm: venc: Don't export omap_dss_pal_vm and omap_dss_ntsc_vm

2017-08-04 Thread Laurent Pinchart
The two variables are never used outside of their compilation unit, make
them static.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 7 ---
 drivers/gpu/drm/omapdrm/dss/venc.c| 6 ++
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 85953a0bc7c2..2bc75b7148df 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -241,13 +241,6 @@ struct omap_dss_dsi_config {
enum omap_dss_dsi_trans_mode trans_mode;
 };
 
-/* Hardcoded videomodes for tv. Venc only uses these to
- * identify the mode, and does not actually use the configs
- * itself. However, the configs should be something that
- * a normal monitor can also show */
-extern const struct videomode omap_dss_pal_vm;
-extern const struct videomode omap_dss_ntsc_vm;
-
 struct omap_dss_cpr_coefs {
s16 rr, rg, rb;
s16 gr, gg, gb;
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c 
b/drivers/gpu/drm/omapdrm/dss/venc.c
index a6bfb3918b8d..9e4fc000e961 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -263,7 +263,7 @@ static const struct venc_config venc_config_pal_bdghi = {
.fid_ext_start_y__fid_ext_offset_y  = 0x01380005,
 };
 
-const struct videomode omap_dss_pal_vm = {
+static const struct videomode omap_dss_pal_vm = {
.hactive= 720,
.vactive= 574,
.pixelclock = 1350,
@@ -279,9 +279,8 @@ const struct videomode omap_dss_pal_vm = {
  DISPLAY_FLAGS_PIXDATA_POSEDGE |
  DISPLAY_FLAGS_SYNC_NEGEDGE,
 };
-EXPORT_SYMBOL(omap_dss_pal_vm);
 
-const struct videomode omap_dss_ntsc_vm = {
+static const struct videomode omap_dss_ntsc_vm = {
.hactive= 720,
.vactive= 482,
.pixelclock = 1350,
@@ -297,7 +296,6 @@ const struct videomode omap_dss_ntsc_vm = {
  DISPLAY_FLAGS_PIXDATA_POSEDGE |
  DISPLAY_FLAGS_SYNC_NEGEDGE,
 };
-EXPORT_SYMBOL(omap_dss_ntsc_vm);
 
 static struct {
struct platform_device *pdev;
-- 
Regards,

Laurent Pinchart

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


[PATCH v3 04/35] drm: omapdrm: panel-dpi: Remove unneeded check for OF node

2017-08-04 Thread Laurent Pinchart
As non-DT booting is no longer supported, the only way to instantiate
the device is through an OF node, which is guaranteed to be present.
Remove the unneeded check.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c 
b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c
index 6468a765f3d1..e065f7e10cca 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c
@@ -231,6 +231,9 @@ static int panel_dpi_probe(struct platform_device *pdev)
struct omap_dss_device *dssdev;
int r;
 
+   if (!pdev->dev.of_node)
+   return -ENODEV;
+
ddata = devm_kzalloc(>dev, sizeof(*ddata), GFP_KERNEL);
if (ddata == NULL)
return -ENOMEM;
-- 
Regards,

Laurent Pinchart

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


[PATCH v3 07/35] drm: omapdrm: hdmi: Store PHY features in PHY data structure

2017-08-04 Thread Laurent Pinchart
PHY features are stored in a global variable, while they should be
properties of the PHY object. As existing OMAP platforms have a single
HDMI PHY this doesn't cause any issue, but doesn't follow the driver
model.

Move the PHY features to the HDMI PHY data structure to follow the
driver model and pave the road for multiple HDMI PHYs support.

Signed-off-by: Laurent Pinchart 
Reviewed-by: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/dss/hdmi.h |  7 +++
 drivers/gpu/drm/omapdrm/dss/hdmi_phy.c | 23 ---
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi.h 
b/drivers/gpu/drm/omapdrm/dss/hdmi.h
index fb6cccd02374..851e5e6f6820 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi.h
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi.h
@@ -245,9 +245,16 @@ struct hdmi_pll_data {
struct hdmi_wp_data *wp;
 };
 
+struct hdmi_phy_features {
+   bool bist_ctrl;
+   bool ldo_voltage;
+   unsigned long max_phy;
+};
+
 struct hdmi_phy_data {
void __iomem *base;
 
+   const struct hdmi_phy_features *features;
u8 lane_function[4];
u8 lane_polarity[4];
 };
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi_phy.c 
b/drivers/gpu/drm/omapdrm/dss/hdmi_phy.c
index fb5e4c724b4b..bff1ea11ed2f 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi_phy.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi_phy.c
@@ -19,14 +19,6 @@
 #include "dss.h"
 #include "hdmi.h"
 
-struct hdmi_phy_features {
-   bool bist_ctrl;
-   bool ldo_voltage;
-   unsigned long max_phy;
-};
-
-static const struct hdmi_phy_features *phy_feat;
-
 void hdmi_phy_dump(struct hdmi_phy_data *phy, struct seq_file *s)
 {
 #define DUMPPHY(r) seq_printf(s, "%-35s %08x\n", #r,\
@@ -36,7 +28,7 @@ void hdmi_phy_dump(struct hdmi_phy_data *phy, struct seq_file 
*s)
DUMPPHY(HDMI_TXPHY_DIGITAL_CTRL);
DUMPPHY(HDMI_TXPHY_POWER_CTRL);
DUMPPHY(HDMI_TXPHY_PAD_CFG_CTRL);
-   if (phy_feat->bist_ctrl)
+   if (phy->features->bist_ctrl)
DUMPPHY(HDMI_TXPHY_BIST_CONTROL);
 }
 
@@ -146,7 +138,7 @@ int hdmi_phy_configure(struct hdmi_phy_data *phy, unsigned 
long hfbitclk,
 * In OMAP5+, the HFBITCLK must be divided by 2 before issuing the
 * HDMI_PHYPWRCMD_LDOON command.
*/
-   if (phy_feat->bist_ctrl)
+   if (phy->features->bist_ctrl)
REG_FLD_MOD(phy->base, HDMI_TXPHY_BIST_CONTROL, 1, 11, 11);
 
/*
@@ -155,7 +147,7 @@ int hdmi_phy_configure(struct hdmi_phy_data *phy, unsigned 
long hfbitclk,
 */
if (hfbitclk != lfbitclk)
freqout = 0;
-   else if (hfbitclk / 10 < phy_feat->max_phy)
+   else if (hfbitclk / 10 < phy->features->max_phy)
freqout = 1;
else
freqout = 2;
@@ -170,7 +162,7 @@ int hdmi_phy_configure(struct hdmi_phy_data *phy, unsigned 
long hfbitclk,
hdmi_write_reg(phy->base, HDMI_TXPHY_DIGITAL_CTRL, 0xF000);
 
/* Setup max LDO voltage */
-   if (phy_feat->ldo_voltage)
+   if (phy->features->ldo_voltage)
REG_FLD_MOD(phy->base, HDMI_TXPHY_POWER_CTRL, 0xB, 3, 0);
 
hdmi_phy_configure_lanes(phy);
@@ -190,7 +182,8 @@ static const struct hdmi_phy_features omap54xx_phy_feats = {
.max_phy=   18600,
 };
 
-static int hdmi_phy_init_features(struct platform_device *pdev)
+static int hdmi_phy_init_features(struct platform_device *pdev,
+ struct hdmi_phy_data *phy)
 {
struct hdmi_phy_features *dst;
const struct hdmi_phy_features *src;
@@ -218,7 +211,7 @@ static int hdmi_phy_init_features(struct platform_device 
*pdev)
}
 
memcpy(dst, src, sizeof(*dst));
-   phy_feat = dst;
+   phy->features = dst;
 
return 0;
 }
@@ -228,7 +221,7 @@ int hdmi_phy_init(struct platform_device *pdev, struct 
hdmi_phy_data *phy)
int r;
struct resource *res;
 
-   r = hdmi_phy_init_features(pdev);
+   r = hdmi_phy_init_features(pdev, phy);
if (r)
return r;
 
-- 
Regards,

Laurent Pinchart

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


[PATCH v3 03/35] drm: omapdrm: connector-analog-tv: Remove unneeded check for OF node

2017-08-04 Thread Laurent Pinchart
As non-DT booting is no longer supported, the only way to instantiate
the device is through an OF node, which is guaranteed to be present.
Remove the unneeded check.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c 
b/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
index e1fa143a5625..542a76503fbd 100644
--- a/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
+++ b/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
@@ -198,6 +198,9 @@ static int tvc_probe(struct platform_device *pdev)
struct omap_dss_device *dssdev;
int r;
 
+   if (!pdev->dev.of_node)
+   return -ENODEV;
+
ddata = devm_kzalloc(>dev, sizeof(*ddata), GFP_KERNEL);
if (!ddata)
return -ENOMEM;
-- 
Regards,

Laurent Pinchart

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


[PATCH v3 02/35] drm: omapdrm: acx565akm: Remove unneeded check for OF node

2017-08-04 Thread Laurent Pinchart
As non-DT booting is no longer supported, the only way to instantiate
the device is through an OF node, which is guaranteed to be present.
Remove the unneeded check.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c 
b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
index 346aefdb015f..a4214a6a95fa 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
@@ -720,6 +720,9 @@ static int acx565akm_probe(struct spi_device *spi)
 
dev_dbg(>dev, "%s\n", __func__);
 
+   if (!spi->dev.of_node)
+   return -ENODEV;
+
spi->mode = SPI_MODE_3;
 
ddata = devm_kzalloc(>dev, sizeof(*ddata), GFP_KERNEL);
-- 
Regards,

Laurent Pinchart

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


[PATCH v3 00/35] omapdrm: Deconstruct DSS features

2017-08-04 Thread Laurent Pinchart
Hello,

This patch series is a third version of the code previously posted as
"[PATCH v2 00/29] Remove the omapdrm and omapdss devices from platform code".

The omapdss/omapdrm initialization code is quite a mess. The physical devices
are instantiated from DT, but two virtual devices named omapdrm and omapdss
are instanciated from platform code to pass various pieces of platform data to
the drivers.

The omapdrm and omapdss platform devices are currently used to pass data and
function pointers from board code to the drivers for the purpose of

- identifying the OMAP SoC revision
- controlling the DSI pads
- configuring bus throughput

It turns out that all these can be handled in the omapdrm and omapdss drivers
without the need for platform data.

- The SoC revision is used to identify the version of various DSS IP cores,
which can instead be done through compatible string matching (with the help of
soc_device_match() in two cases where ES version is needed).

- The DSI pads control can be performed by the driver directly without calling
board code, accessing the related registers through syscon.

- Bus throughput control is implemented in mach-omap2 as a no-op, so we can
just drop the code.

This patch series starts with a new patch that fixes soc_device_match() usage
on OMAP2+. It turned out that OMAP2+ registers SoC device attributes at late
init time, making soc_device_match() impossible to use for drivers at probe
time, which is unfortunately the location where the feature is most needed.

The next five patches (02/35 to 06/35) are small and simple unneeded or unused
code removal. The next two patches (07/35 and 08/35) are cleanups that make
sense by themselves and will be needed by later refactoring.

The series then starts removing usage of the DSS platform data. It first
removes callbacks to platform code in patches 09/35 and 10/35, and then
tackles the larger task of replacing DSS version usage with model data
stored in OF or SoC device match entries (patches 11/35 to 14/35).

The next large user of the DSS version is the omap_dss_features infrastructure
not to be confused with the similarly named dss_features. The former is a
dirty mix of data related to all IP cores in the while display device, while
the latter contains data related to the DSS itself. The next patches
deconstruct omap_dss_features by removing one unneeded features field (15/35),
and slowly moving features to where they belong (patches 16/35 to 34/35).
Patch 35/35 finally removes the omap_dss_features altogether as they're then
empty.

Note that patches 17/35 and 18/35 are not strictly related to
omap_dss_features deconstruction, but they pave the road to removing the
omapdss platform driver (for the virtual omapdss platform device, also known
as core code, not to be confused with the omapdss_dss driver for the DSS
hardware device) which is the ultimate goal of this effort and should be ready
for upstreaming.

Compared to v2, the DSS version usage in the HDMI4 and HDMI5 drivers is still
present, as the related patches were more controversial and require more work.
I will tackle that next as a separate patch series that will finally remove
omapdss platform driver

This version should be simpler to merge given that it doesn't touch the FBDEV
and ALSA subsystems, but still carries an annoying dependency on OMAP2+
platform code. The easiest solution would be to merge the single OMAP2+ patch
(01/35) through the DRM tree as that's where the bulk of changes lies.

The patches are currently based on top of v4.13-rc2 (-rc1 doesn't boot on the
AM57xx board I use for testing) and have been tested on OMAP3 (BeagleBoard-xM,
DM3730), OMAP4 (pandaboard, OMAP4460) and OMAP5 (AM572x EVM, AM572x). Many
regressions were found, and fixed :-)

Laurent Pinchart (35):
  ARM: OMAP2+: Register SoC device attributes from machine .init()
  drm: omapdrm: acx565akm: Remove unneeded check for OF node
  drm: omapdrm: connector-analog-tv: Remove unneeded check for OF node
  drm: omapdrm: panel-dpi: Remove unneeded check for OF node
  drm: omapdrm: dpi: Remove unneeded regulator check
  drm: omapdrm: venc: Don't export omap_dss_pal_vm and omap_dss_ntsc_vm
  drm: omapdrm: hdmi: Store PHY features in PHY data structure
  drm: omapdrm: dss: Split operations out of dss_features structure
  drm: omapdrm: dsi: Handle pin muxing internally
  drm: omapdrm: Don't forward set_min_bus_tput() to no-op platform code
  drm: omapdrm: dispc: Select features based on compatible string
  drm: omapdrm: dpi: Replace OMAP SoC model checks with DSS model
  drm: omapdrm: dsi: Store DSI model and PLL hardware data in OF data
  drm: omapdrm: dss: Select features based on compatible string
  drm: omapdrm: dss: Use supported outputs instead of display types
  drm: omapdrm: dss: Initialize DSS internal features at probe time
  drm: omapdrm: Move all debugfs code from core to dss
  drm: omapdrm: Move shutdown() handler from core to dss
  drm: omapdrm: Move size unit features to 

[PATCH v3 01/35] ARM: OMAP2+: Register SoC device attributes from machine .init()

2017-08-04 Thread Laurent Pinchart
SoC device attributes are registered with a call to
soc_device_register() from the machine .init_late() operation, which is
called from the late initcall, after all drivers built-in drivers have
been probed. This results in the impossibility for drivers to use SoC
device matching in their probe function.

The omap_soc_device_init() function is safe to call from the machine
.init() operation, as all data it depends on is initialized from the
.init_early() operation. Move SoC device attribute registration to
machine .init() like on all other ARM platforms.

Signed-off-by: Laurent Pinchart 
---
 arch/arm/mach-omap2/board-generic.c | 1 +
 arch/arm/mach-omap2/io.c| 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/board-generic.c 
b/arch/arm/mach-omap2/board-generic.c
index dc9e34e670a2..5303402ed5c2 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -33,6 +33,7 @@ static void __init omap_generic_init(void)
pdata_quirks_init(omap_dt_match_table);
 
omapdss_init_of();
+   omap_soc_device_init();
 }
 
 #ifdef CONFIG_SOC_OMAP2420
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 1d739d1a0a65..952e36b4c4d3 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -428,7 +428,6 @@ static void __init omap_hwmod_init_postsetup(void)
 static void __init __maybe_unused omap_common_late_init(void)
 {
omap2_common_pm_late_init();
-   omap_soc_device_init();
 }
 
 #ifdef CONFIG_SOC_OMAP2420
-- 
Regards,

Laurent Pinchart

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


Re: [PATCH v5 2/6] drm/bridge: Add a devm_ allocator for panel bridge.

2017-08-04 Thread Ilia Mirkin
On Fri, Aug 4, 2017 at 4:43 PM, Eric Anholt  wrote:
> Laurent Pinchart  writes:
>
>> Hi Eric,
>>
>> (CC'ing Daniel)
>>
>> Thank you for the patch.
>>
>> On Tuesday 18 Jul 2017 14:05:06 Eric Anholt wrote:
>>> This will let drivers reduce the error cleanup they need, in
>>> particular the "is_panel_bridge" flag.
>>>
>>> v2: Slight cleanup of remove function by Andrzej
>>
>> I just want to point out that, in the context of Daniel's work on hot-unplug,
>> 90% of the devm_* allocations are wrong and will get in the way. All DRM core
>> objects that are accessible one way or another from userspace will need to be
>> properly reference-counted and freed only when the last reference disappears,
>> which could be well after the corresponding device is removed. I believe this
>> could be one such objects :-/
>
> Sure, if you're hotplugging, your life is pain.  For non-hotpluggable
> devices, like our SOC platform devices (current panel-bridge consumers),
> this still seems like an excellent simplification of memory management.

At that point you may as well make your module non-unloadable, and
return failure when trying to remove a device from management by the
driver (whatever the opposite of "probe" is, I forget). Hotplugging
doesn't only happen when physically removing, it can happen for all
kinds of reasons... and userspace may still hold references in some of
those cases.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v5] drm/fb-helper: pass physical dimensions to fbdev

2017-08-04 Thread Laurent Pinchart
Hi David,

Thank you for the patch.

On Friday 04 Aug 2017 11:25:24 David Lechner wrote:
> The fbdev subsystem has a place for physical dimensions (width and height
> in mm) that is readable by userspace. Since DRM also knows these
> dimensions, pass this information to the fbdev device.

I'm curious, what's your use case for this ? What userspace software do you 
use that is still based on fbdev and needs screen dimensions ?

> This has to be done in drm_setup_crtcs_fb() instead of drm_setup_crtcs()
> because fb_helper->fbdev may be NULL in drm_setup_crtcs().
> ---
> 
> v1 changes (from RFC):
> * Use loop to get info from first connected connector instead of just the
>   first connector.
> 
> v2 changes:
> * Update width in height in drm_setup_crtcs() also to handle hotplug events.
> 
> v3 changes:
> * Add new patch to handle post-fb allocation crcts setup.
> * Use new drm_setup_crtcs_fb() function from new patch to avoid duplication
>   of code.
> 
> v4 changes:
> * Drop patch "drm/fb-helper: add new drm_setup_crtcs_fb() function" since it
> has been applied already.
> * Add mutex lock.
> 
> v5 changes:
> * Fix height = width mismatch.
> 
>  drivers/gpu/drm/drm_fb_helper.c | 17 +++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c
> b/drivers/gpu/drm/drm_fb_helper.c index 4447a28..24787d6 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -1882,8 +1882,6 @@ void drm_fb_helper_fill_var(struct fb_info *info,
> struct drm_fb_helper *fb_helpe info->var.xoffset = 0;
>   info->var.yoffset = 0;
>   info->var.activate = FB_ACTIVATE_NOW;
> - info->var.height = -1;
> - info->var.width = -1;
> 
>   switch (fb->format->depth) {
>   case 8:
> @@ -2435,11 +2433,26 @@ static void drm_setup_crtcs(struct drm_fb_helper
> *fb_helper, */
>  static void drm_setup_crtcs_fb(struct drm_fb_helper *fb_helper)
>  {
> + struct fb_info *info = fb_helper->fbdev;
>   int i;
> 
>   for (i = 0; i < fb_helper->crtc_count; i++)
>   if (fb_helper->crtc_info[i].mode_set.num_connectors)
>   fb_helper->crtc_info[i].mode_set.fb = fb_helper-
>fb;
> +
> + mutex_lock(_helper->dev->mode_config.mutex);
> + drm_fb_helper_for_each_connector(fb_helper, i) {
> + struct drm_connector *connector =
> + fb_helper->connector_info[i]-
>connector;
> +
> + /* use first connected connector for the physical dimensions 
*/
> + if (connector->status == connector_status_connected) {
> + info->var.width = connector->display_info.width_mm;
> + info->var.height = connector-
>display_info.height_mm;
> + break;
> + }
> + }
> + mutex_unlock(_helper->dev->mode_config.mutex);
>  }
> 
>  /* Note: Drops fb_helper->lock before returning. */

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH v5 2/6] drm/bridge: Add a devm_ allocator for panel bridge.

2017-08-04 Thread Laurent Pinchart
Hi Eric,

On Friday 04 Aug 2017 13:43:25 Eric Anholt wrote:
> Laurent Pinchart  writes:
> > On Tuesday 18 Jul 2017 14:05:06 Eric Anholt wrote:
> >> This will let drivers reduce the error cleanup they need, in
> >> particular the "is_panel_bridge" flag.
> >> 
> >> v2: Slight cleanup of remove function by Andrzej
> > 
> > I just want to point out that, in the context of Daniel's work on
> > hot-unplug, 90% of the devm_* allocations are wrong and will get in the
> > way. All DRM core objects that are accessible one way or another from
> > userspace will need to be properly reference-counted and freed only when
> > the last reference disappears, which could be well after the
> > corresponding device is removed. I believe this could be one such objects
> > :-/
> 
> Sure, if you're hotplugging, your life is pain.  For non-hotpluggable
> devices, like our SOC platform devices (current panel-bridge consumers),
> this still seems like an excellent simplification of memory management.

It encourages driver writers to write code that they will have to fix later. 
That's certainly a simplification, but certainly not a good thing in my 
opinion :-)

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH v5 1/6] drm/vc4: Avoid using vrefresh==0 mode in DSI htotal math.

2017-08-04 Thread Eric Anholt
Boris Brezillon  writes:

> On Tue, 18 Jul 2017 14:05:05 -0700
> Eric Anholt  wrote:
>
>> The incoming mode might have a missing vrefresh field if it came from
>> drmModeSetCrtc(), which the kernel is supposed to calculate using
>> drm_mode_vrefresh().  We could either use that or the adjusted_mode's
>> original vrefresh value.
>> 
>> However, we can maintain a more exact vrefresh value (not just the
>> integer approximation), by scaling by the ratio of our clocks.
>> 
>> v2: Use math suggested by Andrzej Hajda instead.
>> 
>> Signed-off-by: Eric Anholt 
>> ---
>>  drivers/gpu/drm/vc4/vc4_dsi.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
>> index 629d372633e6..57213f4e3c72 100644
>> --- a/drivers/gpu/drm/vc4/vc4_dsi.c
>> +++ b/drivers/gpu/drm/vc4/vc4_dsi.c
>> @@ -866,7 +866,8 @@ static bool vc4_dsi_encoder_mode_fixup(struct 
>> drm_encoder *encoder,
>>  adjusted_mode->clock = pixel_clock_hz / 1000 + 1;
>>  
>>  /* Given the new pixel clock, adjust HFP to keep vrefresh the same. */
>> -adjusted_mode->htotal = pixel_clock_hz / (mode->vrefresh * 
>> mode->vtotal);
>> +adjusted_mode->htotal = (pixel_clock_hz / 1000 * mode->htotal /
>> + mode->clock);
>
> Hm, I'm not sure I understand this. Shouldn't we have something like:
>
>   adjusted_mode->htotal = (adjusted_mode->clock * mode->htotal) /
>   mode->clock;
>
> Is there a reason for doing '+ 1' when you calculate the adjusted
> pixel clock rate but not here?

We're actually expecting to get within epsilon of pixel_clock_hz, but we
have to bump our clk_set_rate() to a higher value because the clock
driver will give you a bad divider if you ask for anything less than the
rate it can provide.

How about I don't increment the adjusted_mode->clock (since it'll be
userspace visible I think), and instead move that and the "Round up"
comment to the clk_set_rate()?


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


Re: [PATCH] drm/vc4: Advertise supported modifiers for planes

2017-08-04 Thread Eric Anholt
Daniel Stone  writes:

> The IN_FORMATS blob allows the kernel to advertise to userspace which
> format/modifier combinations are supported, per plane. Use this to
> advertise that we support both T_TILED and linear.
>
> Signed-off-by: Daniel Stone 
> ---
>  drivers/gpu/drm/vc4/vc4_plane.c | 22 +-
>  1 file changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
> index 2968b3ebb895..554325117a4e 100644
> --- a/drivers/gpu/drm/vc4/vc4_plane.c
> +++ b/drivers/gpu/drm/vc4/vc4_plane.c
> @@ -863,6 +863,20 @@ vc4_update_plane(struct drm_plane *plane,
> ctx);
>  }
>  
> +static bool vc4_format_mod_supported(struct drm_plane *plane,
> +  uint32_t format,
> +  uint64_t modifier)
> +{
> + /* This is easy: both tiled and linear are supported for all formats. */
> + switch (modifier) {
> + case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED:
> + case DRM_FORMAT_MOD_LINEAR:
> + return true;
> + default:
> + return false;
> + }
> +}

If this is being used for userspace to decide what modifiers it might
want to use for the format, we should disable T_TILED for multi-plane
formats.

However, it also looks like this won't be called unless
dev->mode_config.allow_fb_modifiers, which we should also set.


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


Re: [PATCH v5 2/6] drm/bridge: Add a devm_ allocator for panel bridge.

2017-08-04 Thread Eric Anholt
Laurent Pinchart  writes:

> Hi Eric,
>
> (CC'ing Daniel)
>
> Thank you for the patch.
>
> On Tuesday 18 Jul 2017 14:05:06 Eric Anholt wrote:
>> This will let drivers reduce the error cleanup they need, in
>> particular the "is_panel_bridge" flag.
>> 
>> v2: Slight cleanup of remove function by Andrzej
>
> I just want to point out that, in the context of Daniel's work on hot-unplug, 
> 90% of the devm_* allocations are wrong and will get in the way. All DRM core 
> objects that are accessible one way or another from userspace will need to be 
> properly reference-counted and freed only when the last reference disappears, 
> which could be well after the corresponding device is removed. I believe this 
> could be one such objects :-/

Sure, if you're hotplugging, your life is pain.  For non-hotpluggable
devices, like our SOC platform devices (current panel-bridge consumers),
this still seems like an excellent simplification of memory management.


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


[Bug 101377] Gigabyte R9 380 card fails to load, kernel reports bug

2017-08-04 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101377

--- Comment #11 from j...@dev1ce.com ---
initrd was rebuilt.  Im purchasing another R9 380 card for further testing
(different manufacturer.)  Its possible the build quality of the card is just
mediocre as ive seen numerous reports of problems related specifically to
gigabyte cards and their implementation of the R9 chipset.

-- 
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 v3 3/6] dt-bindings: add binding for Sitronix ST7586 display panels

2017-08-04 Thread Laurent Pinchart
Hi David,

On Friday 04 Aug 2017 10:51:37 David Lechner wrote:
> On 08/04/2017 09:54 AM, Laurent Pinchart wrote:
> > On Thursday 03 Aug 2017 17:33:47 David Lechner wrote:
> >> This adds a new binding for Sitronix ST7586 display panels.
> >> 
> >> Using lego as the vendor prefix in the compatible string because the
> >> display panel I am working with is an integral part of the LEGO
> >> MINDSTORMS EV3.
> >> 
> >> Signed-off-by: David Lechner 
> >> ---
> >> 
> >>   .../bindings/display/sitronix,st7586.txt   | 26
> >>   +++
> >>   1 file changed, 26 insertions(+)
> >>   create mode 100644
> >> 
> >> Documentation/devicetree/bindings/display/sitronix,st7586.txt
> >> 
> >> diff --git
> >> a/Documentation/devicetree/bindings/display/sitronix,st7586.txt
> >> b/Documentation/devicetree/bindings/display/sitronix,st7586.txt new file
> >> mode 100644
> >> index 000..dfb0b7b
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/display/sitronix,st7586.txt
> >> @@ -0,0 +1,26 @@
> >> +Sitronix ST7586 display panel
> >> +
> >> +Required properties:
> >> +- compatible: "lego,ev3-lcd".
> >> +
> >> +The node for this driver must be a child node of a SPI controller, hence
> >> +all mandatory properties described in ../spi/spi-bus.txt must be
> >> specified. +
> >> +Optional properties:
> >> +- dc-gpios:   D/C pin. The presence/absence of this GPIO determines
> >> +  the panel interface operation mode (IF[3:1] pins):
> >> +  - present: IF=011 4-wire 8-bit data serial interface
> >> +  - absent:  IF=010 3-wire 9-bit data serial interface
> > 
> > How does this work ? Do you have a single GPIO on your system connected to
> > IF[1], with IF[3:2] hardwired to 01 ?
> 
> LEGO has not made the internals of the display publicly available, so I
> cannot say for sure. But I assume that IF[3:1] is hardwired to 011. This
> causes pin D1 to assigned to the signal A0, which is what we are calling
> the dc gpio here.
> 
> If IF[3:1] were hardwired to 010, then pin D1 would be not not used and
> there would be no A0 signal.
> 
> So, basically, we can infer the state of IF[3:1] by the fact that we
> have a dc pin or not.

OK, now I understand what you mean. Maybe you should phrase it a bit 
differently to make it clearer ? How about

dc-gpios: Specified or the GPIO connected to the panel's D/C pin (also called 
A0). The property is required when the panel operates in 4-wire mode (IF[3:1] 
= 011) and prohibited when the panel operates in 3-wire mode (IF[3:1] = 010).

By the way, if the signal is named A0, why don't you call the property a0-
gpios ?

> >> +- reset-gpios:Reset pin
> >> +- power-supply:   A regulator node for the supply voltage.
> >> +- backlight:  phandle of the backlight device attached to the panel
> >> +- rotation:   panel rotation in degrees counter clockwise 
(0,90,180,270)
> > 
> > Please use the OF graph DT bindings (a.k.a. ports) to describe the
> > connection between the panel and its source.
> 
> I am afraid that I do not understand this request. What would the source
> of the panel be? There is nothing like a SoC LCD controller that is
> driving this panel.

My bad, I should have read the panel datasheet before replying :-S Please 
ignore this comment.

> >> +Example:
> >> +  display@0{
> >> +  compatible = "lego,ev3-lcd";
> >> +  reg = <0>;
> >> +  spi-max-frequency = <1000>;
> >> +  dc-gpios = < 43 GPIO_ACTIVE_HIGH>;
> >> +  reset-gpios = < 80 GPIO_ACTIVE_HIGH>;
> >> +  };

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH v3 3/6] dt-bindings: add binding for Sitronix ST7586 display panels

2017-08-04 Thread Noralf Trønnes


Den 04.08.2017 18.51, skrev David Lechner:

On 08/04/2017 04:48 AM, Noralf Trønnes wrote:


Den 04.08.2017 00.33, skrev David Lechner:

This adds a new binding for Sitronix ST7586 display panels.

Using lego as the vendor prefix in the compatible string because the 
display

panel I am working with is an integral part of the LEGO MINDSTORMS EV3.


Is this display available outside of this Lego part?

No, it is not.


If not you can remove the properties you don't need for this particular
display setup. Another st7586 display with a different panel would need
a different initialization sequence and compatible string, so we can
add properties when/if that happens.


OK. so I will drop power-supply and backlight.



And the dc/reset gpios should be required properties since your display
won't work without them (or rather they're hardwired that way).

Should I remove these from the driver as well? There are some panels 
out there that could use them.[1]


[1]: 
http://www.buydisplay.com/download/manual/ERC240160-1_Series_Datasheet.pdf




Yes, because that display won't work with the driver as-is, so it's
really dead code. If someone wants to add support for that display,
they'll add the necessary code. When maintaining code for 10-20 years,
it's important to not add code that 'might' be used in the future.
Let the future take care of itself and keep the codebase slim :-)

Noralf.



Noralf.


Signed-off-by: David Lechner 
---
  .../bindings/display/sitronix,st7586.txt   | 26 
++

  1 file changed, 26 insertions(+)
  create mode 100644 
Documentation/devicetree/bindings/display/sitronix,st7586.txt


diff --git 
a/Documentation/devicetree/bindings/display/sitronix,st7586.txt 
b/Documentation/devicetree/bindings/display/sitronix,st7586.txt

new file mode 100644
index 000..dfb0b7b
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/sitronix,st7586.txt
@@ -0,0 +1,26 @@
+Sitronix ST7586 display panel
+
+Required properties:
+- compatible:"lego,ev3-lcd".
+
+The node for this driver must be a child node of a SPI controller, 
hence
+all mandatory properties described in ../spi/spi-bus.txt must be 
specified.

+
+Optional properties:
+- dc-gpios:D/C pin. The presence/absence of this GPIO determines
+the panel interface operation mode (IF[3:1] pins):
+- present: IF=011 4-wire 8-bit data serial interface
+- absent:  IF=010 3-wire 9-bit data serial interface
+- reset-gpios:Reset pin
+- power-supply:A regulator node for the supply voltage.
+- backlight:phandle of the backlight device attached to the panel
+- rotation:panel rotation in degrees counter clockwise 
(0,90,180,270)

+
+Example:
+display@0{
+compatible = "lego,ev3-lcd";
+reg = <0>;
+spi-max-frequency = <1000>;
+dc-gpios = < 43 GPIO_ACTIVE_HIGH>;
+reset-gpios = < 80 GPIO_ACTIVE_HIGH>;
+};






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


Re: [PATCH v3 3/6] dt-bindings: add binding for Sitronix ST7586 display panels

2017-08-04 Thread Noralf Trønnes

Hi Laurent,


Den 04.08.2017 16.54, skrev Laurent Pinchart:

Hi David,

Thank you for the patch.

On Thursday 03 Aug 2017 17:33:47 David Lechner wrote:

This adds a new binding for Sitronix ST7586 display panels.

Using lego as the vendor prefix in the compatible string because the display
panel I am working with is an integral part of the LEGO MINDSTORMS EV3.

Signed-off-by: David Lechner 
---
  .../bindings/display/sitronix,st7586.txt   | 26 +++
  1 file changed, 26 insertions(+)
  create mode 100644
Documentation/devicetree/bindings/display/sitronix,st7586.txt

diff --git a/Documentation/devicetree/bindings/display/sitronix,st7586.txt
b/Documentation/devicetree/bindings/display/sitronix,st7586.txt new file
mode 100644
index 000..dfb0b7b
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/sitronix,st7586.txt
@@ -0,0 +1,26 @@
+Sitronix ST7586 display panel
+
+Required properties:
+- compatible:  "lego,ev3-lcd".
+
+The node for this driver must be a child node of a SPI controller, hence
+all mandatory properties described in ../spi/spi-bus.txt must be specified.
+
+Optional properties:
+- dc-gpios:D/C pin. The presence/absence of this GPIO determines
+   the panel interface operation mode (IF[3:1] pins):
+   - present: IF=011 4-wire 8-bit data serial interface
+   - absent:  IF=010 3-wire 9-bit data serial interface

How does this work ? Do you have a single GPIO on your system connected to
IF[1], with IF[3:2] hardwired to 01 ?


+- reset-gpios: Reset pin
+- power-supply:A regulator node for the supply voltage.
+- backlight:   phandle of the backlight device attached to the panel
+- rotation:panel rotation in degrees counter clockwise (0,90,180,270)

Please use the OF graph DT bindings (a.k.a. ports) to describe the connection
between the panel and its source.


This display has a controller with onboard memory that is scanned out
to the panel. The controller is connected, in this instance, through SPI.
Both initialization and pixel data is transferred over SPI. It resembles
the MIPI DCS/DBI standard except that it misses some of the commands and
has non standard formats: 2-bit greyscale and monochrome. MIPI DBI only
supports rgb formats (3, 8, 12, 16 and 18-bits). So it isn't a drm panel
in the sense as one connected through MIPI DSI or MIPI DPI.

MIPI DBI has 3 interface types:
- 8/9/16/18 bit parallel bus + Data/Command signal (8080 or motorola bus)
- 8/16 bit SPI + D/C signal
- 9 bit SPI (D/C as first bit)

Noralf.


+Example:
+   display@0{
+   compatible = "lego,ev3-lcd";
+   reg = <0>;
+   spi-max-frequency = <1000>;
+   dc-gpios = < 43 GPIO_ACTIVE_HIGH>;
+   reset-gpios = < 80 GPIO_ACTIVE_HIGH>;
+   };


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


Re: [PATCH v3 3/6] dt-bindings: add binding for Sitronix ST7586 display panels

2017-08-04 Thread David Lechner

On 08/04/2017 04:48 AM, Noralf Trønnes wrote:


Den 04.08.2017 00.33, skrev David Lechner:

This adds a new binding for Sitronix ST7586 display panels.

Using lego as the vendor prefix in the compatible string because the 
display

panel I am working with is an integral part of the LEGO MINDSTORMS EV3.


Is this display available outside of this Lego part?

No, it is not.


If not you can remove the properties you don't need for this particular
display setup. Another st7586 display with a different panel would need
a different initialization sequence and compatible string, so we can
add properties when/if that happens.


OK. so I will drop power-supply and backlight.

Should I remove these from the driver as well? There are some panels out 
there that could use them.[1]


[1]: 
http://www.buydisplay.com/download/manual/ERC240160-1_Series_Datasheet.pdf




Noralf.


Signed-off-by: David Lechner 
---
  .../bindings/display/sitronix,st7586.txt   | 26 
++

  1 file changed, 26 insertions(+)
  create mode 100644 
Documentation/devicetree/bindings/display/sitronix,st7586.txt


diff --git 
a/Documentation/devicetree/bindings/display/sitronix,st7586.txt 
b/Documentation/devicetree/bindings/display/sitronix,st7586.txt

new file mode 100644
index 000..dfb0b7b
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/sitronix,st7586.txt
@@ -0,0 +1,26 @@
+Sitronix ST7586 display panel
+
+Required properties:
+- compatible:"lego,ev3-lcd".
+
+The node for this driver must be a child node of a SPI controller, hence
+all mandatory properties described in ../spi/spi-bus.txt must be 
specified.

+
+Optional properties:
+- dc-gpios:D/C pin. The presence/absence of this GPIO determines
+the panel interface operation mode (IF[3:1] pins):
+- present: IF=011 4-wire 8-bit data serial interface
+- absent:  IF=010 3-wire 9-bit data serial interface
+- reset-gpios:Reset pin
+- power-supply:A regulator node for the supply voltage.
+- backlight:phandle of the backlight device attached to the panel
+- rotation:panel rotation in degrees counter clockwise 
(0,90,180,270)

+
+Example:
+display@0{
+compatible = "lego,ev3-lcd";
+reg = <0>;
+spi-max-frequency = <1000>;
+dc-gpios = < 43 GPIO_ACTIVE_HIGH>;
+reset-gpios = < 80 GPIO_ACTIVE_HIGH>;
+};




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


Re: [PATCH v4] drm/fb-helper: pass physical dimensions to fbdev

2017-08-04 Thread David Lechner

On 08/04/2017 11:22 AM, David Lechner wrote:

The fbdev subsystem has a place for physical dimensions (width and height
in mm) that is readable by userspace. Since DRM also knows these
dimensions, pass this information to the fbdev device.

This has to be done in drm_setup_crtcs_fb() instead of drm_setup_crtcs()
because fb_helper->fbdev may be NULL in drm_setup_crtcs().
---

v1 changes (from RFC):
* Use loop to get info from first connected connector instead of just the
   first connector.

v2 changes:
* Update width in height in drm_setup_crtcs() also to handle hotplug events.

v3 changes:
* Add new patch to handle post-fb allocation crcts setup.
* Use new drm_setup_crtcs_fb() function from new patch to avoid duplication
   of code.

v4 changes:
* Drop patch "drm/fb-helper: add new drm_setup_crtcs_fb() function" since it
   has been applied already.
* Add mutex lock.

  drivers/gpu/drm/drm_fb_helper.c | 17 +++--
  1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 4447a28..24787d6 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -1882,8 +1882,6 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct 
drm_fb_helper *fb_helpe
info->var.xoffset = 0;
info->var.yoffset = 0;
info->var.activate = FB_ACTIVATE_NOW;
-   info->var.height = -1;
-   info->var.width = -1;
  
  	switch (fb->format->depth) {

case 8:
@@ -2435,11 +2433,26 @@ static void drm_setup_crtcs(struct drm_fb_helper 
*fb_helper,
   */
  static void drm_setup_crtcs_fb(struct drm_fb_helper *fb_helper)
  {
+   struct fb_info *info = fb_helper->fbdev;
int i;
  
  	for (i = 0; i < fb_helper->crtc_count; i++)

if (fb_helper->crtc_info[i].mode_set.num_connectors)
fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb;
+
+   mutex_lock(_helper->dev->mode_config.mutex);
+   drm_fb_helper_for_each_connector(fb_helper, i) {
+   struct drm_connector *connector =
+   fb_helper->connector_info[i]->connector;
+
+   /* use first connected connector for the physical dimensions */
+   if (connector->status == connector_status_connected) {
+   info->var.height = connector->display_info.width_mm;
+   info->var.width = connector->display_info.height_mm;


Oops. height = width!


+   break;
+   }
+   }
+   mutex_unlock(_helper->dev->mode_config.mutex);
  }
  
  /* Note: Drops fb_helper->lock before returning. */




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


[PATCH v5] drm/fb-helper: pass physical dimensions to fbdev

2017-08-04 Thread David Lechner
The fbdev subsystem has a place for physical dimensions (width and height
in mm) that is readable by userspace. Since DRM also knows these
dimensions, pass this information to the fbdev device.

This has to be done in drm_setup_crtcs_fb() instead of drm_setup_crtcs()
because fb_helper->fbdev may be NULL in drm_setup_crtcs().
---

v1 changes (from RFC):
* Use loop to get info from first connected connector instead of just the
  first connector.

v2 changes:
* Update width in height in drm_setup_crtcs() also to handle hotplug events.

v3 changes:
* Add new patch to handle post-fb allocation crcts setup.
* Use new drm_setup_crtcs_fb() function from new patch to avoid duplication
  of code.

v4 changes:
* Drop patch "drm/fb-helper: add new drm_setup_crtcs_fb() function" since it
  has been applied already.
* Add mutex lock.

v5 changes:
* Fix height = width mismatch.

 drivers/gpu/drm/drm_fb_helper.c | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 4447a28..24787d6 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -1882,8 +1882,6 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct 
drm_fb_helper *fb_helpe
info->var.xoffset = 0;
info->var.yoffset = 0;
info->var.activate = FB_ACTIVATE_NOW;
-   info->var.height = -1;
-   info->var.width = -1;
 
switch (fb->format->depth) {
case 8:
@@ -2435,11 +2433,26 @@ static void drm_setup_crtcs(struct drm_fb_helper 
*fb_helper,
  */
 static void drm_setup_crtcs_fb(struct drm_fb_helper *fb_helper)
 {
+   struct fb_info *info = fb_helper->fbdev;
int i;
 
for (i = 0; i < fb_helper->crtc_count; i++)
if (fb_helper->crtc_info[i].mode_set.num_connectors)
fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb;
+
+   mutex_lock(_helper->dev->mode_config.mutex);
+   drm_fb_helper_for_each_connector(fb_helper, i) {
+   struct drm_connector *connector =
+   fb_helper->connector_info[i]->connector;
+
+   /* use first connected connector for the physical dimensions */
+   if (connector->status == connector_status_connected) {
+   info->var.width = connector->display_info.width_mm;
+   info->var.height = connector->display_info.height_mm;
+   break;
+   }
+   }
+   mutex_unlock(_helper->dev->mode_config.mutex);
 }
 
 /* Note: Drops fb_helper->lock before returning. */
-- 
2.7.4

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


[PATCH v4] drm/fb-helper: pass physical dimensions to fbdev

2017-08-04 Thread David Lechner
The fbdev subsystem has a place for physical dimensions (width and height
in mm) that is readable by userspace. Since DRM also knows these
dimensions, pass this information to the fbdev device.

This has to be done in drm_setup_crtcs_fb() instead of drm_setup_crtcs()
because fb_helper->fbdev may be NULL in drm_setup_crtcs().
---

v1 changes (from RFC):
* Use loop to get info from first connected connector instead of just the
  first connector.

v2 changes:
* Update width in height in drm_setup_crtcs() also to handle hotplug events.

v3 changes:
* Add new patch to handle post-fb allocation crcts setup.
* Use new drm_setup_crtcs_fb() function from new patch to avoid duplication
  of code.

v4 changes:
* Drop patch "drm/fb-helper: add new drm_setup_crtcs_fb() function" since it
  has been applied already.
* Add mutex lock.

 drivers/gpu/drm/drm_fb_helper.c | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 4447a28..24787d6 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -1882,8 +1882,6 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct 
drm_fb_helper *fb_helpe
info->var.xoffset = 0;
info->var.yoffset = 0;
info->var.activate = FB_ACTIVATE_NOW;
-   info->var.height = -1;
-   info->var.width = -1;
 
switch (fb->format->depth) {
case 8:
@@ -2435,11 +2433,26 @@ static void drm_setup_crtcs(struct drm_fb_helper 
*fb_helper,
  */
 static void drm_setup_crtcs_fb(struct drm_fb_helper *fb_helper)
 {
+   struct fb_info *info = fb_helper->fbdev;
int i;
 
for (i = 0; i < fb_helper->crtc_count; i++)
if (fb_helper->crtc_info[i].mode_set.num_connectors)
fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb;
+
+   mutex_lock(_helper->dev->mode_config.mutex);
+   drm_fb_helper_for_each_connector(fb_helper, i) {
+   struct drm_connector *connector =
+   fb_helper->connector_info[i]->connector;
+
+   /* use first connected connector for the physical dimensions */
+   if (connector->status == connector_status_connected) {
+   info->var.height = connector->display_info.width_mm;
+   info->var.width = connector->display_info.height_mm;
+   break;
+   }
+   }
+   mutex_unlock(_helper->dev->mode_config.mutex);
 }
 
 /* Note: Drops fb_helper->lock before returning. */
-- 
2.7.4

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


Re: [Intel-gfx] [PATCH 00/11] constify i915 attribute_group structures.

2017-08-04 Thread Lionel Landwerlin

On 04/08/17 11:39, Arvind Yadav wrote:




On Friday 04 August 2017 04:04 PM, Lionel Landwerlin wrote:

On 04/08/17 11:22, Arvind Yadav wrote:

Hi Lionel,


On Friday 04 August 2017 02:33 PM, Lionel Landwerlin wrote:

Hi Arwind,

These files were generated by a script maintained in this 
repository : 
https://github.com/rib/gputop/blob/master/scripts/i915-perf-kernelgen.py 

It would best to update this script first to make sure future 
platforms get the fixes too.


Some changes have just been merged, deleted most configs but the 
test ones.

You'll need to update your series.

I have done the changes. Please review it. :) Shared patch is 
0001-i915-perf-kernelgen.py-constify-attribute_group-stru.patch.


Hm... Where is it? (I can't see it on the mailing list nor attached)
The best would be to submit a PR on the github project directly.

I have push directly on github project. I have send patch to you. Is 
there  any different way to send mail.?

 Changes are looks like this.


It turns out the structs you've made const aren't in the tree anymore.

Thanks though!



---
 scripts/i915-perf-kernelgen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/i915-perf-kernelgen.
py b/scripts/i915-perf-kernelgen.py
index 7178f47..7633624 100755
--- a/scripts/i915-perf-kernelgen.py
+++ b/scripts/i915-perf-kernelgen.py
@@ -382,7 +382,7 @@ def output_sysfs_code(sets):
 c("};")

 c("\n")
-c("static struct attribute_group group_" + perf_name_lc + " = {")
+c("static const struct attribute_group group_" + perf_name_lc 
+ " = {")

 c.indent(8)
 c(".name = \"" + metric_set['guid'] + "\",")
 c(".attrs =  attrs_" + perf_name_lc + ",")

---



Otherwise it looks like a good change.

Thanks,

-
Lionel

On 04/08/17 06:03, Arvind Yadav wrote:

attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Arvind Yadav (11):
   [PATCH 01/11] drm: i915: i915_oa_kblgt2: constify 
attribute_group structures.
   [PATCH 02/11] drm: i915: i915_oa_bdw: constify attribute_group 
structures.
   [PATCH 03/11] drm: i915: i915_oa_bxt: constify attribute_group 
structures.
   [PATCH 04/11] drm: i915: i915_oa_chv: constify attribute_group 
structures.
   [PATCH 05/11] drm: i915: i915_oa_glk: constify attribute_group 
structures.
   [PATCH 06/11] drm: i915: i915_oa_hsw: constify attribute_group 
structures.
   [PATCH 07/11] drm: i915: i915_oa_kblgt3: constify 
attribute_group structures.
   [PATCH 08/11] drm: i915: i915_oa_sklgt2: constify 
attribute_group structures.
   [PATCH 09/11] drm: i915: i915_oa_sklgt3: constify 
attribute_group structures.
   [PATCH 10/11] drm: i915: i915_oa_sklgt4: constify 
attribute_group structures.
   [PATCH 11/11] drm: i915: i915_sysfs: constify attribute_group 
structures.


  drivers/gpu/drm/i915/i915_oa_bdw.c| 44 
+--

  drivers/gpu/drm/i915/i915_oa_bxt.c| 30 
  drivers/gpu/drm/i915/i915_oa_chv.c| 28 +++---
  drivers/gpu/drm/i915/i915_oa_glk.c| 30 
  drivers/gpu/drm/i915/i915_oa_hsw.c| 12 +-
  drivers/gpu/drm/i915/i915_oa_kblgt2.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_kblgt3.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_sklgt2.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_sklgt3.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_sklgt4.c | 36 
++--

  drivers/gpu/drm/i915/i915_sysfs.c |  6 ++---
  11 files changed, 165 insertions(+), 165 deletions(-)




~arvind







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


Re: [PATCH v3 3/6] dt-bindings: add binding for Sitronix ST7586 display panels

2017-08-04 Thread David Lechner

On 08/04/2017 09:54 AM, Laurent Pinchart wrote:

Hi David,

Thank you for the patch.

On Thursday 03 Aug 2017 17:33:47 David Lechner wrote:

This adds a new binding for Sitronix ST7586 display panels.

Using lego as the vendor prefix in the compatible string because the display
panel I am working with is an integral part of the LEGO MINDSTORMS EV3.

Signed-off-by: David Lechner 
---
  .../bindings/display/sitronix,st7586.txt   | 26 +++
  1 file changed, 26 insertions(+)
  create mode 100644
Documentation/devicetree/bindings/display/sitronix,st7586.txt

diff --git a/Documentation/devicetree/bindings/display/sitronix,st7586.txt
b/Documentation/devicetree/bindings/display/sitronix,st7586.txt new file
mode 100644
index 000..dfb0b7b
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/sitronix,st7586.txt
@@ -0,0 +1,26 @@
+Sitronix ST7586 display panel
+
+Required properties:
+- compatible:  "lego,ev3-lcd".
+
+The node for this driver must be a child node of a SPI controller, hence
+all mandatory properties described in ../spi/spi-bus.txt must be specified.
+
+Optional properties:
+- dc-gpios:D/C pin. The presence/absence of this GPIO determines
+   the panel interface operation mode (IF[3:1] pins):
+   - present: IF=011 4-wire 8-bit data serial interface
+   - absent:  IF=010 3-wire 9-bit data serial interface


How does this work ? Do you have a single GPIO on your system connected to
IF[1], with IF[3:2] hardwired to 01 ?


LEGO has not made the internals of the display publicly available, so I 
cannot say for sure. But I assume that IF[3:1] is hardwired to 011. This 
causes pin D1 to assigned to the signal A0, which is what we are calling 
the dc gpio here.


If IF[3:1] were hardwired to 010, then pin D1 would be not not used and 
there would be no A0 signal.


So, basically, we can infer the state of IF[3:1] by the fact that we 
have a dc pin or not.





+- reset-gpios: Reset pin
+- power-supply:A regulator node for the supply voltage.
+- backlight:   phandle of the backlight device attached to the panel
+- rotation:panel rotation in degrees counter clockwise (0,90,180,270)


Please use the OF graph DT bindings (a.k.a. ports) to describe the connection
between the panel and its source.


I am afraid that I do not understand this request. What would the source 
of the panel be? There is nothing like a SoC LCD controller that is 
driving this panel.





+Example:
+   display@0{
+   compatible = "lego,ev3-lcd";
+   reg = <0>;
+   spi-max-frequency = <1000>;
+   dc-gpios = < 43 GPIO_ACTIVE_HIGH>;
+   reset-gpios = < 80 GPIO_ACTIVE_HIGH>;
+   };




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


[PATCH libdrm 2/2] etnaviv: add etna_bo_from_handle

2017-08-04 Thread Philipp Zabel
Although etnaviv_drmif.h declared etna_bo_from_handle from the start,
there was no implementation.

Signed-off-by: Philipp Zabel 
---
 etnaviv/etnaviv_bo.c | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/etnaviv/etnaviv_bo.c b/etnaviv/etnaviv_bo.c
index 4fe877f1..75669572 100644
--- a/etnaviv/etnaviv_bo.c
+++ b/etnaviv/etnaviv_bo.c
@@ -135,6 +135,25 @@ struct etna_bo *etna_bo_new(struct etna_device *dev, 
uint32_t size,
return bo;
 }
 
+struct etna_bo *
+etna_bo_from_handle(struct etna_device *dev, uint32_t handle, uint32_t size)
+{
+   struct etna_bo *bo = NULL;
+
+   pthread_mutex_lock(_lock);
+
+   bo = lookup_bo(dev->handle_table, handle);
+   if (bo)
+   goto out_unlock;
+
+   bo = bo_from_handle(dev, size, handle, 0);
+
+out_unlock:
+   pthread_mutex_unlock(_lock);
+
+   return bo;
+}
+
 struct etna_bo *etna_bo_ref(struct etna_bo *bo)
 {
atomic_inc(>refcnt);
-- 
2.11.0

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


[PATCH libdrm 1/2] etnaviv: fix etna_bo_from_name

2017-08-04 Thread Philipp Zabel
Look up BOs from the name table using the name parameter instead of
req.handle (which at this point is always zero).

Signed-off-by: Philipp Zabel 
Reviewed-by: Eric Engestrom 
---
Sorry for the resend, this time to the correct list.
---
 etnaviv/etnaviv_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/etnaviv/etnaviv_bo.c b/etnaviv/etnaviv_bo.c
index 4ad0434e..4fe877f1 100644
--- a/etnaviv/etnaviv_bo.c
+++ b/etnaviv/etnaviv_bo.c
@@ -173,7 +173,7 @@ struct etna_bo *etna_bo_from_name(struct etna_device *dev, 
uint32_t name)
pthread_mutex_lock(_lock);
 
/* check name table first, to see if bo is already open: */
-   bo = lookup_bo(dev->name_table, req.handle);
+   bo = lookup_bo(dev->name_table, name);
if (bo)
goto out_unlock;
 
-- 
2.11.0

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


Re: [PATCH v5 2/6] drm/bridge: Add a devm_ allocator for panel bridge.

2017-08-04 Thread Laurent Pinchart
Now CC'ing Daniel with his correct address :-/ I'll blame auto-completion in 
my e-mail client. Sorry for the noise.

On Friday 04 Aug 2017 16:46:24 Laurent Pinchart wrote:
> Hi Eric,
> 
> (CC'ing Daniel)
> 
> Thank you for the patch.
> 
> On Tuesday 18 Jul 2017 14:05:06 Eric Anholt wrote:
> > This will let drivers reduce the error cleanup they need, in
> > particular the "is_panel_bridge" flag.
> > 
> > v2: Slight cleanup of remove function by Andrzej
> 
> I just want to point out that, in the context of Daniel's work on
> hot-unplug, 90% of the devm_* allocations are wrong and will get in the
> way. All DRM core objects that are accessible one way or another from
> userspace will need to be properly reference-counted and freed only when
> the last reference disappears, which could be well after the corresponding
> device is removed. I believe this could be one such objects :-/
> 
> > Signed-off-by: Eric Anholt 
> > Reviewed-by: Andrzej Hajda 
> > ---
> > 
> >  drivers/gpu/drm/bridge/panel.c | 30 ++
> >  include/drm/drm_bridge.h   |  3 +++
> >  2 files changed, 33 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/bridge/panel.c
> > b/drivers/gpu/drm/bridge/panel.c index 685c1a480201..292ee92a9c97 100644
> > --- a/drivers/gpu/drm/bridge/panel.c
> > +++ b/drivers/gpu/drm/bridge/panel.c
> > @@ -195,3 +195,33 @@ void drm_panel_bridge_remove(struct drm_bridge
> > *bridge) devm_kfree(panel_bridge->panel->dev, bridge);
> > 
> >  }
> >  EXPORT_SYMBOL(drm_panel_bridge_remove);
> > 
> > +
> > +static void devm_drm_panel_bridge_release(struct device *dev, void *res)
> > +{
> > +   struct drm_bridge **bridge = res;
> > +
> > +   drm_panel_bridge_remove(*bridge);
> > +}
> > +
> > +struct drm_bridge *devm_drm_panel_bridge_add(struct device *dev,
> > +struct drm_panel *panel,
> > +u32 connector_type)
> > +{
> > +   struct drm_bridge **ptr, *bridge;
> > +
> > +   ptr = devres_alloc(devm_drm_panel_bridge_release, sizeof(*ptr),
> > +  GFP_KERNEL);
> > +   if (!ptr)
> > +   return ERR_PTR(-ENOMEM);
> > +
> > +   bridge = drm_panel_bridge_add(panel, connector_type);
> > +   if (!IS_ERR(bridge)) {
> > +   *ptr = bridge;
> > +   devres_add(dev, ptr);
> > +   } else {
> > +   devres_free(ptr);
> > +   }
> > +
> > +   return bridge;
> > +}
> > +EXPORT_SYMBOL(devm_drm_panel_bridge_add);
> > diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
> > index 1dc94d5392e2..6522d4cbc9d9 100644
> > --- a/include/drm/drm_bridge.h
> > +++ b/include/drm/drm_bridge.h
> > @@ -268,6 +268,9 @@ void drm_bridge_enable(struct drm_bridge *bridge);
> > 
> >  struct drm_bridge *drm_panel_bridge_add(struct drm_panel *panel,
> >  
> > u32 connector_type);
> >  
> >  void drm_panel_bridge_remove(struct drm_bridge *bridge);
> > 
> > +struct drm_bridge *devm_drm_panel_bridge_add(struct device *dev,
> > +struct drm_panel *panel,
> > +u32 connector_type);
> > 
> >  #endif
> >  
> >  #endif

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH v3 3/6] dt-bindings: add binding for Sitronix ST7586 display panels

2017-08-04 Thread Laurent Pinchart
Hi David,

Thank you for the patch.

On Thursday 03 Aug 2017 17:33:47 David Lechner wrote:
> This adds a new binding for Sitronix ST7586 display panels.
> 
> Using lego as the vendor prefix in the compatible string because the display
> panel I am working with is an integral part of the LEGO MINDSTORMS EV3.
> 
> Signed-off-by: David Lechner 
> ---
>  .../bindings/display/sitronix,st7586.txt   | 26 +++
>  1 file changed, 26 insertions(+)
>  create mode 100644
> Documentation/devicetree/bindings/display/sitronix,st7586.txt
> 
> diff --git a/Documentation/devicetree/bindings/display/sitronix,st7586.txt
> b/Documentation/devicetree/bindings/display/sitronix,st7586.txt new file
> mode 100644
> index 000..dfb0b7b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/sitronix,st7586.txt
> @@ -0,0 +1,26 @@
> +Sitronix ST7586 display panel
> +
> +Required properties:
> +- compatible:"lego,ev3-lcd".
> +
> +The node for this driver must be a child node of a SPI controller, hence
> +all mandatory properties described in ../spi/spi-bus.txt must be specified.
> +
> +Optional properties:
> +- dc-gpios:  D/C pin. The presence/absence of this GPIO determines
> + the panel interface operation mode (IF[3:1] pins):
> + - present: IF=011 4-wire 8-bit data serial interface
> + - absent:  IF=010 3-wire 9-bit data serial interface

How does this work ? Do you have a single GPIO on your system connected to 
IF[1], with IF[3:2] hardwired to 01 ?

> +- reset-gpios:   Reset pin
> +- power-supply:  A regulator node for the supply voltage.
> +- backlight: phandle of the backlight device attached to the panel
> +- rotation:  panel rotation in degrees counter clockwise (0,90,180,270)

Please use the OF graph DT bindings (a.k.a. ports) to describe the connection 
between the panel and its source.

> +Example:
> + display@0{
> + compatible = "lego,ev3-lcd";
> + reg = <0>;
> + spi-max-frequency = <1000>;
> + dc-gpios = < 43 GPIO_ACTIVE_HIGH>;
> + reset-gpios = < 80 GPIO_ACTIVE_HIGH>;
> + };

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH v2 23/28] drm: omapdrm: Merge the dss_features and omap_dss_features structures

2017-08-04 Thread Laurent Pinchart
Hi Tomi,

On Monday 15 May 2017 09:32:01 Tomi Valkeinen wrote:
> On 13/05/17 14:12, Laurent Pinchart wrote:
> >> Is it? You already use the dss compat string and soc_device_match to
> >> figure out some versions. Isn't that a proper way to find out about the
> >> SoC? But I agree that a more fine grained version management in each
> >> individual driver would be better.
> > 
> > For OMAP2, OMAP4 or OMAP5 it shouldn't be too much of a problem, but OMAP3
> > would be more painful to handle. The following machine names are used.
> > 
> > "AM3505"
> > "AM3517"
> > "AM437x"
> > "OMAP3430/3530"
> > "OMAP3525"
> > "OMAP3515"
> > "OMAP3503"
> > "OMAP3611"
> > "OMAP3615/AM3715"
> > "OMAP3621"
> > "OMAP3630/DM3730"
> > "AM3703"
> > "DM3725"
> 
> Don't we need all those somewhere in any case? I mean, I presume all the
> current OMAPDSS_VER_* defines are used somewhere. Which means that
> somewhere, maybe in multiple different files, we need to handle some or
> all of those.

We do, but the way we combine all the information we need in a single version 
isn't ideal. Most omapdrm sub-drivers use version checks in a way that combine 
many cases together, resulting in just a handful of different options. 
Different drivers use different checks, so we end up with a long list of 
versions that more or less describe the combination of multiple boolean (or 
short enum) parameters. By splitting the version into those parameters, we can 
simplify the code, and move the pieces where they belong to.

> For some features, perhaps we could move them to DT. If the feature is
> about how DSS is integrated into the SoC, it might make sense to have
> that in the DT, as a property for DSS, as it's not part of DSS itself.
> If the data is missing, we could inject it into the DT at boot time,
> based on the omap revision. Though I'm not sure if that would really
> help that much.

I agree in principle, but we should probably check that on a case by case 
basis.

> I think the most annoying "feature" is the blank/porch register field
> size change, that they made between OMAP3430 ES1 and ES2. And didn't
> bother to change the DSS IP version...

This could indeed be described in DT (either through a different compatible 
string or a separate DT property). Using SoC matching is a reasonable 
alternative in my opinion to handle past mistakes, as long as there's not too 
many of them.

> But back to the topic... Are you sure this version detection should not
> be centralized? If we have that many OMAP3 related devices already (btw,
> AM4 is not really OMAP3 related, even if the DSS there is)... And if we
> get one more. Does it mean we need to edit that same new device into
> many places?

Yes, I'm fairly confident, as most parameters are related to versions of the 
individual IP cores, not about how they're integrated in a particular SoC.

> Then again, maybe it's better to handle that separately in each file
> that requires the information, as sometimes all you need to know is that
> it's DSS3 based, but sometimes you need to know that it's AM4's DSS vs
> OMAP3's DSS.

Yes, that's definitely how I've implemented it (in patches I'm about to send). 
It results in simpler code in my opinion.

> > But I don't think that removing the extra platform devices is so urgent.
> > I'd rather do it when we're ready.
> > 
> > The omapdss driver needs major cleanup and refactoring, and that will
> > result in a large number of patches that will cause conflicts and be
> > sources of potential errors. I don't think that's avoidable. However,
> > lots of those cleanups will be independent from each other, so we can
> > start merging the less controversial ones as soon as they're ready. I'll
> > take care of rebasing the rest of the patches as needed.
> 
> Yes, no disagreements there. My hope is just that a series is as small
> as possible. Or, that's not correct... A series does one change at a
> time, e.g. here my problem was that the platform change was being done
> at the same time as the feature change, interleaved.
> 
> I most likely will need to backport all these to v4.9 kernel. And then
> manage new patches that will be applied on top of mainline and that v4.9
> kernel. And I will gladly take any changes to patch serieses that
> possibly make that work easier =).

-- 
Regards,

Laurent Pinchart

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


[Bug 196337] [amdgpu][carrizo] Re-enable GFX PG breaks Carrizo

2017-08-04 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=196337

--- Comment #3 from Johannes Hirte (johannes.hi...@datenkhaos.de) ---
Created attachment 257811
  --> https://bugzilla.kernel.org/attachment.cgi?id=257811=edit
Xorg.0.log

-- 
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


[Bug 196337] [amdgpu][carrizo] Re-enable GFX PG breaks Carrizo

2017-08-04 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=196337

--- Comment #2 from Johannes Hirte (johannes.hi...@datenkhaos.de) ---
Created attachment 257809
  --> https://bugzilla.kernel.org/attachment.cgi?id=257809=edit
dmesg

-- 
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


[Bug 196337] [amdgpu][carrizo] Re-enable GFX PG breaks Carrizo

2017-08-04 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=196337

--- Comment #1 from Johannes Hirte (johannes.hi...@datenkhaos.de) ---
Still an issue with linux-4.13-rc3. I can login via ssh, so I can provide the
logs. Showing blocked tasks gives me this:

[  620.046142] sysrq: SysRq : Show Blocked State
[  620.046155]   taskPC stack   pid father
[  620.046194] disk_cache:0D0  2446  1 0x0006
[  620.046201] Call Trace:
[  620.046214]  __schedule+0x217/0x710
[  620.046222]  ? preempt_count_add+0x6f/0xb0
[  620.046268]  ? _raw_spin_lock_irqsave+0x18/0x50
[  620.046274]  schedule+0x3b/0x90
[  620.046280]  amd_sched_entity_fini+0x95/0xe0
[  620.046286]  ? wait_woken+0x80/0x80
[  620.046292]  amdgpu_vm_fini+0x38/0x280
[  620.046297]  amdgpu_driver_postclose_kms+0x81/0x1f0
[  620.046302]  ? drm_master_release+0x61/0x110
[  620.046306]  drm_release+0x260/0x380
[  620.046312]  __fput+0xd4/0x1e0
[  620.046317]  fput+0x9/0x10
[  620.046322]  task_work_run+0x71/0x90
[  620.046327]  do_exit+0x2c1/0xb00
[  620.046332]  ? futex_wait+0x149/0x230
[  620.046336]  do_group_exit+0x3e/0xb0
[  620.046341]  get_signal+0x25b/0x610
[  620.046347]  do_signal+0x23/0x5e0
[  620.046352]  ? __schedule+0x217/0x710
[  620.046356]  ? preempt_count_add+0x6f/0xb0
[  620.046362]  ? strlcpy+0x36/0x50
[  620.046367]  exit_to_usermode_loop+0x53/0x90
[  620.046371]  syscall_return_slowpath+0x53/0x60
[  620.046374]  entry_SYSCALL_64_fastpath+0x92/0x94
[  620.046379] RIP: 0033:0x7fd3ebc0323d
[  620.046382] RSP: 002b:7fd3dcc6bbb0 EFLAGS: 0246 ORIG_RAX:
00ca
[  620.046386] RAX: fe00 RBX: 01bf0cd8 RCX:
7fd3ebc0323d
[  620.046389] RDX:  RSI: 0080 RDI:
01bf0d00
[  620.046392] RBP:  R08:  R09:
cccd
[  620.046395] R10:  R11: 0246 R12:

[  620.046398] R13: 01bf0cb0 R14:  R15:
01bf0d00

-- 
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


[Bug 102008] DRI_PRIME causes X Error of failed request: BadAlloc (insufficient resources for operation)

2017-08-04 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=102008

bartos.p...@gmail.com changed:

   What|Removed |Added

  Component|Drivers/Gallium/radeonsi|Drivers/DRI/i965
 QA Contact|dri-devel@lists.freedesktop |intel-3d-bugs@lists.freedes
   |.org|ktop.org
   Assignee|dri-devel@lists.freedesktop |intel-3d-bugs@lists.freedes
   |.org|ktop.org

--- Comment #5 from bartos.p...@gmail.com ---
So after applying patch to avoid segfault (from
655a32f729a46176c1fc0c1727b33c15c69cad78) I was able to further bisect and
found that error is caused by commit

34e1ccbfbe851ecf4ebbfc86d70da384d176d994

Therefore I have also changed component from radeonsi to i965.

As for rendering, Mike, I am using plasma where I must disable kwin compositor
for full screen apps, else I see also blackscreen (but I did not notice, that
is is related to 32 or 64bit apps)

-- 
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 v5 2/6] drm/bridge: Add a devm_ allocator for panel bridge.

2017-08-04 Thread Laurent Pinchart
Hi Eric,

(CC'ing Daniel)

Thank you for the patch.

On Tuesday 18 Jul 2017 14:05:06 Eric Anholt wrote:
> This will let drivers reduce the error cleanup they need, in
> particular the "is_panel_bridge" flag.
> 
> v2: Slight cleanup of remove function by Andrzej

I just want to point out that, in the context of Daniel's work on hot-unplug, 
90% of the devm_* allocations are wrong and will get in the way. All DRM core 
objects that are accessible one way or another from userspace will need to be 
properly reference-counted and freed only when the last reference disappears, 
which could be well after the corresponding device is removed. I believe this 
could be one such objects :-/

> Signed-off-by: Eric Anholt 
> Reviewed-by: Andrzej Hajda 
> ---
>  drivers/gpu/drm/bridge/panel.c | 30 ++
>  include/drm/drm_bridge.h   |  3 +++
>  2 files changed, 33 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c
> index 685c1a480201..292ee92a9c97 100644
> --- a/drivers/gpu/drm/bridge/panel.c
> +++ b/drivers/gpu/drm/bridge/panel.c
> @@ -195,3 +195,33 @@ void drm_panel_bridge_remove(struct drm_bridge *bridge)
> devm_kfree(panel_bridge->panel->dev, bridge);
>  }
>  EXPORT_SYMBOL(drm_panel_bridge_remove);
> +
> +static void devm_drm_panel_bridge_release(struct device *dev, void *res)
> +{
> + struct drm_bridge **bridge = res;
> +
> + drm_panel_bridge_remove(*bridge);
> +}
> +
> +struct drm_bridge *devm_drm_panel_bridge_add(struct device *dev,
> +  struct drm_panel *panel,
> +  u32 connector_type)
> +{
> + struct drm_bridge **ptr, *bridge;
> +
> + ptr = devres_alloc(devm_drm_panel_bridge_release, sizeof(*ptr),
> +GFP_KERNEL);
> + if (!ptr)
> + return ERR_PTR(-ENOMEM);
> +
> + bridge = drm_panel_bridge_add(panel, connector_type);
> + if (!IS_ERR(bridge)) {
> + *ptr = bridge;
> + devres_add(dev, ptr);
> + } else {
> + devres_free(ptr);
> + }
> +
> + return bridge;
> +}
> +EXPORT_SYMBOL(devm_drm_panel_bridge_add);
> diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
> index 1dc94d5392e2..6522d4cbc9d9 100644
> --- a/include/drm/drm_bridge.h
> +++ b/include/drm/drm_bridge.h
> @@ -268,6 +268,9 @@ void drm_bridge_enable(struct drm_bridge *bridge);
>  struct drm_bridge *drm_panel_bridge_add(struct drm_panel *panel,
>   u32 connector_type);
>  void drm_panel_bridge_remove(struct drm_bridge *bridge);
> +struct drm_bridge *devm_drm_panel_bridge_add(struct device *dev,
> +  struct drm_panel *panel,
> +  u32 connector_type);
>  #endif
> 
>  #endif

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH v2 2/4] drm/bridge: dw-hdmi: add better clock disable control

2017-08-04 Thread Archit Taneja



On 07/31/2017 08:56 PM, Hans Verkuil wrote:

On 07/31/2017 04:29 PM, Russell King wrote:

The video setup path aways sets the clock disable register to a specific
value, which has the effect of disabling the CEC engine.  When we add the
CEC driver, this becomes a problem.

Fix this by only setting/clearing the bits that the video path needs to.

Reviewed-by: Jose Abreu 
Signed-off-by: Russell King 


Acked-by: Hans Verkuil 



Queued to drm-misc-next.

Thanks,
Archit



Regards,

Hans


---
  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 29 ++---
  1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c 
b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 82e55ee8e4fa..b08cc0c95590 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -166,6 +166,7 @@ struct dw_hdmi {
bool bridge_is_on;  /* indicates the bridge is on */
bool rxsense;   /* rxsense state */
u8 phy_mask;/* desired phy int mask settings */
+   u8 mc_clkdis;   /* clock disable register */
  
  	spinlock_t audio_lock;

struct mutex audio_mutex;
@@ -551,8 +552,11 @@ EXPORT_SYMBOL_GPL(dw_hdmi_set_sample_rate);
  
  static void hdmi_enable_audio_clk(struct dw_hdmi *hdmi, bool enable)

  {
-   hdmi_modb(hdmi, enable ? 0 : HDMI_MC_CLKDIS_AUDCLK_DISABLE,
- HDMI_MC_CLKDIS_AUDCLK_DISABLE, HDMI_MC_CLKDIS);
+   if (enable)
+   hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_AUDCLK_DISABLE;
+   else
+   hdmi->mc_clkdis |= HDMI_MC_CLKDIS_AUDCLK_DISABLE;
+   hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS);
  }
  
  static void dw_hdmi_ahb_audio_enable(struct dw_hdmi *hdmi)

@@ -1574,8 +1578,6 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
  /* HDMI Initialization Step B.4 */
  static void dw_hdmi_enable_video_path(struct dw_hdmi *hdmi)
  {
-   u8 clkdis;
-
/* control period minimum duration */
hdmi_writeb(hdmi, 12, HDMI_FC_CTRLDUR);
hdmi_writeb(hdmi, 32, HDMI_FC_EXCTRLDUR);
@@ -1587,17 +1589,21 @@ static void dw_hdmi_enable_video_path(struct dw_hdmi 
*hdmi)
hdmi_writeb(hdmi, 0x21, HDMI_FC_CH2PREAM);
  
  	/* Enable pixel clock and tmds data path */

-   clkdis = 0x7F;
-   clkdis &= ~HDMI_MC_CLKDIS_PIXELCLK_DISABLE;
-   hdmi_writeb(hdmi, clkdis, HDMI_MC_CLKDIS);
+   hdmi->mc_clkdis |= HDMI_MC_CLKDIS_HDCPCLK_DISABLE |
+  HDMI_MC_CLKDIS_CSCCLK_DISABLE |
+  HDMI_MC_CLKDIS_AUDCLK_DISABLE |
+  HDMI_MC_CLKDIS_PREPCLK_DISABLE |
+  HDMI_MC_CLKDIS_TMDSCLK_DISABLE;
+   hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_PIXELCLK_DISABLE;
+   hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS);
  
-	clkdis &= ~HDMI_MC_CLKDIS_TMDSCLK_DISABLE;

-   hdmi_writeb(hdmi, clkdis, HDMI_MC_CLKDIS);
+   hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_TMDSCLK_DISABLE;
+   hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS);
  
  	/* Enable csc path */

if (is_color_space_conversion(hdmi)) {
-   clkdis &= ~HDMI_MC_CLKDIS_CSCCLK_DISABLE;
-   hdmi_writeb(hdmi, clkdis, HDMI_MC_CLKDIS);
+   hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_CSCCLK_DISABLE;
+   hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS);
}
  
  	/* Enable color space conversion if needed */

@@ -2272,6 +2278,7 @@ __dw_hdmi_probe(struct platform_device *pdev,
hdmi->disabled = true;
hdmi->rxsense = true;
hdmi->phy_mask = (u8)~(HDMI_PHY_HPD | HDMI_PHY_RX_SENSE);
+   hdmi->mc_clkdis = 0x7f;
  
  	mutex_init(>mutex);

mutex_init(>audio_mutex);




___
linux-arm-kernel mailing list
linux-arm-ker...@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 1/4] drm/bridge: dw-hdmi: add cec notifier support

2017-08-04 Thread Archit Taneja



On 07/31/2017 08:55 PM, Hans Verkuil wrote:

On 07/31/2017 04:29 PM, Russell King wrote:

Add CEC notifier support to the HDMI bridge driver, so that the CEC
part of the IP can receive its physical address.

Signed-off-by: Russell King 


Acked-by: Hans Verkuil 



Queued to drm-misc-next.

Thanks,
Archit


Regards,

Hans


---
  drivers/gpu/drm/bridge/synopsys/Kconfig   |  1 +
  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 22 +-
  2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/Kconfig 
b/drivers/gpu/drm/bridge/synopsys/Kconfig
index 53e78d092d18..351db000599a 100644
--- a/drivers/gpu/drm/bridge/synopsys/Kconfig
+++ b/drivers/gpu/drm/bridge/synopsys/Kconfig
@@ -2,6 +2,7 @@ config DRM_DW_HDMI
tristate
select DRM_KMS_HELPER
select REGMAP_MMIO
+   select CEC_CORE if CEC_NOTIFIER
  
  config DRM_DW_HDMI_AHB_AUDIO

tristate "Synopsys Designware AHB Audio interface"
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c 
b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index ead11242c4b9..82e55ee8e4fa 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -36,7 +36,10 @@
  #include "dw-hdmi.h"
  #include "dw-hdmi-audio.h"
  
+#include 

+
  #define DDC_SEGMENT_ADDR  0x30
+
  #define HDMI_EDID_LEN 512
  
  enum hdmi_datamap {

@@ -175,6 +178,8 @@ struct dw_hdmi {
struct regmap *regm;
void (*enable_audio)(struct dw_hdmi *hdmi);
void (*disable_audio)(struct dw_hdmi *hdmi);
+
+   struct cec_notifier *cec_notifier;
  };
  
  #define HDMI_IH_PHY_STAT0_RX_SENSE \

@@ -1896,6 +1901,7 @@ static int dw_hdmi_connector_get_modes(struct 
drm_connector *connector)
hdmi->sink_is_hdmi = drm_detect_hdmi_monitor(edid);
hdmi->sink_has_audio = drm_detect_monitor_audio(edid);
drm_mode_connector_update_edid_property(connector, edid);
+   cec_notifier_set_phys_addr_from_edid(hdmi->cec_notifier, edid);
ret = drm_add_edid_modes(connector, edid);
/* Store the ELD */
drm_edid_to_eld(connector, edid);
@@ -2119,11 +2125,16 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id)
 * ask the source to re-read the EDID.
 */
if (intr_stat &
-   (HDMI_IH_PHY_STAT0_RX_SENSE | HDMI_IH_PHY_STAT0_HPD))
+   (HDMI_IH_PHY_STAT0_RX_SENSE | HDMI_IH_PHY_STAT0_HPD)) {
__dw_hdmi_setup_rx_sense(hdmi,
 phy_stat & HDMI_PHY_HPD,
 phy_stat & HDMI_PHY_RX_SENSE);
  
+		if ((phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD)) == 0)

+   cec_notifier_set_phys_addr(hdmi->cec_notifier,
+  CEC_PHYS_ADDR_INVALID);
+   }
+
if (intr_stat & HDMI_IH_PHY_STAT0_HPD) {
dev_dbg(hdmi->dev, "EVENT=%s\n",
phy_int_pol & HDMI_PHY_HPD ? "plugin" : "plugout");
@@ -2376,6 +2387,12 @@ __dw_hdmi_probe(struct platform_device *pdev,
if (ret)
goto err_iahb;
  
+	hdmi->cec_notifier = cec_notifier_get(dev);

+   if (!hdmi->cec_notifier) {
+   ret = -ENOMEM;
+   goto err_iahb;
+   }
+
/*
 * To prevent overflows in HDMI_IH_FC_STAT2, set the clk regenerator
 * N and cts values before enabling phy
@@ -2452,6 +2469,9 @@ __dw_hdmi_probe(struct platform_device *pdev,
hdmi->ddc = NULL;
}
  
+	if (hdmi->cec_notifier)

+   cec_notifier_put(hdmi->cec_notifier);
+
clk_disable_unprepare(hdmi->iahb_clk);
  err_isfr:
clk_disable_unprepare(hdmi->isfr_clk);




___
linux-arm-kernel mailing list
linux-arm-ker...@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v3 2/6] drm/tinydrm: generalize tinydrm_xrgb8888_to_gray8()

2017-08-04 Thread Noralf Trønnes


Den 04.08.2017 09.27, skrev Noralf Trønnes:


Den 04.08.2017 00.33, skrev David Lechner:
This adds parameters for vaddr and clip to 
tinydrm_xrgb_to_gray8() to

make it more generic.

dma_buf_{begin,end}_cpu_access() are moved out to the repaper driver.

Signed-off-by: David Lechner 
---
  drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c | 35 
++

  drivers/gpu/drm/tinydrm/repaper.c  | 21 +++-
  include/drm/tinydrm/tinydrm-helpers.h  |  3 ++-
  3 files changed, 35 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c 
b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c

index 75808bb..5915ba8 100644
--- a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c
+++ b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c
@@ -185,7 +185,9 @@ EXPORT_SYMBOL(tinydrm_xrgb_to_rgb565);
  /**
   * tinydrm_xrgb_to_gray8 - Convert XRGB to grayscale
   * @dst: 8-bit grayscale destination buffer
+ * @vaddr: XRGB source buffer
   * @fb: DRM framebuffer
+ * @clip: Clip rectangle area to copy
   *
   * Drm doesn't have native monochrome or grayscale support.
   * Such drivers can announce the commonly supported XR24 format to 
userspace

@@ -199,12 +201,11 @@ EXPORT_SYMBOL(tinydrm_xrgb_to_rgb565);
   * Returns:
   * Zero on success, negative error code on failure.
   */
-int tinydrm_xrgb_to_gray8(u8 *dst, struct drm_framebuffer *fb)
+int tinydrm_xrgb_to_gray8(u8 *dst, void *vaddr, struct 
drm_framebuffer *fb,

+  struct drm_clip_rect *clip)
  {
-struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
-struct dma_buf_attachment *import_attach = 
cma_obj->base.import_attach;

-unsigned int x, y, pitch = fb->pitches[0];
-int ret = 0;
+unsigned int len = (clip->x2 - clip->x1) * sizeof(u32);
+unsigned int x, y;
  void *buf;
  u32 *src;
  @@ -214,22 +215,16 @@ int tinydrm_xrgb_to_gray8(u8 *dst, struct 
drm_framebuffer *fb)

   * The cma memory is write-combined so reads are uncached.
   * Speed up by fetching one line at a time.
   */
-buf = kmalloc(pitch, GFP_KERNEL);
+buf = kmalloc(len, GFP_KERNEL);
  if (!buf)
  return -ENOMEM;
  -if (import_attach) {
-ret = dma_buf_begin_cpu_access(import_attach->dmabuf,
-   DMA_FROM_DEVICE);
-if (ret)
-goto err_free;
-}
-
-for (y = 0; y < fb->height; y++) {
-src = cma_obj->vaddr + (y * pitch);
-memcpy(buf, src, pitch);
+for (y = clip->y1; y < clip->y2; y++) {
+src = vaddr + (y * fb->pitches[0]);
+src += clip->x1;
+memcpy(buf, src, len);
  src = buf;
-for (x = 0; x < fb->width; x++) {
+for (x = clip->x1; x < clip->x2; x++) {
  u8 r = (*src & 0x00ff) >> 16;
  u8 g = (*src & 0xff00) >> 8;
  u8 b =  *src & 0x00ff;
@@ -240,13 +235,9 @@ int tinydrm_xrgb_to_gray8(u8 *dst, struct 
drm_framebuffer *fb)

  }
  }
  -if (import_attach)
-ret = dma_buf_end_cpu_access(import_attach->dmabuf,
- DMA_FROM_DEVICE);
-err_free:
  kfree(buf);
  -return ret;
+return 0;
  }
  EXPORT_SYMBOL(tinydrm_xrgb_to_gray8);
  diff --git a/drivers/gpu/drm/tinydrm/repaper.c 
b/drivers/gpu/drm/tinydrm/repaper.c

index 3343d3f..d34cd9b 100644
--- a/drivers/gpu/drm/tinydrm/repaper.c
+++ b/drivers/gpu/drm/tinydrm/repaper.c
@@ -18,6 +18,7 @@
   */
#include 
+#include 
  #include 
  #include 
  #include 
@@ -525,11 +526,20 @@ static int repaper_fb_dirty(struct 
drm_framebuffer *fb,

  struct drm_clip_rect *clips,
  unsigned int num_clips)
  {
+struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
+struct dma_buf_attachment *import_attach = 
cma_obj->base.import_attach;

  struct tinydrm_device *tdev = fb->dev->dev_private;
  struct repaper_epd *epd = epd_from_tinydrm(tdev);
+struct drm_clip_rect clip;
  u8 *buf = NULL;
  int ret = 0;
  +/* repaper can't do partial updates */
+clip.x1 = 0;
+clip.x2 = fb->width;
+clip.y1 = 0;
+clip.y2 = fb->height;
+
  mutex_lock(>dirty_lock);
if (!epd->enabled)
@@ -550,7 +560,16 @@ static int repaper_fb_dirty(struct 
drm_framebuffer *fb,

  goto out_unlock;
  }
  -ret = tinydrm_xrgb_to_gray8(buf, fb);
+if (import_attach) {
+ret = dma_buf_begin_cpu_access(import_attach->dmabuf,
+   DMA_FROM_DEVICE);
+if (ret)
+goto out_unlock;
+}
+
+ret = tinydrm_xrgb_to_gray8(buf, cma_obj->vaddr, fb, );
+if (import_attach)
+dma_buf_end_cpu_access(import_attach->dmabuf, DMA_FROM_DEVICE);


I think we can make tinydrm_xrgb_to_gray8() return void like the
other copy functions. We loose the error if the line buffer can't be
allocated, but that's 

Re: [PATCH v3 1/6] drm/tinydrm: remove call to mipi_dbi_init() from mipi_dbi_spi_init()

2017-08-04 Thread Noralf Trønnes


Den 04.08.2017 00.33, skrev David Lechner:

This removes the call to mipi_dbi_init() from mipi_dbi_spi_init() so that
drivers can have a driver-specific implementation if needed.

Suggested-by: Noralf Trønnes 
Signed-off-by: David Lechner 
Reviewed-by: Noralf Trønnes 
---


Thanks, applied to drm-misc.

Noralf.


  drivers/gpu/drm/tinydrm/mi0283qt.c |  8 ++--
  drivers/gpu/drm/tinydrm/mipi-dbi.c | 17 +
  include/drm/tinydrm/mipi-dbi.h |  6 +-
  3 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c 
b/drivers/gpu/drm/tinydrm/mi0283qt.c
index 482ff1c3..7e5bb7d 100644
--- a/drivers/gpu/drm/tinydrm/mi0283qt.c
+++ b/drivers/gpu/drm/tinydrm/mi0283qt.c
@@ -195,8 +195,12 @@ static int mi0283qt_probe(struct spi_device *spi)
  
  	device_property_read_u32(dev, "rotation", );
  
-	ret = mipi_dbi_spi_init(spi, mipi, dc, _pipe_funcs,

-   _driver, _mode, rotation);
+   ret = mipi_dbi_spi_init(spi, mipi, dc);
+   if (ret)
+   return ret;
+
+   ret = mipi_dbi_init(>dev, mipi, _pipe_funcs,
+   _driver, _mode, rotation);
if (ret)
return ret;
  
diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c

index e10fa4b..cba9784 100644
--- a/drivers/gpu/drm/tinydrm/mipi-dbi.c
+++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c
@@ -777,15 +777,12 @@ static int mipi_dbi_typec3_command(struct mipi_dbi *mipi, 
u8 cmd,
  /**
   * mipi_dbi_spi_init - Initialize MIPI DBI SPI interfaced controller
   * @spi: SPI device
- * @dc: D/C gpio (optional)
   * @mipi: _dbi structure to initialize
- * @pipe_funcs: Display pipe functions
- * @driver: DRM driver
- * @mode: Display mode
- * @rotation: Initial rotation in degrees Counter Clock Wise
+ * @dc: D/C gpio (optional)
   *
   * This function sets _dbi->command, enables >read_commands for the
- * usual read commands and initializes @mipi using mipi_dbi_init().
+ * usual read commands. It should be followed by a call to mipi_dbi_init() or
+ * a driver-specific init.
   *
   * If @dc is set, a Type C Option 3 interface is assumed, if not
   * Type C Option 1.
@@ -800,11 +797,7 @@ static int mipi_dbi_typec3_command(struct mipi_dbi *mipi, 
u8 cmd,
   * Zero on success, negative error code on failure.
   */
  int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi,
- struct gpio_desc *dc,
- const struct drm_simple_display_pipe_funcs *pipe_funcs,
- struct drm_driver *driver,
- const struct drm_display_mode *mode,
- unsigned int rotation)
+ struct gpio_desc *dc)
  {
size_t tx_size = tinydrm_spi_max_transfer_size(spi, 0);
struct device *dev = >dev;
@@ -850,7 +843,7 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct 
mipi_dbi *mipi,
return -ENOMEM;
}
  
-	return mipi_dbi_init(dev, mipi, pipe_funcs, driver, mode, rotation);

+   return 0;
  }
  EXPORT_SYMBOL(mipi_dbi_spi_init);
  
diff --git a/include/drm/tinydrm/mipi-dbi.h b/include/drm/tinydrm/mipi-dbi.h

index d137b16..83346dd 100644
--- a/include/drm/tinydrm/mipi-dbi.h
+++ b/include/drm/tinydrm/mipi-dbi.h
@@ -62,11 +62,7 @@ mipi_dbi_from_tinydrm(struct tinydrm_device *tdev)
  }
  
  int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi,

- struct gpio_desc *dc,
- const struct drm_simple_display_pipe_funcs *pipe_funcs,
- struct drm_driver *driver,
- const struct drm_display_mode *mode,
- unsigned int rotation);
+ struct gpio_desc *dc);
  int mipi_dbi_init(struct device *dev, struct mipi_dbi *mipi,
  const struct drm_simple_display_pipe_funcs *pipe_funcs,
  struct drm_driver *driver,


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


Re: [PATCH 07/41] drm/fsl-dcu: Use .dumb_map_offset and .dumb_destroy defaults

2017-08-04 Thread Noralf Trønnes


Den 29.07.2017 19.24, skrev Stefan Agner:

On 2017-07-23 12:16, Noralf Trønnes wrote:

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Stefan Agner 
Cc: Alison Wang 
Signed-off-by: Noralf Trønnes 

Acked-by: Stefan Agner 


Thanks, applied to drm-misc.

Noralf.


--
Stefan


---
  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 --
  1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
index 5cbde19..58e9e06 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
@@ -176,8 +176,6 @@ static struct drm_driver fsl_dcu_drm_driver = {
.gem_prime_vunmap   = drm_gem_cma_prime_vunmap,
.gem_prime_mmap = drm_gem_cma_prime_mmap,
.dumb_create= drm_gem_cma_dumb_create,
-   .dumb_map_offset= drm_gem_cma_dumb_map_offset,
-   .dumb_destroy   = drm_gem_dumb_destroy,
.fops   = _dcu_drm_fops,
.name   = "fsl-dcu-drm",
.desc   = "Freescale DCU DRM",


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


Re: [PATCH] drm/etnaviv: Fix off-by-one error in reloc checking

2017-08-04 Thread Christian Gmeiner
2017-07-25 14:33 GMT+02:00 Wladimir J. van der Laan :
> A relocation pointing to the last four bytes of a buffer can
> legitimately happen in the case of small vertex buffers.
>
> Signed-off-by: Wladimir J. van der Laan 

Reviewed-by: Christian Gmeiner 

> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c 
> b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
> index de80ee1..21be4dc 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
> @@ -270,8 +270,8 @@ static int submit_reloc(struct etnaviv_gem_submit 
> *submit, void *stream,
> if (ret)
> return ret;
>
> -   if (r->reloc_offset >= bo->obj->base.size - sizeof(*ptr)) {
> -   DRM_ERROR("relocation %u outside object", i);
> +   if (r->reloc_offset > bo->obj->base.size - sizeof(*ptr)) {
> +   DRM_ERROR("relocation %u outside object\n", i);
> return -EINVAL;
> }
>
> --
> 2.7.4
>

greets
--
Christian Gmeiner, MSc

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


[Bug 101672] radeonsi: 3D engines causing frequent GPU lockups

2017-08-04 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101672

--- Comment #21 from MirceaKitsune  ---
Created attachment 133244
  --> https://bugs.freedesktop.org/attachment.cgi?id=133244=edit
Memtest86 screenshot

To rule out the possibility of a hardware issue, I ran two Memtest86 5.01
sessions from a Clonezilla bootable CD. The first was in the day for 5 hours,
the second was during the night for over 10 hours: The program only registered
3 passes in total, but it did not find any errors. I'll attach a picture just
in case any useful information is printed there.

-- 
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 100306] System randomly freezes or crashes to the login screen, glitches until rebooted

2017-08-04 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=100306

--- Comment #35 from MirceaKitsune  ---
Created attachment 133243
  --> https://bugs.freedesktop.org/attachment.cgi?id=133243=edit
Memtest86 screenshot

To rule out the possibility of a hardware issue, I ran two Memtest86 5.01
sessions from a Clonezilla bootable CD. The first was in the day for 5 hours,
the second was during the night for over 10 hours: The program only registered
3 passes in total, but it did not find any errors. I'll attach a picture just
in case any useful information is printed there.

-- 
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 2/3] drm/msm/mdp5: mark runtime_pm functions as __maybe_unused

2017-08-04 Thread Archit Taneja



On 08/03/2017 05:20 PM, Arnd Bergmann wrote:

When CONFIG_PM is disabled, we get harmless warnings about unused
functions:

drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c:1025:12: error: 'mdp5_runtime_resume' 
defined but not used [-Werror=unused-function]
  static int mdp5_runtime_resume(struct device *dev)
 ^~~
drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c:1015:12: error: 'mdp5_runtime_suspend' 
defined but not used [-Werror=unused-function]
  static int mdp5_runtime_suspend(struct device *dev)
 ^~~~

This marks both functions as __maybe_unused so the compiler
can drop them silently.


Thanks for the fix. Since the commit is still in Rob's -next branch,
I'll post a new version which fixes this.

Archit



Fixes: d68fe15b1878 ("drm/msm/mdp5: Use runtime PM get/put API instead of toggling 
clocks")
Signed-off-by: Arnd Bergmann 
---
  drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c 
b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
index 9f9d95f7c80f..f7c0698fec40 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
@@ -1012,7 +1012,7 @@ static int mdp5_dev_remove(struct platform_device *pdev)
return 0;
  }
  
-static int mdp5_runtime_suspend(struct device *dev)

+static __maybe_unused int mdp5_runtime_suspend(struct device *dev)
  {
struct platform_device *pdev = to_platform_device(dev);
struct mdp5_kms *mdp5_kms = platform_get_drvdata(pdev);
@@ -1022,7 +1022,7 @@ static int mdp5_runtime_suspend(struct device *dev)
return mdp5_disable(mdp5_kms);
  }
  
-static int mdp5_runtime_resume(struct device *dev)

+static __maybe_unused int mdp5_runtime_resume(struct device *dev)
  {
struct platform_device *pdev = to_platform_device(dev);
struct mdp5_kms *mdp5_kms = platform_get_drvdata(pdev);



--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[drm:drm-syncobj-wait-null 31/31] htmldocs: include/drm/drm_syncobj.h:56: warning: No description found for parameter 'null_fence_attached'

2017-08-04 Thread kbuild test robot
tree:   git://people.freedesktop.org/~airlied/linux.git drm-syncobj-wait-null
head:   77645c44e3fc32028b3bef3b75889c1524b8df3a
commit: 77645c44e3fc32028b3bef3b75889c1524b8df3a [31/31] drm/syncobj: allow 
wait on unsignalled semantics
reproduce: make htmldocs

All warnings (new ones prefixed by >>):

   WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick 
(https://www.imagemagick.org)
   arch/x86/include/asm/uaccess_32.h:1: warning: no structured comments found
   include/linux/init.h:1: warning: no structured comments found
   include/linux/mod_devicetable.h:687: warning: Excess 
struct/union/enum/typedef member 'ver_major' description in 'fsl_mc_device_id'
   include/linux/mod_devicetable.h:687: warning: Excess 
struct/union/enum/typedef member 'ver_minor' description in 'fsl_mc_device_id'
   kernel/sched/core.c:2088: warning: No description found for parameter 'rf'
   kernel/sched/core.c:2088: warning: Excess function parameter 'cookie' 
description in 'try_to_wake_up_local'
   include/linux/kthread.h:26: warning: Excess function parameter '...' 
description in 'kthread_create'
   kernel/sys.c:1: warning: no structured comments found
   include/linux/device.h:969: warning: No description found for parameter 
'dma_ops'
   drivers/dma-buf/seqno-fence.c:1: warning: no structured comments found
   include/linux/iio/iio.h:597: warning: No description found for parameter 
'trig_readonly'
   include/linux/iio/trigger.h:151: warning: No description found for parameter 
'indio_dev'
   include/linux/iio/trigger.h:151: warning: No description found for parameter 
'trig'
   include/linux/device.h:970: warning: No description found for parameter 
'dma_ops'
   include/linux/usb/gadget.h:230: warning: No description found for parameter 
'claimed'
   include/linux/usb/gadget.h:230: warning: No description found for parameter 
'enabled'
   include/linux/usb/gadget.h:408: warning: No description found for parameter 
'quirk_altset_not_supp'
   include/linux/usb/gadget.h:408: warning: No description found for parameter 
'quirk_stall_not_supp'
   include/linux/usb/gadget.h:408: warning: No description found for parameter 
'quirk_zlp_not_supp'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'set_busid'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'debugfs_init'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'gem_open_object'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'gem_close_object'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'prime_handle_to_fd'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'prime_fd_to_handle'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'gem_prime_export'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'gem_prime_import'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'gem_prime_pin'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'gem_prime_unpin'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'gem_prime_res_obj'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'gem_prime_get_sg_table'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'gem_prime_import_sg_table'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'gem_prime_vmap'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'gem_prime_vunmap'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'gem_prime_mmap'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'gem_vm_ops'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'major'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'minor'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'patchlevel'
   include/drm/drm_drv.h:537: warning: No description found for parameter 'name'
   include/drm/drm_drv.h:537: warning: No description found for parameter 'desc'
   include/drm/drm_drv.h:537: warning: No description found for parameter 'date'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'driver_features'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'ioctls'
   include/drm/drm_drv.h:537: warning: No description found for parameter 
'num_ioctls'
   include/drm/drm_drv.h:537: warning: No description found for parameter 'fops'
   include/drm/drm_color_mgmt.h:1: warning: no structured comments found
   drivers/gpu/drm/drm_syncobj.c:394: warning: Excess function parameter 'dev' 
description in 'drm_syncobj_open'
   drivers/gpu/drm/drm_syncobj.c:419: warning: Excess function parameter 'dev' 
description in 'drm_syncobj_release'
>> include/drm/drm_syncobj.h:56: warning: No description found for 

Re: [Intel-gfx] [PATCH 00/11] constify i915 attribute_group structures.

2017-08-04 Thread Lionel Landwerlin

On 04/08/17 11:22, Arvind Yadav wrote:

Hi Lionel,


On Friday 04 August 2017 02:33 PM, Lionel Landwerlin wrote:

Hi Arwind,

These files were generated by a script maintained in this repository 
: 
https://github.com/rib/gputop/blob/master/scripts/i915-perf-kernelgen.py
It would best to update this script first to make sure future 
platforms get the fixes too.


Some changes have just been merged, deleted most configs but the test 
ones.

You'll need to update your series.

I have done the changes. Please review it. :) Shared patch is 
0001-i915-perf-kernelgen.py-constify-attribute_group-stru.patch.


Hm... Where is it? (I can't see it on the mailing list nor attached)
The best would be to submit a PR on the github project directly.





Otherwise it looks like a good change.

Thanks,

-
Lionel

On 04/08/17 06:03, Arvind Yadav wrote:

attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work with
const attribute_group. So mark the non-const structs as const.

Arvind Yadav (11):
   [PATCH 01/11] drm: i915: i915_oa_kblgt2: constify attribute_group 
structures.
   [PATCH 02/11] drm: i915: i915_oa_bdw: constify attribute_group 
structures.
   [PATCH 03/11] drm: i915: i915_oa_bxt: constify attribute_group 
structures.
   [PATCH 04/11] drm: i915: i915_oa_chv: constify attribute_group 
structures.
   [PATCH 05/11] drm: i915: i915_oa_glk: constify attribute_group 
structures.
   [PATCH 06/11] drm: i915: i915_oa_hsw: constify attribute_group 
structures.
   [PATCH 07/11] drm: i915: i915_oa_kblgt3: constify attribute_group 
structures.
   [PATCH 08/11] drm: i915: i915_oa_sklgt2: constify attribute_group 
structures.
   [PATCH 09/11] drm: i915: i915_oa_sklgt3: constify attribute_group 
structures.
   [PATCH 10/11] drm: i915: i915_oa_sklgt4: constify attribute_group 
structures.
   [PATCH 11/11] drm: i915: i915_sysfs: constify attribute_group 
structures.


  drivers/gpu/drm/i915/i915_oa_bdw.c| 44 
+--

  drivers/gpu/drm/i915/i915_oa_bxt.c| 30 
  drivers/gpu/drm/i915/i915_oa_chv.c| 28 +++---
  drivers/gpu/drm/i915/i915_oa_glk.c| 30 
  drivers/gpu/drm/i915/i915_oa_hsw.c| 12 +-
  drivers/gpu/drm/i915/i915_oa_kblgt2.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_kblgt3.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_sklgt2.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_sklgt3.c | 36 
++--
  drivers/gpu/drm/i915/i915_oa_sklgt4.c | 36 
++--

  drivers/gpu/drm/i915/i915_sysfs.c |  6 ++---
  11 files changed, 165 insertions(+), 165 deletions(-)




~arvind



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


  1   2   >