[Bug 102909] radeon 0000:03:00.0: ring 0 stalled for more than 10000msec

2018-01-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=102909

Kai-Heng Feng  changed:

   What|Removed |Added

  Component|Driver/Radeon   |DRM/Radeon
 QA Contact|xorg-t...@lists.x.org   |
   Assignee|xorg-driver-...@lists.x.org |dri-devel@lists.freedesktop
   ||.org
Product|xorg|DRI

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


RE: [PATCH] drm/ttm: optimize errors checking and free _manager when finishing

2018-01-01 Thread He, Roger


-Original Message-
From: Xiongwei Song [mailto:sxwj...@gmail.com] 
Sent: Sunday, December 31, 2017 7:40 PM
To: Koenig, Christian ; He, Roger 
; airl...@linux.ie
Cc: dri-devel@lists.freedesktop.org; linux-ker...@vger.kernel.org
Subject: [PATCH] drm/ttm: optimize errors checking and free _manager when 
finishing

In the function ttm_page_alloc_init, kzalloc call is made for variable 
_manager, we need to check its return value, it may return NULL.

In the function ttm_page_alloc_fini, we need to call kfree for variable 
_manager, instead of make _manager NULL directly.

Signed-off-by: Xiongwei Song 
---
 drivers/gpu/drm/ttm/ttm_page_alloc.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c 
b/drivers/gpu/drm/ttm/ttm_page_alloc.c
index b5ba6441489f..e20a0b8e352b 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -1007,6 +1007,10 @@ int ttm_page_alloc_init(struct ttm_mem_global *glob, 
unsigned max_pages)
pr_info("Initializing pool allocator\n");
 
_manager = kzalloc(sizeof(*_manager), GFP_KERNEL);
+   if (!_manager) {
+   ret = -ENOMEM;
+   goto out;
+   }
Seems we only need above here for this patch I think. 
The rest is no need, because ttm_pool_kobj_release will kfree _manager.


Thanks
Roger(Hongbo.He)

ttm_page_pool_init_locked(&_manager->wc_pool, GFP_HIGHUSER, "wc", 0);
 
@@ -1034,13 +1038,17 @@ int ttm_page_alloc_init(struct ttm_mem_global *glob, 
unsigned max_pages)
   >kobj, "pool");
if (unlikely(ret != 0)) {
kobject_put(&_manager->kobj);
-   _manager = NULL;
-   return ret;
+   goto out_free_mgr;
}
 
ttm_pool_mm_shrink_init(_manager);
 
return 0;
+out_free_mgr:
+   kfree(_manager);
+   _manager = NULL;
+out:
+   return ret;
 }
 
 void ttm_page_alloc_fini(void)
@@ -1055,6 +1063,7 @@ void ttm_page_alloc_fini(void)
ttm_page_pool_free(&_manager->pools[i], FREE_ALL_PAGES, true);
 
kobject_put(&_manager->kobj);
+   kfree(_manager);
_manager = NULL;
 }
 
--
2.15.1

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


RE: [PATCH] staging: vboxvideo adapt to new TTM interface

2018-01-01 Thread He, Roger
+Alex

Do you know who can help about it?


Thanks
Roger(Hongbo.He)

-Original Message-
From: dri-devel [mailto:dri-devel-boun...@lists.freedesktop.org] On Behalf Of 
He, Roger
Sent: Thursday, December 28, 2017 6:21 PM
To: dri-devel@lists.freedesktop.org; Bridgman, John ; 
Gregory, Robert ; Khan, Tahir ; 
Shamim, Zafar 
Cc: hdego...@redhat.com; Koenig, Christian ; 
gre...@linuxfoundation.org
Subject: RE: [PATCH] staging: vboxvideo adapt to new TTM interface

Seems I have no permission to push the patch into amd-staging-drm-next.
Needs Whitelisted.

http://git.amd.com:8080/#/c/124051/1
anyone can help?

Thanks
Roger(Hongbo.He)
-Original Message-
From: Zhou, David(ChunMing) 
Sent: Thursday, December 28, 2017 12:24 PM
To: He, Roger ; dri-devel@lists.freedesktop.org
Cc: hdego...@redhat.com; gre...@linuxfoundation.org; Koenig, Christian 
; Zhou, David(ChunMing) 
Subject: Re: [PATCH] staging: vboxvideo adapt to new TTM interface

Reviewed-by: Chunming Zhou 


On 2017年12月28日 11:35, Roger He wrote:
> Fixes interface change done in the following commit:
> eb86c98 drm/ttm: use an operation ctx for ttm_tt_populate in ttm_bo_driver
>
> i missed this driver because it is in staging dir.
>
> Signed-off-by: Roger He 
> ---
>   drivers/staging/vboxvideo/vbox_ttm.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/vboxvideo/vbox_ttm.c 
> b/drivers/staging/vboxvideo/vbox_ttm.c
> index 231c89e..55f14c9 100644
> --- a/drivers/staging/vboxvideo/vbox_ttm.c
> +++ b/drivers/staging/vboxvideo/vbox_ttm.c
> @@ -213,9 +213,10 @@ static struct ttm_tt *vbox_ttm_tt_create(struct 
> ttm_bo_device *bdev,
>   return tt;
>   }
>   
> -static int vbox_ttm_tt_populate(struct ttm_tt *ttm)
> +static int vbox_ttm_tt_populate(struct ttm_tt *ttm,
> + struct ttm_operation_ctx *ctx)
>   {
> - return ttm_pool_populate(ttm);
> + return ttm_pool_populate(ttm, ctx);
>   }
>   
>   static void vbox_ttm_tt_unpopulate(struct ttm_tt *ttm)

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


linux-next: build failure after merge of the drm tree

2018-01-01 Thread Stephen Rothwell
Hi all,

After merging the drm tree, today's linux-next build (x86_64 allmodconfig)
failed like this:

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:219:6: 
error: redefinition of 'dm_dp_mst_dc_sink_create'
 void dm_dp_mst_dc_sink_create(struct drm_connector *connector)
  ^
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:183:6: 
note: previous definition of 'dm_dp_mst_dc_sink_create' was here
 void dm_dp_mst_dc_sink_create(struct drm_connector *connector)
  ^

Caused by commit

  391ef035200f ("drm/amd/display: Fix rehook MST display not light back on")

automatically mergeing badly with commit

  becd0875f439 ("drm/amd/display: Fix rehook MST display not light back on")

from Linus' tree.

I applied this merge fix patch (to remove the second copy of
dm_dp_mst_dc_sink_create):

From: Stephen Rothwell 
Date: Tue, 2 Jan 2018 12:43:32 +1100
Subject: [PATCH] drm/amd/display: fix mismerge of identical patches

Signed-off-by: Stephen Rothwell 
---
 .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c| 36 --
 1 file changed, 36 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 7ace4dd302c1..f3d87f418d2e 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -216,42 +216,6 @@ void dm_dp_mst_dc_sink_create(struct drm_connector 
*connector)
>base, aconnector->edid);
 }
 
-void dm_dp_mst_dc_sink_create(struct drm_connector *connector)
-{
-   struct amdgpu_dm_connector *aconnector = 
to_amdgpu_dm_connector(connector);
-   struct edid *edid;
-   struct dc_sink *dc_sink;
-   struct dc_sink_init_data init_params = {
-   .link = aconnector->dc_link,
-   .sink_signal = SIGNAL_TYPE_DISPLAY_PORT_MST };
-
-   edid = drm_dp_mst_get_edid(connector, >mst_port->mst_mgr, 
aconnector->port);
-
-   if (!edid) {
-   drm_mode_connector_update_edid_property(
-   >base,
-   NULL);
-   return;
-   }
-
-   aconnector->edid = edid;
-
-   dc_sink = dc_link_add_remote_sink(
-   aconnector->dc_link,
-   (uint8_t *)aconnector->edid,
-   (aconnector->edid->extensions + 1) * EDID_LENGTH,
-   _params);
-
-   dc_sink->priv = aconnector;
-   aconnector->dc_sink = dc_sink;
-
-   amdgpu_dm_add_sink_to_freesync_module(
-   connector, aconnector->edid);
-
-   drm_mode_connector_update_edid_property(
-   >base, aconnector->edid);
-}
-
 static int dm_dp_mst_get_modes(struct drm_connector *connector)
 {
struct amdgpu_dm_connector *aconnector = 
to_amdgpu_dm_connector(connector);
-- 
2.15.0

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


[GIT PULL] exynos-drm-next

2018-01-01 Thread Inki Dae
Hi Dave,

   Just removing lagacy IPP driver and several trivial cleanups.

   As discussed already, we are preparing a new version of IPP driver
   which will include rewritten code and API. Removing the lagacy
   IPP driver is a first step for use of the new driver.

   Please kindly let me know if there is any problem.

Happy new year~

Thanks,
Inki Dae

The following changes since commit 350877626faba5d60cbb8cef2bdeb524212c780b:

  Merge tag 'drm-intel-next-2017-12-22' of 
git://anongit.freedesktop.org/drm/drm-intel into drm-next (2017-12-28 05:20:31 
+1000)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos 
tags/exynos-drm-next-for-v4.16

for you to fetch changes up to 8ded59413ccc58fe138ab4bf337d0d0b3131d46b:

  drm/exynos: ipp: Remove Exynos DRM IPP subsystem (2018-01-02 08:41:22 +0900)


Remove lagacy IPP driver
- This driver isn't used anymore so remove it. Marek is preparing new one
  which includes completely rewritten API so this driver will be replaced
  with the new version[1] later.
And cleanups.

[1] https://patches.linaro.org/cover/118386/


Fabio Estevam (1):
  drm/exynos: decon5433: Remove unnecessary platform_get_resource() error 
check

Krzysztof Kozlowski (2):
  drm/exynos/decon: Move headers from global to local place
  drm/exynos/decon: Add include guard to the Exynos7 header

Marek Szyprowski (1):
  drm/exynos: ipp: Remove Exynos DRM IPP subsystem

 drivers/gpu/drm/exynos/Kconfig |   11 +-
 drivers/gpu/drm/exynos/Makefile|1 -
 drivers/gpu/drm/exynos/exynos5433_drm_decon.c  |8 +-
 drivers/gpu/drm/exynos/exynos7_drm_decon.c |2 +-
 drivers/gpu/drm/exynos/exynos_drm_drv.c|   12 -
 drivers/gpu/drm/exynos/exynos_drm_drv.h|2 -
 drivers/gpu/drm/exynos/exynos_drm_ipp.c| 1806 
 drivers/gpu/drm/exynos/exynos_drm_ipp.h|  252 ---
 .../gpu/drm/exynos/regs-decon5433.h|6 +-
 .../gpu/drm/exynos/regs-decon7.h   |8 +-
 include/uapi/drm/exynos_drm.h  |  192 +--
 11 files changed, 15 insertions(+), 2285 deletions(-)
 delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.c
 delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.h
 rename include/video/exynos5433_decon.h => 
drivers/gpu/drm/exynos/regs-decon5433.h (98%)
 rename include/video/exynos7_decon.h => drivers/gpu/drm/exynos/regs-decon7.h 
(99%)
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: tinydrm: page allocation failure

2018-01-01 Thread David Lechner

On 12/14/2017 01:55 PM, Noralf Trønnes wrote:


Den 14.12.2017 17.25, skrev David Lechner:

On 12/11/2017 06:45 AM, Noralf Trønnes wrote:


Den 11.12.2017 04.28, skrev David Lechner:

I'm using drm-misc/drm-misc-next and occasionally getting errors as seen in the 
stack traces below. I'm not really sure what to make of it. Any ideas?



I'm starting to wonder if there is some sort of race condition involved. I only 
get this warning on some boots, but when I do, it happens multiple times. Also, 
when I was debugging a an unrelated problem, I enabled some of the spin lock 
checking kernel options that really slow down the kernel. When I did this, I 
got this warning all of the time.

Would it be sensible to allocate a dummy RX buffer once instead of letting SPI 
allocate a new one for every transfer?



I have looked at the code and the dummy buffer is needed by some
drivers for DMA transfers. They need both tx and rx buffers to do the
transfer. A solution might be to let tinydrm allocate a dummy rx buffer
and attach it to every spi_transfer.

We could check if it's really needed:

     if (spi->controller->flags & (SPI_CONTROLLER_MUST_RX | 
SPI_CONTROLLER_MUST_TX))
         // allocate dummy rx buffer

And maybe something like this:

+ * @dummy_rx_buf: Optional dummy rx buffer to avoid per transfer allocation of
+ *    dummy rx buffers in the spi core.

  int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz,
           struct spi_transfer *header, u8 bpw, const void *buf,
-             size_t len)
+             size_t len, void dummy_rx_buf)
  {
  struct spi_transfer tr = {
      .bits_per_word = bpw,
      .speed_hz = speed_hz,
+        .rx_buf = dummy_rx_buf,
  };

Noralf.



FWIW, the problem seems to go away if CONFIG_SWAP=y.

I also made the changes as suggested and it seems to be working for 
CONFIG_SWAP=n. Preventing constant reallocations seems like a good idea to me 
even when memory is not limited. I'll submit a patch after a bit more testing.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 11/12] drm/amd/powerplay: drop unneeded newline

2018-01-01 Thread Alex Deucher
On Wed, Dec 27, 2017 at 9:51 AM, Julia Lawall  wrote:
> PP_ASSERT_WITH_CODE prints a newline at the end of the message string,
> so the message string does not need to include a newline explicitly.
> Done using Coccinelle.
>
> Signed-off-by: Julia Lawall 

Applied.  thanks!

Alex

>
> ---
>
> I couldn't figure out how to configure the kernel to get any of this code
> to compile.
>
>  drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c|   12 
>  drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c  |2 +-
>  drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c   |2 +-
>  drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c |2 +-
>  drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c |2 +-
>  5 files changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c 
> b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> index 40adc85..8d7fd06 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> @@ -2266,14 +2266,18 @@ static int 
> smu7_set_private_data_based_on_pptable_v0(struct pp_hwmgr *hwmgr)
> struct phm_clock_voltage_dependency_table *allowed_mclk_vddci_table = 
> hwmgr->dyn_state.vddci_dependency_on_mclk;
>
> PP_ASSERT_WITH_CODE(allowed_sclk_vddc_table != NULL,
> -   "VDDC dependency on SCLK table is missing. This table is 
> mandatory\n", return -EINVAL);
> +   "VDDC dependency on SCLK table is missing. This table is 
> mandatory",
> +   return -EINVAL);
> PP_ASSERT_WITH_CODE(allowed_sclk_vddc_table->count >= 1,
> -   "VDDC dependency on SCLK table has to have is missing. This 
> table is mandatory\n", return -EINVAL);
> +   "VDDC dependency on SCLK table has to have is missing. This 
> table is mandatory",
> +   return -EINVAL);
>
> PP_ASSERT_WITH_CODE(allowed_mclk_vddc_table != NULL,
> -   "VDDC dependency on MCLK table is missing. This table is 
> mandatory\n", return -EINVAL);
> +   "VDDC dependency on MCLK table is missing. This table is 
> mandatory",
> +   return -EINVAL);
> PP_ASSERT_WITH_CODE(allowed_mclk_vddc_table->count >= 1,
> -   "VDD dependency on MCLK table has to have is missing. This 
> table is mandatory\n", return -EINVAL);
> +   "VDD dependency on MCLK table has to have is missing. This 
> table is mandatory",
> +   return -EINVAL);
>
> data->min_vddc_in_pptable = 
> (uint16_t)allowed_sclk_vddc_table->entries[0].v;
> data->max_vddc_in_pptable = 
> (uint16_t)allowed_sclk_vddc_table->entries[allowed_sclk_vddc_table->count - 
> 1].v;
> diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c 
> b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
> index 085d81c..427daa6 100644
> --- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
> @@ -1799,7 +1799,7 @@ static int 
> fiji_populate_clock_stretcher_data_table(struct pp_hwmgr *hwmgr)
> phm_cap_unset(hwmgr->platform_descriptor.platformCaps,
> PHM_PlatformCaps_ClockStretcher);
> PP_ASSERT_WITH_CODE(false,
> -   "Stretch Amount in PPTable not supported\n",
> +   "Stretch Amount in PPTable not supported",
> return -EINVAL);
> }
>
> diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c 
> b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
> index 1253126..6400065 100644
> --- a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
> @@ -546,7 +546,7 @@ static int iceland_get_std_voltage_value_sidd(struct 
> pp_hwmgr *hwmgr,
>
> /* SCLK/VDDC Dependency Table has to exist. */
> PP_ASSERT_WITH_CODE(NULL != hwmgr->dyn_state.vddc_dependency_on_sclk,
> -   "The SCLK/VDDC Dependency Table does not exist.\n",
> +   "The SCLK/VDDC Dependency Table does not exist.",
> return -EINVAL);
>
> if (NULL == hwmgr->dyn_state.cac_leakage_table) {
> diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c 
> b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
> index cdb4765..fd874f7 100644
> --- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
> @@ -1652,7 +1652,7 @@ static int 
> polaris10_populate_clock_stretcher_data_table(struct pp_hwmgr *hwmgr)
> phm_cap_unset(hwmgr->platform_descriptor.platformCaps,
> PHM_PlatformCaps_ClockStretcher);
> PP_ASSERT_WITH_CODE(false,
> -   "Stretch Amount in 

[PATCH v3 01/34] clk_ops: change round_rate() to return unsigned long

2018-01-01 Thread Bryan O'Donoghue
Right now it is not possible to return a value larger than LONG_MAX on 32
bit systems. You can pass a rate of ULONG_MAX but can't return anything
past LONG_MAX due to the fact both the rounded_rate and negative error
codes are represented in the return value of round_rate().

Most implementations either return zero on error or don't return error
codes at all. A minority of implementations do return a negative number -
typically -EINVAL or -ENODEV.

At the higher level then callers of round_rate() typically and rightly
check for a value of <= 0.

It is possible then to convert round_rate() to an unsigned long return
value and change error code indication for the minority from -ERRORCODE to
a simple 0.

This patch is the first step in making it possible to scale round_rate past
LONG_MAX, later patches will change the previously mentioned minority of
round_rate() implementations to return zero only on error if those
implementations currently return a negative error number. Implementations
that do not return an error code of < 0 will be left as-is.

Signed-off-by: Bryan O'Donoghue 
Cc: Michael Turquette 
Cc: Stephen Boyd 
Cc: linux-o...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Cc: linux-m...@linux-mips.org
Cc: linux-...@vger.kernel.org
Cc: linux-rpi-ker...@lists.infradead.org
Cc: patc...@opensource.cirrus.com
Cc: uclinux-h8-de...@lists.sourceforge.jp
Cc: linux-amlo...@lists.infradead.org
Cc: linux-arm-...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-renesas-...@vger.kernel.org
Cc: linux-rockc...@lists.infradead.org
Cc: linux-samsung-...@vger.kernel.org
Cc: linux-te...@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media...@lists.infradead.org
Cc: freedr...@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linux-...@vger.kernel.org
---
 arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c|  4 ++--
 arch/arm/mach-omap2/clock2xxx.h |  4 ++--
 arch/arm/mach-vexpress/spc.c|  4 ++--
 arch/mips/alchemy/common/clock.c|  2 +-
 drivers/clk/at91/clk-audio-pll.c| 10 ++
 drivers/clk/at91/clk-h32mx.c|  5 +++--
 drivers/clk/at91/clk-peripheral.c   |  6 +++---
 drivers/clk/at91/clk-pll.c  |  2 +-
 drivers/clk/at91/clk-plldiv.c   |  5 +++--
 drivers/clk/at91/clk-smd.c  |  5 +++--
 drivers/clk/at91/clk-usb.c  |  5 +++--
 drivers/clk/axs10x/i2s_pll_clock.c  |  4 ++--
 drivers/clk/axs10x/pll_clock.c  |  5 +++--
 drivers/clk/bcm/clk-bcm2835.c   | 11 ++-
 drivers/clk/bcm/clk-iproc-asiu.c|  5 +++--
 drivers/clk/bcm/clk-iproc-pll.c |  8 
 drivers/clk/clk-axi-clkgen.c|  5 +++--
 drivers/clk/clk-cdce706.c   | 15 +--
 drivers/clk/clk-cdce925.c   | 15 +--
 drivers/clk/clk-composite.c |  5 +++--
 drivers/clk/clk-cs2000-cp.c |  4 ++--
 drivers/clk/clk-divider.c   |  5 +++--
 drivers/clk/clk-fixed-factor.c  |  5 +++--
 drivers/clk/clk-fractional-divider.c|  4 ++--
 drivers/clk/clk-gemini.c|  5 +++--
 drivers/clk/clk-highbank.c  | 10 ++
 drivers/clk/clk-hsdk-pll.c  |  4 ++--
 drivers/clk/clk-multiplier.c|  5 +++--
 drivers/clk/clk-scpi.c  |  8 
 drivers/clk/clk-si514.c |  4 ++--
 drivers/clk/clk-si5351.c| 15 +--
 drivers/clk/clk-si570.c |  4 ++--
 drivers/clk/clk-stm32f4.c   | 15 +--
 drivers/clk/clk-u300.c  |  4 ++--
 drivers/clk/clk-versaclock5.c   | 16 
 drivers/clk/clk-vt8500.c|  9 +
 drivers/clk/clk-wm831x.c|  5 +++--
 drivers/clk/clk-xgene.c |  9 +
 drivers/clk/h8300/clk-h8s2678.c |  4 ++--
 drivers/clk/hisilicon/clk-hi6220-stub.c |  5 +++--
 drivers/clk/hisilicon/clkdivider-hi6220.c   |  5 +++--
 drivers/clk/imx/clk-busy.c  |  5 +++--
 drivers/clk/imx/clk-cpu.c   |  4 ++--
 drivers/clk/imx/clk-fixup-div.c |  5 +++--
 drivers/clk/imx/clk-pfd.c   |  4 ++--
 drivers/clk/imx/clk-pllv2.c |  4 ++--
 drivers/clk/imx/clk-pllv3.c | 19 +++
 drivers/clk/ingenic/cgu.c   |  4 ++--
 drivers/clk/ingenic/jz4780-cgu.c|  5 +++--
 drivers/clk/mediatek/clk-pll.c  |  4 ++--
 

[PATCH v2 01/34] clk_ops: change round_rate() to return unsigned long

2018-01-01 Thread Bryan O'Donoghue
Right now it is not possible to return a value larger than LONG_MAX on 32
bit systems. You can pass a rate of ULONG_MAX but can't return anything
past LONG_MAX due to the fact both the rounded_rate and negative error
codes are represented in the return value of round_rate().

Most implementations either return zero on error or don't return error
codes at all. A minority of implementations do return a negative number -
typically -EINVAL or -ENODEV.

At the higher level then callers of round_rate() typically and rightly
check for a value of <= 0.

It is possible then to convert round_rate() to an unsigned long return
value and change error code indication for the minority from -ERRORCODE to
a simple 0.

This patch is the first step in making it possible to scale round_rate past
LONG_MAX, later patches will change the previously mentioned minority of
round_rate() implementations to return zero only on error if those
implementations currently return a negative error number. Implementations
that do not return an error code of < 0 will be left as-is.

Signed-off-by: Bryan O'Donoghue 
Cc: Michael Turquette 
Cc: Stephen Boyd 
Cc: linux-o...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Cc: linux-m...@linux-mips.org
Cc: linux-...@vger.kernel.org
Cc: linux-rpi-ker...@lists.infradead.org
Cc: patc...@opensource.cirrus.com
Cc: uclinux-h8-de...@lists.sourceforge.jp
Cc: linux-amlo...@lists.infradead.org
Cc: linux-arm-...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-renesas-...@vger.kernel.org
Cc: linux-rockc...@lists.infradead.org
Cc: linux-samsung-...@vger.kernel.org
Cc: linux-te...@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media...@lists.infradead.org
Cc: freedr...@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linux-...@vger.kernel.org
---
 arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c|  4 ++--
 arch/arm/mach-omap2/clock2xxx.h |  4 ++--
 arch/arm/mach-vexpress/spc.c|  4 ++--
 arch/mips/alchemy/common/clock.c|  2 +-
 drivers/clk/at91/clk-audio-pll.c| 10 ++
 drivers/clk/at91/clk-h32mx.c|  5 +++--
 drivers/clk/at91/clk-peripheral.c   |  6 +++---
 drivers/clk/at91/clk-pll.c  |  2 +-
 drivers/clk/at91/clk-plldiv.c   |  5 +++--
 drivers/clk/at91/clk-smd.c  |  5 +++--
 drivers/clk/at91/clk-usb.c  |  5 +++--
 drivers/clk/axs10x/i2s_pll_clock.c  |  4 ++--
 drivers/clk/axs10x/pll_clock.c  |  5 +++--
 drivers/clk/bcm/clk-bcm2835.c   | 11 ++-
 drivers/clk/bcm/clk-iproc-asiu.c|  5 +++--
 drivers/clk/bcm/clk-iproc-pll.c |  8 
 drivers/clk/clk-axi-clkgen.c|  5 +++--
 drivers/clk/clk-cdce706.c   | 15 +--
 drivers/clk/clk-cdce925.c   | 15 +--
 drivers/clk/clk-composite.c |  5 +++--
 drivers/clk/clk-cs2000-cp.c |  4 ++--
 drivers/clk/clk-divider.c   |  5 +++--
 drivers/clk/clk-fixed-factor.c  |  5 +++--
 drivers/clk/clk-fractional-divider.c|  4 ++--
 drivers/clk/clk-gemini.c|  5 +++--
 drivers/clk/clk-highbank.c  | 10 ++
 drivers/clk/clk-hsdk-pll.c  |  4 ++--
 drivers/clk/clk-multiplier.c|  5 +++--
 drivers/clk/clk-scpi.c  |  8 
 drivers/clk/clk-si514.c |  4 ++--
 drivers/clk/clk-si5351.c| 15 +--
 drivers/clk/clk-si570.c |  4 ++--
 drivers/clk/clk-stm32f4.c   | 15 +--
 drivers/clk/clk-u300.c  |  4 ++--
 drivers/clk/clk-versaclock5.c   | 16 
 drivers/clk/clk-vt8500.c|  9 +
 drivers/clk/clk-wm831x.c|  5 +++--
 drivers/clk/clk-xgene.c |  9 +
 drivers/clk/h8300/clk-h8s2678.c |  4 ++--
 drivers/clk/hisilicon/clk-hi6220-stub.c |  5 +++--
 drivers/clk/hisilicon/clkdivider-hi6220.c   |  5 +++--
 drivers/clk/imx/clk-busy.c  |  5 +++--
 drivers/clk/imx/clk-cpu.c   |  4 ++--
 drivers/clk/imx/clk-fixup-div.c |  5 +++--
 drivers/clk/imx/clk-pfd.c   |  4 ++--
 drivers/clk/imx/clk-pllv2.c |  4 ++--
 drivers/clk/imx/clk-pllv3.c | 19 +++
 drivers/clk/ingenic/cgu.c   |  4 ++--
 drivers/clk/ingenic/jz4780-cgu.c|  5 +++--
 drivers/clk/mediatek/clk-pll.c  |  4 ++--
 

[PATCH v4 2/3] dt-bindings: Add binding for Sitronix ST7735R display panels

2018-01-01 Thread David Lechner
This adds a new device tree binding for Sitronix ST7735R display panels,
such as the Adafruit 1.8" TFT.

Signed-off-by: David Lechner 
Reviewed-by: Rob Herring 
---

v4 changes:
* none

v3 changes:
* compatible string is changed from "sitronix,st7735r-jd-t18003-t01" to
"jianda,jd-t18003-t01", "sitronix,st7735r"

v2 changes:
* none

 .../bindings/display/sitronix,st7735r.txt  | 35 ++
 1 file changed, 35 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/sitronix,st7735r.txt

diff --git a/Documentation/devicetree/bindings/display/sitronix,st7735r.txt 
b/Documentation/devicetree/bindings/display/sitronix,st7735r.txt
new file mode 100644
index 000..f0a5090
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/sitronix,st7735r.txt
@@ -0,0 +1,35 @@
+Sitronix ST7735R display panels
+
+This binding is for display panels using a Sitronix ST7735R controller in SPI
+mode.
+
+Required properties:
+- compatible:  "jianda,jd-t18003-t01", "sitronix,st7735r"
+- dc-gpios:Display data/command selection (D/CX)
+- reset-gpios: Reset signal (RSTX)
+
+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:
+- rotation:panel rotation in degrees counter clockwise (0,90,180,270)
+- backlight:   phandle of the backlight device attached to the panel
+
+Example:
+
+   backlight: backlight {
+   compatible = "gpio-backlight";
+   gpios = < 44 GPIO_ACTIVE_HIGH>;
+   }
+
+   ...
+
+   display@0{
+   compatible = "jianda,jd-t18003-t01", "sitronix,st7735r";
+   reg = <0>;
+   spi-max-frequency = <3200>;
+   dc-gpios = < 43 GPIO_ACTIVE_HIGH>;
+   reset-gpios = < 80 GPIO_ACTIVE_HIGH>;
+   rotation = <270>;
+   backlight = 
+   };
-- 
2.7.4

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


[PATCH v4 3/3] drm/tinydrm: add driver for ST7735R panels

2018-01-01 Thread David Lechner
This adds a new driver for Sitronix ST7735R display panels.

This has been tested using an Adafruit 1.8" TFT.

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

v4 changes:
* renamed st7735r_pipe_enable to jd_t18003_t01_pipe_enable
* renamed st7735r_pipe_funcs to jd_t18003_t01_pipe_funcs
* changed gamma curve to one from Adafruit's Arduino library

v3 changes:
* Changed compatible string
* use SPDX license header
* Renamed mode struct to use panel name instead of controller name

v2 changes:
* Change delay from 10ms to 20ms to avoid checkpatch warning
* Use mipi_dbi_pipe_enable()/mipi_dbi_pipe_disable() to reduce duplicated code
* Rebase on drm-misc-next (tinydrm_lastclose => drm_fb_helper_lastclose)
* Use mipi_dbi_debugfs_init
* Add mipi->read_commands = NULL; since this display is write-only


 MAINTAINERS   |   6 ++
 drivers/gpu/drm/tinydrm/Kconfig   |  10 ++
 drivers/gpu/drm/tinydrm/Makefile  |   1 +
 drivers/gpu/drm/tinydrm/st7735r.c | 215 ++
 4 files changed, 232 insertions(+)
 create mode 100644 drivers/gpu/drm/tinydrm/st7735r.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 528e223..b4ffbc2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4556,6 +4556,12 @@ S:   Maintained
 F: drivers/gpu/drm/tinydrm/st7586.c
 F: Documentation/devicetree/bindings/display/st7586.txt
 
+DRM DRIVER FOR SITRONIX ST7735R PANELS
+M: David Lechner 
+S: Maintained
+F: drivers/gpu/drm/tinydrm/st7735r.c
+F: Documentation/devicetree/bindings/display/st7735r.txt
+
 DRM DRIVER FOR TDFX VIDEO CARDS
 S: Orphan / Obsolete
 F: drivers/gpu/drm/tdfx/
diff --git a/drivers/gpu/drm/tinydrm/Kconfig b/drivers/gpu/drm/tinydrm/Kconfig
index 90c5bd5..b0e567d 100644
--- a/drivers/gpu/drm/tinydrm/Kconfig
+++ b/drivers/gpu/drm/tinydrm/Kconfig
@@ -52,3 +52,13 @@ config TINYDRM_ST7586
  * LEGO MINDSTORMS EV3
 
  If M is selected the module will be called st7586.
+
+config TINYDRM_ST7735R
+   tristate "DRM support for Sitronix ST7735R display panels"
+   depends on DRM_TINYDRM && SPI
+   select TINYDRM_MIPI_DBI
+   help
+ DRM driver Sitronix ST7735R with one of the following LCDs:
+ * JD-T18003-T01 1.8" 128x160 TFT
+
+ If M is selected the module will be called st7735r.
diff --git a/drivers/gpu/drm/tinydrm/Makefile b/drivers/gpu/drm/tinydrm/Makefile
index 8aeee53..49a1119 100644
--- a/drivers/gpu/drm/tinydrm/Makefile
+++ b/drivers/gpu/drm/tinydrm/Makefile
@@ -8,3 +8,4 @@ obj-$(CONFIG_TINYDRM_ILI9225)   += ili9225.o
 obj-$(CONFIG_TINYDRM_MI0283QT) += mi0283qt.o
 obj-$(CONFIG_TINYDRM_REPAPER)  += repaper.o
 obj-$(CONFIG_TINYDRM_ST7586)   += st7586.o
+obj-$(CONFIG_TINYDRM_ST7735R)  += st7735r.o
diff --git a/drivers/gpu/drm/tinydrm/st7735r.c 
b/drivers/gpu/drm/tinydrm/st7735r.c
new file mode 100644
index 000..98ff447
--- /dev/null
+++ b/drivers/gpu/drm/tinydrm/st7735r.c
@@ -0,0 +1,215 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * DRM driver for Sitronix ST7735R panels
+ *
+ * Copyright 2017 David Lechner 
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#define ST7735R_FRMCTR10xb1
+#define ST7735R_FRMCTR20xb2
+#define ST7735R_FRMCTR30xb3
+#define ST7735R_INVCTR 0xb4
+#define ST7735R_PWCTR1 0xc0
+#define ST7735R_PWCTR2 0xc1
+#define ST7735R_PWCTR3 0xc2
+#define ST7735R_PWCTR4 0xc3
+#define ST7735R_PWCTR5 0xc4
+#define ST7735R_VMCTR1 0xc5
+#define ST7735R_GAMCTRP1   0xe0
+#define ST7735R_GAMCTRN1   0xe1
+
+#define ST7735R_MY BIT(7)
+#define ST7735R_MX BIT(6)
+#define ST7735R_MV BIT(5)
+
+static void jd_t18003_t01_pipe_enable(struct drm_simple_display_pipe *pipe,
+ struct drm_crtc_state *crtc_state)
+{
+   struct tinydrm_device *tdev = pipe_to_tinydrm(pipe);
+   struct mipi_dbi *mipi = mipi_dbi_from_tinydrm(tdev);
+   struct device *dev = tdev->drm->dev;
+   int ret;
+   u8 addr_mode;
+
+   DRM_DEBUG_KMS("\n");
+
+   mipi_dbi_hw_reset(mipi);
+
+   ret = mipi_dbi_command(mipi, MIPI_DCS_SOFT_RESET);
+   if (ret) {
+   DRM_DEV_ERROR(dev, "Error sending command %d\n", ret);
+   return;
+   }
+
+   msleep(150);
+
+   mipi_dbi_command(mipi, MIPI_DCS_EXIT_SLEEP_MODE);
+   msleep(500);
+
+   mipi_dbi_command(mipi, ST7735R_FRMCTR1, 0x01, 0x2c, 0x2d);
+   mipi_dbi_command(mipi, ST7735R_FRMCTR2, 0x01, 0x2c, 0x2d);
+   mipi_dbi_command(mipi, ST7735R_FRMCTR3, 0x01, 0x2c, 0x2d, 0x01, 0x2c,
+0x2d);
+   mipi_dbi_command(mipi, ST7735R_INVCTR, 0x07);
+   mipi_dbi_command(mipi, ST7735R_PWCTR1, 0xa2, 0x02, 0x84);
+   

[PATCH v4 0/3] DRM driver for Sitronix ST7735R display panels

2018-01-01 Thread David Lechner
This series adds a new DRM/TinyDRM driver for Sitronix ST7735R, specifically
the Adafruit 1.8" TFT.

Nothing fancy here. Just mostly TinyDRM boilerplate with the init sequence
from the fbtft driver for the same panel.

v4 changes:
* Fix alphabetical order of device tree vendor
* change prefix on panel-specific functions/structs to panel prefix instead
  of controller
* Use gamma curve from Adafruit's Arduino library.

v3 changes:
* New patch for jianda vendor prefix
* Change compatible string in DT bindings (dropped ACK because of this)
* Use SPDX license ID

David Lechner (3):
  dt-bindings: add jianda vendor prefix
  dt-bindings: Add binding for Sitronix ST7735R display panels
  drm/tinydrm: add driver for ST7735R panels

 .../bindings/display/sitronix,st7735r.txt  |  35 
 .../devicetree/bindings/vendor-prefixes.txt|   1 +
 MAINTAINERS|   6 +
 drivers/gpu/drm/tinydrm/Kconfig|  10 +
 drivers/gpu/drm/tinydrm/Makefile   |   1 +
 drivers/gpu/drm/tinydrm/st7735r.c  | 215 +
 6 files changed, 268 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/sitronix,st7735r.txt
 create mode 100644 drivers/gpu/drm/tinydrm/st7735r.c

-- 
2.7.4

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


[PATCH v4 1/3] dt-bindings: add jianda vendor prefix

2018-01-01 Thread David Lechner
This adds a vendor prefix "jianda" for Jiandangjing Technology Co., Ltd.

Signed-off-by: David Lechner 
Reviewed-by: Rob Herring 
---

v4 changes:
* Fixed alphabetical order

v3 changes:
* new patch in v3

 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 41cb1ff0..2954ca0 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -173,6 +173,7 @@ itead   ITEAD Intelligent Systems Co.Ltd
 iwave  iWave Systems Technologies Pvt. Ltd.
 jdiJapan Display Inc.
 jedec  JEDEC Solid State Technology Association
+jianda Jiandangjing Technology Co., Ltd.
 karo   Ka-Ro electronics GmbH
 keithkoep  Keith & Koep GmbH
 keymileKeymile GmbH
-- 
2.7.4

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


Re: nouveau. swiotlb: coherent allocation failed for device 0000:01:00.0 size=2097152

2018-01-01 Thread Ilia Mirkin
On Sun, Dec 31, 2017 at 3:53 PM, Mike Galbraith  wrote:
> On Sun, 2017-12-31 at 13:27 -0500, Ilia Mirkin wrote:
>> On Tue, Dec 19, 2017 at 8:45 AM, Christian König
>>  wrote:
>> > Am 19.12.2017 um 11:39 schrieb Michel Dänzer:
>> >>
>> >> On 2017-12-19 11:37 AM, Michel Dänzer wrote:
>> >>>
>> >>> On 2017-12-18 08:01 PM, Tobias Klausmann wrote:
>> 
>>  On 12/18/17 7:06 PM, Mike Galbraith wrote:
>> >
>> > Greetings,
>> >
>> > Kernel bound workloads seem to trigger the below for whatever reason.
>> >I only see this when beating up NFS.  There was a kworker wakeup
>> > latency issue, but with a bandaid applied to fix that up, I can still
>> > trigger this.
>> 
>> 
>>  Hi,
>> 
>>  i have seen this one as well with my system, but i could not find an
>>  easy way to trigger it for bisecting purpose. If you can trigger it
>>  conveniently, a bisect would be nice!
>> >>>
>> >>> I'm seeing this (with the amdgpu and radeon drivers) when restic takes a
>> >>> backup, creating memory pressure. I happen to have just finished
>> >>> bisecting, the result is:
>> >>>
>> >>> 648bc3574716400acc06f99915815f80d9563783 is the first bad commit
>> >>> commit 648bc3574716400acc06f99915815f80d9563783
>> >>> Author: Christian König 
>> >>> Date:   Thu Jul 6 09:59:43 2017 +0200
>> >>>
>> >>>  drm/ttm: add transparent huge page support for DMA allocations v2
>> >>>
>> >>>  Try to allocate huge pages when it makes sense.
>> >>>
>> >>>  v2: fix comment and use ifdef
>> >>>
>> >>>
>> >> BTW, I haven't noticed any bad effects other than the dmesg splats, so
>> >> maybe it's just noise about transient failures for which there is a
>> >> proper fallback in place.
>> >
>> >
>> > Yeah, I think that is exactly what happens here.
>> >
>> > We try to allocate a huge page, but fail and so fall back to using multiple
>> > 4k pages instead.
>> >
>> > Going to send out a patch to suppress the warning.
>>
>> Hi Christian,
>>
>> Did you ever send out such a patch? I didn't see one on the list, but
>> perhaps I missed it. One definitely hasn't made it upstream yet. (I
>> just hit the issue myself with Linus's tree from last night.)
>
> Actually, that wants a bit more methinks, because while the stack dump
> goes away, you still get spammed, it just comes in smaller chunks.

OK, well this has to either be fixed or reverted. Right now it's
complaining all the time for me after like a day of uptime.

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


Re: [PATCH 01/33] clk_ops: change round_rate() to return unsigned long

2018-01-01 Thread kbuild test robot
Hi Bryan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tegra/for-next]
[also build test WARNING on v4.15-rc6]
[cannot apply to clk/clk-next next-20171222]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Bryan-O-Donoghue/change-clk_ops-round_rate-to-scale-past-LONG_MAX/20180101-212907
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)


vim +321 drivers/clk/clk-versaclock5.c

8c1ebe97 Marek Vasut 2017-07-09  318  
8c1ebe97 Marek Vasut 2017-07-09  319  static const struct clk_ops vc5_dbl_ops = 
{
8c1ebe97 Marek Vasut 2017-07-09  320.recalc_rate= vc5_dbl_recalc_rate,
8c1ebe97 Marek Vasut 2017-07-09 @321.round_rate = vc5_dbl_round_rate,
8c1ebe97 Marek Vasut 2017-07-09  322.set_rate   = vc5_dbl_set_rate,
8c1ebe97 Marek Vasut 2017-07-09  323  };
8c1ebe97 Marek Vasut 2017-07-09  324  

:: The code at line 321 was first introduced by commit
:: 8c1ebe9762670159ca982167131af63c94ff1571 clk: vc5: Add support for the 
input frequency doubler

:: TO: Marek Vasut <marek.va...@gmail.com>
:: CC: Stephen Boyd <sb...@codeaurora.org>

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104439] intel_do_flush_locked failed: Invalid argument

2018-01-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104439

Bug ID: 104439
   Summary: intel_do_flush_locked failed: Invalid argument
   Product: Mesa
   Version: unspecified
  Hardware: Other
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: Drivers/DRI/i915
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: ftu...@fastmail.fm
QA Contact: dri-devel@lists.freedesktop.org

Created attachment 136471
  --> https://bugs.freedesktop.org/attachment.cgi?id=136471=edit
git bisect log

The Qutebrowser web browser crashes after a while with the following error
message:

> intel_do_flush_locked failed: Invalid argument

If I restart Qutebrowser afterwards I obtain some sort of graphical corruption.

This only happens with 4.14.x kernels. No problem with 4.13.x kernels.

I'm running Gentoo Linux (~amd64) on a desktop machine with an Intel GPU:

> # lspci | grep VGA
> 00:02.0 VGA compatible controller: Intel Corporation 82Q35 Express Integrated
> Graphics Controller (rev 02)

Packages:
- www-client/qutebrowser-1.0.4
- x11-apps/mesa-progs-8.3.0
- x11-drivers/xf86-video-intel-2.99.917_p20171018
- x11-libs/libdrm-2.4.88

This is the result of my first attempt at bisecting a kernel:

> fe91f28138e730790db014812623cfaadd318fa6 is the first bad commit

Please also see: https://bugzilla.kernel.org/show_bug.cgi?id=198115

-- 
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 104437] RX480 + SME = amdgpu init failed + null dereference

2018-01-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104437

Bug ID: 104437
   Summary: RX480 + SME  = amdgpu init failed + null dereference
   Product: DRI
   Version: DRI git
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: DRM/AMDgpu
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: a...@sannes.org

Created attachment 136470
  --> https://bugs.freedesktop.org/attachment.cgi?id=136470=edit
dmesg when not working

When upgrading from linux 4.13.x -> 4.14.x the amdgpu failed to come up, often
hanging my desktop computer.

Ending the amdgpg bring up with:
[drm:gfx_v8_0_ring_test_ring [amdgpu]] *ERROR* amdgpu: ring 0 test failed
(scratch(0xC040)=0xCAFEDEAD)
[drm:amdgpu_device_init [amdgpu]] *ERROR* hw_init of IP block  failed
-22
amdgpu :0a:00.0: amdgpu_init failed


After getting some help in #radeon we figured out that the culprit was that I
had enabled SME (which the CPU Ryzen X1800 support).


Got the same error on 4.15-rc6, but with additional null dereference in DC
code.

-- 
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 01/33] clk_ops: change round_rate() to return unsigned long

2018-01-01 Thread kbuild test robot
Hi Bryan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tegra/for-next]
[also build test WARNING on v4.15-rc6]
[cannot apply to clk/clk-next next-20171222]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Bryan-O-Donoghue/change-clk_ops-round_rate-to-scale-past-LONG_MAX/20180101-212907
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
config: i386-randconfig-b0-01011934 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

>> drivers/clk/clk-versaclock5.c:321:2: warning: initialization from 
>> incompatible pointer type
 .round_rate = vc5_dbl_round_rate,
 ^
   drivers/clk/clk-versaclock5.c:321:2: warning: (near initialization for 
'vc5_dbl_ops.round_rate')

vim +321 drivers/clk/clk-versaclock5.c

8c1ebe97 Marek Vasut 2017-07-09  318  
8c1ebe97 Marek Vasut 2017-07-09  319  static const struct clk_ops vc5_dbl_ops = 
{
8c1ebe97 Marek Vasut 2017-07-09  320.recalc_rate= vc5_dbl_recalc_rate,
8c1ebe97 Marek Vasut 2017-07-09 @321.round_rate = vc5_dbl_round_rate,
8c1ebe97 Marek Vasut 2017-07-09  322.set_rate   = vc5_dbl_set_rate,
8c1ebe97 Marek Vasut 2017-07-09  323  };
8c1ebe97 Marek Vasut 2017-07-09  324  

:: The code at line 321 was first introduced by commit
:: 8c1ebe9762670159ca982167131af63c94ff1571 clk: vc5: Add support for the 
input frequency doubler

:: TO: Marek Vasut <marek.va...@gmail.com>
:: CC: Stephen Boyd <sb...@codeaurora.org>

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 01/33] clk_ops: change round_rate() to return unsigned long

2018-01-01 Thread kbuild test robot
Hi Bryan,

I love your patch! Yet something to improve:

[auto build test ERROR on tegra/for-next]
[also build test ERROR on v4.15-rc6]
[cannot apply to clk/clk-next next-20171222]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Bryan-O-Donoghue/change-clk_ops-round_rate-to-scale-past-LONG_MAX/20180101-212907
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
config: x86_64-randconfig-x016-201800 (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All errors (new ones prefixed by >>):

>> drivers//clk/clk-versaclock5.c:321:16: error: initialization from 
>> incompatible pointer type [-Werror=incompatible-pointer-types]
 .round_rate = vc5_dbl_round_rate,
   ^~
   drivers//clk/clk-versaclock5.c:321:16: note: (near initialization for 
'vc5_dbl_ops.round_rate')
   cc1: some warnings being treated as errors

vim +321 drivers//clk/clk-versaclock5.c

8c1ebe97 Marek Vasut 2017-07-09  318  
8c1ebe97 Marek Vasut 2017-07-09  319  static const struct clk_ops vc5_dbl_ops = 
{
8c1ebe97 Marek Vasut 2017-07-09  320.recalc_rate= vc5_dbl_recalc_rate,
8c1ebe97 Marek Vasut 2017-07-09 @321.round_rate = vc5_dbl_round_rate,
8c1ebe97 Marek Vasut 2017-07-09  322.set_rate   = vc5_dbl_set_rate,
8c1ebe97 Marek Vasut 2017-07-09  323  };
8c1ebe97 Marek Vasut 2017-07-09  324  

:: The code at line 321 was first introduced by commit
:: 8c1ebe9762670159ca982167131af63c94ff1571 clk: vc5: Add support for the 
input frequency doubler

:: TO: Marek Vasut <marek.va...@gmail.com>
:: CC: Stephen Boyd <sb...@codeaurora.org>

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [Intel-gfx] [RFC 4/7] drm/prime: Clear drm_gem_object->dma_buf on release

2018-01-01 Thread Noralf Trønnes


Den 31.12.2017 16.41, skrev Chris Wilson:

Quoting Noralf Trønnes (2017-12-31 13:58:40)

Clear the pointer so the buffer can be re-exported. Otherwise use
after free happens in the next call to drm_gem_prime_handle_to_fd().

Signed-off-by: Noralf Trønnes 
---
  drivers/gpu/drm/drm_prime.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 9a17725b0f7a..3214c0eb7466 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -343,6 +343,7 @@ void drm_gem_dmabuf_release(struct dma_buf *dma_buf)
  
 /* drop the reference on the export fd holds */

 drm_gem_object_put_unlocked(obj);
+   obj->dma_buf = NULL;

obj->dma_buf holds a reference to the dma_buf, so to get to the dma_buf
release we must have already called dma_buf_put(obj->dma_buf). See
drm_gem_object_exported_dma_buf_free(). (Note you would do the
obj->dma_buf = NULL before dropping the potentially last ref to obj.)
A BUG_ON(obj->dma_buf) may help clarify the cache was already released.


Hmm, okay it was a shot in the dark.
Maybe I can defer dumb_buffer and drm_framebuffer creation until fb_open
and then free it all in fb_close. That would align fbdev emulation more
with how DRM userspace operates. Let's see what assumptions the code has
about drm_fb_helper->fb being set on probe...

Noralf.

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


[Bug 104435] TF2 crashes with out of memory error vega 56

2018-01-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104435

--- Comment #2 from coolo...@gmail.com ---
Comment on attachment 136468
  --> https://bugs.freedesktop.org/attachment.cgi?id=136468
glxinfo

Extended renderer info (GLX_MESA_query_renderer):
Vendor: X.Org (0x1002)
Device: Radeon RX Vega (VEGA10 / DRM 3.23.0 / 4.15.0-rc5-mainline, LLVM
6.0.0) (0x687f)
Version: 17.4.0
Accelerated: yes
Video memory: 8147MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 4.5
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.1
OpenGL vendor string: X.Org
OpenGL renderer string: Radeon RX Vega (VEGA10 / DRM 3.23.0 /
4.15.0-rc5-mainline, LLVM 6.0.0)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.4.0-devel
(git-60c2d09483)
OpenGL core profile shading language version string: 4.50

-- 
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 104435] TF2 crashes with out of memory error vega 56

2018-01-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104435

--- Comment #1 from coolo...@gmail.com ---
Created attachment 136468
  --> https://bugs.freedesktop.org/attachment.cgi?id=136468=edit
glxinfo

-- 
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 104435] TF2 crashes with out of memory error vega 56

2018-01-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104435

Bug ID: 104435
   Summary: TF2 crashes with out of memory error vega 56
   Product: DRI
   Version: XOrg git
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: DRM/AMDgpu
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: coolo...@gmail.com

Created attachment 136467
  --> https://bugs.freedesktop.org/attachment.cgi?id=136467=edit
dmesg output

Often upon loading a map on TF2 the game crashes stating it is out of graphics
memory, spitting out an error to dmesg as attached.

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


[PATCH v2 2/3] drm/omap: Add get_ovl_name() and get_mgr_name() to dispc_ops

2018-01-01 Thread Jyri Sarha
Add get_ovl_name() and get_mgr_name() to dispc_ops and get rid of
adhoc names here and there in the omapdrm code. This moves the names
of hardware entities to omapdss side where they have to be when new
omapdss backend drivers are introduced.

Signed-off-by: Jyri Sarha 
---
 drivers/gpu/drm/omapdrm/dss/dispc.c   | 21 +
 drivers/gpu/drm/omapdrm/dss/omapdss.h |  3 +++
 drivers/gpu/drm/omapdrm/omap_crtc.c   | 11 ++-
 drivers/gpu/drm/omapdrm/omap_irq.c| 19 +++
 drivers/gpu/drm/omapdrm/omap_plane.c  | 13 +++--
 5 files changed, 36 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 4e8f68e..070053f 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -680,6 +680,24 @@ void dispc_runtime_put(void)
WARN_ON(r < 0 && r != -ENOSYS);
 }
 
+static const char *dispc_get_ovl_name(enum omap_plane_id plane)
+{
+   static const char *ovl_names[] = {
+   [OMAP_DSS_GFX]  = "GFX",
+   [OMAP_DSS_VIDEO1]   = "VID1",
+   [OMAP_DSS_VIDEO2]   = "VID2",
+   [OMAP_DSS_VIDEO3]   = "VID3",
+   [OMAP_DSS_WB]   = "WB",
+   };
+
+   return ovl_names[plane];
+}
+
+static const char *dispc_get_mgr_name(enum omap_channel channel)
+{
+   return mgr_desc[channel].name;
+}
+
 static u32 dispc_mgr_get_vsync_irq(enum omap_channel channel)
 {
return mgr_desc[channel].vsync_irq;
@@ -4506,6 +4524,9 @@ static void dispc_errata_i734_wa(void)
.get_num_ovls = dispc_get_num_ovls,
.get_num_mgrs = dispc_get_num_mgrs,
 
+   .get_ovl_name = dispc_get_ovl_name,
+   .get_mgr_name = dispc_get_mgr_name,
+
.get_memory_bandwidth_limit = dispc_get_memory_bandwidth_limit,
 
.mgr_enable = dispc_mgr_enable,
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h 
b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index f8f83e8..d7ed1a4 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -691,6 +691,9 @@ struct dispc_ops {
int (*get_num_ovls)(void);
int (*get_num_mgrs)(void);
 
+   const char *(*get_ovl_name)(enum omap_plane_id plane);
+   const char *(*get_mgr_name)(enum omap_channel channel);
+
u32 (*get_memory_bandwidth_limit)(void);
 
void (*mgr_enable)(enum omap_channel channel, bool enable);
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c 
b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 1b8154e..fee8a63 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -662,13 +662,6 @@ static void omap_crtc_reset(struct drm_crtc *crtc)
  * Init and Cleanup
  */
 
-static const char *channel_names[] = {
-   [OMAP_DSS_CHANNEL_LCD] = "lcd",
-   [OMAP_DSS_CHANNEL_DIGIT] = "tv",
-   [OMAP_DSS_CHANNEL_LCD2] = "lcd2",
-   [OMAP_DSS_CHANNEL_LCD3] = "lcd3",
-};
-
 void omap_crtc_pre_init(void)
 {
memset(omap_crtcs, 0, sizeof(omap_crtcs));
@@ -696,7 +689,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
channel = out->dispc_channel;
omap_dss_put_device(out);
 
-   DBG("%s", channel_names[channel]);
+   DBG("%s", priv->dispc_ops->get_mgr_name(channel));
 
/* Multiple displays on same channel is not allowed */
if (WARN_ON(omap_crtcs[channel] != NULL))
@@ -711,7 +704,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
init_waitqueue_head(_crtc->pending_wait);
 
omap_crtc->channel = channel;
-   omap_crtc->name = channel_names[channel];
+   omap_crtc->name = priv->dispc_ops->get_mgr_name(channel);
 
ret = drm_crtc_init_with_planes(dev, crtc, plane, NULL,
_crtc_funcs, NULL);
diff --git a/drivers/gpu/drm/omapdrm/omap_irq.c 
b/drivers/gpu/drm/omapdrm/omap_irq.c
index 53ba424..b0f6850 100644
--- a/drivers/gpu/drm/omapdrm/omap_irq.c
+++ b/drivers/gpu/drm/omapdrm/omap_irq.c
@@ -144,15 +144,10 @@ static void omap_irq_fifo_underflow(struct 
omap_drm_private *priv,
 {
static DEFINE_RATELIMIT_STATE(_rs, DEFAULT_RATELIMIT_INTERVAL,
  DEFAULT_RATELIMIT_BURST);
-   static const struct {
-   const char *name;
-   u32 mask;
-   } sources[] = {
-   { "gfx", DISPC_IRQ_GFX_FIFO_UNDERFLOW },
-   { "vid1", DISPC_IRQ_VID1_FIFO_UNDERFLOW },
-   { "vid2", DISPC_IRQ_VID2_FIFO_UNDERFLOW },
-   { "vid3", DISPC_IRQ_VID3_FIFO_UNDERFLOW },
-   };
+   static const u32 irqbits[] = { DISPC_IRQ_GFX_FIFO_UNDERFLOW,
+  DISPC_IRQ_VID1_FIFO_UNDERFLOW,
+  DISPC_IRQ_VID2_FIFO_UNDERFLOW,
+  DISPC_IRQ_VID3_FIFO_UNDERFLOW };
 
const u32 mask = DISPC_IRQ_GFX_FIFO_UNDERFLOW

[PATCH v2 0/3] drm/omap: Make omapdss API more generic + related patches

2018-01-01 Thread Jyri Sarha
This the v2 rouns of a this RFC patch:
https://patchwork.kernel.org/patch/10066245/

The first patch is a simple fix that should be applied in any case.

I did not split the mgr_has_framedone() callback as a separate patch. It
quite literally replaces the mgr_get_framedone_irq() and makes no
sense without the "drm/omap: Make omapdss API more generic"-patch.

The patches have been rebased on top of the latest drm-next
(350877626faba5d60cbb8cef2bdeb524212c780b).

Best regards,
Jyri

Jyri Sarha (3):
  drm/omap: Fail probe if irq registration fails
  drm/omap: Add get_ovl_name() and get_mgr_name() to dispc_ops
  drm/omap: Make omapdss API more generic

 drivers/gpu/drm/omapdrm/dss/dispc.c   | 159 +-
 drivers/gpu/drm/omapdrm/dss/dispc.h   |  33 +++
 drivers/gpu/drm/omapdrm/dss/omapdss.h |  67 +++---
 drivers/gpu/drm/omapdrm/omap_crtc.c   |  27 +++---
 drivers/gpu/drm/omapdrm/omap_crtc.h   |   2 +-
 drivers/gpu/drm/omapdrm/omap_drv.c|   4 +-
 drivers/gpu/drm/omapdrm/omap_drv.h|   3 +-
 drivers/gpu/drm/omapdrm/omap_irq.c| 141 ++
 drivers/gpu/drm/omapdrm/omap_irq.h|   2 +-
 drivers/gpu/drm/omapdrm/omap_plane.c  |  18 ++--
 drivers/gpu/drm/omapdrm/omap_plane.h  |   1 +
 11 files changed, 292 insertions(+), 165 deletions(-)

-- 
1.9.1

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 1/3] drm/omap: Fail probe if irq registration fails

2018-01-01 Thread Jyri Sarha
Call to omap_drm_irq_install() may fail with an error code. In such a
case the driver probe should fail.

Signed-off-by: Jyri Sarha 
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c 
b/drivers/gpu/drm/omapdrm/omap_drv.c
index dd68b25..5fe2fcb 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -321,9 +321,9 @@ static int omap_modeset_init(struct drm_device *dev)
 
drm_mode_config_reset(dev);
 
-   omap_drm_irq_install(dev);
+   ret = omap_drm_irq_install(dev);
 
-   return 0;
+   return ret;
 }
 
 /*
-- 
1.9.1

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 3/3] drm/omap: Make omapdss API more generic, especially the IRQ handling

2018-01-01 Thread Jyri Sarha
The new omapdss API is HW independent and cleans up some of the DSS5
specific hacks from the omapdrm side and gets rid off the DSS5 IRQ
register bits and replace them with HW independent generic u64 based
macros. This new macros make it more straight forward to implement the
IRQ code for the future DSS versions that do not share the same
register structure as DSS2 to DSS5 has.

Signed-off-by: Jyri Sarha 
---
 drivers/gpu/drm/omapdrm/dss/dispc.c   | 148 --
 drivers/gpu/drm/omapdrm/dss/dispc.h   |  33 
 drivers/gpu/drm/omapdrm/dss/omapdss.h |  64 +++
 drivers/gpu/drm/omapdrm/omap_crtc.c   |  16 ++--
 drivers/gpu/drm/omapdrm/omap_crtc.h   |   2 +-
 drivers/gpu/drm/omapdrm/omap_drv.h|   3 +-
 drivers/gpu/drm/omapdrm/omap_irq.c| 136 +++
 drivers/gpu/drm/omapdrm/omap_irq.h|   2 +-
 drivers/gpu/drm/omapdrm/omap_plane.c  |   7 ++
 drivers/gpu/drm/omapdrm/omap_plane.h  |   1 +
 10 files changed, 267 insertions(+), 145 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 070053f..a80ebe1 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -698,27 +698,12 @@ static const char *dispc_get_mgr_name(enum omap_channel 
channel)
return mgr_desc[channel].name;
 }
 
-static u32 dispc_mgr_get_vsync_irq(enum omap_channel channel)
-{
-   return mgr_desc[channel].vsync_irq;
-}
-
-static u32 dispc_mgr_get_framedone_irq(enum omap_channel channel)
+static bool dispc_mgr_has_framedone(enum omap_channel channel)
 {
if (channel == OMAP_DSS_CHANNEL_DIGIT && dispc.feat->no_framedone_tv)
-   return 0;
-
-   return mgr_desc[channel].framedone_irq;
-}
-
-static u32 dispc_mgr_get_sync_lost_irq(enum omap_channel channel)
-{
-   return mgr_desc[channel].sync_lost_irq;
-}
+   return false;
 
-u32 dispc_wb_get_framedone_irq(void)
-{
-   return DISPC_IRQ_FRAMEDONEWB;
+   return true;
 }
 
 static void dispc_mgr_enable(enum omap_channel channel, bool enable)
@@ -3604,6 +3589,121 @@ static void dispc_write_irqenable(u32 mask)
dispc_read_reg(DISPC_IRQENABLE);
 }
 
+static u64 dispc_hw_to_api_irq(u32 hw)
+{
+   u64 api = 0;
+
+   if (hw & DISPC_IRQ_OCP_ERR)
+   api |= DSS_IRQ_DEVICE_OCP_ERR;
+
+   if (hw & DISPC_IRQ_FRAMEDONE)
+   api |= DSS_IRQ_MGR_FRAME_DONE(0);
+   if (hw & DISPC_IRQ_VSYNC)
+   api |= DSS_IRQ_MGR_VSYNC_EVEN(0);
+   if (hw & DISPC_IRQ_SYNC_LOST)
+   api |= DSS_IRQ_MGR_SYNC_LOST(0);
+
+   if (hw & DISPC_IRQ_EVSYNC_EVEN)
+   api |= DSS_IRQ_MGR_VSYNC_EVEN(1);
+   if (hw & DISPC_IRQ_EVSYNC_ODD)
+   api |= DSS_IRQ_MGR_VSYNC_ODD(1);
+   if (hw & DISPC_IRQ_SYNC_LOST_DIGIT)
+   api |= DSS_IRQ_MGR_SYNC_LOST(1);
+   if (hw & DISPC_IRQ_FRAMEDONETV)
+   api |= DSS_IRQ_MGR_FRAME_DONE(1);
+
+   if (hw & DISPC_IRQ_SYNC_LOST2)
+   api |= DSS_IRQ_MGR_SYNC_LOST(2);
+   if (hw & DISPC_IRQ_VSYNC2)
+   api |= DSS_IRQ_MGR_VSYNC_EVEN(2);
+   if (hw & DISPC_IRQ_FRAMEDONE2)
+   api |= DSS_IRQ_MGR_FRAME_DONE(2);
+
+   if (hw & DISPC_IRQ_SYNC_LOST3)
+   api |= DSS_IRQ_MGR_SYNC_LOST(3);
+   if (hw & DISPC_IRQ_VSYNC3)
+   api |= DSS_IRQ_MGR_VSYNC_EVEN(3);
+   if (hw & DISPC_IRQ_FRAMEDONE3)
+   api |= DSS_IRQ_MGR_FRAME_DONE(3);
+
+   if (hw & DISPC_IRQ_GFX_FIFO_UNDERFLOW)
+   api |= DSS_IRQ_OVL_FIFO_UNDERFLOW(0);
+   if (hw & DISPC_IRQ_VID1_FIFO_UNDERFLOW)
+   api |= DSS_IRQ_OVL_FIFO_UNDERFLOW(1);
+   if (hw & DISPC_IRQ_VID2_FIFO_UNDERFLOW)
+   api |= DSS_IRQ_OVL_FIFO_UNDERFLOW(2);
+   if (hw & DISPC_IRQ_VID3_FIFO_UNDERFLOW)
+   api |= DSS_IRQ_OVL_FIFO_UNDERFLOW(3);
+
+   return api;
+}
+
+static u32 dispc_api_to_hw_irq(u64 api)
+{
+   u32 hw = 0;
+
+   if (api & DSS_IRQ_DEVICE_OCP_ERR)
+   hw |= DISPC_IRQ_OCP_ERR;
+
+   if (api & DSS_IRQ_MGR_FRAME_DONE(0))
+   hw |= DISPC_IRQ_FRAMEDONE;
+   if (api & DSS_IRQ_MGR_VSYNC_EVEN(0))
+   hw |= DISPC_IRQ_VSYNC;
+   if (api & DSS_IRQ_MGR_SYNC_LOST(0))
+   hw |= DISPC_IRQ_SYNC_LOST;
+
+   if (api & DSS_IRQ_MGR_VSYNC_EVEN(1))
+   hw |= DISPC_IRQ_EVSYNC_EVEN;
+   if (api & DSS_IRQ_MGR_VSYNC_ODD(1))
+   hw |= DISPC_IRQ_EVSYNC_ODD;
+   if (api & DSS_IRQ_MGR_SYNC_LOST(1))
+   hw |= DISPC_IRQ_SYNC_LOST_DIGIT;
+   if (api & DSS_IRQ_MGR_FRAME_DONE(1))
+   hw |= DISPC_IRQ_FRAMEDONETV;
+
+   if (api & DSS_IRQ_MGR_SYNC_LOST(2))
+   hw |= DISPC_IRQ_SYNC_LOST2;
+   if (api & DSS_IRQ_MGR_VSYNC_EVEN(2))
+   hw |= DISPC_IRQ_VSYNC2;
+   if (api & DSS_IRQ_MGR_FRAME_DONE(2))
+   hw |= 

Re: [PATCH v4 0/9] drm/i915: Implement HDCP

2018-01-01 Thread Ramalingam C

Sean,

Checkpatch.pl is giving errors and warning on the patches of this 
series. You might want to have a look at it.


-Ram


On Thursday 07 December 2017 05:30 AM, Sean Paul wrote:

Welcome to version 4 of the patchset. I think we're nearing the finish line
(hopefully) now. This set addresses the review feedback from v3. I applied some
R-b's from v3 review, and converted others to Cc since other changes were made
to the patch, and I didn't want to speak for reviewers.

Thanks for all the review feedback!

Sean

Sean Paul (9):
   drm: Fix link-status kerneldoc line lengths
   drm/i915: Add more control to wait_for routines
   drm: Add Content Protection property
   drm: Add some HDCP related #defines
   drm/i915: Add HDCP framework + base implementation
   drm/i915: Make use of indexed write GMBUS feature
   drm/i915: Add function to output Aksv over GMBUS
   drm/i915: Implement HDCP for HDMI
   drm/i915: Implement HDCP for DisplayPort

  drivers/gpu/drm/drm_atomic.c |   8 +
  drivers/gpu/drm/drm_connector.c  |  87 -
  drivers/gpu/drm/drm_sysfs.c  |   1 +
  drivers/gpu/drm/i915/Makefile|   1 +
  drivers/gpu/drm/i915/i915_drv.h  |   1 +
  drivers/gpu/drm/i915/i915_reg.h  |  85 
  drivers/gpu/drm/i915/intel_atomic.c  |   2 +
  drivers/gpu/drm/i915/intel_ddi.c |  36 ++
  drivers/gpu/drm/i915/intel_display.c |   4 +
  drivers/gpu/drm/i915/intel_dp.c  | 244 +++-
  drivers/gpu/drm/i915/intel_drv.h | 106 -
  drivers/gpu/drm/i915/intel_hdcp.c| 735 +++
  drivers/gpu/drm/i915/intel_hdmi.c| 250 
  drivers/gpu/drm/i915/intel_i2c.c |  81 +++-
  drivers/gpu/drm/i915/intel_uncore.c  |  23 +-
  drivers/gpu/drm/i915/intel_uncore.h  |  14 +-
  include/drm/drm_connector.h  |  16 +
  include/drm/drm_dp_helper.h  |  17 +
  include/drm/drm_hdcp.h   |  56 +++
  include/uapi/drm/drm_mode.h  |   4 +
  20 files changed, 1728 insertions(+), 43 deletions(-)
  create mode 100644 drivers/gpu/drm/i915/intel_hdcp.c
  create mode 100644 include/drm/drm_hdcp.h



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