Re: omapfb/dss: Delete an error message for a failed memory allocation in three functions

2017-11-27 Thread SF Markus Elfring
>> It seems that I got no responses so far for clarification requests
>> according to the documentation in a direction I hoped for.
> 
> That's because you are pretty unresponsive to direction.

From which places did you get this impression?


> You've gotten _many_ replies to your patches

I got the usual mixture of disagreements and acceptance for
my selection of change possibilities.
Some constructive feedback was also provided which might need
further software development considerations.
Is the situation improvable here?


> to which you have seemingly decided to ignore.

You might eventually notice that I react to special information
occasionally with a big delay.

For which concrete details are you still waiting for a better
response from me?

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


Re: [PATCH] drm/bridge/synopsis: stop clobbering drvdata

2017-11-27 Thread Archit Taneja



On 11/28/2017 06:35 AM, Brian Norris wrote:

Bridge drivers/helpers shouldn't be clobbering the drvdata, since a
parent driver might need to own this. Instead, let's return our
'dw_mipi_dsi' object and have callers pass that back to us for removal.



Reviewed-by: Archit Taneja 


Signed-off-by: Brian Norris 
---
  drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 36 ++-
  drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 14 +++
  include/drm/bridge/dw_mipi_dsi.h  | 17 -
  3 files changed, 33 insertions(+), 34 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c 
b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index d9cca4fd66ec..c39c7dce20ed 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -922,8 +922,6 @@ __dw_mipi_dsi_probe(struct platform_device *pdev,
dsi->bridge.of_node = pdev->dev.of_node;
  #endif
  
-	dev_set_drvdata(dev, dsi);

-
return dsi;
  }
  
@@ -935,23 +933,16 @@ static void __dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi)

  /*
   * Probe/remove API, used from platforms based on the DRM bridge API.
   */
-int dw_mipi_dsi_probe(struct platform_device *pdev,
- const struct dw_mipi_dsi_plat_data *plat_data)
+struct dw_mipi_dsi *
+dw_mipi_dsi_probe(struct platform_device *pdev,
+ const struct dw_mipi_dsi_plat_data *plat_data)
  {
-   struct dw_mipi_dsi *dsi;
-
-   dsi = __dw_mipi_dsi_probe(pdev, plat_data);
-   if (IS_ERR(dsi))
-   return PTR_ERR(dsi);
-
-   return 0;
+   return __dw_mipi_dsi_probe(pdev, plat_data);
  }
  EXPORT_SYMBOL_GPL(dw_mipi_dsi_probe);
  
-void dw_mipi_dsi_remove(struct platform_device *pdev)

+void dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi)
  {
-   struct dw_mipi_dsi *dsi = platform_get_drvdata(pdev);
-
mipi_dsi_host_unregister(>dsi_host);
  
  	__dw_mipi_dsi_remove(dsi);

@@ -961,31 +952,30 @@ EXPORT_SYMBOL_GPL(dw_mipi_dsi_remove);
  /*
   * Bind/unbind API, used from platforms based on the component framework.
   */
-int dw_mipi_dsi_bind(struct platform_device *pdev, struct drm_encoder *encoder,
-const struct dw_mipi_dsi_plat_data *plat_data)
+struct dw_mipi_dsi *
+dw_mipi_dsi_bind(struct platform_device *pdev, struct drm_encoder *encoder,
+const struct dw_mipi_dsi_plat_data *plat_data)
  {
struct dw_mipi_dsi *dsi;
int ret;
  
  	dsi = __dw_mipi_dsi_probe(pdev, plat_data);

if (IS_ERR(dsi))
-   return PTR_ERR(dsi);
+   return dsi;
  
  	ret = drm_bridge_attach(encoder, >bridge, NULL);

if (ret) {
-   dw_mipi_dsi_remove(pdev);
+   dw_mipi_dsi_remove(dsi);
DRM_ERROR("Failed to initialize bridge with drm\n");
-   return ret;
+   return ERR_PTR(ret);
}
  
-	return 0;

+   return dsi;
  }
  EXPORT_SYMBOL_GPL(dw_mipi_dsi_bind);
  
-void dw_mipi_dsi_unbind(struct device *dev)

+void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi)
  {
-   struct dw_mipi_dsi *dsi = dev_get_drvdata(dev);
-
__dw_mipi_dsi_remove(dsi);
  }
  EXPORT_SYMBOL_GPL(dw_mipi_dsi_unbind);
diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c 
b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
index e5b6310240fe..7ed0ef7f6ec2 100644
--- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
+++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
@@ -66,6 +66,7 @@ enum dsi_color {
  struct dw_mipi_dsi_stm {
void __iomem *base;
struct clk *pllref_clk;
+   struct dw_mipi_dsi *dsi;
  };
  
  static inline void dsi_write(struct dw_mipi_dsi_stm *dsi, u32 reg, u32 val)

@@ -318,21 +319,24 @@ static int dw_mipi_dsi_stm_probe(struct platform_device 
*pdev)
dw_mipi_dsi_stm_plat_data.base = dsi->base;
dw_mipi_dsi_stm_plat_data.priv_data = dsi;
  
-	ret = dw_mipi_dsi_probe(pdev, _mipi_dsi_stm_plat_data);

-   if (ret) {
+   platform_set_drvdata(pdev, dsi);
+
+   dsi->dsi = dw_mipi_dsi_probe(pdev, _mipi_dsi_stm_plat_data);
+   if (IS_ERR(dsi->dsi)) {
DRM_ERROR("Failed to initialize mipi dsi host\n");
clk_disable_unprepare(dsi->pllref_clk);
+   return PTR_ERR(dsi->dsi);
}
  
-	return ret;

+   return 0;
  }
  
  static int dw_mipi_dsi_stm_remove(struct platform_device *pdev)

  {
-   struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data;
+   struct dw_mipi_dsi_stm *dsi = platform_get_drvdata(pdev);
  
  	clk_disable_unprepare(dsi->pllref_clk);

-   dw_mipi_dsi_remove(pdev);
+   dw_mipi_dsi_remove(dsi->dsi);
  
  	return 0;

  }
diff --git a/include/drm/bridge/dw_mipi_dsi.h b/include/drm/bridge/dw_mipi_dsi.h
index 9b30fec302c8..d9c6d549f971 100644
--- a/include/drm/bridge/dw_mipi_dsi.h
+++ b/include/drm/bridge/dw_mipi_dsi.h
@@ -10,6 +10,8 @@
  #ifndef __DW_MIPI_DSI__
  

Re: [PATCH v2 2/3] drm/rockchip: Add ROCKCHIP DW MIPI DSI controller driver

2017-11-27 Thread Archit Taneja

Hi,

Thanks a lot for working on this. Some comments below.

On 11/28/2017 07:25 AM, Nickey Yang wrote:

Add the ROCKCHIP DSI controller driver that uses the Synopsys DesignWare
MIPI DSI host controller bridge.

Signed-off-by: Nickey Yang 
---
  drivers/gpu/drm/rockchip/Kconfig|2 +-
  drivers/gpu/drm/rockchip/Makefile   |2 +-
  drivers/gpu/drm/rockchip/dw-mipi-dsi.c  | 1349 ---
  drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c |  756 +
  drivers/gpu/drm/rockchip/rockchip_drm_drv.c |2 +-
  drivers/gpu/drm/rockchip/rockchip_drm_drv.h |2 +-
  6 files changed, 760 insertions(+), 1353 deletions(-)
  delete mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi.c
  create mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c

diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig
index 0ccc762..9eb4795 100644
--- a/drivers/gpu/drm/rockchip/Kconfig
+++ b/drivers/gpu/drm/rockchip/Kconfig
@@ -7,7 +7,7 @@ config DRM_ROCKCHIP
select VIDEOMODE_HELPERS
select DRM_ANALOGIX_DP if ROCKCHIP_ANALOGIX_DP
select DRM_DW_HDMI if ROCKCHIP_DW_HDMI
-   select DRM_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI
+   select DRM_DW_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI
select SND_SOC_HDMI_CODEC if ROCKCHIP_CDN_DP && SND_SOC
help
  Choose this option if you have a Rockchip soc chipset.
diff --git a/drivers/gpu/drm/rockchip/Makefile 
b/drivers/gpu/drm/rockchip/Makefile
index a314e21..c05fe47 100644
--- a/drivers/gpu/drm/rockchip/Makefile
+++ b/drivers/gpu/drm/rockchip/Makefile
@@ -11,7 +11,7 @@ rockchipdrm-$(CONFIG_DRM_FBDEV_EMULATION) += 
rockchip_drm_fbdev.o
  rockchipdrm-$(CONFIG_ROCKCHIP_ANALOGIX_DP) += analogix_dp-rockchip.o
  rockchipdrm-$(CONFIG_ROCKCHIP_CDN_DP) += cdn-dp-core.o cdn-dp-reg.o
  rockchipdrm-$(CONFIG_ROCKCHIP_DW_HDMI) += dw_hdmi-rockchip.o
-rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) += dw-mipi-dsi.o
+rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) += dw-mipi-dsi_rockchip.o
  rockchipdrm-$(CONFIG_ROCKCHIP_INNO_HDMI) += inno_hdmi.o
  rockchipdrm-$(CONFIG_ROCKCHIP_LVDS) += rockchip_lvds.o
  
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c

deleted file mode 100644
index b15755b..000
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
+++ /dev/null
@@ -1,1349 +0,0 @@
-/*
- * Copyright (c) 2016, Fuzhou Rockchip Electronics Co., Ltd
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "rockchip_drm_drv.h"
-#include "rockchip_drm_vop.h"
-
-#define DRIVER_NAME"dw-mipi-dsi"
-
-#define RK3288_GRF_SOC_CON60x025c
-#define RK3288_DSI0_SEL_VOP_LITBIT(6)
-#define RK3288_DSI1_SEL_VOP_LITBIT(9)
-
-#define RK3399_GRF_SOC_CON20   0x6250
-#define RK3399_DSI0_SEL_VOP_LITBIT(0)
-#define RK3399_DSI1_SEL_VOP_LITBIT(4)
-
-/* disable turnrequest, turndisable, forcetxstopmode, forcerxmode */
-#define RK3399_GRF_SOC_CON22   0x6258
-#define RK3399_GRF_DSI_MODE0x
-
-#define DSI_VERSION0x00
-#define DSI_PWR_UP 0x04
-#define RESET  0
-#define POWERUPBIT(0)
-
-#define DSI_CLKMGR_CFG 0x08
-#define TO_CLK_DIVIDSION(div)  (((div) & 0xff) << 8)
-#define TX_ESC_CLK_DIVIDSION(div)  (((div) & 0xff) << 0)
-
-#define DSI_DPI_VCID   0x0c
-#define DPI_VID(vid)   (((vid) & 0x3) << 0)
-
-#define DSI_DPI_COLOR_CODING   0x10
-#define EN18_LOOSELY   BIT(8)
-#define DPI_COLOR_CODING_16BIT_1   0x0
-#define DPI_COLOR_CODING_16BIT_2   0x1
-#define DPI_COLOR_CODING_16BIT_3   0x2
-#define DPI_COLOR_CODING_18BIT_1   0x3
-#define DPI_COLOR_CODING_18BIT_2   0x4
-#define DPI_COLOR_CODING_24BIT 0x5
-
-#define DSI_DPI_CFG_POL0x14
-#define COLORM_ACTIVE_LOW  BIT(4)
-#define SHUTD_ACTIVE_LOW   BIT(3)
-#define HSYNC_ACTIVE_LOW   BIT(2)
-#define VSYNC_ACTIVE_LOW   BIT(1)
-#define DATAEN_ACTIVE_LOW  BIT(0)
-
-#define DSI_DPI_LP_CMD_TIM 0x18
-#define OUTVACT_LPCMD_TIME(p)  (((p) & 0xff) << 16)
-#define INVACT_LPCMD_TIME(p)   ((p) & 0xff)
-
-#define DSI_DBI_CFG0x20
-#define DSI_DBI_CMDSIZE0x28
-
-#define DSI_PCKHDL_CFG 0x2c
-#define EN_CRC_RX  

[git pull resend] drm fixes

2017-11-27 Thread Dave Airlie
Hi Linus,

I sent this last week as a follow on to the one you pulled, the tag
hasn't changed but the pull request has as you pulled the old tag.

This has a TTM regression fix for some virt gpus (bochs vga), a few
i915 stable fixes,
one vc4 fix, one uapi fix.

Dave.

The following changes since commit 98ecf1a308977505381b5c360b039a84cf67513c:

  dt-bindings: remove file that was added accidentally (2017-11-23
14:10:39 +1000)

are available in the git repository at:

  git://people.freedesktop.org/~airlied/linux tags/drm-for-v4.15-part2-fixes

for you to fetch changes up to c209101fc1c91a318422733a3721ff6a9ff7899f:

  Merge tag 'drm-misc-fixes-2017-11-20' of
git://anongit.freedesktop.org/drm/drm-misc into drm-next (2017-11-24
11:33:29 +1000)


previous part 2 tag + ttm regression fix, i915,vc4,core,uapi fixes


Chris Wilson (2):
  drm/i915: Clear breadcrumb node when cancelling signaling
  drm/i915: Mark the userptr invalidate workqueue as WQ_MEM_RECLAIM

Colin Ian King (1):
  drm/i915/gvt: ensure -ve return value is handled correctly

Dave Airlie (4):
  drm/ttm: don't attempt to use hugepages if dma32 requested (v2)
  Merge tag 'drm-misc-next-fixes-2017-11-23' of
git://anongit.freedesktop.org/drm/drm-misc into drm-next
  Merge tag 'drm-intel-next-fixes-2017-11-23' of
git://anongit.freedesktop.org/drm/drm-intel into drm-next
  Merge tag 'drm-misc-fixes-2017-11-20' of
git://anongit.freedesktop.org/drm/drm-misc into drm-next

Hans de Goede (2):
  drm/i915: Fix false-positive assert_rpm_wakelock_held in
i915_pmic_bus_access_notifier v2
  drm/i915: Re-register PMIC bus access notifier on runtime resume

Maarten Lankhorst (1):
  drm/vblank: Pass crtc_id to page_flip_ioctl.

Stefan Schake (1):
  drm/vc4: Account for interrupts in flight

Ville Syrjälä (2):
  drm/edid: Don't send non-zero YQ in AVI infoframe for HDMI 1.x sinks
  drm/i915: Fix init_clock_gating for resume

 drivers/gpu/drm/drm_edid.c   | 12 +--
 drivers/gpu/drm/drm_plane.c  |  1 +
 drivers/gpu/drm/i915/gvt/cmd_parser.c|  2 +-
 drivers/gpu/drm/i915/i915_drv.c  |  3 +++
 drivers/gpu/drm/i915/i915_gem_userptr.c  |  6 --
 drivers/gpu/drm/i915/intel_breadcrumbs.c |  1 +
 drivers/gpu/drm/i915/intel_hdmi.c|  3 ++-
 drivers/gpu/drm/i915/intel_uncore.c  | 13 
 drivers/gpu/drm/i915/intel_uncore.h  |  1 +
 drivers/gpu/drm/ttm/ttm_page_alloc.c | 36 ++--
 drivers/gpu/drm/vc4/vc4_hdmi.c   |  3 ++-
 drivers/gpu/drm/vc4/vc4_irq.c|  6 ++
 include/drm/drm_edid.h   |  3 ++-
 13 files changed, 66 insertions(+), 24 deletions(-)
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: Hardware 3D acceleration doesn't work anymore with the latest git kernel

2017-11-27 Thread Christian Zigotzky
Is it better to enable SWIOTLB? Are there any advantages with SWIOTLB enabled?

— Christian

Sent from my iPhone

> On 27. Nov 2017, at 15:53, Michel Dänzer  wrote:
> 
>> On 2017-11-27 01:17 PM, Tom St Denis wrote:
>>> On 27/11/17 07:02 AM, Michel Dänzer wrote:
 On 2017-11-27 12:50 PM, Christian König wrote:
> Am 27.11.2017 um 12:02 schrieb Michel Dänzer:
>> On 2017-11-24 05:09 PM, Michel Dänzer wrote:
>>> On 2017-11-24 03:29 PM, Christian Zigotzky wrote:
>>> Hi All,
>>> 
>>> I bisected today and the first bad commit is:
>>> a4dec819c8bba6365eb893a4ca88db4dd1210110 (drm/ttm: Add helper
>>> functions
>>> to populate/map in one call (v2)) [1]
>> It can't really be that commit, since it just adds functions but
>> doesn't
>> hook them up anywhere. Presumably it's commit
>> f7871fd19389c5f64f625a4389675d0740f0dfe4 ("drm/radeon: use new TTM
>> populate/dma map helper functions") instead, which makes the radeon
>> driver rely on ttm_populate_and_map_pages, which is just a stub
>> returning -ENOMEM when neither CONFIG_SWIOTLB nor
>> CONFIG_INTEL_IOMMU is
>> enabled.
>> 
>> I can see two possible solutions:
>> 
>> 1. Make ttm_populate_and_map_pages and ttm_unmap_and_unpopulate_pages
>>  work without SWIOTLB / INTEL_IOMMU as well.
>> 
>> 2. Make the drivers work without ttm_populate_and_map_pages and
>>  ttm_unmap_and_unpopulate_pages again in that case.
>> 
>> 
>> Solution 1 would be preferable.
> Which solution do you want to go for?
 
 well, can somebody please explain to me why those patches actually
 result in problems?
>>> 
>>> I thought I did above...
>>> 
>>> Commit f7871fd19389c5f64f625a4389675d0740f0dfe4 made the radeon driver
>>> rely on ttm_populate_and_map_pages, which is implemented as:
>>> 
>>> static inline int ttm_populate_and_map_pages(struct device *dev,
>>> struct ttm_dma_tt *tt)
>>> {
>>> return -ENOMEM;
>>> }
>>> 
>>> when neither CONFIG_SWIOTLB nor CONFIG_INTEL_IOMMU is enabled.
>>> Previously, the driver worked fine without either of those enabled.
>>> 
>>> 
>> 
>> I think the issue is why would you have both disabled [...]
> Doesn't matter. The drivers worked with both disabled before, now they
> don't. That's a regression.
> 
> 
> -- 
> Earthling Michel Dänzer   |   http://www.amd.com
> Libre software enthusiast | Mesa and X developer
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 13/15] drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip rectangle

2017-11-27 Thread Sinclair Yeh
This looks okay to me.

Reviewed-by: Sinclair Yeh 

On Thu, Nov 23, 2017 at 09:05:00PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä 
> 
> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle.
> 
> Note that this replaces crtc_state->adjusted_mode usage with
> crtc_state->mode. The latter is the correct choice since that's the
> mode the user provided and it matches the plane crtc coordinates
> the user also provided.
> 
> Once everyone agrees on this we can move the clip handling into
> drm_atomic_helper_check_plane_state().
> 
> Cc: Laurent Pinchart 
> Cc: VMware Graphics 
> Cc: Sinclair Yeh 
> Cc: Thomas Hellstrom 
> Signed-off-by: Ville Syrjälä 
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 7 +++
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c 
> b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> index a2a93d7e2a04..25d96560180b 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> @@ -449,10 +449,9 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane 
> *plane,
>   if (state->crtc)
>   crtc_state = drm_atomic_get_new_crtc_state(state->state, 
> state->crtc);
>  
> - if (crtc_state && crtc_state->enable) {
> - clip.x2 = crtc_state->adjusted_mode.hdisplay;
> - clip.y2 = crtc_state->adjusted_mode.vdisplay;
> - }
> + if (crtc_state && crtc_state->enable)
> + drm_mode_get_hv_timing(_state->mode,
> +, );
>  
>   ret = drm_atomic_helper_check_plane_state(state, crtc_state, ,
> DRM_PLANE_HELPER_NO_SCALING,
> -- 
> 2.13.6
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 2/3] drm/rockchip: Add ROCKCHIP DW MIPI DSI controller driver

2017-11-27 Thread Brian Norris
Hi Nickey,

Thanks for the quick version 2. You've fixed most of the the problems I
pointed out, but you've missed at least one.

On Tue, Nov 28, 2017 at 09:55:24AM +0800, Nickey Yang wrote:
> Add the ROCKCHIP DSI controller driver that uses the Synopsys DesignWare
> MIPI DSI host controller bridge.
> 
> Signed-off-by: Nickey Yang 
> ---

I suppose you've included a changelog in the cover letter (thanks!), but
sometimes it helps to go here too, to give an individual history of each
patch.

>  drivers/gpu/drm/rockchip/Kconfig|2 +-
>  drivers/gpu/drm/rockchip/Makefile   |2 +-
>  drivers/gpu/drm/rockchip/dw-mipi-dsi.c  | 1349 
> ---
>  drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c |  756 +
>  drivers/gpu/drm/rockchip/rockchip_drm_drv.c |2 +-
>  drivers/gpu/drm/rockchip/rockchip_drm_drv.h |2 +-
>  6 files changed, 760 insertions(+), 1353 deletions(-)
>  delete mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi.c
>  create mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c
> 


> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c 
> b/drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c
> new file mode 100644
> index 000..c919d4f
> --- /dev/null
> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c
> @@ -0,0 +1,756 @@
[...]
> +static int dw_mipi_dsi_rockchip_bind(struct device *dev,
> +  struct device *master,
> +  void *data)
> +{
> + const struct of_device_id *of_id =
> + of_match_device(dw_mipi_dsi_rockchip_dt_ids, dev);
> + const struct rockchip_dw_dsi_chip_data *cdata = of_id->data;
> + struct dw_mipi_dsi_rockchip *dsi = dev_get_drvdata(dev);

Hmm, so I see 2 instances of 'dev_get_drvdata()' in this driver, and one
of them is here. I never see a 'dev_set_drvdata()', so that can't
possibly be useful.

In this case...you've actually moved all the 'probe()' logic into
bind(), so there's no driver data to carry over here. And instead, you
just clobber this 'dsi = ...' assignment a few lines below:

> + struct resource *res;
> + struct platform_device *pdev = to_platform_device(dev);
> + struct drm_device *drm_dev = data;
> + struct device_node *np = dev->of_node;
> + int ret;
> +
> + dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);

^^^ See here.

So if you don't actually need to stash anything in drvdata between
probe() and bind(), then you might get away without my patch:

[PATCH] drm/bridge/synopsis: stop clobbering drvdata
https://patchwork.kernel.org/patch/10078493/

There's one other instance to review though:

> + if (!dsi)
> + return -ENOMEM;
> +
[...]

> +static void dw_mipi_dsi_rockchip_unbind(struct device *dev,
> + struct device *master,
> + void *data)
> +{
> + struct dw_mipi_dsi_rockchip *dsi = dev_get_drvdata(dev);

^^ That's wrong. You either want to do your own 'dev_set_drvdata()'
somewhere (and make sure the bridge driver doesn't clobber it, e.g.,
with my patch above), or else you need to convince the bridge driver to
give us back something like its 'priv_data' pointer
(dsi->plat_data->priv_data).

Also, don't you need to call dw_mipi_dsi_unbind() here?

> + clk_disable_unprepare(dsi->pllref_clk);
> +}
> +
> +static const struct component_ops dw_mipi_dsi_rockchip_ops = {
> + .bind   = dw_mipi_dsi_rockchip_bind,
> + .unbind = dw_mipi_dsi_rockchip_unbind,
> +};

...

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


[Bug 103808] [radeonsi, bisected] World of Warcraft scribbling all over screen

2017-11-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103808

--- Comment #8 from Shmerl  ---
Marek pushed this fix:
https://cgit.freedesktop.org/mesa/mesa/commit/?id=b5444877c0820b7848c07d1bc4e9a706f90894a5

I've just tested it with The Witcher 3 in Wine, and flickering is gone along
with performance drop!

-- 
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 103949] REG_WAIT timeout - dce110_stream_encoder_dp_blank line:930 - 4.15-rc1

2017-11-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103949

--- Comment #1 from Barry G  ---
Created attachment 135744
  --> https://bugs.freedesktop.org/attachment.cgi?id=135744=edit
Xorg.0.log file

-- 
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 103949] REG_WAIT timeout - dce110_stream_encoder_dp_blank line:930 - 4.15-rc1

2017-11-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103949

Bug ID: 103949
   Summary: REG_WAIT timeout - dce110_stream_encoder_dp_blank
line:930 - 4.15-rc1
   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: ba...@grussling.com

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

First off, I would like to thank the amdgpu developers.  I was able to boot
4.15-rc1 on my RX Vega 64 and activate six displays (using two startech MST
hubs).  Kudos!

I am however getting ~5 of these on boot:
[  122.039308] [drm:generic_reg_wait [amdgpu]] *ERROR* REG_WAIT timeout 10us *
3000 tries - dce110_stream_encoder_dp_blank line:930
[  122.832825] [drm:generic_reg_wait [amdgpu]] *ERROR* REG_WAIT timeout 10us *
3000 tries - dce110_stream_encoder_dp_blank line:930
[  123.428493] [drm:generic_reg_wait [amdgpu]] *ERROR* REG_WAIT timeout 10us *
3000 tries - dce110_stream_encoder_dp_blank line:930
[  123.740053] [drm:generic_reg_wait [amdgpu]] *ERROR* REG_WAIT timeout 10us *
3000 tries - dce110_stream_encoder_dp_blank line:930
[  134.681772] [drm:generic_reg_wait [amdgpu]] *ERROR* REG_WAIT timeout 10us *
3000 tries - dce110_stream_encoder_dp_blank line:930


The full text of the backtrace of each one is:
[  134.681772] [drm:generic_reg_wait [amdgpu]] *ERROR* REG_WAIT timeout 10us *
3000 tries - dce110_stream_encoder_dp_blank line:930
[  134.681798] WARNING: CPU: 2 PID: 854 at
drivers/gpu/drm/amd/amdgpu/../display/dc/dc_helper.c:168
generic_reg_wait+0xe8/0x120 [amdgpu]
[  134.681799] Modules linked in: rpcsec_gss_krb5 auth_rpcgss nfsv4
dns_resolver nfs lockd grace sunrpc fscache amdkfd amd_iommu_v2 wmi_bmof
mxm_wmi amdgpu nls_iso8859_1 nls_cp437 vfat fat chash ttm edac_mce_amd xpad
drm_kms_helper snd_usb_audio evdev ff_memless input_leds mousedev joydev
led_class drm snd_usbmidi_lib kvm snd_hda_codec_realtek snd_rawmidi mac_hid
snd_seq_device cdc_acm irqbypass snd_hda_codec_hdmi snd_hda_codec_generic igb
syscopyarea sysfillrect snd_hda_intel sysimgblt ixgbe fb_sys_fops snd_hda_codec
i2c_algo_bit snd_hda_core mdio snd_hwdep snd_pcm ptp pps_core snd_timer dca snd
soundcore sp5100_tco tpm_tis tpm_tis_core pcspkr i2c_piix4 shpchp k10temp tpm
wmi 8250_dw button acpi_cpufreq sch_fq_codel ip_tables x_tables ext4 crc16
mbcache jbd2 fscrypto algif_skcipher af_alg sd_mod dm_crypt
[  134.681830]  dm_mod dax uas usb_storage hid_generic usbhid hid
crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel pcbc aesni_intel
aes_x86_64 crypto_simd glue_helper cryptd ccp xhci_pci ahci rng_core
sha256_generic libahci nvme xhci_hcd sha1_generic libata nvme_core usbcore
scsi_mod usb_common serio
[  134.681841] CPU: 2 PID: 854 Comm: Xorg Tainted: GW   
4.15.0-rc1-g4fbd8d194f06 #1
[  134.681842] Hardware name: Micro-Star International Co., Ltd. MS-7B09/X399
GAMING PRO CARBON AC (MS-7B09), BIOS 1.60 11/14/2017
[  134.681843] task: 880ff1426740 task.stack: c900077c4000
[  134.681854] RIP: 0010:generic_reg_wait+0xe8/0x120 [amdgpu]
[  134.681855] RSP: 0018:c900077c7850 EFLAGS: 00010297
[  134.681856] RAX: 00010200 RBX: 0bb9 RCX:

[  134.681857] RDX:  RSI: 880ffc88dc08 RDI:
880ffc88dc08
[  134.681857] RBP: 000a R08:  R09:
0698
[  134.681858] R10: 0002 R11: 821213ed R12:
880fe97e5700
[  134.681858] R13: 4de2 R14: 0001 R15:

[  134.681859] FS:  7f10e073d940() GS:880ffc88()
knlGS:
[  134.681860] CS:  0010 DS:  ES:  CR0: 80050033
[  134.681861] CR2: 55e098cae098 CR3: 000fedb72000 CR4:
003406e0
[  134.681862] Call Trace:
[  134.681878]  dce110_stream_encoder_dp_blank+0xd4/0x130 [amdgpu]
[  134.681890]  dce110_disable_stream+0xf5/0x180 [amdgpu]
[  134.681902]  core_link_disable_stream+0x51/0x240 [amdgpu]
[  134.681913]  dce110_reset_hw_ctx_wrap+0x196/0x1a0 [amdgpu]
[  134.681926]  dce110_apply_ctx_to_hw+0x4c/0x610 [amdgpu]
[  134.681938]  dc_commit_state+0x37e/0x470 [amdgpu]
[  134.681953]  amdgpu_dm_atomic_commit_tail+0x2ab/0x9a0 [amdgpu]
[  134.681957]  ? __wake_up_common_lock+0x89/0xc0
[  134.681967]  ? amdgpu_bo_pin_restricted+0x1ac/0x290 [amdgpu]
[  134.681969]  ? wait_for_common+0x151/0x180
[  134.681970]  ? wait_for_common+0x151/0x180
[  134.681974]  commit_tail+0x3a/0x70 [drm_kms_helper]
[  134.681976]  drm_atomic_helper_commit+0xfc/0x110 [drm_kms_helper]
[  134.681979]  drm_atomic_helper_set_config+0x80/0x90 [drm_kms_helper]
[  134.681983]  __drm_mode_set_config_internal+0x61/0x110 [drm]
[  134.681988]  drm_mode_setcrtc+0x3fb/0x5b0 [drm]
[  134.681992]  ? 

Re: [PATCH 2/3] drm/rockchip: Add ROCKCHIP DW MIPI DSI controller driver

2017-11-27 Thread Nickey Yang

Hi Brian,


Below comments fixed in 
patch-v2:https://patchwork.kernel.org/patch/10078527/

but :"get_drvdata()"

Thanks for review.
Nickey.

On 2017年11月28日 09:51, Brian Norris wrote:

Hi Nickey,

Several people already made comments on the initial version of this
patch [1], and I don't think you've caught them all here yet. I'll
repeat a few. Not sure if I've caught them all.

[1] 
https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/780120

On Tue, Nov 28, 2017 at 09:13:35AM +0800, Nickey Yang wrote:

Add the ROCKCHIP DSI controller driver that uses the Synopsys DesignWare
MIPI DSI host controller bridge.

Signed-off-by: Nickey Yang 
---
  drivers/gpu/drm/rockchip/Kconfig|2 +-
  drivers/gpu/drm/rockchip/Makefile   |2 +-
  drivers/gpu/drm/rockchip/dw-mipi-dsi.c  | 1349 ---
  drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c |  756 +
  drivers/gpu/drm/rockchip/rockchip_drm_drv.c |2 +-
  drivers/gpu/drm/rockchip/rockchip_drm_drv.h |2 +-
  6 files changed, 760 insertions(+), 1353 deletions(-)
  delete mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi.c
  create mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c


...


diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c 
b/drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c
new file mode 100644
index 000..32be430
--- /dev/null
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c
@@ -0,0 +1,756 @@
+/*
+ * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
+ * Author:
+ *  Chris Zhong 
+ *  Nickey Yang 
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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.
+ *
+ * License terms:  GNU General Public License (GPL), version 2
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "rockchip_drm_drv.h"
+#include "rockchip_drm_vop.h"
+
+#define DSI_PHY_TST_CTRL0  0xb4
+#define PHY_TESTCLKBIT(1)
+#define PHY_UNTESTCLK  0
+#define PHY_TESTCLRBIT(0)
+#define PHY_UNTESTCLR  0
+
+#define DSI_PHY_TST_CTRL1  0xb8
+#define PHY_TESTEN BIT(16)
+#define PHY_UNTESTEN   0
+#define PHY_TESTDOUT(n)(((n) & 0xff) << 8)
+#define PHY_TESTDIN(n) (((n) & 0xff) << 0)
+
+#define BYPASS_VCO_RANGE   BIT(7)
+#define VCO_RANGE_CON_SEL(val) (((val) & 0x7) << 3)
+#define VCO_IN_CAP_CON_DEFAULT (0x0 << 1)
+#define VCO_IN_CAP_CON_LOW (0x1 << 1)
+#define VCO_IN_CAP_CON_HIGH(0x2 << 1)
+#define REF_BIAS_CUR_SEL   BIT(0)
+
+#define CP_CURRENT_3UA 0x1
+#define CP_CURRENT_4_5UA   0x2
+#define CP_CURRENT_7_5UA   0x6
+#define CP_CURRENT_6UA 0x9
+#define CP_CURRENT_12UA0xb
+#define CP_CURRENT_SEL(val)((val) & 0xf)
+#define CP_PROGRAM_EN  BIT(7)
+
+#define LPF_RESISTORS_15_5KOHM 0x1
+#define LPF_RESISTORS_13KOHM   0x2
+#define LPF_RESISTORS_11_5KOHM 0x4
+#define LPF_RESISTORS_10_5KOHM 0x8
+#define LPF_RESISTORS_8KOHM0x10
+#define LPF_PROGRAM_EN BIT(6)
+#define LPF_RESISTORS_SEL(val) ((val) & 0x3f)
+
+#define HSFREQRANGE_SEL(val)   (((val) & 0x3f) << 1)
+
+#define INPUT_DIVIDER(val) (((val) - 1) & 0x7f)
+#define LOW_PROGRAM_EN 0
+#define HIGH_PROGRAM_ENBIT(7)
+#define LOOP_DIV_LOW_SEL(val)  (((val) - 1) & 0x1f)
+#define LOOP_DIV_HIGH_SEL(val) val) - 1) >> 5) & 0xf)
+#define PLL_LOOP_DIV_ENBIT(5)
+#define PLL_INPUT_DIV_EN   BIT(4)
+
+#define POWER_CONTROL  BIT(6)
+#define INTERNAL_REG_CURRENT   BIT(3)
+#define BIAS_BLOCK_ON  BIT(2)
+#define BANDGAP_ON BIT(0)
+
+#define TER_RESISTOR_HIGH  BIT(7)
+#defineTER_RESISTOR_LOW0
+#define LEVEL_SHIFTERS_ON  BIT(6)
+#define TER_CAL_DONE   BIT(5)
+#define SETRD_MAX  (0x7 << 2)
+#define POWER_MANAGE   BIT(1)
+#define TER_RESISTORS_ON   BIT(0)
+
+#define BIASEXTR_SEL(val)  ((val) & 0x7)
+#define BANDGAP_SEL(val)   ((val) & 0x7)
+#define TLP_PROGRAM_EN BIT(7)
+#define THS_PRE_PROGRAM_EN BIT(7)
+#define THS_ZERO_PROGRAM_ENBIT(6)
+
+#define PLL_BIAS_CUR_SEL_CAP_VCO_CONTROL   0x10
+#define PLL_CP_CONTROL_PLL_LOCK_BYPASS 0x11
+#define PLL_LPF_AND_CP_CONTROL 0x12
+#define PLL_INPUT_DIVIDER_RATIO0x17
+#define PLL_LOOP_DIVIDER_RATIO 0x18
+#define PLL_INPUT_AND_LOOP_DIVIDER_RATIOS_CONTROL  0x19
+#define BANDGAP_AND_BIAS_CONTROL 

[radeon-alex:amd-staging-drm-next 417/475] drivers/staging/vboxvideo/vbox_ttm.c:240:10: error: initialization from incompatible pointer type

2017-11-27 Thread kbuild test robot
tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next
head:   f3769c94f4e6a794dbb72601936199d9b258f7b7
commit: 67e032a0a9a8e26db6960aae59e7a319ac900f95 [417/475] drm/ttm: add context 
to driver move callback as well
config: i386-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025
reproduce:
git checkout 67e032a0a9a8e26db6960aae59e7a319ac900f95
# save the attached .config to linux build tree
make ARCH=i386 

All errors (new ones prefixed by >>):

>> drivers/staging/vboxvideo/vbox_ttm.c:240:10: error: initialization from 
>> incompatible pointer type [-Werror=incompatible-pointer-types]
 .move = vbox_bo_move,
 ^~~~
   drivers/staging/vboxvideo/vbox_ttm.c:240:10: note: (near initialization for 
'vbox_bo_driver.move')
   drivers/staging/vboxvideo/vbox_ttm.c: In function 'vbox_bo_pin':
   drivers/staging/vboxvideo/vbox_ttm.c:392:8: error: too many arguments to 
function 'ttm_bo_validate'
 ret = ttm_bo_validate(>bo, >placement, false, false);
   ^~~
   In file included from drivers/staging/vboxvideo/vbox_drv.h:43:0,
from drivers/staging/vboxvideo/vbox_ttm.c:30:
   include/drm/ttm/ttm_bo_api.h:333:5: note: declared here
int ttm_bo_validate(struct ttm_buffer_object *bo,
^~~
   drivers/staging/vboxvideo/vbox_ttm.c: In function 'vbox_bo_unpin':
   drivers/staging/vboxvideo/vbox_ttm.c:419:8: error: too many arguments to 
function 'ttm_bo_validate'
 ret = ttm_bo_validate(>bo, >placement, false, false);
   ^~~
   In file included from drivers/staging/vboxvideo/vbox_drv.h:43:0,
from drivers/staging/vboxvideo/vbox_ttm.c:30:
   include/drm/ttm/ttm_bo_api.h:333:5: note: declared here
int ttm_bo_validate(struct ttm_buffer_object *bo,
^~~
   drivers/staging/vboxvideo/vbox_ttm.c: In function 'vbox_bo_push_sysram':
   drivers/staging/vboxvideo/vbox_ttm.c:451:8: error: too many arguments to 
function 'ttm_bo_validate'
 ret = ttm_bo_validate(>bo, >placement, false, false);
   ^~~
   In file included from drivers/staging/vboxvideo/vbox_drv.h:43:0,
from drivers/staging/vboxvideo/vbox_ttm.c:30:
   include/drm/ttm/ttm_bo_api.h:333:5: note: declared here
int ttm_bo_validate(struct ttm_buffer_object *bo,
^~~
   cc1: some warnings being treated as errors

vim +240 drivers/staging/vboxvideo/vbox_ttm.c

dd55d44f4 Hans de Goede  2017-07-06  232  
cb67fa13c Colin Ian King 2017-07-19  233  static struct ttm_bo_driver 
vbox_bo_driver = {
dd55d44f4 Hans de Goede  2017-07-06  234.ttm_tt_create = 
vbox_ttm_tt_create,
dd55d44f4 Hans de Goede  2017-07-06  235.ttm_tt_populate = 
vbox_ttm_tt_populate,
dd55d44f4 Hans de Goede  2017-07-06  236.ttm_tt_unpopulate = 
vbox_ttm_tt_unpopulate,
dd55d44f4 Hans de Goede  2017-07-06  237.init_mem_type = 
vbox_bo_init_mem_type,
dd55d44f4 Hans de Goede  2017-07-06  238.eviction_valuable = 
ttm_bo_eviction_valuable,
dd55d44f4 Hans de Goede  2017-07-06  239.evict_flags = 
vbox_bo_evict_flags,
dd55d44f4 Hans de Goede  2017-07-06 @240.move = vbox_bo_move,
dd55d44f4 Hans de Goede  2017-07-06  241.verify_access = 
vbox_bo_verify_access,
dd55d44f4 Hans de Goede  2017-07-06  242.io_mem_reserve = 
_ttm_io_mem_reserve,
dd55d44f4 Hans de Goede  2017-07-06  243.io_mem_free = 
_ttm_io_mem_free,
dd55d44f4 Hans de Goede  2017-07-06  244.io_mem_pfn = 
ttm_bo_default_io_mem_pfn,
dd55d44f4 Hans de Goede  2017-07-06  245  };
dd55d44f4 Hans de Goede  2017-07-06  246  

:: The code at line 240 was first introduced by commit
:: dd55d44f408419278c00887bfcb2261d0caae350 staging: vboxvideo: Add 
vboxvideo to drivers/staging

:: TO: Hans de Goede 
:: CC: Greg Kroah-Hartman 

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


[PATCH 1/3] drm: drm_fourcc: Add scaling and padding factor to drm_format_info

2017-11-27 Thread Hyun Kwon
From: Satish Kumar Nagireddy 

'cpp_scale' can be used as a multiplying factor to calculate
bytes per component based on color format.
For eg. scaling factor of YUV420 8 bit format is 1
so multiplying factor is 1 (8/8)
scaling factor of YUV420 10 bit format is 1.25 (10/8)

'padding_scale' can be used as a multiplying factor to calculate
actual width of video according to color format.
For eg. padding factor of YUV420 8 bit format: 8 bits per 1 component
no padding bits here, so multiplying factor is 1
padding factor of YUV422 10 bit format: 32 bits per 3 components
each component is 10 bit and the factor is 32/30

Signed-off-by: Satish Kumar Nagireddy 
Signed-off-by: Hyun Kwon 
---
 drivers/gpu/drm/drm_fourcc.c | 136 +--
 include/drm/drm_fourcc.h |   9 +++
 2 files changed, 77 insertions(+), 68 deletions(-)

diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
index 9c0152d..52afb5e 100644
--- a/drivers/gpu/drm/drm_fourcc.c
+++ b/drivers/gpu/drm/drm_fourcc.c
@@ -105,74 +105,74 @@ EXPORT_SYMBOL(drm_get_format_name);
 const struct drm_format_info *__drm_format_info(u32 format)
 {
static const struct drm_format_info formats[] = {
-   { .format = DRM_FORMAT_C8,  .depth = 8,  
.num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_RGB332,  .depth = 8,  
.num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_BGR233,  .depth = 8,  
.num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_XRGB,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_XBGR,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_RGBX,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_BGRX,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_ARGB,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_ABGR,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_RGBA,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_BGRA,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_XRGB1555,.depth = 15, 
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_XBGR1555,.depth = 15, 
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_RGBX5551,.depth = 15, 
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_BGRX5551,.depth = 15, 
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_ARGB1555,.depth = 15, 
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_ABGR1555,.depth = 15, 
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_RGBA5551,.depth = 15, 
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_BGRA5551,.depth = 15, 
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_RGB565,  .depth = 16, 
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_BGR565,  .depth = 16, 
.num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_RGB888,  .depth = 24, 
.num_planes = 1, .cpp = { 3, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_BGR888,  .depth = 24, 
.num_planes = 1, .cpp = { 3, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_XRGB,.depth = 24, 
.num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_XBGR,.depth = 24, 
.num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_RGBX,.depth = 24, 
.num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_BGRX,.depth = 24, 
.num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
-   { .format = DRM_FORMAT_RGB565_A8,   .depth = 24, 
.num_planes = 2, .cpp = { 2, 1, 0 }, .hsub = 1, 

[PATCH 0/3] Adding new drm formats needed by Xilinx IPs

2017-11-27 Thread Hyun Kwon
Hi,

This series is to add new drm formats needed by some Xilinx IPs.
Some formats have unique characteristics such as pixels not being
byte-aligned. For instance, some 10bit formats have 2bit padding
after every 3-10bit components:

32b[0]: 10b comp0 - 10b comp1 - 10b comp2 - 2b padding
32b[1]: 10b comp3 - 10b comp4 - 10b comp5 - 2b padding
...

To model this, additional information is added to struct drm_format_info.
The patch has been tested with downstream drivers as well as the downstream
user space component (ex, modified modetest).

Thanks,
hyun

Jeffrey Mouroux (2):
  uapi: drm: New fourcc codes needed by Xilinx Video IP
  drm: fourcc: Update DRM Framework with new fourcc codes

Satish Kumar Nagireddy (1):
  drm: drm_fourcc: Add scaling and padding factor to drm_format_info

 drivers/gpu/drm/drm_fourcc.c  | 143 ++
 include/drm/drm_fourcc.h  |   9 +++
 include/uapi/drm/drm_fourcc.h |   9 +++
 3 files changed, 93 insertions(+), 68 deletions(-)

-- 
2.7.4

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


[PATCH 2/3] uapi: drm: New fourcc codes needed by Xilinx Video IP

2017-11-27 Thread Hyun Kwon
From: Jeffrey Mouroux 

The Xilinx Video Mixer and 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 
Signed-off-by: Hyun Kwon 
---
 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 3ad838d..83806d5 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -112,6 +112,13 @@ extern "C" {
 #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_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-bit packed 
greyscale Y:Y:Y:Y 8:8:8:8 */
+#define DRM_FORMAT_Y10 fourcc_code('Y', '1', '0', ' ') /* 10-bit 
packed greyscale X:Y:Y:Y 2:10:10:10 */
 
 /*
  * 2 plane RGB + A
@@ -140,6 +147,8 @@ extern "C" {
 #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', '1', '5') /* 2x2 
subsampled Cr:Cb plane 2:10:10:10 */
+#define DRM_FORMAT_XV20fourcc_code('X', 'V', '2', '0') /* 2x1 
subsampled Cr:Cb plane 2:10:10:10 */
 
 /*
  * 3 plane YCbCr
-- 
2.7.4

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


[PATCH 3/3] drm: fourcc: Update DRM Framework with new fourcc codes

2017-11-27 Thread Hyun Kwon
From: Jeffrey Mouroux 

New fourcc codes have been added to support new YUV semi-planar
and packed formats (including greyscale) needed by new Xilinx
Video IP.  This patch includes recognition of these new formats
in the DRM framework library functions.

Signed-off-by: Jeffrey Mouroux 
Signed-off-by: Hyun Kwon 
---
 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 52afb5e..70342b3 100644
--- a/drivers/gpu/drm/drm_fourcc.c
+++ b/drivers/gpu/drm/drm_fourcc.c
@@ -168,11 +168,18 @@ const struct drm_format_info *__drm_format_info(u32 
format)
{ .format = DRM_FORMAT_NV61,.depth = 0,  
.num_planes = 2, .cpp = { 1, 2, 0 }, .cpp_scale = { 1, 1 }, .hsub = 2, .vsub = 
1, .padding_scale = { 1, 1 } },
{ .format = DRM_FORMAT_NV24,.depth = 0,  
.num_planes = 2, .cpp = { 1, 2, 0 }, .cpp_scale = { 1, 1 }, .hsub = 1, .vsub = 
1, .padding_scale = { 1, 1 } },
{ .format = DRM_FORMAT_NV42,.depth = 0,  
.num_planes = 2, .cpp = { 1, 2, 0 }, .cpp_scale = { 1, 1 }, .hsub = 1, .vsub = 
1, .padding_scale = { 1, 1 } },
+   { .format = DRM_FORMAT_XV15,.depth = 0,  
.num_planes = 2, .cpp = { 1, 2, 0 }, .cpp_scale = { 10, 8 }, .hsub = 2, .vsub = 
2,  .padding_scale = { 32, 30 } },
+   { .format = DRM_FORMAT_XV20,.depth = 0,  
.num_planes = 2, .cpp = { 1, 2, 0 }, .cpp_scale = { 10, 8 }, .hsub = 2, .vsub = 
1,  .padding_scale = { 32, 30 } },
{ .format = DRM_FORMAT_YUYV,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .cpp_scale = { 1, 1 }, .hsub = 2, .vsub = 
1, .padding_scale = { 1, 1 } },
{ .format = DRM_FORMAT_YVYU,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .cpp_scale = { 1, 1 }, .hsub = 2, .vsub = 
1, .padding_scale = { 1, 1 } },
{ .format = DRM_FORMAT_UYVY,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .cpp_scale = { 1, 1 }, .hsub = 2, .vsub = 
1, .padding_scale = { 1, 1 } },
{ .format = DRM_FORMAT_VYUY,.depth = 0,  
.num_planes = 1, .cpp = { 2, 0, 0 }, .cpp_scale = { 1, 1 }, .hsub = 2, .vsub = 
1, .padding_scale = { 1, 1 } },
{ .format = DRM_FORMAT_AYUV,.depth = 0,  
.num_planes = 1, .cpp = { 4, 0, 0 }, .cpp_scale = { 1, 1 }, .hsub = 1, .vsub = 
1, .padding_scale = { 1, 1 } },
+   { .format = DRM_FORMAT_VUY888,  .depth = 0,  
.num_planes = 1, .cpp = { 3, 0, 0 }, .cpp_scale = { 1, 1 }, .hsub = 1, .vsub = 
1,  .padding_scale = { 1, 1 } },
+   { .format = DRM_FORMAT_XVUY,.depth = 0,  
.num_planes = 1, .cpp = { 4, 0, 0 }, .cpp_scale = { 1, 1 }, .hsub = 1, .vsub = 
1,  .padding_scale = { 1, 1 } },
+   { .format = DRM_FORMAT_XVUY2101010, .depth = 0,  
.num_planes = 1, .cpp = { 4, 0, 0 }, .cpp_scale = { 1, 1 }, .hsub = 1, .vsub = 
1,  .padding_scale = { 1, 1 } },
+   { .format = DRM_FORMAT_Y8,  .depth = 0,  
.num_planes = 1, .cpp = { 1, 0, 0 }, .cpp_scale = { 1, 1 }, .hsub = 1, .vsub = 
1,  .padding_scale = { 1, 1 } },
+   { .format = DRM_FORMAT_Y10, .depth = 0,  
.num_planes = 1, .cpp = { 1, 0, 0 }, .cpp_scale = { 10, 8 }, .hsub = 1, .vsub = 
1,  .padding_scale = { 32, 30 } },
};
 
unsigned int i;
-- 
2.7.4

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


[radeon-alex:amd-staging-drm-next 413/475] drivers/staging/vboxvideo/vbox_ttm.c:392:8: error: too many arguments to function 'ttm_bo_validate'

2017-11-27 Thread kbuild test robot
tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next
head:   f3769c94f4e6a794dbb72601936199d9b258f7b7
commit: f4d284ea58186199a9e2757dd9571d8386172141 [413/475] drm/ttm: add 
operation ctx to ttm_bo_validate v2
config: i386-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025
reproduce:
git checkout f4d284ea58186199a9e2757dd9571d8386172141
# save the attached .config to linux build tree
make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/staging/vboxvideo/vbox_ttm.c: In function 'vbox_bo_pin':
>> drivers/staging/vboxvideo/vbox_ttm.c:392:8: error: too many arguments to 
>> function 'ttm_bo_validate'
 ret = ttm_bo_validate(>bo, >placement, false, false);
   ^~~
   In file included from drivers/staging/vboxvideo/vbox_drv.h:43:0,
from drivers/staging/vboxvideo/vbox_ttm.c:30:
   include/drm/ttm/ttm_bo_api.h:333:5: note: declared here
int ttm_bo_validate(struct ttm_buffer_object *bo,
^~~
   drivers/staging/vboxvideo/vbox_ttm.c: In function 'vbox_bo_unpin':
   drivers/staging/vboxvideo/vbox_ttm.c:419:8: error: too many arguments to 
function 'ttm_bo_validate'
 ret = ttm_bo_validate(>bo, >placement, false, false);
   ^~~
   In file included from drivers/staging/vboxvideo/vbox_drv.h:43:0,
from drivers/staging/vboxvideo/vbox_ttm.c:30:
   include/drm/ttm/ttm_bo_api.h:333:5: note: declared here
int ttm_bo_validate(struct ttm_buffer_object *bo,
^~~
   drivers/staging/vboxvideo/vbox_ttm.c: In function 'vbox_bo_push_sysram':
   drivers/staging/vboxvideo/vbox_ttm.c:451:8: error: too many arguments to 
function 'ttm_bo_validate'
 ret = ttm_bo_validate(>bo, >placement, false, false);
   ^~~
   In file included from drivers/staging/vboxvideo/vbox_drv.h:43:0,
from drivers/staging/vboxvideo/vbox_ttm.c:30:
   include/drm/ttm/ttm_bo_api.h:333:5: note: declared here
int ttm_bo_validate(struct ttm_buffer_object *bo,
^~~

vim +/ttm_bo_validate +392 drivers/staging/vboxvideo/vbox_ttm.c

dd55d44f4 Hans de Goede 2017-07-06  374  
dd55d44f4 Hans de Goede 2017-07-06  375  int vbox_bo_pin(struct vbox_bo *bo, 
u32 pl_flag, u64 *gpu_addr)
dd55d44f4 Hans de Goede 2017-07-06  376  {
dd55d44f4 Hans de Goede 2017-07-06  377 int i, ret;
dd55d44f4 Hans de Goede 2017-07-06  378  
dd55d44f4 Hans de Goede 2017-07-06  379 if (bo->pin_count) {
dd55d44f4 Hans de Goede 2017-07-06  380 bo->pin_count++;
dd55d44f4 Hans de Goede 2017-07-06  381 if (gpu_addr)
dd55d44f4 Hans de Goede 2017-07-06  382 *gpu_addr = 
vbox_bo_gpu_offset(bo);
dd55d44f4 Hans de Goede 2017-07-06  383  
dd55d44f4 Hans de Goede 2017-07-06  384 return 0;
dd55d44f4 Hans de Goede 2017-07-06  385 }
dd55d44f4 Hans de Goede 2017-07-06  386  
dd55d44f4 Hans de Goede 2017-07-06  387 vbox_ttm_placement(bo, pl_flag);
dd55d44f4 Hans de Goede 2017-07-06  388  
dd55d44f4 Hans de Goede 2017-07-06  389 for (i = 0; i < 
bo->placement.num_placement; i++)
dd55d44f4 Hans de Goede 2017-07-06  390 bo->placements[i].flags 
|= TTM_PL_FLAG_NO_EVICT;
dd55d44f4 Hans de Goede 2017-07-06  391  
dd55d44f4 Hans de Goede 2017-07-06 @392 ret = ttm_bo_validate(>bo, 
>placement, false, false);
dd55d44f4 Hans de Goede 2017-07-06  393 if (ret)
dd55d44f4 Hans de Goede 2017-07-06  394 return ret;
dd55d44f4 Hans de Goede 2017-07-06  395  
dd55d44f4 Hans de Goede 2017-07-06  396 bo->pin_count = 1;
dd55d44f4 Hans de Goede 2017-07-06  397  
dd55d44f4 Hans de Goede 2017-07-06  398 if (gpu_addr)
dd55d44f4 Hans de Goede 2017-07-06  399 *gpu_addr = 
vbox_bo_gpu_offset(bo);
dd55d44f4 Hans de Goede 2017-07-06  400  
dd55d44f4 Hans de Goede 2017-07-06  401 return 0;
dd55d44f4 Hans de Goede 2017-07-06  402  }
dd55d44f4 Hans de Goede 2017-07-06  403  

:: The code at line 392 was first introduced by commit
:: dd55d44f408419278c00887bfcb2261d0caae350 staging: vboxvideo: Add 
vboxvideo to drivers/staging

:: TO: Hans de Goede 
:: CC: Greg Kroah-Hartman 

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


[radeon-alex:amd-staging-drm-next 413/475] drivers/staging/vboxvideo/vbox_ttm.c:392:30: sparse: too many arguments for function ttm_bo_validate

2017-11-27 Thread kbuild test robot
tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next
head:   f3769c94f4e6a794dbb72601936199d9b258f7b7
commit: f4d284ea58186199a9e2757dd9571d8386172141 [413/475] drm/ttm: add 
operation ctx to ttm_bo_validate v2
reproduce:
# apt-get install sparse
git checkout f4d284ea58186199a9e2757dd9571d8386172141
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)


vim +392 drivers/staging/vboxvideo/vbox_ttm.c

dd55d44f4 Hans de Goede 2017-07-06  374  
dd55d44f4 Hans de Goede 2017-07-06  375  int vbox_bo_pin(struct vbox_bo *bo, 
u32 pl_flag, u64 *gpu_addr)
dd55d44f4 Hans de Goede 2017-07-06  376  {
dd55d44f4 Hans de Goede 2017-07-06  377 int i, ret;
dd55d44f4 Hans de Goede 2017-07-06  378  
dd55d44f4 Hans de Goede 2017-07-06  379 if (bo->pin_count) {
dd55d44f4 Hans de Goede 2017-07-06  380 bo->pin_count++;
dd55d44f4 Hans de Goede 2017-07-06  381 if (gpu_addr)
dd55d44f4 Hans de Goede 2017-07-06  382 *gpu_addr = 
vbox_bo_gpu_offset(bo);
dd55d44f4 Hans de Goede 2017-07-06  383  
dd55d44f4 Hans de Goede 2017-07-06  384 return 0;
dd55d44f4 Hans de Goede 2017-07-06  385 }
dd55d44f4 Hans de Goede 2017-07-06  386  
dd55d44f4 Hans de Goede 2017-07-06  387 vbox_ttm_placement(bo, pl_flag);
dd55d44f4 Hans de Goede 2017-07-06  388  
dd55d44f4 Hans de Goede 2017-07-06  389 for (i = 0; i < 
bo->placement.num_placement; i++)
dd55d44f4 Hans de Goede 2017-07-06  390 bo->placements[i].flags 
|= TTM_PL_FLAG_NO_EVICT;
dd55d44f4 Hans de Goede 2017-07-06  391  
dd55d44f4 Hans de Goede 2017-07-06 @392 ret = ttm_bo_validate(>bo, 
>placement, false, false);
dd55d44f4 Hans de Goede 2017-07-06  393 if (ret)
dd55d44f4 Hans de Goede 2017-07-06  394 return ret;
dd55d44f4 Hans de Goede 2017-07-06  395  
dd55d44f4 Hans de Goede 2017-07-06  396 bo->pin_count = 1;
dd55d44f4 Hans de Goede 2017-07-06  397  
dd55d44f4 Hans de Goede 2017-07-06  398 if (gpu_addr)
dd55d44f4 Hans de Goede 2017-07-06  399 *gpu_addr = 
vbox_bo_gpu_offset(bo);
dd55d44f4 Hans de Goede 2017-07-06  400  
dd55d44f4 Hans de Goede 2017-07-06  401 return 0;
dd55d44f4 Hans de Goede 2017-07-06  402  }
dd55d44f4 Hans de Goede 2017-07-06  403  

:: The code at line 392 was first introduced by commit
:: dd55d44f408419278c00887bfcb2261d0caae350 staging: vboxvideo: Add 
vboxvideo to drivers/staging

:: TO: Hans de Goede 
:: CC: Greg Kroah-Hartman 

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


Re: [PATCH] drm/bridge/synopsis: stop clobbering drvdata

2017-11-27 Thread Matthias Kaehlcke
El Mon, Nov 27, 2017 at 05:05:38PM -0800 Brian Norris ha dit:

> Bridge drivers/helpers shouldn't be clobbering the drvdata, since a
> parent driver might need to own this. Instead, let's return our
> 'dw_mipi_dsi' object and have callers pass that back to us for removal.
> 
> Signed-off-by: Brian Norris 
> ---
>  drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 36 
> ++-
>  drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 14 +++
>  include/drm/bridge/dw_mipi_dsi.h  | 17 -
>  3 files changed, 33 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c 
> b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> index d9cca4fd66ec..c39c7dce20ed 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> @@ -922,8 +922,6 @@ __dw_mipi_dsi_probe(struct platform_device *pdev,
>   dsi->bridge.of_node = pdev->dev.of_node;
>  #endif
>  
> - dev_set_drvdata(dev, dsi);
> -
>   return dsi;
>  }
>  
> @@ -935,23 +933,16 @@ static void __dw_mipi_dsi_remove(struct dw_mipi_dsi 
> *dsi)
>  /*
>   * Probe/remove API, used from platforms based on the DRM bridge API.
>   */
> -int dw_mipi_dsi_probe(struct platform_device *pdev,
> -   const struct dw_mipi_dsi_plat_data *plat_data)
> +struct dw_mipi_dsi *
> +dw_mipi_dsi_probe(struct platform_device *pdev,
> +   const struct dw_mipi_dsi_plat_data *plat_data)
>  {
> - struct dw_mipi_dsi *dsi;
> -
> - dsi = __dw_mipi_dsi_probe(pdev, plat_data);
> - if (IS_ERR(dsi))
> - return PTR_ERR(dsi);
> -
> - return 0;
> + return __dw_mipi_dsi_probe(pdev, plat_data);
>  }
>  EXPORT_SYMBOL_GPL(dw_mipi_dsi_probe);
>  
> -void dw_mipi_dsi_remove(struct platform_device *pdev)
> +void dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi)
>  {
> - struct dw_mipi_dsi *dsi = platform_get_drvdata(pdev);
> -
>   mipi_dsi_host_unregister(>dsi_host);
>  
>   __dw_mipi_dsi_remove(dsi);
> @@ -961,31 +952,30 @@ EXPORT_SYMBOL_GPL(dw_mipi_dsi_remove);
>  /*
>   * Bind/unbind API, used from platforms based on the component framework.
>   */
> -int dw_mipi_dsi_bind(struct platform_device *pdev, struct drm_encoder 
> *encoder,
> -  const struct dw_mipi_dsi_plat_data *plat_data)
> +struct dw_mipi_dsi *
> +dw_mipi_dsi_bind(struct platform_device *pdev, struct drm_encoder *encoder,
> +  const struct dw_mipi_dsi_plat_data *plat_data)
>  {
>   struct dw_mipi_dsi *dsi;
>   int ret;
>  
>   dsi = __dw_mipi_dsi_probe(pdev, plat_data);
>   if (IS_ERR(dsi))
> - return PTR_ERR(dsi);
> + return dsi;
>  
>   ret = drm_bridge_attach(encoder, >bridge, NULL);
>   if (ret) {
> - dw_mipi_dsi_remove(pdev);
> + dw_mipi_dsi_remove(dsi);
>   DRM_ERROR("Failed to initialize bridge with drm\n");
> - return ret;
> + return ERR_PTR(ret);
>   }
>  
> - return 0;
> + return dsi;
>  }
>  EXPORT_SYMBOL_GPL(dw_mipi_dsi_bind);
>  
> -void dw_mipi_dsi_unbind(struct device *dev)
> +void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi)
>  {
> - struct dw_mipi_dsi *dsi = dev_get_drvdata(dev);
> -
>   __dw_mipi_dsi_remove(dsi);
>  }
>  EXPORT_SYMBOL_GPL(dw_mipi_dsi_unbind);
> diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c 
> b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> index e5b6310240fe..7ed0ef7f6ec2 100644
> --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> @@ -66,6 +66,7 @@ enum dsi_color {
>  struct dw_mipi_dsi_stm {
>   void __iomem *base;
>   struct clk *pllref_clk;
> + struct dw_mipi_dsi *dsi;
>  };
>  
>  static inline void dsi_write(struct dw_mipi_dsi_stm *dsi, u32 reg, u32 val)
> @@ -318,21 +319,24 @@ static int dw_mipi_dsi_stm_probe(struct platform_device 
> *pdev)
>   dw_mipi_dsi_stm_plat_data.base = dsi->base;
>   dw_mipi_dsi_stm_plat_data.priv_data = dsi;
>  
> - ret = dw_mipi_dsi_probe(pdev, _mipi_dsi_stm_plat_data);
> - if (ret) {
> + platform_set_drvdata(pdev, dsi);
> +
> + dsi->dsi = dw_mipi_dsi_probe(pdev, _mipi_dsi_stm_plat_data);
> + if (IS_ERR(dsi->dsi)) {
>   DRM_ERROR("Failed to initialize mipi dsi host\n");
>   clk_disable_unprepare(dsi->pllref_clk);
> + return PTR_ERR(dsi->dsi);
>   }
>  
> - return ret;
> + return 0;
>  }
>  
>  static int dw_mipi_dsi_stm_remove(struct platform_device *pdev)
>  {
> - struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data;
> + struct dw_mipi_dsi_stm *dsi = platform_get_drvdata(pdev);
>  
>   clk_disable_unprepare(dsi->pllref_clk);
> - dw_mipi_dsi_remove(pdev);
> + dw_mipi_dsi_remove(dsi->dsi);
>  
>   return 0;
>  }
> diff --git a/include/drm/bridge/dw_mipi_dsi.h 
> b/include/drm/bridge/dw_mipi_dsi.h
> index 9b30fec302c8..d9c6d549f971 

[PATCH v2 3/3] arm64: dts: rockchip: update mipi node for RK3399

2017-11-27 Thread Nickey Yang
This patch update mipi node for RK3399 DSI controller
based on the Synopsys DesignWare MIPI DSI host controller.

Signed-off-by: Nickey Yang 
---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi 
b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index d340b58a..0ac67a9 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -1652,9 +1652,11 @@
status = "disabled";
 
ports {
-   mipi_in: port {
-   #address-cells = <1>;
-   #size-cells = <0>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   mipi_in: port@0 {
+   reg = <0>;
 
mipi_in_vopb: endpoint@0 {
reg = <0>;
-- 
1.9.1

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


[PATCH v2 2/3] drm/rockchip: Add ROCKCHIP DW MIPI DSI controller driver

2017-11-27 Thread Nickey Yang
Add the ROCKCHIP DSI controller driver that uses the Synopsys DesignWare
MIPI DSI host controller bridge.

Signed-off-by: Nickey Yang 
---
 drivers/gpu/drm/rockchip/Kconfig|2 +-
 drivers/gpu/drm/rockchip/Makefile   |2 +-
 drivers/gpu/drm/rockchip/dw-mipi-dsi.c  | 1349 ---
 drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c |  756 +
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c |2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_drv.h |2 +-
 6 files changed, 760 insertions(+), 1353 deletions(-)
 delete mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi.c
 create mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c

diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig
index 0ccc762..9eb4795 100644
--- a/drivers/gpu/drm/rockchip/Kconfig
+++ b/drivers/gpu/drm/rockchip/Kconfig
@@ -7,7 +7,7 @@ config DRM_ROCKCHIP
select VIDEOMODE_HELPERS
select DRM_ANALOGIX_DP if ROCKCHIP_ANALOGIX_DP
select DRM_DW_HDMI if ROCKCHIP_DW_HDMI
-   select DRM_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI
+   select DRM_DW_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI
select SND_SOC_HDMI_CODEC if ROCKCHIP_CDN_DP && SND_SOC
help
  Choose this option if you have a Rockchip soc chipset.
diff --git a/drivers/gpu/drm/rockchip/Makefile 
b/drivers/gpu/drm/rockchip/Makefile
index a314e21..c05fe47 100644
--- a/drivers/gpu/drm/rockchip/Makefile
+++ b/drivers/gpu/drm/rockchip/Makefile
@@ -11,7 +11,7 @@ rockchipdrm-$(CONFIG_DRM_FBDEV_EMULATION) += 
rockchip_drm_fbdev.o
 rockchipdrm-$(CONFIG_ROCKCHIP_ANALOGIX_DP) += analogix_dp-rockchip.o
 rockchipdrm-$(CONFIG_ROCKCHIP_CDN_DP) += cdn-dp-core.o cdn-dp-reg.o
 rockchipdrm-$(CONFIG_ROCKCHIP_DW_HDMI) += dw_hdmi-rockchip.o
-rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) += dw-mipi-dsi.o
+rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) += dw-mipi-dsi_rockchip.o
 rockchipdrm-$(CONFIG_ROCKCHIP_INNO_HDMI) += inno_hdmi.o
 rockchipdrm-$(CONFIG_ROCKCHIP_LVDS) += rockchip_lvds.o
 
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c 
b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
deleted file mode 100644
index b15755b..000
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
+++ /dev/null
@@ -1,1349 +0,0 @@
-/*
- * Copyright (c) 2016, Fuzhou Rockchip Electronics Co., Ltd
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "rockchip_drm_drv.h"
-#include "rockchip_drm_vop.h"
-
-#define DRIVER_NAME"dw-mipi-dsi"
-
-#define RK3288_GRF_SOC_CON60x025c
-#define RK3288_DSI0_SEL_VOP_LITBIT(6)
-#define RK3288_DSI1_SEL_VOP_LITBIT(9)
-
-#define RK3399_GRF_SOC_CON20   0x6250
-#define RK3399_DSI0_SEL_VOP_LITBIT(0)
-#define RK3399_DSI1_SEL_VOP_LITBIT(4)
-
-/* disable turnrequest, turndisable, forcetxstopmode, forcerxmode */
-#define RK3399_GRF_SOC_CON22   0x6258
-#define RK3399_GRF_DSI_MODE0x
-
-#define DSI_VERSION0x00
-#define DSI_PWR_UP 0x04
-#define RESET  0
-#define POWERUPBIT(0)
-
-#define DSI_CLKMGR_CFG 0x08
-#define TO_CLK_DIVIDSION(div)  (((div) & 0xff) << 8)
-#define TX_ESC_CLK_DIVIDSION(div)  (((div) & 0xff) << 0)
-
-#define DSI_DPI_VCID   0x0c
-#define DPI_VID(vid)   (((vid) & 0x3) << 0)
-
-#define DSI_DPI_COLOR_CODING   0x10
-#define EN18_LOOSELY   BIT(8)
-#define DPI_COLOR_CODING_16BIT_1   0x0
-#define DPI_COLOR_CODING_16BIT_2   0x1
-#define DPI_COLOR_CODING_16BIT_3   0x2
-#define DPI_COLOR_CODING_18BIT_1   0x3
-#define DPI_COLOR_CODING_18BIT_2   0x4
-#define DPI_COLOR_CODING_24BIT 0x5
-
-#define DSI_DPI_CFG_POL0x14
-#define COLORM_ACTIVE_LOW  BIT(4)
-#define SHUTD_ACTIVE_LOW   BIT(3)
-#define HSYNC_ACTIVE_LOW   BIT(2)
-#define VSYNC_ACTIVE_LOW   BIT(1)
-#define DATAEN_ACTIVE_LOW  BIT(0)
-
-#define DSI_DPI_LP_CMD_TIM 0x18
-#define OUTVACT_LPCMD_TIME(p)  (((p) & 0xff) << 16)
-#define INVACT_LPCMD_TIME(p)   ((p) & 0xff)
-
-#define DSI_DBI_CFG0x20
-#define DSI_DBI_CMDSIZE0x28
-
-#define DSI_PCKHDL_CFG 0x2c
-#define EN_CRC_RX  BIT(4)
-#define EN_ECC_RX  BIT(3)
-#define EN_BTA BIT(2)
-#define EN_EOTP_RX

[PATCH v2 1/3] dt-bindings: display: rockchip: update DSI controller

2017-11-27 Thread Nickey Yang
This patch update documentation of device tree bindings for the rockchip
DSI controller based on the Synopsys DesignWare MIPI DSI host controller.

Signed-off-by: Nickey Yang 
---
 .../display/rockchip/dw_mipi_dsi_rockchip.txt  | 23 ++
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt 
b/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
index 6bb59ab..336909d 100644
--- 
a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
+++ 
b/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
@@ -14,6 +14,8 @@ Required properties:
 - rockchip,grf: this soc should set GRF regs to mux vopl/vopb.
 - ports: contain a port node with endpoint definitions as defined in [2].
   For vopb,set the reg = <0> and set the reg = <1> for vopl.
+- video port 0 for the VOP input, the remote endpoint maybe vopb or vopl
+- video port 1 for either a panel or subsequent encoder
 
 Optional properties:
 - power-domains: a phandle to mipi dsi power domain node.
@@ -40,11 +42,10 @@ Example:
ports {
#address-cells = <1>;
#size-cells = <0>;
-   reg = <1>;
 
-   mipi_in: port {
-   #address-cells = <1>;
-   #size-cells = <0>;
+   mipi_in: port@0 {
+   reg = <0>;
+
mipi_in_vopb: endpoint@0 {
reg = <0>;
remote-endpoint = <_out_mipi>;
@@ -54,6 +55,14 @@ Example:
remote-endpoint = <_out_mipi>;
};
};
+
+   mipi_out: port@1 {
+   reg = <1>;
+
+   mipi_out_panel: endpoint {
+   remote-endpoint = <_in_mipi>;
+   };
+   };
};
 
panel {
@@ -64,5 +73,11 @@ Example:
pinctrl-names = "default";
pinctrl-0 = <_en>;
backlight = <>;
+
+   port {
+   panel_in_mipi: endpoint {
+   remote-endpoint = <_out_panel>;
+   };
+   };
};
};
-- 
1.9.1

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


[PATCH v2 0/3] Update ROCKCHIP DSI driver that uses dw-mipi-dsi bridge

2017-11-27 Thread Nickey Yang
We now have a generic dw-mipi-dsi bridge driver.So we send
this patchs to moving rockchip dw-mipi-dsi driver to that
in order to add new features(dual mipi support).
Update ROCKCHIP DSI controller driver that uses the Synopsys
DesignWare MIPI DSI host controller bridge.

ChangeLog:
v2:
   add err_pllref???remove unnecessary encoder.enable & disable
   correct spelling mistakes


Nickey Yang (3):
  dt-bindings: display: rockchip: update DSI controller
  drm/rockchip: Add ROCKCHIP DW MIPI DSI controller driver
  arm64: dts: rockchip: update mipi node for RK3399

 .../display/rockchip/dw_mipi_dsi_rockchip.txt  |   23 +-
 arch/arm64/boot/dts/rockchip/rk3399.dtsi   |8 +-
 drivers/gpu/drm/rockchip/Kconfig   |2 +-
 drivers/gpu/drm/rockchip/Makefile  |2 +-
 drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 1349 
 drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c|  756 +++
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c|2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_drv.h|2 +-
 8 files changed, 784 insertions(+), 1360 deletions(-)
 delete mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi.c
 create mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c

-- 
1.9.1

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


Re: [PATCH 2/3] drm/rockchip: Add ROCKCHIP DW MIPI DSI controller driver

2017-11-27 Thread Brian Norris
Hi Nickey,

Several people already made comments on the initial version of this
patch [1], and I don't think you've caught them all here yet. I'll
repeat a few. Not sure if I've caught them all.

[1] 
https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/780120

On Tue, Nov 28, 2017 at 09:13:35AM +0800, Nickey Yang wrote:
> Add the ROCKCHIP DSI controller driver that uses the Synopsys DesignWare
> MIPI DSI host controller bridge.
> 
> Signed-off-by: Nickey Yang 
> ---
>  drivers/gpu/drm/rockchip/Kconfig|2 +-
>  drivers/gpu/drm/rockchip/Makefile   |2 +-
>  drivers/gpu/drm/rockchip/dw-mipi-dsi.c  | 1349 
> ---
>  drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c |  756 +
>  drivers/gpu/drm/rockchip/rockchip_drm_drv.c |2 +-
>  drivers/gpu/drm/rockchip/rockchip_drm_drv.h |2 +-
>  6 files changed, 760 insertions(+), 1353 deletions(-)
>  delete mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi.c
>  create mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c
> 

...

> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c 
> b/drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c
> new file mode 100644
> index 000..32be430
> --- /dev/null
> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c
> @@ -0,0 +1,756 @@
> +/*
> + * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
> + * Author:
> + *  Chris Zhong 
> + *  Nickey Yang 
> + *
> + * This software is licensed under the terms of the GNU General Public
> + * License version 2, as published by the Free Software Foundation, and
> + * may be copied, distributed, and modified under those terms.
> + *
> + * 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.
> + *
> + * License terms:  GNU General Public License (GPL), version 2
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "rockchip_drm_drv.h"
> +#include "rockchip_drm_vop.h"
> +
> +#define DSI_PHY_TST_CTRL00xb4
> +#define PHY_TESTCLK  BIT(1)
> +#define PHY_UNTESTCLK0
> +#define PHY_TESTCLR  BIT(0)
> +#define PHY_UNTESTCLR0
> +
> +#define DSI_PHY_TST_CTRL10xb8
> +#define PHY_TESTEN   BIT(16)
> +#define PHY_UNTESTEN 0
> +#define PHY_TESTDOUT(n)  (((n) & 0xff) << 8)
> +#define PHY_TESTDIN(n)   (((n) & 0xff) << 0)
> +
> +#define BYPASS_VCO_RANGE BIT(7)
> +#define VCO_RANGE_CON_SEL(val)   (((val) & 0x7) << 3)
> +#define VCO_IN_CAP_CON_DEFAULT   (0x0 << 1)
> +#define VCO_IN_CAP_CON_LOW   (0x1 << 1)
> +#define VCO_IN_CAP_CON_HIGH  (0x2 << 1)
> +#define REF_BIAS_CUR_SEL BIT(0)
> +
> +#define CP_CURRENT_3UA   0x1
> +#define CP_CURRENT_4_5UA 0x2
> +#define CP_CURRENT_7_5UA 0x6
> +#define CP_CURRENT_6UA   0x9
> +#define CP_CURRENT_12UA  0xb
> +#define CP_CURRENT_SEL(val)  ((val) & 0xf)
> +#define CP_PROGRAM_ENBIT(7)
> +
> +#define LPF_RESISTORS_15_5KOHM   0x1
> +#define LPF_RESISTORS_13KOHM 0x2
> +#define LPF_RESISTORS_11_5KOHM   0x4
> +#define LPF_RESISTORS_10_5KOHM   0x8
> +#define LPF_RESISTORS_8KOHM  0x10
> +#define LPF_PROGRAM_EN   BIT(6)
> +#define LPF_RESISTORS_SEL(val)   ((val) & 0x3f)
> +
> +#define HSFREQRANGE_SEL(val) (((val) & 0x3f) << 1)
> +
> +#define INPUT_DIVIDER(val)   (((val) - 1) & 0x7f)
> +#define LOW_PROGRAM_EN   0
> +#define HIGH_PROGRAM_EN  BIT(7)
> +#define LOOP_DIV_LOW_SEL(val)(((val) - 1) & 0x1f)
> +#define LOOP_DIV_HIGH_SEL(val)   val) - 1) >> 5) & 0xf)
> +#define PLL_LOOP_DIV_EN  BIT(5)
> +#define PLL_INPUT_DIV_EN BIT(4)
> +
> +#define POWER_CONTROLBIT(6)
> +#define INTERNAL_REG_CURRENT BIT(3)
> +#define BIAS_BLOCK_ONBIT(2)
> +#define BANDGAP_ON   BIT(0)
> +
> +#define TER_RESISTOR_HIGHBIT(7)
> +#define  TER_RESISTOR_LOW0
> +#define LEVEL_SHIFTERS_ONBIT(6)
> +#define TER_CAL_DONE BIT(5)
> +#define SETRD_MAX(0x7 << 2)
> +#define POWER_MANAGE BIT(1)
> +#define TER_RESISTORS_ON BIT(0)
> +
> +#define BIASEXTR_SEL(val)((val) & 0x7)
> +#define BANDGAP_SEL(val) ((val) & 0x7)
> +#define TLP_PROGRAM_EN   BIT(7)
> +#define THS_PRE_PROGRAM_EN   BIT(7)
> +#define THS_ZERO_PROGRAM_EN  BIT(6)
> +
> +#define PLL_BIAS_CUR_SEL_CAP_VCO_CONTROL 0x10
> +#define PLL_CP_CONTROL_PLL_LOCK_BYPASS   0x11
> +#define PLL_LPF_AND_CP_CONTROL   0x12
> +#define PLL_INPUT_DIVIDER_RATIO  0x17
> +#define 

Re: omapfb/dss: Delete an error message for a failed memory allocation in three functions

2017-11-27 Thread Joe Perches
On Mon, 2017-11-27 at 22:48 +0100, SF Markus Elfring wrote:
> It seems that I got no responses so far for clarification requests
> according to the documentation in a direction I hoped for.

That's because you are pretty unresponsive to
direction.

You've gotten _many_ replies to your patches to
which you have seemingly decided to ignore.

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


[Bug 103783] atombios stuck in loop for more than 5secs

2017-11-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103783

--- Comment #13 from Rene Barbosa  ---
Hey, 

Is your system using 'pcieport' module?

I've added it to RUNTIME_PM_DRIVER_BLACKLIST in TLP's configuration and now the
problem is fixed!

Not sure why it's happening in Linux 4.13+ and not in 4.4 with AMDGPU-Pro
installed.

-- 
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 3/3] arm64: dts: rockchip: update mipi node for RK3399

2017-11-27 Thread Nickey Yang
This patch update mipi node for RK3399 DSI controller
based on the Synopsys DesignWare MIPI DSI host controller.

Signed-off-by: Nickey Yang 
---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi 
b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index d340b58a..0ac67a9 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -1652,9 +1652,11 @@
status = "disabled";
 
ports {
-   mipi_in: port {
-   #address-cells = <1>;
-   #size-cells = <0>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   mipi_in: port@0 {
+   reg = <0>;
 
mipi_in_vopb: endpoint@0 {
reg = <0>;
-- 
1.9.1

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


[PATCH 2/3] drm/rockchip: Add ROCKCHIP DW MIPI DSI controller driver

2017-11-27 Thread Nickey Yang
Add the ROCKCHIP DSI controller driver that uses the Synopsys DesignWare
MIPI DSI host controller bridge.

Signed-off-by: Nickey Yang 
---
 drivers/gpu/drm/rockchip/Kconfig|2 +-
 drivers/gpu/drm/rockchip/Makefile   |2 +-
 drivers/gpu/drm/rockchip/dw-mipi-dsi.c  | 1349 ---
 drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c |  756 +
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c |2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_drv.h |2 +-
 6 files changed, 760 insertions(+), 1353 deletions(-)
 delete mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi.c
 create mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c

diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig
index 0ccc762..9eb4795 100644
--- a/drivers/gpu/drm/rockchip/Kconfig
+++ b/drivers/gpu/drm/rockchip/Kconfig
@@ -7,7 +7,7 @@ config DRM_ROCKCHIP
select VIDEOMODE_HELPERS
select DRM_ANALOGIX_DP if ROCKCHIP_ANALOGIX_DP
select DRM_DW_HDMI if ROCKCHIP_DW_HDMI
-   select DRM_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI
+   select DRM_DW_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI
select SND_SOC_HDMI_CODEC if ROCKCHIP_CDN_DP && SND_SOC
help
  Choose this option if you have a Rockchip soc chipset.
diff --git a/drivers/gpu/drm/rockchip/Makefile 
b/drivers/gpu/drm/rockchip/Makefile
index a314e21..c05fe47 100644
--- a/drivers/gpu/drm/rockchip/Makefile
+++ b/drivers/gpu/drm/rockchip/Makefile
@@ -11,7 +11,7 @@ rockchipdrm-$(CONFIG_DRM_FBDEV_EMULATION) += 
rockchip_drm_fbdev.o
 rockchipdrm-$(CONFIG_ROCKCHIP_ANALOGIX_DP) += analogix_dp-rockchip.o
 rockchipdrm-$(CONFIG_ROCKCHIP_CDN_DP) += cdn-dp-core.o cdn-dp-reg.o
 rockchipdrm-$(CONFIG_ROCKCHIP_DW_HDMI) += dw_hdmi-rockchip.o
-rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) += dw-mipi-dsi.o
+rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) += dw-mipi-dsi_rockchip.o
 rockchipdrm-$(CONFIG_ROCKCHIP_INNO_HDMI) += inno_hdmi.o
 rockchipdrm-$(CONFIG_ROCKCHIP_LVDS) += rockchip_lvds.o
 
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c 
b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
deleted file mode 100644
index b15755b..000
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
+++ /dev/null
@@ -1,1349 +0,0 @@
-/*
- * Copyright (c) 2016, Fuzhou Rockchip Electronics Co., Ltd
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "rockchip_drm_drv.h"
-#include "rockchip_drm_vop.h"
-
-#define DRIVER_NAME"dw-mipi-dsi"
-
-#define RK3288_GRF_SOC_CON60x025c
-#define RK3288_DSI0_SEL_VOP_LITBIT(6)
-#define RK3288_DSI1_SEL_VOP_LITBIT(9)
-
-#define RK3399_GRF_SOC_CON20   0x6250
-#define RK3399_DSI0_SEL_VOP_LITBIT(0)
-#define RK3399_DSI1_SEL_VOP_LITBIT(4)
-
-/* disable turnrequest, turndisable, forcetxstopmode, forcerxmode */
-#define RK3399_GRF_SOC_CON22   0x6258
-#define RK3399_GRF_DSI_MODE0x
-
-#define DSI_VERSION0x00
-#define DSI_PWR_UP 0x04
-#define RESET  0
-#define POWERUPBIT(0)
-
-#define DSI_CLKMGR_CFG 0x08
-#define TO_CLK_DIVIDSION(div)  (((div) & 0xff) << 8)
-#define TX_ESC_CLK_DIVIDSION(div)  (((div) & 0xff) << 0)
-
-#define DSI_DPI_VCID   0x0c
-#define DPI_VID(vid)   (((vid) & 0x3) << 0)
-
-#define DSI_DPI_COLOR_CODING   0x10
-#define EN18_LOOSELY   BIT(8)
-#define DPI_COLOR_CODING_16BIT_1   0x0
-#define DPI_COLOR_CODING_16BIT_2   0x1
-#define DPI_COLOR_CODING_16BIT_3   0x2
-#define DPI_COLOR_CODING_18BIT_1   0x3
-#define DPI_COLOR_CODING_18BIT_2   0x4
-#define DPI_COLOR_CODING_24BIT 0x5
-
-#define DSI_DPI_CFG_POL0x14
-#define COLORM_ACTIVE_LOW  BIT(4)
-#define SHUTD_ACTIVE_LOW   BIT(3)
-#define HSYNC_ACTIVE_LOW   BIT(2)
-#define VSYNC_ACTIVE_LOW   BIT(1)
-#define DATAEN_ACTIVE_LOW  BIT(0)
-
-#define DSI_DPI_LP_CMD_TIM 0x18
-#define OUTVACT_LPCMD_TIME(p)  (((p) & 0xff) << 16)
-#define INVACT_LPCMD_TIME(p)   ((p) & 0xff)
-
-#define DSI_DBI_CFG0x20
-#define DSI_DBI_CMDSIZE0x28
-
-#define DSI_PCKHDL_CFG 0x2c
-#define EN_CRC_RX  BIT(4)
-#define EN_ECC_RX  BIT(3)
-#define EN_BTA BIT(2)
-#define EN_EOTP_RX

[PATCH 1/3] dt-bindings: display: rockchip: update DSI controller

2017-11-27 Thread Nickey Yang
This patch update documentation of device tree bindings for the rockchip
DSI controller based on the Synopsys DesignWare MIPI DSI host controller.

Signed-off-by: Nickey Yang 
---
 .../display/rockchip/dw_mipi_dsi_rockchip.txt  | 23 ++
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git 
a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt 
b/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
index 6bb59ab..336909d 100644
--- 
a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
+++ 
b/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
@@ -14,6 +14,8 @@ Required properties:
 - rockchip,grf: this soc should set GRF regs to mux vopl/vopb.
 - ports: contain a port node with endpoint definitions as defined in [2].
   For vopb,set the reg = <0> and set the reg = <1> for vopl.
+- video port 0 for the VOP input, the remote endpoint maybe vopb or vopl
+- video port 1 for either a panel or subsequent encoder
 
 Optional properties:
 - power-domains: a phandle to mipi dsi power domain node.
@@ -40,11 +42,10 @@ Example:
ports {
#address-cells = <1>;
#size-cells = <0>;
-   reg = <1>;
 
-   mipi_in: port {
-   #address-cells = <1>;
-   #size-cells = <0>;
+   mipi_in: port@0 {
+   reg = <0>;
+
mipi_in_vopb: endpoint@0 {
reg = <0>;
remote-endpoint = <_out_mipi>;
@@ -54,6 +55,14 @@ Example:
remote-endpoint = <_out_mipi>;
};
};
+
+   mipi_out: port@1 {
+   reg = <1>;
+
+   mipi_out_panel: endpoint {
+   remote-endpoint = <_in_mipi>;
+   };
+   };
};
 
panel {
@@ -64,5 +73,11 @@ Example:
pinctrl-names = "default";
pinctrl-0 = <_en>;
backlight = <>;
+
+   port {
+   panel_in_mipi: endpoint {
+   remote-endpoint = <_out_panel>;
+   };
+   };
};
};
-- 
1.9.1

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


[PATCH 0/3] Update ROCKCHIP DSI driver that uses dw-mipi-dsi bridge

2017-11-27 Thread Nickey Yang
We now have a generic dw-mipi-dsi bridge driver.So we send
this patchs to moving rockchip dw-mipi-dsi driver to that
in order to add new features(dual mipi support).
Update ROCKCHIP DSI controller driver that uses the Synopsys
DesignWare MIPI DSI host controller bridge.

Nickey Yang (3):
  dt-bindings: display: rockchip: update DSI controller
  drm/rockchip: Add ROCKCHIP DW MIPI DSI controller driver
  arm64: dts: rockchip: update mipi node for RK3399

 .../display/rockchip/dw_mipi_dsi_rockchip.txt  |   23 +-
 arch/arm64/boot/dts/rockchip/rk3399.dtsi   |8 +-
 drivers/gpu/drm/rockchip/Kconfig   |2 +-
 drivers/gpu/drm/rockchip/Makefile  |2 +-
 drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 1349 
 drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c|  756 +++
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c|2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_drv.h|2 +-
 8 files changed, 784 insertions(+), 1360 deletions(-)
 delete mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi.c
 create mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi_rockchip.c

-- 
1.9.1

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


[PATCH] drm/bridge/synopsis: stop clobbering drvdata

2017-11-27 Thread Brian Norris
Bridge drivers/helpers shouldn't be clobbering the drvdata, since a
parent driver might need to own this. Instead, let's return our
'dw_mipi_dsi' object and have callers pass that back to us for removal.

Signed-off-by: Brian Norris 
---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 36 ++-
 drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 14 +++
 include/drm/bridge/dw_mipi_dsi.h  | 17 -
 3 files changed, 33 insertions(+), 34 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c 
b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index d9cca4fd66ec..c39c7dce20ed 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -922,8 +922,6 @@ __dw_mipi_dsi_probe(struct platform_device *pdev,
dsi->bridge.of_node = pdev->dev.of_node;
 #endif
 
-   dev_set_drvdata(dev, dsi);
-
return dsi;
 }
 
@@ -935,23 +933,16 @@ static void __dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi)
 /*
  * Probe/remove API, used from platforms based on the DRM bridge API.
  */
-int dw_mipi_dsi_probe(struct platform_device *pdev,
- const struct dw_mipi_dsi_plat_data *plat_data)
+struct dw_mipi_dsi *
+dw_mipi_dsi_probe(struct platform_device *pdev,
+ const struct dw_mipi_dsi_plat_data *plat_data)
 {
-   struct dw_mipi_dsi *dsi;
-
-   dsi = __dw_mipi_dsi_probe(pdev, plat_data);
-   if (IS_ERR(dsi))
-   return PTR_ERR(dsi);
-
-   return 0;
+   return __dw_mipi_dsi_probe(pdev, plat_data);
 }
 EXPORT_SYMBOL_GPL(dw_mipi_dsi_probe);
 
-void dw_mipi_dsi_remove(struct platform_device *pdev)
+void dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi)
 {
-   struct dw_mipi_dsi *dsi = platform_get_drvdata(pdev);
-
mipi_dsi_host_unregister(>dsi_host);
 
__dw_mipi_dsi_remove(dsi);
@@ -961,31 +952,30 @@ EXPORT_SYMBOL_GPL(dw_mipi_dsi_remove);
 /*
  * Bind/unbind API, used from platforms based on the component framework.
  */
-int dw_mipi_dsi_bind(struct platform_device *pdev, struct drm_encoder *encoder,
-const struct dw_mipi_dsi_plat_data *plat_data)
+struct dw_mipi_dsi *
+dw_mipi_dsi_bind(struct platform_device *pdev, struct drm_encoder *encoder,
+const struct dw_mipi_dsi_plat_data *plat_data)
 {
struct dw_mipi_dsi *dsi;
int ret;
 
dsi = __dw_mipi_dsi_probe(pdev, plat_data);
if (IS_ERR(dsi))
-   return PTR_ERR(dsi);
+   return dsi;
 
ret = drm_bridge_attach(encoder, >bridge, NULL);
if (ret) {
-   dw_mipi_dsi_remove(pdev);
+   dw_mipi_dsi_remove(dsi);
DRM_ERROR("Failed to initialize bridge with drm\n");
-   return ret;
+   return ERR_PTR(ret);
}
 
-   return 0;
+   return dsi;
 }
 EXPORT_SYMBOL_GPL(dw_mipi_dsi_bind);
 
-void dw_mipi_dsi_unbind(struct device *dev)
+void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi)
 {
-   struct dw_mipi_dsi *dsi = dev_get_drvdata(dev);
-
__dw_mipi_dsi_remove(dsi);
 }
 EXPORT_SYMBOL_GPL(dw_mipi_dsi_unbind);
diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c 
b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
index e5b6310240fe..7ed0ef7f6ec2 100644
--- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
+++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
@@ -66,6 +66,7 @@ enum dsi_color {
 struct dw_mipi_dsi_stm {
void __iomem *base;
struct clk *pllref_clk;
+   struct dw_mipi_dsi *dsi;
 };
 
 static inline void dsi_write(struct dw_mipi_dsi_stm *dsi, u32 reg, u32 val)
@@ -318,21 +319,24 @@ static int dw_mipi_dsi_stm_probe(struct platform_device 
*pdev)
dw_mipi_dsi_stm_plat_data.base = dsi->base;
dw_mipi_dsi_stm_plat_data.priv_data = dsi;
 
-   ret = dw_mipi_dsi_probe(pdev, _mipi_dsi_stm_plat_data);
-   if (ret) {
+   platform_set_drvdata(pdev, dsi);
+
+   dsi->dsi = dw_mipi_dsi_probe(pdev, _mipi_dsi_stm_plat_data);
+   if (IS_ERR(dsi->dsi)) {
DRM_ERROR("Failed to initialize mipi dsi host\n");
clk_disable_unprepare(dsi->pllref_clk);
+   return PTR_ERR(dsi->dsi);
}
 
-   return ret;
+   return 0;
 }
 
 static int dw_mipi_dsi_stm_remove(struct platform_device *pdev)
 {
-   struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data;
+   struct dw_mipi_dsi_stm *dsi = platform_get_drvdata(pdev);
 
clk_disable_unprepare(dsi->pllref_clk);
-   dw_mipi_dsi_remove(pdev);
+   dw_mipi_dsi_remove(dsi->dsi);
 
return 0;
 }
diff --git a/include/drm/bridge/dw_mipi_dsi.h b/include/drm/bridge/dw_mipi_dsi.h
index 9b30fec302c8..d9c6d549f971 100644
--- a/include/drm/bridge/dw_mipi_dsi.h
+++ b/include/drm/bridge/dw_mipi_dsi.h
@@ -10,6 +10,8 @@
 #ifndef __DW_MIPI_DSI__
 #define __DW_MIPI_DSI__
 
+struct dw_mipi_dsi;
+
 struct dw_mipi_dsi_phy_ops {
int (*init)(void *priv_data);
   

[PATCH] drm: Add DPCD definitions for DP 1.4 FEC feature

2017-11-27 Thread Anusha Srivatsa
Forward Error Correction is supported on DP 1.4.
This patch adds corresponding DPCD register definitions.

v2: Add dri-devel to the CC list

Cc: dri-devel@lists.freedesktop.org
Cc: Ville Syrjala 
Cc: Jani Nikula 
Cc: Manasi Navare 
Signed-off-by: Anusha Srivatsa 
---
 include/drm/drm_dp_helper.h | 29 +
 1 file changed, 29 insertions(+)

diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index da58a42..bc816ea 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -284,6 +284,35 @@
 # define DP_DSC_BITS_PER_PIXEL_1_2  0x3
 # define DP_DSC_BITS_PER_PIXEL_10x4
 
+/* DP Forward error Correction Registers */
+#define DP_FEC_CAPABILITY  0x090
+# define DP_FEC_CAPABLE(1 << 0)
+# define DP_FEC_UNCORR_BLK_ERROR_COUNT_CAP  (1 << 1)
+# define DP_FEC_CORR_BLK_ERROR_COUNT_CAP(1 << 2)
+# define DP_FEC_BIT_ERROR_COUNT_CAP(1 << 3)
+
+#define DP_FEC_CONFIGURATION   0x120
+# define DP_FEC_READY  (1 << 0)
+# define DP_FEC_ERR_COUNT_DIS  (0 << 1)
+# define DP_FEC_UNCORR_BLK_ERROR_COUNT (1 << 1)
+# define DP_FEC_CORR_BLK_ERROR_COUNT   (2 << 1)
+# define DP_FEC_BIT_ERROR_COUNT(3 << 1)
+# define DP_FEC_LANE_0_SELECT  (0 << 4)
+# define DP_FEC_LANE_1_SELECT  (1 << 4)
+# define DP_FEC_LANE_2_SELECT  (2 << 4)
+# define DP_FEC_LANE_3_SELECT  (3 << 4)
+
+#define DP_FEC_STATUS  0x280
+# define DP_FEC_EN_DETECTED(1 << 0)
+# define DP_FEC_DEC_DETECTED   (1 << 1)
+
+#define DP_FEC_ERROR_COUNT_1   0x0281
+# define DP_FEC_ERR_COUNT_7_0(err_count)(err_count << 0)
+
+#define DP_FEC_ERROR_COUNT_2   0x0282
+# define DP_FEC_ERR_COUNT_14_8(err_count)   (err_count << 0)
+# define DP_FEC_ERR_COUNT_VALID(1 << 7)
+
 #define DP_PSR_SUPPORT  0x070   /* XXX 1.2? */
 # define DP_PSR_IS_SUPPORTED1
 # define DP_PSR2_IS_SUPPORTED  2   /* eDP 1.4 */
-- 
2.7.4

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


Re: [PATCH v3 3/6] drm/rockchip/dsi: correct Feedback divider setting

2017-11-27 Thread Brian Norris
(Dropping Mark, whose Rockchip address is dead; and fixing Chris's email again)

On Mon, Nov 27, 2017 at 4:29 PM, Brian Norris  wrote:
> On Thu, Oct 26, 2017 at 09:44:14AM +, Philippe CORNU wrote:
>> On 10/26/2017 06:13 AM, Archit Taneja wrote:
>> > On 10/26/2017 06:39 AM, Brian Norris wrote:
>> >> somebody already working on refactoring existing Rockchip code to use
>> >> this?
>> >
>> > I don't know. If rockchip isn't interested in doing it, we can check with
>> > Philippe from ST if he can try creating a RFC that converts the rockchip
>> > driver to use the dw-mipi-dsi driver.
>>
>> I am not really interested in doing this port for Rockchip (or Hisilicon
>> or i.MX...) but happy to help anyone that wants to use the dw-mipi-dsi
>> bridge driver :)
>
> Ugh, this stuff is worse than I expected. I'm helping Rockchip along
> with getting this rewritten, but there are some hiccups.
>
> Among other things, the bridge driver is assuming it can set the
> device's drvdata itself. This works because the STM MIPI driver is
> simple, but the Rockchip one registers stuff via component_add(), and so
> it *needs* to handle drvdata between probe() and bind()...but then the
> "common" bridge driver is going to clobber it (dev_set_drvdata()).
>
> Along the way, I'm noticing that the STM driver just steps around this
> at times by referencing a static (!!) instance of its priv_data. See:
>
> static int dw_mipi_dsi_stm_remove(struct platform_device *pdev)
> {
> struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data;
> ...
>
>
> I might rewrite this, but it's not fun to have to fix somebody else's
> fork for them...
>
> Brian
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v3 3/6] drm/rockchip/dsi: correct Feedback divider setting

2017-11-27 Thread Brian Norris
On Thu, Oct 26, 2017 at 09:44:14AM +, Philippe CORNU wrote:
> On 10/26/2017 06:13 AM, Archit Taneja wrote:
> > On 10/26/2017 06:39 AM, Brian Norris wrote:
> >> somebody already working on refactoring existing Rockchip code to use
> >> this?
> > 
> > I don't know. If rockchip isn't interested in doing it, we can check with
> > Philippe from ST if he can try creating a RFC that converts the rockchip
> > driver to use the dw-mipi-dsi driver.
> 
> I am not really interested in doing this port for Rockchip (or Hisilicon 
> or i.MX...) but happy to help anyone that wants to use the dw-mipi-dsi 
> bridge driver :)

Ugh, this stuff is worse than I expected. I'm helping Rockchip along
with getting this rewritten, but there are some hiccups.

Among other things, the bridge driver is assuming it can set the
device's drvdata itself. This works because the STM MIPI driver is
simple, but the Rockchip one registers stuff via component_add(), and so
it *needs* to handle drvdata between probe() and bind()...but then the
"common" bridge driver is going to clobber it (dev_set_drvdata()).

Along the way, I'm noticing that the STM driver just steps around this
at times by referencing a static (!!) instance of its priv_data. See:

static int dw_mipi_dsi_stm_remove(struct platform_device *pdev)
{
struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data;
...


I might rewrite this, but it's not fun to have to fix somebody else's
fork for them...

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


Re: [PATCH] drm/ttm: fix populate_and_map() functions once more

2017-11-27 Thread Alex Deucher
On Mon, Nov 27, 2017 at 7:21 AM, Christian König
 wrote:
> This reverts "drm/ttm: Fix configuration error around populate_and_map()
> functions".
>
> This fix has gone into the wrong direction. Those helpers should be
> available even when neither CONFIG_INTEL_IOMMU nor CONFIG_SWIOTLB are
> set.
>
> Signed-off-by: Christian König 

Acked-by: Alex Deucher 

> ---
>  drivers/gpu/drm/ttm/ttm_page_alloc.c |  2 --
>  include/drm/ttm/ttm_page_alloc.h | 32 ++--
>  2 files changed, 10 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c 
> b/drivers/gpu/drm/ttm/ttm_page_alloc.c
> index 1543532b8740..c82d94cbbabc 100644
> --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
> +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
> @@ -1096,7 +1096,6 @@ void ttm_pool_unpopulate(struct ttm_tt *ttm)
>  }
>  EXPORT_SYMBOL(ttm_pool_unpopulate);
>
> -#if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU)
>  int ttm_populate_and_map_pages(struct device *dev, struct ttm_dma_tt *tt)
>  {
> unsigned i, j;
> @@ -1167,7 +1166,6 @@ void ttm_unmap_and_unpopulate_pages(struct device *dev, 
> struct ttm_dma_tt *tt)
> ttm_pool_unpopulate(>ttm);
>  }
>  EXPORT_SYMBOL(ttm_unmap_and_unpopulate_pages);
> -#endif
>
>  int ttm_page_alloc_debugfs(struct seq_file *m, void *data)
>  {
> diff --git a/include/drm/ttm/ttm_page_alloc.h 
> b/include/drm/ttm/ttm_page_alloc.h
> index 38a2b4770c35..593811362a91 100644
> --- a/include/drm/ttm/ttm_page_alloc.h
> +++ b/include/drm/ttm/ttm_page_alloc.h
> @@ -59,11 +59,20 @@ int ttm_pool_populate(struct ttm_tt *ttm);
>  void ttm_pool_unpopulate(struct ttm_tt *ttm);
>
>  /**
> + * Populates and DMA maps pages to fullfil a ttm_dma_populate() request
> + */
> +int ttm_populate_and_map_pages(struct device *dev, struct ttm_dma_tt *tt);
> +
> +/**
> + * Unpopulates and DMA unmaps pages as part of a
> + * ttm_dma_unpopulate() request */
> +void ttm_unmap_and_unpopulate_pages(struct device *dev, struct ttm_dma_tt 
> *tt);
> +
> +/**
>   * Output the state of pools to debugfs file
>   */
>  int ttm_page_alloc_debugfs(struct seq_file *m, void *data);
>
> -
>  #if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU)
>  /**
>   * Initialize pool allocator.
> @@ -83,17 +92,6 @@ int ttm_dma_page_alloc_debugfs(struct seq_file *m, void 
> *data);
>  int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev);
>  void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev);
>
> -
> -/**
> - * Populates and DMA maps pages to fullfil a ttm_dma_populate() request
> - */
> -int ttm_populate_and_map_pages(struct device *dev, struct ttm_dma_tt *tt);
> -
> -/**
> - * Unpopulates and DMA unmaps pages as part of a
> - * ttm_dma_unpopulate() request */
> -void ttm_unmap_and_unpopulate_pages(struct device *dev, struct ttm_dma_tt 
> *tt);
> -
>  #else
>  static inline int ttm_dma_page_alloc_init(struct ttm_mem_global *glob,
>   unsigned max_pages)
> @@ -116,16 +114,6 @@ static inline void ttm_dma_unpopulate(struct ttm_dma_tt 
> *ttm_dma,
>   struct device *dev)
>  {
>  }
> -
> -static inline int ttm_populate_and_map_pages(struct device *dev, struct 
> ttm_dma_tt *tt)
> -{
> -   return -ENOMEM;
> -}
> -
> -static inline void ttm_unmap_and_unpopulate_pages(struct device *dev, struct 
> ttm_dma_tt *tt)
> -{
> -}
> -
>  #endif
>
>  #endif
> --
> 2.11.0
>
> ___
> 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


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

2017-11-27 Thread Alex Deucher
On Fri, Nov 24, 2017 at 5:32 AM, Christian König
 wrote:
> Fixes interface changes done in the following commits:
> drm/ttm: add operation ctx to ttm_bo_validate v2
> drm/ttm: add context to driver move callback as well
>
> I missed this driver because it is in the staging area.
>
> Signed-off-by: Christian König 
> Reviewed-by: Hans de Goede 

Acked-by: Alex Deucher 

Alex

> ---
>  drivers/staging/vboxvideo/vbox_ttm.c | 17 ++---
>  1 file changed, 6 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/staging/vboxvideo/vbox_ttm.c 
> b/drivers/staging/vboxvideo/vbox_ttm.c
> index 4eb410a2a1a8..231c89e0699c 100644
> --- a/drivers/staging/vboxvideo/vbox_ttm.c
> +++ b/drivers/staging/vboxvideo/vbox_ttm.c
> @@ -183,13 +183,6 @@ static void vbox_ttm_io_mem_free(struct ttm_bo_device 
> *bdev,
>  {
>  }
>
> -static int vbox_bo_move(struct ttm_buffer_object *bo,
> -   bool evict, bool interruptible,
> -   bool no_wait_gpu, struct ttm_mem_reg *new_mem)
> -{
> -   return ttm_bo_move_memcpy(bo, interruptible, no_wait_gpu, new_mem);
> -}
> -
>  static void vbox_ttm_backend_destroy(struct ttm_tt *tt)
>  {
> ttm_tt_fini(tt);
> @@ -237,7 +230,6 @@ static struct ttm_bo_driver vbox_bo_driver = {
> .init_mem_type = vbox_bo_init_mem_type,
> .eviction_valuable = ttm_bo_eviction_valuable,
> .evict_flags = vbox_bo_evict_flags,
> -   .move = vbox_bo_move,
> .verify_access = vbox_bo_verify_access,
> .io_mem_reserve = _ttm_io_mem_reserve,
> .io_mem_free = _ttm_io_mem_free,
> @@ -374,6 +366,7 @@ static inline u64 vbox_bo_gpu_offset(struct vbox_bo *bo)
>
>  int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr)
>  {
> +   struct ttm_operation_ctx ctx = { false, false };
> int i, ret;
>
> if (bo->pin_count) {
> @@ -389,7 +382,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 
> *gpu_addr)
> for (i = 0; i < bo->placement.num_placement; i++)
> bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
>
> -   ret = ttm_bo_validate(>bo, >placement, false, false);
> +   ret = ttm_bo_validate(>bo, >placement, );
> if (ret)
> return ret;
>
> @@ -403,6 +396,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 
> *gpu_addr)
>
>  int vbox_bo_unpin(struct vbox_bo *bo)
>  {
> +   struct ttm_operation_ctx ctx = { false, false };
> int i, ret;
>
> if (!bo->pin_count) {
> @@ -416,7 +410,7 @@ int vbox_bo_unpin(struct vbox_bo *bo)
> for (i = 0; i < bo->placement.num_placement; i++)
> bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT;
>
> -   ret = ttm_bo_validate(>bo, >placement, false, false);
> +   ret = ttm_bo_validate(>bo, >placement, );
> if (ret)
> return ret;
>
> @@ -430,6 +424,7 @@ int vbox_bo_unpin(struct vbox_bo *bo)
>   */
>  int vbox_bo_push_sysram(struct vbox_bo *bo)
>  {
> +   struct ttm_operation_ctx ctx = { false, false };
> int i, ret;
>
> if (!bo->pin_count) {
> @@ -448,7 +443,7 @@ int vbox_bo_push_sysram(struct vbox_bo *bo)
> for (i = 0; i < bo->placement.num_placement; i++)
> bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
>
> -   ret = ttm_bo_validate(>bo, >placement, false, false);
> +   ret = ttm_bo_validate(>bo, >placement, );
> if (ret) {
> DRM_ERROR("pushing to VRAM failed\n");
> return ret;
> --
> 2.11.0
>
> ___
> 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


[PATCH v2 0/2] qxl cursor fixes

2017-11-27 Thread Ray Strode
From: Ray Strode 

This series includes a small leak fix and a fix for an initial invisible
cursor on wayland sessions.

Ray Strode (2):
  drm/qxl: unref cursor bo when finished with it
  drm/qxl: reapply cursor after resetting primary

 drivers/gpu/drm/qxl/qxl_display.c | 63 ++-
 drivers/gpu/drm/qxl/qxl_drv.h |  2 ++
 2 files changed, 64 insertions(+), 1 deletion(-)

-- 
2.14.3

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


[PATCH 1/2] drm/qxl: unref cursor bo when finished with it

2017-11-27 Thread Ray Strode
From: Ray Strode 

qxl_cursor_atomic_update allocs a bo for the cursor that
it never frees up at the end of the function.

This commit fixes that.

Signed-off-by: Ray Strode 
---
 drivers/gpu/drm/qxl/qxl_display.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/qxl/qxl_display.c 
b/drivers/gpu/drm/qxl/qxl_display.c
index 4756b3c9bf2c..7335d99244d5 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -548,61 +548,61 @@ static void qxl_primary_atomic_disable(struct drm_plane 
*plane,
struct qxl_device *qdev = plane->dev->dev_private;
 
if (old_state->fb) {
struct qxl_framebuffer *qfb =
to_qxl_framebuffer(old_state->fb);
struct qxl_bo *bo = gem_to_qxl_bo(qfb->obj);
 
if (bo->is_primary) {
qxl_io_destroy_primary(qdev);
bo->is_primary = false;
}
}
 }
 
 static int qxl_plane_atomic_check(struct drm_plane *plane,
  struct drm_plane_state *state)
 {
return 0;
 }
 
 static void qxl_cursor_atomic_update(struct drm_plane *plane,
 struct drm_plane_state *old_state)
 {
struct drm_device *dev = plane->dev;
struct qxl_device *qdev = dev->dev_private;
struct drm_framebuffer *fb = plane->state->fb;
struct qxl_release *release;
struct qxl_cursor_cmd *cmd;
struct qxl_cursor *cursor;
struct drm_gem_object *obj;
-   struct qxl_bo *cursor_bo, *user_bo = NULL;
+   struct qxl_bo *cursor_bo = NULL, *user_bo = NULL;
int ret;
void *user_ptr;
int size = 64*64*4;
 
ret = qxl_alloc_release_reserved(qdev, sizeof(*cmd),
 QXL_RELEASE_CURSOR_CMD,
 , NULL);
if (ret)
return;
 
if (fb != old_state->fb) {
obj = to_qxl_framebuffer(fb)->obj;
user_bo = gem_to_qxl_bo(obj);
 
/* pinning is done in the prepare/cleanup framevbuffer */
ret = qxl_bo_kmap(user_bo, _ptr);
if (ret)
goto out_free_release;
 
ret = qxl_alloc_bo_reserved(qdev, release,
sizeof(struct qxl_cursor) + size,
_bo);
if (ret)
goto out_kunmap;
 
ret = qxl_release_reserve_list(release, true);
if (ret)
goto out_free_bo;
 
ret = qxl_bo_kmap(cursor_bo, (void **));
@@ -618,60 +618,62 @@ static void qxl_cursor_atomic_update(struct drm_plane 
*plane,
cursor->data_size = size;
cursor->chunk.next_chunk = 0;
cursor->chunk.prev_chunk = 0;
cursor->chunk.data_size = size;
memcpy(cursor->chunk.data, user_ptr, size);
qxl_bo_kunmap(cursor_bo);
qxl_bo_kunmap(user_bo);
 
cmd = (struct qxl_cursor_cmd *) qxl_release_map(qdev, release);
cmd->u.set.visible = 1;
cmd->u.set.shape = qxl_bo_physical_address(qdev,
   cursor_bo, 0);
cmd->type = QXL_CURSOR_SET;
} else {
 
ret = qxl_release_reserve_list(release, true);
if (ret)
goto out_free_release;
 
cmd = (struct qxl_cursor_cmd *) qxl_release_map(qdev, release);
cmd->type = QXL_CURSOR_MOVE;
}
 
cmd->u.position.x = plane->state->crtc_x + fb->hot_x;
cmd->u.position.y = plane->state->crtc_y + fb->hot_y;
 
qxl_release_unmap(qdev, release, >release_info);
qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false);
qxl_release_fence_buffer_objects(release);
 
+   qxl_bo_unref(_bo);
+
return;
 
 out_backoff:
qxl_release_backoff_reserve_list(release);
 out_free_bo:
qxl_bo_unref(_bo);
 out_kunmap:
qxl_bo_kunmap(user_bo);
 out_free_release:
qxl_release_free(qdev, release);
return;
 
 }
 
 static void qxl_cursor_atomic_disable(struct drm_plane *plane,
  struct drm_plane_state *old_state)
 {
struct qxl_device *qdev = plane->dev->dev_private;
struct qxl_release *release;
struct qxl_cursor_cmd *cmd;
int ret;
 
ret = qxl_alloc_release_reserved(qdev, sizeof(*cmd),
 QXL_RELEASE_CURSOR_CMD,
 , NULL);
if (ret)
return;
 
ret = qxl_release_reserve_list(release, true);
if (ret) {
-- 
2.14.3


[PATCH 2/2] drm/qxl: reapply cursor after resetting primary

2017-11-27 Thread Ray Strode
From: Ray Strode 

QXL associates mouse state with its primary plane.

Destroying a primary plane and putting a new one in place has the side
effect of destroying the cursor as well.

This commit changes the driver to reapply the cursor any time a new
primary is created. It achieves this by keeping a reference to the
cursor bo on the qxl_crtc struct.

This fix is very similar to

commit 4532b241a4b7 ("drm/qxl: reapply cursor after SetCrtc calls")

which got implicitly reverted as part of implementing the atomic
modeset feature.

Cc: Gerd Hoffmann 
Cc: Dave Airlie 
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1512097
Fixes: 1277eed5fecb ("drm: qxl: Atomic phase 1: convert cursor to universal 
plane")
Signed-off-by: Ray Strode 
---
 drivers/gpu/drm/qxl/qxl_display.c | 59 +++
 drivers/gpu/drm/qxl/qxl_drv.h |  2 ++
 2 files changed, 61 insertions(+)

diff --git a/drivers/gpu/drm/qxl/qxl_display.c 
b/drivers/gpu/drm/qxl/qxl_display.c
index 7335d99244d5..9a9214ae0fb5 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -262,60 +262,61 @@ static int qxl_add_common_modes(struct drm_connector 
*connector,
mode = drm_cvt_mode(dev, common_modes[i].w, common_modes[i].h,
60, false, false, false);
if (common_modes[i].w == pwidth && common_modes[i].h == pheight)
mode->type |= DRM_MODE_TYPE_PREFERRED;
drm_mode_probed_add(connector, mode);
}
return i - 1;
 }
 
 static void qxl_crtc_atomic_flush(struct drm_crtc *crtc,
  struct drm_crtc_state *old_crtc_state)
 {
struct drm_device *dev = crtc->dev;
struct drm_pending_vblank_event *event;
unsigned long flags;
 
if (crtc->state && crtc->state->event) {
event = crtc->state->event;
crtc->state->event = NULL;
 
spin_lock_irqsave(>event_lock, flags);
drm_crtc_send_vblank_event(crtc, event);
spin_unlock_irqrestore(>event_lock, flags);
}
 }
 
 static void qxl_crtc_destroy(struct drm_crtc *crtc)
 {
struct qxl_crtc *qxl_crtc = to_qxl_crtc(crtc);
 
+   qxl_bo_unref(_crtc->cursor_bo);
drm_crtc_cleanup(crtc);
kfree(qxl_crtc);
 }
 
 static const struct drm_crtc_funcs qxl_crtc_funcs = {
.set_config = drm_atomic_helper_set_config,
.destroy = qxl_crtc_destroy,
.page_flip = drm_atomic_helper_page_flip,
.reset = drm_atomic_helper_crtc_reset,
.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
 };
 
 void qxl_user_framebuffer_destroy(struct drm_framebuffer *fb)
 {
struct qxl_framebuffer *qxl_fb = to_qxl_framebuffer(fb);
struct qxl_bo *bo = gem_to_qxl_bo(qxl_fb->obj);
 
WARN_ON(bo->shadow);
drm_gem_object_unreference_unlocked(qxl_fb->obj);
drm_framebuffer_cleanup(fb);
kfree(qxl_fb);
 }
 
 static int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb,
 struct drm_file *file_priv,
 unsigned flags, unsigned color,
 struct drm_clip_rect *clips,
 unsigned num_clips)
 {
@@ -468,193 +469,251 @@ static void qxl_crtc_atomic_disable(struct drm_crtc 
*crtc,
 
 static const struct drm_crtc_helper_funcs qxl_crtc_helper_funcs = {
.mode_fixup = qxl_crtc_mode_fixup,
.mode_set_nofb = qxl_mode_set_nofb,
.atomic_flush = qxl_crtc_atomic_flush,
.atomic_enable = qxl_crtc_atomic_enable,
.atomic_disable = qxl_crtc_atomic_disable,
 };
 
 static int qxl_primary_atomic_check(struct drm_plane *plane,
struct drm_plane_state *state)
 {
struct qxl_device *qdev = plane->dev->dev_private;
struct qxl_framebuffer *qfb;
struct qxl_bo *bo;
 
if (!state->crtc || !state->fb)
return 0;
 
qfb = to_qxl_framebuffer(state->fb);
bo = gem_to_qxl_bo(qfb->obj);
 
if (bo->surf.stride * bo->surf.height > qdev->vram_size) {
DRM_ERROR("Mode doesn't fit in vram size (vgamem)");
return -EINVAL;
}
 
return 0;
 }
 
+static int qxl_primary_apply_cursor(struct drm_plane *plane)
+{
+   struct drm_device *dev = plane->dev;
+   struct qxl_device *qdev = dev->dev_private;
+   struct drm_framebuffer *fb = plane->state->fb;
+   struct qxl_crtc *qcrtc = to_qxl_crtc(plane->state->crtc);
+   struct qxl_cursor_cmd *cmd;
+   struct qxl_release *release;
+   int ret = 0;
+
+   if (!qcrtc->cursor_bo)
+   return 0;
+
+   ret = 

Re: omapfb/dss: Delete an error message for a failed memory allocation in three functions

2017-11-27 Thread SF Markus Elfring
> There is the generic stack dump on OOM so the module/line
> is already known.

Can such an implementation detail become better documented
than in C source code?


> The existence of these messages increases code size which
> also make the OOM condition slightly more likely.

Interesting view …


> Markus' commit messages are always really poor descriptions
> of why these removals are somewhat useful and the commit
> could/should/might be applied.

I agree that they could be improved for this transformation
pattern if other information sources would become clearer
for corresponding references.
It seems that I got no responses so far for clarification requests
according to the documentation in a direction I hoped for.

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


Re: [PATCH] drm/qxl: reapply cursor after resetting primary

2017-11-27 Thread Ray Strode
Hi,

On Mon, Nov 27, 2017 at 4:07 PM Ray Strode  wrote:
...
> This commit changes the driver to reapply the cursor any time a new
> primary is created. It achieves this by keeping a reference to the
> cursor bo on the qxl_crtc struct.
So i forgot this is on top of a small leak fix, too.

For clarity, I'll resend with both patches in the series.

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


[PATCH 5/5] radeon_backlight: Delete a jump target in radeonfb_bl_init()

2017-11-27 Thread SF Markus Elfring
From: Markus Elfring 
Date: Mon, 27 Nov 2017 22:03:03 +0100

* Replace a goto statement by a direct call of the function "kfree"
  in an if branch.

* Delete the jump label "error" which became unnecessary with
  this refactoring.

Signed-off-by: Markus Elfring 
---
 drivers/video/fbdev/aty/radeon_backlight.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/video/fbdev/aty/radeon_backlight.c 
b/drivers/video/fbdev/aty/radeon_backlight.c
index 7f7ed6f72ddb..3c5b8291e773 100644
--- a/drivers/video/fbdev/aty/radeon_backlight.c
+++ b/drivers/video/fbdev/aty/radeon_backlight.c
@@ -157,7 +157,8 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
if (IS_ERR(bd)) {
rinfo->info->bl_dev = NULL;
printk("radeonfb: Backlight registration failed\n");
-   goto error;
+   kfree(pdata);
+   return;
}
 
pdata->rinfo = rinfo;
@@ -188,11 +189,6 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
backlight_update_status(bd);
 
printk("radeonfb: Backlight initialized (%s)\n", name);
-
-   return;
-
-error:
-   kfree(pdata);
 }
 
 void radeonfb_bl_exit(struct radeonfb_info *rinfo)
-- 
2.15.0

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


[PATCH 4/5] radeon_backlight: Return directly after a failed kmalloc() in radeonfb_bl_init()

2017-11-27 Thread SF Markus Elfring
From: Markus Elfring 
Date: Mon, 27 Nov 2017 21:50:28 +0100

Return directly after a call of the function "kmalloc" failed
at the beginning.

Signed-off-by: Markus Elfring 
---
 drivers/video/fbdev/aty/radeon_backlight.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/aty/radeon_backlight.c 
b/drivers/video/fbdev/aty/radeon_backlight.c
index c5e0e3557cc2..7f7ed6f72ddb 100644
--- a/drivers/video/fbdev/aty/radeon_backlight.c
+++ b/drivers/video/fbdev/aty/radeon_backlight.c
@@ -145,7 +145,7 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
 
pdata = kmalloc(sizeof(*pdata), GFP_KERNEL);
if (!pdata)
-   goto error;
+   return;
 
snprintf(name, sizeof(name), "radeonbl%d", rinfo->info->node);
 
-- 
2.15.0

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


[PATCH 3/5] radeon_backlight: Delete an unnecessary return statement in radeonfb_bl_init()

2017-11-27 Thread SF Markus Elfring
From: Markus Elfring 
Date: Mon, 27 Nov 2017 21:37:52 +0100

The script "checkpatch.pl" pointed information out like the following.

WARNING: void function return statements are not generally useful

Thus remove such a statement in the affected function.

Signed-off-by: Markus Elfring 
---
 drivers/video/fbdev/aty/radeon_backlight.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/aty/radeon_backlight.c 
b/drivers/video/fbdev/aty/radeon_backlight.c
index 78c36c8d5e57..c5e0e3557cc2 100644
--- a/drivers/video/fbdev/aty/radeon_backlight.c
+++ b/drivers/video/fbdev/aty/radeon_backlight.c
@@ -193,7 +193,6 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
 
 error:
kfree(pdata);
-   return;
 }
 
 void radeonfb_bl_exit(struct radeonfb_info *rinfo)
-- 
2.15.0

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


[PATCH 1/5] radeon_backlight: Delete an error message for a failed memory allocation in radeonfb_bl_init()

2017-11-27 Thread SF Markus Elfring
From: Markus Elfring 
Date: Mon, 27 Nov 2017 21:27:51 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 drivers/video/fbdev/aty/radeon_backlight.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/aty/radeon_backlight.c 
b/drivers/video/fbdev/aty/radeon_backlight.c
index 301d6d6aeead..ce5b22d710b3 100644
--- a/drivers/video/fbdev/aty/radeon_backlight.c
+++ b/drivers/video/fbdev/aty/radeon_backlight.c
@@ -144,10 +144,8 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
 #endif
 
pdata = kmalloc(sizeof(struct radeon_bl_privdata), GFP_KERNEL);
-   if (!pdata) {
-   printk("radeonfb: Memory allocation failed\n");
+   if (!pdata)
goto error;
-   }
 
snprintf(name, sizeof(name), "radeonbl%d", rinfo->info->node);
 
-- 
2.15.0

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


[PATCH 2/5] radeon_backlight: Improve a size determination in radeonfb_bl_init()

2017-11-27 Thread SF Markus Elfring
From: Markus Elfring 
Date: Mon, 27 Nov 2017 21:30:06 +0100

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 drivers/video/fbdev/aty/radeon_backlight.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/aty/radeon_backlight.c 
b/drivers/video/fbdev/aty/radeon_backlight.c
index ce5b22d710b3..78c36c8d5e57 100644
--- a/drivers/video/fbdev/aty/radeon_backlight.c
+++ b/drivers/video/fbdev/aty/radeon_backlight.c
@@ -143,7 +143,7 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
return;
 #endif
 
-   pdata = kmalloc(sizeof(struct radeon_bl_privdata), GFP_KERNEL);
+   pdata = kmalloc(sizeof(*pdata), GFP_KERNEL);
if (!pdata)
goto error;
 
-- 
2.15.0

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


[PATCH 0/5] Radeon backlight: Adjustments for radeonfb_bl_init()

2017-11-27 Thread SF Markus Elfring
From: Markus Elfring 
Date: Mon, 27 Nov 2017 22:14:04 +0100

A few update suggestions were taken into account
from static source code analysis.

Markus Elfring (5):
  Delete an error message for a failed memory allocation
  Improve a size determination
  Delete an unnecessary return statement
  Return directly after a failed kmalloc()
  Delete a jump target

 drivers/video/fbdev/aty/radeon_backlight.c | 17 +
 1 file changed, 5 insertions(+), 12 deletions(-)

-- 
2.15.0

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


[PATCH] drm/qxl: reapply cursor after resetting primary

2017-11-27 Thread Ray Strode
From: Ray Strode 

QXL associates mouse state with its primary plane.

Destroying a primary plane and putting a new one in place has the side
effect of destroying the cursor as well.

This commit changes the driver to reapply the cursor any time a new
primary is created. It achieves this by keeping a reference to the
cursor bo on the qxl_crtc struct.

This fix is very similar to

commit 4532b241a4b7 ("drm/qxl: reapply cursor after SetCrtc calls")

which got implicitly reverted as part of implementing the atomic
modeset feature.

Cc: Gerd Hoffmann 
Cc: Dave Airlie 
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1512097
Fixes: 1277eed5fecb ("drm: qxl: Atomic phase 1: convert cursor to universal 
plane")
Signed-off-by: Ray Strode 
---
 drivers/gpu/drm/qxl/qxl_display.c | 59 +++
 drivers/gpu/drm/qxl/qxl_drv.h |  2 ++
 2 files changed, 61 insertions(+)

diff --git a/drivers/gpu/drm/qxl/qxl_display.c 
b/drivers/gpu/drm/qxl/qxl_display.c
index fc9e86f3811f..a51a5abb977d 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -262,60 +262,61 @@ static int qxl_add_common_modes(struct drm_connector 
*connector,
mode = drm_cvt_mode(dev, common_modes[i].w, common_modes[i].h,
60, false, false, false);
if (common_modes[i].w == pwidth && common_modes[i].h == pheight)
mode->type |= DRM_MODE_TYPE_PREFERRED;
drm_mode_probed_add(connector, mode);
}
return i - 1;
 }
 
 static void qxl_crtc_atomic_flush(struct drm_crtc *crtc,
  struct drm_crtc_state *old_crtc_state)
 {
struct drm_device *dev = crtc->dev;
struct drm_pending_vblank_event *event;
unsigned long flags;
 
if (crtc->state && crtc->state->event) {
event = crtc->state->event;
crtc->state->event = NULL;
 
spin_lock_irqsave(>event_lock, flags);
drm_crtc_send_vblank_event(crtc, event);
spin_unlock_irqrestore(>event_lock, flags);
}
 }
 
 static void qxl_crtc_destroy(struct drm_crtc *crtc)
 {
struct qxl_crtc *qxl_crtc = to_qxl_crtc(crtc);
 
+   qxl_bo_unref(_crtc->cursor_bo);
drm_crtc_cleanup(crtc);
kfree(qxl_crtc);
 }
 
 static const struct drm_crtc_funcs qxl_crtc_funcs = {
.set_config = drm_atomic_helper_set_config,
.destroy = qxl_crtc_destroy,
.page_flip = drm_atomic_helper_page_flip,
.reset = drm_atomic_helper_crtc_reset,
.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
 };
 
 void qxl_user_framebuffer_destroy(struct drm_framebuffer *fb)
 {
struct qxl_framebuffer *qxl_fb = to_qxl_framebuffer(fb);
struct qxl_bo *bo = gem_to_qxl_bo(qxl_fb->obj);
 
WARN_ON(bo->shadow);
drm_gem_object_unreference_unlocked(qxl_fb->obj);
drm_framebuffer_cleanup(fb);
kfree(qxl_fb);
 }
 
 static int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb,
 struct drm_file *file_priv,
 unsigned flags, unsigned color,
 struct drm_clip_rect *clips,
 unsigned num_clips)
 {
@@ -468,193 +469,251 @@ static void qxl_crtc_atomic_disable(struct drm_crtc 
*crtc,
 
 static const struct drm_crtc_helper_funcs qxl_crtc_helper_funcs = {
.mode_fixup = qxl_crtc_mode_fixup,
.mode_set_nofb = qxl_mode_set_nofb,
.atomic_flush = qxl_crtc_atomic_flush,
.atomic_enable = qxl_crtc_atomic_enable,
.atomic_disable = qxl_crtc_atomic_disable,
 };
 
 static int qxl_primary_atomic_check(struct drm_plane *plane,
struct drm_plane_state *state)
 {
struct qxl_device *qdev = plane->dev->dev_private;
struct qxl_framebuffer *qfb;
struct qxl_bo *bo;
 
if (!state->crtc || !state->fb)
return 0;
 
qfb = to_qxl_framebuffer(state->fb);
bo = gem_to_qxl_bo(qfb->obj);
 
if (bo->surf.stride * bo->surf.height > qdev->vram_size) {
DRM_ERROR("Mode doesn't fit in vram size (vgamem)");
return -EINVAL;
}
 
return 0;
 }
 
+static int qxl_primary_apply_cursor(struct drm_plane *plane)
+{
+   struct drm_device *dev = plane->dev;
+   struct qxl_device *qdev = dev->dev_private;
+   struct drm_framebuffer *fb = plane->state->fb;
+   struct qxl_crtc *qcrtc = to_qxl_crtc(plane->state->crtc);
+   struct qxl_cursor_cmd *cmd;
+   struct qxl_release *release;
+   int ret = 0;
+
+   if (!qcrtc->cursor_bo)
+   return 0;
+
+   ret = 

Re: [PATCH 09/13] staging: sm750fb: use simpler remove_conflicting_pci_framebuffers()

2017-11-27 Thread Sudip Mukherjee
On Mon, Nov 27, 2017 at 11:25:05AM +0100, Daniel Vetter wrote:
> On Fri, Nov 24, 2017 at 06:53:33PM +0100, Michał Mirosław wrote:
> > Signed-off-by: Michał Mirosław 
> > ---
> 
> Why exactly do we have an fbdev driver in staging? Afaiui fbdev is
> entirely closed for new drivers (pls convert to an atomic drm driver
> instead, it likely will be smaller even).

This is in staging for many days now, it was added to staging even
before Tomi announced that he will not accept any new drivers in fbdev.

Converting it to drm driver is the plan and I will have a look into it.

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


Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

2017-11-27 Thread Sudip Mukherjee
On Mon, Nov 27, 2017 at 11:27:59AM +0100, Daniel Vetter wrote:
> On Fri, Nov 24, 2017 at 06:53:31PM +0100, Michał Mirosław wrote:
> > Almost all drivers using remove_conflicting_framebuffers() wrap it with
> > the same code. Extract common part from PCI drivers into separate
> > remove_conflicting_pci_framebuffers().
> > 
> > Signed-off-by: Michał Mirosław 
> 
> Since the only driver that seems to use this is the staging one, which imo
> is a DOA project, not sure it's worth to bother with this here.

afaik, this device is used in production by few manufacturers and it is
usefull for them to have it in the tree and the only reason it is still
in staging is because Tomi announced he will not take any new drivers in
fbdev. And, so I have not taken the initiative to properly move it out
of staging. I think Bartlomiej will also not accept new drivers in fbdev.


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


[Bug 103743] Nier:Automata - "if" in fragment shader incorrectly evaluated, causes artifacts

2017-11-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103743

--- Comment #6 from Nicolai Hähnle  ---
Thanks. To give you an update, this is a super subtle control flow handling bug
in LLVM -- and the difference between the original shader and your modification
at the LLVM input is merely that the sense of one branch is (correctly)
inverted, leading LLVM down a subtly different path in the end.

A sledge-hammer fix is quite simple, but I'm still thinking about how to get a
better fix which doesn't pessimize a bunch of cases.

-- 
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 103783] atombios stuck in loop for more than 5secs

2017-11-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103783

--- Comment #12 from vkr...@yahoo.com ---
Uninstalling tlp and tlp-rdw packages eliminates the error. 

What I don't get is that runtime pm for amggpu driver is supposed to be
disabled by default according to TLP docs.

I'll try reinstalling TLP and follow the TLP troubleshooting guide to see
exactly what setting is causing this.

-- 
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 libdrm] Android: disable warnings causing errors

2017-11-27 Thread Rob Herring
AOSP master has changed the build default to -Werror making all the
warnings errors. Override that with -Wno-error.

Signed-off-by: Rob Herring 
---
 Android.common.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Android.common.mk b/Android.common.mk
index d487acb95fd4..e3de1069dfad 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -5,6 +5,7 @@ LOCAL_CFLAGS += \
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
 
 LOCAL_CFLAGS += \
+   -Wno-error \
-Wno-unused-parameter \
-Wno-missing-field-initializers \
-Wno-pointer-arith \
-- 
2.14.1

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


Re: [PATCH] drm/amd/display: Fix potential NULL pointer dereferences in amdgpu_dm_atomic_commit_tail

2017-11-27 Thread Harry Wentland
On 2017-11-27 09:57 AM, Gustavo A. R. Silva wrote:
> dm_new_crtc_state->stream and disconnected_acrtc are being dereferenced
> before they are null checked, hence there is a potential null pointer
> dereference.
> 
> Fix this by null checking such pointers before they are dereferenced.
> 
> Addresses-Coverity-ID: 1423745 ("Dereference before null check")
> Addresses-Coverity-ID: 1423833 ("Dereference before null check")
> Fixes: e7b07ceef2a6 ("drm/amd/display: Merge amdgpu_dm_types and amdgpu_dm")
> Fixes: 54d765752467 ("drm/amd/display: Unify amdgpu_dm state variable 
> namings.")
> Signed-off-by: Gustavo A. R. Silva 
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 +++-
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 889ed24..3bdd137 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -4190,6 +4190,9 @@ static void amdgpu_dm_atomic_commit_tail(struct 
> drm_atomic_state *state)
>  
>   dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
>  
> + if (!dm_new_crtc_state->stream)
> + continue;
> +
>   
> update_stream_scaling_settings(_new_con_state->base.crtc->mode,
>   dm_new_con_state, (struct dc_stream_state 
> *)dm_new_crtc_state->stream);
>  
> @@ -4197,9 +4200,6 @@ static void amdgpu_dm_atomic_commit_tail(struct 
> drm_atomic_state *state)
>   WARN_ON(!status);
>   WARN_ON(!status->plane_count);
>  
> - if (!dm_new_crtc_state->stream)
> - continue;
> -
>   /*TODO How it works with MPO ?*/
>   if (!dc_commit_planes_to_stream(
>   dm->dc,
> @@ -4332,9 +4332,11 @@ void dm_restore_drm_connector_state(struct drm_device 
> *dev,
>   return;
>  
>   disconnected_acrtc = to_amdgpu_crtc(connector->encoder->crtc);
> - acrtc_state = to_dm_crtc_state(disconnected_acrtc->base.state);
> + if (!disconnected_acrtc)
> + return;
>  
> - if (!disconnected_acrtc || !acrtc_state->stream)
> + acrtc_state = to_dm_crtc_state(disconnected_acrtc->base.state);
> + if (!acrtc_state->stream)
>   return;

This part is already in 
https://lists.freedesktop.org/archives/amd-gfx/2017-November/016389.html on its 
way to be merged.

The rest of the patch is
Reviewed-by: Harry Wentland 

Harry

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


Re: [PATCH] omapfb/dss: Delete an error message for a failed memory allocation in three functions

2017-11-27 Thread Joe Perches
On Mon, 2017-11-27 at 10:43 -0600, Andrew F. Davis wrote:
> On 11/26/2017 12:55 PM, SF Markus Elfring wrote:
> > From: Markus Elfring 
> > Date: Sun, 26 Nov 2017 19:46:09 +0100
> > 
> > Omit an extra message for a memory allocation failure in these functions.
> > 
> > This issue was detected by using the Coccinelle software.
> > 
> > Signed-off-by: Markus Elfring 
> > ---
> 
> nak, unlike many others, these message give extra info on which
> allocation failed, that can be useful.

  Not really.  There are tradeoffs.

There is the generic stack dump on OOM so the module/line
is already known.

The existence of these messages increases code size which
also make the OOM condition slightly more likely.

These are generally used only at initialization and those
if you are OOM at initialization, bad things happen anyway
so where the specific OOM occurred doesn't really matter.

Markus' commit messages are always really poor descriptions
of why these removals are somewhat useful and the commit
could/should/might be applied.

Your choice.

> >  drivers/video/fbdev/omap2/omapfb/dss/dispc.c| 4 +---
> >  drivers/video/fbdev/omap2/omapfb/dss/dss.c  | 4 +---
> >  drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c | 4 +---
> >  3 files changed, 3 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c 
> > b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c
> > index 7a75dfda9845..10164a3bae4a 100644
> > --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c
> > +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c
> > @@ -3982,10 +3982,8 @@ static int dispc_init_features(struct 
> > platform_device *pdev)
> > struct dispc_features *dst;
> >  
> > dst = devm_kzalloc(>dev, sizeof(*dst), GFP_KERNEL);
> > -   if (!dst) {
> > -   dev_err(>dev, "Failed to allocate DISPC Features\n");
> > +   if (!dst)
> > return -ENOMEM;
> > -   }
> >  
> > switch (omapdss_get_version()) {
> > case OMAPDSS_VER_OMAP24xx:
> > diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c 
> > b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
> > index 48c6500c24e1..a5de13777e2b 100644
> > --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c
> > +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
> > @@ -893,10 +893,8 @@ static int dss_init_features(struct platform_device 
> > *pdev)
> > struct dss_features *dst;
> >  
> > dst = devm_kzalloc(>dev, sizeof(*dst), GFP_KERNEL);
> > -   if (!dst) {
> > -   dev_err(>dev, "Failed to allocate local DSS Features\n");
> > +   if (!dst)
> > return -ENOMEM;
> > -   }
> >  
> > switch (omapdss_get_version()) {
> > case OMAPDSS_VER_OMAP24xx:
> > diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c 
> > b/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c
> > index 9a13c35fd6d8..d25eea10c665 100644
> > --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c
> > +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c
> > @@ -195,10 +195,8 @@ static int hdmi_phy_init_features(struct 
> > platform_device *pdev)
> > const struct hdmi_phy_features *src;
> >  
> > dst = devm_kzalloc(>dev, sizeof(*dst), GFP_KERNEL);
> > -   if (!dst) {
> > -   dev_err(>dev, "Failed to allocate HDMI PHY Features\n");
> > +   if (!dst)
> > return -ENOMEM;
> > -   }
> >  
> > switch (omapdss_get_version()) {
> > case OMAPDSS_VER_OMAP4430_ES1:
> > 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: omapfb/dss: Delete an error message for a failed memory allocation in three functions

2017-11-27 Thread Geert Uytterhoeven
Hi Markus,

On Mon, Nov 27, 2017 at 7:12 PM, SF Markus Elfring
 wrote:
>>> Can a default allocation failure report provide the information
>>> which you might expect so far?
>>
>> You should be able to answer that question yourself.
>
> I can not answer this detail completely myself because my knowledge
> is incomplete about your concrete expectations for the exception handling
> which can lead to different views for the need of additional error messages.

It may be a good idea to try to trigger an out-of-memory condition yourself,
and see what happens?

>> And if you are unable to do so, just do not sent changes pointed
>> by any code analysis tools.
>
> They can point aspects out for further software development considerations,
> can't they?

Sure. But I think it is a good experience to witness what can happen if you
"violate" these "coding standards written by other people", and learn to
understand why they were written, increasing your own knowledge.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 100387] War Thunder game has visual errors, missing textures

2017-11-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=100387

--- Comment #20 from russianneuroman...@ya.ru ---
Possibly this bug is duplicate of bug 99349

-- 
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 103913] DRM/Radeon GPU hang

2017-11-27 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103913

--- Comment #2 from ro...@beardandsandals.co.uk ---
No applications are running other than gnome desktop itself. I doubt this
actually a real GPU hang, that is just what it says in the syslog messages. Are
fences used by the driver for anything other than communicating with the GPU?

I can trigger this by pulling out the HDMI cable and sticking it back in again.

I will do some more tests over the next couple of days.

Roger

-- 
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: omapfb/dss: Delete an error message for a failed memory allocation in three functions

2017-11-27 Thread SF Markus Elfring
>> Can a default allocation failure report provide the information
>> which you might expect so far?
> 
> You should be able to answer that question yourself.

I can not answer this detail completely myself because my knowledge
is incomplete about your concrete expectations for the exception handling
which can lead to different views for the need of additional error messages.


> And if you are unable to do so, just do not sent changes pointed
> by any code analysis tools.

They can point aspects out for further software development considerations,
can't they?


> As a side note, if you look at whole call chain, you'll find quite some
> room for optimizations - look how dev and pdev are used. That also applies
> to other patches.

Would you prefer to improve the source code in other ways?

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


Re: [PATCH 2/2] video: s3c-fb: Improve a size determination in s3c_fb_probe()

2017-11-27 Thread Jingoo Han
On Sunday, November 26, 2017 9:18 AM, SF Markus Elfring wrote:
> 
> From: Markus Elfring 
> Date: Sun, 26 Nov 2017 15:03:03 +0100
> 
> Replace the specification of a data structure by a pointer dereference
> as the parameter for the operator "sizeof" to make the corresponding size
> determination a bit safer according to the Linux coding style convention.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring 

Acked-by: Jingoo Han 

Best regards,
Jingoo Han

> ---
>  drivers/video/fbdev/s3c-fb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c
> index 0914c973cbd9..8c7623d63eb1 100644
> --- a/drivers/video/fbdev/s3c-fb.c
> +++ b/drivers/video/fbdev/s3c-fb.c
> @@ -1383,7 +1383,7 @@ static int s3c_fb_probe(struct platform_device *pdev)
>   return -EINVAL;
>   }
> 
> - sfb = devm_kzalloc(dev, sizeof(struct s3c_fb), GFP_KERNEL);
> + sfb = devm_kzalloc(dev, sizeof(*sfb), GFP_KERNEL);
>   if (!sfb)
>   return -ENOMEM;
> 
> --
> 2.15.0


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


Re: [PATCH 1/2] video: s3c-fb: Delete an error message for a failed memory allocation in s3c_fb_probe()

2017-11-27 Thread Jingoo Han
On Sunday, November 26, 2017 9:17 AM, SF Markus Elfring wrote:
> 
> From: Markus Elfring 
> Date: Sun, 26 Nov 2017 15:00:16 +0100
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring 

Acked-by: Jingoo Han 

Best regards,
Jingoo Han

> ---
>  drivers/video/fbdev/s3c-fb.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c
> index 5f4f696c2ecf..0914c973cbd9 100644
> --- a/drivers/video/fbdev/s3c-fb.c
> +++ b/drivers/video/fbdev/s3c-fb.c
> @@ -1384,10 +1384,8 @@ static int s3c_fb_probe(struct platform_device
> *pdev)
>   }
> 
>   sfb = devm_kzalloc(dev, sizeof(struct s3c_fb), GFP_KERNEL);
> - if (!sfb) {
> - dev_err(dev, "no memory for framebuffers\n");
> + if (!sfb)
>   return -ENOMEM;
> - }
> 
>   dev_dbg(dev, "allocate new framebuffer %p\n", sfb);
> 
> --
> 2.15.0


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


Re: [PATCH] PCI: use dev_info rather than dev_err for rom validation

2017-11-27 Thread Alex Deucher
On Mon, Nov 27, 2017 at 1:00 PM, Michel Dänzer  wrote:
> On 2017-11-27 06:21 PM, Alex Deucher wrote:
>> On AMD GPUs, we use several mechanisms to fetch the vbios
>> rom depending on the platform.  We try to read the rom
>> back via the rom BAR and fall back to other methods in
>> some cases.  This leads to spurious error messages
>> from the pci rom code which are harmless in our case.
>> This leads to bugs being files, etc.  Change these to
>> dev_info rather than dev_err to avoid that.
>
> Does dev_info still print the message by default though? If so, I wonder
> if this will change anything in practice...

It will still show up, just not as an error so if you are filtering on
errors, you won't see it.

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


[PATCH 3/3] video: au1100fb: Delete an unnecessary variable initialisation in au1100fb_drv_probe()

2017-11-27 Thread SF Markus Elfring
From: Markus Elfring 
Date: Mon, 27 Nov 2017 18:40:23 +0100

The local variable "fbdev" will be reassigned by a following statement.
Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring 
---
 drivers/video/fbdev/au1100fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index 1e5b872f0da6..7c9a672e9811 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -410,7 +410,7 @@ static int au1100fb_setup(struct au1100fb_device *fbdev)
 
 static int au1100fb_drv_probe(struct platform_device *dev)
 {
-   struct au1100fb_device *fbdev = NULL;
+   struct au1100fb_device *fbdev;
struct resource *regs_res;
unsigned long page;
struct clk *c;
-- 
2.15.0

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


Re: [PATCH] PCI: use dev_info rather than dev_err for rom validation

2017-11-27 Thread Michel Dänzer
On 2017-11-27 06:21 PM, Alex Deucher wrote:
> On AMD GPUs, we use several mechanisms to fetch the vbios
> rom depending on the platform.  We try to read the rom
> back via the rom BAR and fall back to other methods in
> some cases.  This leads to spurious error messages
> from the pci rom code which are harmless in our case.
> This leads to bugs being files, etc.  Change these to
> dev_info rather than dev_err to avoid that.

Does dev_info still print the message by default though? If so, I wonder
if this will change anything in practice...


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/3] video: au1100fb: Improve a size determination in au1100fb_drv_probe()

2017-11-27 Thread SF Markus Elfring
From: Markus Elfring 
Date: Mon, 27 Nov 2017 18:18:34 +0100

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 drivers/video/fbdev/au1100fb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index cae17d02d804..1e5b872f0da6 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -416,8 +416,7 @@ static int au1100fb_drv_probe(struct platform_device *dev)
struct clk *c;
 
/* Allocate new device private */
-   fbdev = devm_kzalloc(>dev, sizeof(struct au1100fb_device),
-GFP_KERNEL);
+   fbdev = devm_kzalloc(>dev, sizeof(*fbdev), GFP_KERNEL);
if (!fbdev)
return -ENOMEM;
 
-- 
2.15.0

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


[PATCH 1/3] video: au1100fb: Delete an error message for a failed memory allocation in au1100fb_drv_probe()

2017-11-27 Thread SF Markus Elfring
From: Markus Elfring 
Date: Mon, 27 Nov 2017 18:14:41 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 drivers/video/fbdev/au1100fb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index 8de42f617d16..cae17d02d804 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -418,10 +418,8 @@ static int au1100fb_drv_probe(struct platform_device *dev)
/* Allocate new device private */
fbdev = devm_kzalloc(>dev, sizeof(struct au1100fb_device),
 GFP_KERNEL);
-   if (!fbdev) {
-   print_err("fail to allocate device private record");
+   if (!fbdev)
return -ENOMEM;
-   }
 
if (au1100fb_setup(fbdev))
goto failed;
-- 
2.15.0

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


[PATCH 0/3] video/fbdev/au1100fb: Adjustments for au1100fb_drv_probe()

2017-11-27 Thread SF Markus Elfring
From: Markus Elfring 
Date: Mon, 27 Nov 2017 18:53:21 +0100

Three update suggestions were taken into account
from static source code analysis.

Markus Elfring (3):
  Delete an error message for a failed memory allocation
  Improve a size determination
  Delete an unnecessary variable initialisation

 drivers/video/fbdev/au1100fb.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

-- 
2.15.0

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


GPF with kernel 4.15-rc1, and display locks up

2017-11-27 Thread Mike Keehan
Hi,

I am getting a General Protection Fault on 4.15-rc1, and the X11 screen
locks up.


Nov 27 10:16:37 babelfish kernel: Call Trace:
Nov 27 10:16:37 babelfish kernel:  ?
__i915_gem_object_flush_for_display+0x13/0x40 [i915]
Nov 27 10:16:37 babelfish kernel:
i915_gem_object_wait_priority+0xb2/0x170 [i915]
Nov 27 10:16:37 babelfish kernel:  intel_prepare_plane_fb+0x16e/0x2e0
[i915]
Nov 27 10:16:37 babelfish kernel:
drm_atomic_helper_prepare_planes+0x4c/0xd0
Nov 27 10:16:37 babelfish kernel:  intel_atomic_commit+0xa3/0x280 [i915]
Nov 27 10:16:37 babelfish kernel:  drm_atomic_helper_page_flip+0x7c/0x90
Nov 27 10:16:37 babelfish kernel:  drm_mode_page_flip_ioctl+0x4c2/0x530
Nov 27 10:16:37 babelfish kernel:  ? drm_mode_cursor2_ioctl+0x10/0x10
Nov 27 10:16:37 babelfish kernel:  drm_ioctl_kernel+0x59/0xb0
Nov 27 10:16:37 babelfish kernel:  drm_ioctl+0x2cb/0x380
Nov 27 10:16:37 babelfish kernel:  ? drm_mode_cursor2_ioctl+0x10/0x10
Nov 27 10:16:37 babelfish kernel:  ? vfs_writev+0xb9/0x110
Nov 27 10:16:37 babelfish kernel:  do_vfs_ioctl+0xa1/0x610
Nov 27 10:16:37 babelfish kernel:  SyS_ioctl+0x74/0x80
Nov 27 10:16:37 babelfish kernel:  entry_SYSCALL_64_fastpath+0x13/0x6c

I have attached the full GPF trace.

(Haven't tried to login with ssh yet.)

Mike.




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


Re: [PATCH] video: fsl-diu-fb: Delete an error message for a failed memory allocation in fsl_diu_init()

2017-11-27 Thread Timur Tabi

On 11/27/17 3:00 AM, SF Markus Elfring wrote:

From: Markus Elfring
Date: Mon, 27 Nov 2017 09:56:09 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring


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


[PATCH] drm/amd/display: Fix potential NULL pointer dereferences in amdgpu_dm_atomic_commit_tail

2017-11-27 Thread Gustavo A. R. Silva
dm_new_crtc_state->stream and disconnected_acrtc are being dereferenced
before they are null checked, hence there is a potential null pointer
dereference.

Fix this by null checking such pointers before they are dereferenced.

Addresses-Coverity-ID: 1423745 ("Dereference before null check")
Addresses-Coverity-ID: 1423833 ("Dereference before null check")
Fixes: e7b07ceef2a6 ("drm/amd/display: Merge amdgpu_dm_types and amdgpu_dm")
Fixes: 54d765752467 ("drm/amd/display: Unify amdgpu_dm state variable namings.")
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 889ed24..3bdd137 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4190,6 +4190,9 @@ static void amdgpu_dm_atomic_commit_tail(struct 
drm_atomic_state *state)
 
dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
 
+   if (!dm_new_crtc_state->stream)
+   continue;
+

update_stream_scaling_settings(_new_con_state->base.crtc->mode,
dm_new_con_state, (struct dc_stream_state 
*)dm_new_crtc_state->stream);
 
@@ -4197,9 +4200,6 @@ static void amdgpu_dm_atomic_commit_tail(struct 
drm_atomic_state *state)
WARN_ON(!status);
WARN_ON(!status->plane_count);
 
-   if (!dm_new_crtc_state->stream)
-   continue;
-
/*TODO How it works with MPO ?*/
if (!dc_commit_planes_to_stream(
dm->dc,
@@ -4332,9 +4332,11 @@ void dm_restore_drm_connector_state(struct drm_device 
*dev,
return;
 
disconnected_acrtc = to_amdgpu_crtc(connector->encoder->crtc);
-   acrtc_state = to_dm_crtc_state(disconnected_acrtc->base.state);
+   if (!disconnected_acrtc)
+   return;
 
-   if (!disconnected_acrtc || !acrtc_state->stream)
+   acrtc_state = to_dm_crtc_state(disconnected_acrtc->base.state);
+   if (!acrtc_state->stream)
return;
 
/*
-- 
2.7.4

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


[PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()

2017-11-27 Thread Sinan Kaya
pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Extract the domain number from drm_device and pass it into
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya 
---
 drivers/gpu/drm/i915/i915_drv.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 9f45cfe..5a8cb79 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void 
*data,
 
 static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
 {
-   dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+   int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
+
+   dev_priv->bridge_dev =
+   pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
if (!dev_priv->bridge_dev) {
DRM_ERROR("bridge device not found\n");
return -1;
-- 
1.9.1

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


[PATCH V3 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()

2017-11-27 Thread Sinan Kaya
pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from
1. struct pci_dev
2. struct pci_dev through drm_device->pdev
3. struct pci_dev through fb->subdev->drm_device->pdev

Signed-off-by: Sinan Kaya 
---
 drivers/gpu/drm/nouveau/dispnv04/arb.c   |  4 +++-
 drivers/gpu/drm/nouveau/dispnv04/hw.c| 10 +++---
 drivers/gpu/drm/nouveau/nouveau_drm.c|  3 ++-
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c | 10 +-
 4 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv04/arb.c 
b/drivers/gpu/drm/nouveau/dispnv04/arb.c
index 90075b6..c79160c 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/arb.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/arb.c
@@ -213,8 +213,10 @@ struct nv_sim_state {
if ((dev->pdev->device & 0x) == 0x01a0 /*CHIPSET_NFORCE*/ ||
(dev->pdev->device & 0x) == 0x01f0 /*CHIPSET_NFORCE2*/) {
uint32_t type;
+   int domain = pci_domain_nr(dev->pdev->bus);
 
-   pci_read_config_dword(pci_get_bus_and_slot(0, 1), 0x7c, );
+   pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 1),
+ 0x7c, );
 
sim_data.memory_type = (type >> 12) & 1;
sim_data.memory_width = 64;
diff --git a/drivers/gpu/drm/nouveau/dispnv04/hw.c 
b/drivers/gpu/drm/nouveau/dispnv04/hw.c
index b985990..0c9bdf0 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/hw.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/hw.c
@@ -216,12 +216,15 @@
 {
struct nvkm_pll_vals pllvals;
int ret;
+   int domain;
+
+   domain = pci_domain_nr(dev->pdev->bus);
 
if (plltype == PLL_MEMORY &&
(dev->pdev->device & 0x0ff0) == CHIPSET_NFORCE) {
uint32_t mpllP;
-
-   pci_read_config_dword(pci_get_bus_and_slot(0, 3), 0x6c, );
+   pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 3),
+ 0x6c, );
mpllP = (mpllP >> 8) & 0xf;
if (!mpllP)
mpllP = 4;
@@ -232,7 +235,8 @@
(dev->pdev->device & 0xff0) == CHIPSET_NFORCE2) {
uint32_t clock;
 
-   pci_read_config_dword(pci_get_bus_and_slot(0, 5), 0x4c, );
+   pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 5),
+ 0x4c, );
return clock / 1000;
}
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c 
b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 595630d..0b6c639 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -406,7 +406,8 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
}
 
/* subfunction one is a hdmi audio device? */
-   drm->hdmi_device = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
+   drm->hdmi_device = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+   (unsigned int)pdev->bus->number,

PCI_DEVFN(PCI_SLOT(pdev->devfn), 1));
 
if (!drm->hdmi_device) {
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
index 3c6a871..8849b71 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
@@ -28,8 +28,16 @@
 {
struct pci_dev *bridge;
u32 mem, mib;
+   int domain = 0;
+   struct pci_dev *pdev = NULL;
 
-   bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 1));
+   if (dev_is_pci(fb->subdev.device->dev))
+   pdev = to_pci_dev(fb->subdev.device->dev);
+
+   if (pdev)
+   domain = pci_domain_nr(pdev->bus);
+
+   bridge = pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 1));
if (!bridge) {
nvkm_error(>subdev, "no bridge device\n");
return -ENODEV;
-- 
1.9.1

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


Re: [PATCH v2 05/18] drm/sun4i: Force the mixer rate at 150MHz

2017-11-27 Thread Jernej Škrabec
Hi Maxime,

Dne ponedeljek, 27. november 2017 ob 16:41:29 CET je Maxime Ripard napisal(a):
> It seems like the mixer can only run properly when clocked at 150MHz. In
> order to have something more robust than simply a fire-and-forget
> assigned-clocks-rate, let's put that in the code.
> 
> Signed-off-by: Maxime Ripard 
> ---
>  drivers/gpu/drm/sun4i/sun8i_mixer.c | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c
> b/drivers/gpu/drm/sun4i/sun8i_mixer.c index cb193c5f1686..c0cdccf772a2
> 100644
> --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
> +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
> @@ -315,6 +315,13 @@ static int sun8i_mixer_bind(struct device *dev, struct
> device *master, }
>   clk_prepare_enable(mixer->mod_clk);
> 
> + /*
> +  * It seems that we need to enforce that rate for whatever
> +  * reason for the mixer to be functional. Make sure it's the
> +  * case.
> +  */
> + clk_set_rate(mixer->mod_clk, 15000);
> +

H3 mixer works at much higher rate and if we want to support tv out, it must 
be dividable by 432 MHz, so either 432 MHz or maybe even 864 MHz.

We talked about that few months ago.

I guess this should be read from mixer configuration structure.

Best regards,
Jernej

>   list_add_tail(>engine.list, >engine_list);
> 
>   /* Reset the registers */
> --
> git-series 0.9.1


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


Re: [PATCH] omapfb/dss: Delete an error message for a failed memory allocation in three functions

2017-11-27 Thread Andrew F. Davis
On 11/26/2017 12:55 PM, SF Markus Elfring wrote:
> From: Markus Elfring 
> Date: Sun, 26 Nov 2017 19:46:09 +0100
> 
> Omit an extra message for a memory allocation failure in these functions.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring 
> ---

nak, unlike many others, these message give extra info on which
allocation failed, that can be useful.

>  drivers/video/fbdev/omap2/omapfb/dss/dispc.c| 4 +---
>  drivers/video/fbdev/omap2/omapfb/dss/dss.c  | 4 +---
>  drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c | 4 +---
>  3 files changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c 
> b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c
> index 7a75dfda9845..10164a3bae4a 100644
> --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c
> +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c
> @@ -3982,10 +3982,8 @@ static int dispc_init_features(struct platform_device 
> *pdev)
>   struct dispc_features *dst;
>  
>   dst = devm_kzalloc(>dev, sizeof(*dst), GFP_KERNEL);
> - if (!dst) {
> - dev_err(>dev, "Failed to allocate DISPC Features\n");
> + if (!dst)
>   return -ENOMEM;
> - }
>  
>   switch (omapdss_get_version()) {
>   case OMAPDSS_VER_OMAP24xx:
> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c 
> b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
> index 48c6500c24e1..a5de13777e2b 100644
> --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c
> +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
> @@ -893,10 +893,8 @@ static int dss_init_features(struct platform_device 
> *pdev)
>   struct dss_features *dst;
>  
>   dst = devm_kzalloc(>dev, sizeof(*dst), GFP_KERNEL);
> - if (!dst) {
> - dev_err(>dev, "Failed to allocate local DSS Features\n");
> + if (!dst)
>   return -ENOMEM;
> - }
>  
>   switch (omapdss_get_version()) {
>   case OMAPDSS_VER_OMAP24xx:
> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c 
> b/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c
> index 9a13c35fd6d8..d25eea10c665 100644
> --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c
> +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c
> @@ -195,10 +195,8 @@ static int hdmi_phy_init_features(struct platform_device 
> *pdev)
>   const struct hdmi_phy_features *src;
>  
>   dst = devm_kzalloc(>dev, sizeof(*dst), GFP_KERNEL);
> - if (!dst) {
> - dev_err(>dev, "Failed to allocate HDMI PHY Features\n");
> + if (!dst)
>   return -ENOMEM;
> - }
>  
>   switch (omapdss_get_version()) {
>   case OMAPDSS_VER_OMAP4430_ES1:
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 11/18] drm/sun4i: Add A83T support

2017-11-27 Thread Jernej Škrabec
Hi Maxime,

Dne ponedeljek, 27. november 2017 ob 16:41:35 CET je Maxime Ripard napisal(a):
> Add support for the A83T display pipeline.
> 
> Reviewed-by: Chen-Yu Tsai 
> Signed-off-by: Maxime Ripard 
> ---
>  Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 3 +++
>  drivers/gpu/drm/sun4i/sun4i_drv.c | 2 ++
>  drivers/gpu/drm/sun4i/sun4i_tcon.c| 5 +
>  drivers/gpu/drm/sun4i/sun8i_mixer.c   | 4 
>  4 files changed, 14 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
> b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt index
> d4259a4f5171..d6b52e5c48c0 100644
> --- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
> +++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
> @@ -93,6 +93,7 @@ Required properties:
> * allwinner,sun6i-a31s-tcon
> * allwinner,sun7i-a20-tcon
> * allwinner,sun8i-a33-tcon
> +   * allwinner,sun8i-a83t-tcon-lcd
> * allwinner,sun8i-v3s-tcon
>   - reg: base address and size of memory-mapped region
>   - interrupts: interrupt associated to this IP
> @@ -224,6 +225,7 @@ supported.
> 
>  Required properties:
>- compatible: value must be one of:
> +* allwinner,sun8i-a83t-de2-mixer

What will be the name of the second mixer, once support for HDMI is added? 
Should we start directly with 0 and 1 postfix ?

>  * allwinner,sun8i-v3s-de2-mixer
>- reg: base address and size of the memory-mapped region.
>- clocks: phandles to the clocks feeding the mixer
> @@ -253,6 +255,7 @@ Required properties:
>  * allwinner,sun6i-a31s-display-engine
>  * allwinner,sun7i-a20-display-engine
>  * allwinner,sun8i-a33-display-engine
> +* allwinner,sun8i-a83t-display-engine
>  * allwinner,sun8i-v3s-display-engine
> 
>- allwinner,pipelines: list of phandle to the display engine
> diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c
> b/drivers/gpu/drm/sun4i/sun4i_drv.c index 75c76cdd82bc..c418be2f22be 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_drv.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
> @@ -193,6 +193,7 @@ static bool sun4i_drv_node_is_tcon(struct device_node
> *node) of_device_is_compatible(node, "allwinner,sun6i-a31s-tcon") ||
>   of_device_is_compatible(node, "allwinner,sun7i-a20-tcon") ||
>   of_device_is_compatible(node, "allwinner,sun8i-a33-tcon") ||
> + of_device_is_compatible(node, "allwinner,sun8i-a83t-tcon-lcd") 
> ||
>   of_device_is_compatible(node, "allwinner,sun8i-v3s-tcon");
>  }
> 
> @@ -353,6 +354,7 @@ static const struct of_device_id sun4i_drv_of_table[] =
> { { .compatible = "allwinner,sun6i-a31s-display-engine" },
>   { .compatible = "allwinner,sun7i-a20-display-engine" },
>   { .compatible = "allwinner,sun8i-a33-display-engine" },
> + { .compatible = "allwinner,sun8i-a83t-display-engine" },
>   { .compatible = "allwinner,sun8i-v3s-display-engine" },
>   { }
>  };
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> b/drivers/gpu/drm/sun4i/sun4i_tcon.c index 46ce6daa0b1a..871df75793a9
> 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -1132,6 +1132,10 @@ static const struct sun4i_tcon_quirks
> sun8i_a33_quirks = { .has_lvds_pll= true,
>  };
> 
> +static const struct sun4i_tcon_quirks sun8i_a83t_quirks = {
> + /* nothing is supported */
> +};
> +
>  static const struct sun4i_tcon_quirks sun8i_v3s_quirks = {
>   /* nothing is supported */
>  };
> @@ -1143,6 +1147,7 @@ static const struct of_device_id sun4i_tcon_of_table[]
> = { { .compatible = "allwinner,sun6i-a31s-tcon", .data = _a31s_quirks
> }, { .compatible = "allwinner,sun7i-a20-tcon", .data = _a20_quirks },
> { .compatible = "allwinner,sun8i-a33-tcon", .data = _a33_quirks },
> + { .compatible = "allwinner,sun8i-a83t-tcon-lcd", .data =
> _a83t_quirks }, { .compatible = "allwinner,sun8i-v3s-tcon", .data =
> _v3s_quirks }, { }
>  };
> diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c
> b/drivers/gpu/drm/sun4i/sun8i_mixer.c index 44d5e639ebb2..5a1376965270
> 100644
> --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
> +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
> @@ -395,6 +395,10 @@ static const struct sun8i_mixer_cfg sun8i_v3s_mixer_cfg
> = {
> 
>  static const struct of_device_id sun8i_mixer_of_table[] = {
>   {
> + .compatible = "allwinner,sun8i-a83t-de2-mixer",
> + .data = _v3s_mixer_cfg,
> + },
> + {

Maybe you want to squash 12 patch since this works only by luck.

Best regards,
Jernej

>   .compatible = "allwinner,sun8i-v3s-de2-mixer",
>   .data = _v3s_mixer_cfg,
>   },
> --
> git-series 0.9.1


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


Re: [PATCH v2 00/18] drm/sun4i: Add A83t LVDS support

2017-11-27 Thread Jernej Škrabec
Hi,

Dne ponedeljek, 27. november 2017 ob 16:41:24 CET je Maxime Ripard napisal(a):
> Hi,
> 
> Here is an attempt at supporting the LVDS output in our DRM driver. This
> has been tested on the A83T (with DE2), but since everything is basically
> in the TCON, it should also be usable on the older SoCs with minor
> modifications.
> 
> This was the occasion to refactor a bunch of things. The most notable ones
> would be the documentation, and split of the UI layers in the mixer code,

I'm just about to send my series of patches which would add full support for 
UI and VI planes (multi planes, HW scaling, all color formats). It would clash 
with your patches 6, 7 and 8.

Preview of my work as a single patch can be seen here:
https://github.com/jernejsk/linux-1/commit/
8fdef3b510b567bfe81c87b0c3e73ddcf4f5b711

How would you like to handle that? Some changes are similar, but I don't see a 
point rebasing my patches atop of yours.

Since I'm almost done, I will just send them and we can discuss them then.

Best regards,
Jernej

> and the switch to kfifo for our endpoint parsing code in the driver that
> fixes an issue introduced by the switch to BFS.
> 
> Let me know what you think,
> Maxime

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


Re: PROBLEM: Asus C201 video mode problems on HDMI hotplug (regression)

2017-11-27 Thread Nick Bowler
Hi,

On 11/27/17, Laurent Pinchart  wrote:
> The driver should print a "PHY PLL failed to lock" error message to the
> kernel log in that case. Nick, does that happen on your system ?

I will try to test the other things later today, but after bootup there
were no messages whatsoever printed to the kernel log during the test
procedure.

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


Re: omapfb/dss: Delete an error message for a failed memory allocation in three functions

2017-11-27 Thread SF Markus Elfring
>> Omit an extra message for a memory allocation failure in these functions.
…
> nak, unlike many others, these message give extra info on which
> allocation failed, that can be useful.

Can a default allocation failure report provide the information
which you might expect so far?

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


Re: [PATCH] PCI: use dev_info rather than dev_err for rom validation

2017-11-27 Thread Christian König

Am 27.11.2017 um 18:21 schrieb Alex Deucher:

On AMD GPUs, we use several mechanisms to fetch the vbios
rom depending on the platform.  We try to read the rom
back via the rom BAR and fall back to other methods in
some cases.  This leads to spurious error messages
from the pci rom code which are harmless in our case.
This leads to bugs being files, etc.  Change these to
dev_info rather than dev_err to avoid that.

Signed-off-by: Alex Deucher 


Reviewed-by: Christian König 


---
  drivers/pci/rom.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c
index b6edb187d160..7ab7c6bb17c6 100644
--- a/drivers/pci/rom.c
+++ b/drivers/pci/rom.c
@@ -92,14 +92,14 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem 
*rom, size_t size)
void __iomem *pds;
/* Standard PCI ROMs start out with these bytes 55 AA */
if (readw(image) != 0xAA55) {
-   dev_err(>dev, "Invalid PCI ROM header signature: 
expecting 0xaa55, got %#06x\n",
+   dev_info(>dev, "Invalid PCI ROM header signature: 
expecting 0xaa55, got %#06x\n",
readw(image));
break;
}
/* get the PCI data structure and check its "PCIR" signature */
pds = image + readw(image + 24);
if (readl(pds) != 0x52494350) {
-   dev_err(>dev, "Invalid PCI ROM data signature: 
expecting 0x52494350, got %#010x\n",
+   dev_info(>dev, "Invalid PCI ROM data signature: 
expecting 0x52494350, got %#010x\n",
readl(pds));
break;
}


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


[PATCH] PCI: use dev_info rather than dev_err for rom validation

2017-11-27 Thread Alex Deucher
On AMD GPUs, we use several mechanisms to fetch the vbios
rom depending on the platform.  We try to read the rom
back via the rom BAR and fall back to other methods in
some cases.  This leads to spurious error messages
from the pci rom code which are harmless in our case.
This leads to bugs being files, etc.  Change these to
dev_info rather than dev_err to avoid that.

Signed-off-by: Alex Deucher 
---
 drivers/pci/rom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c
index b6edb187d160..7ab7c6bb17c6 100644
--- a/drivers/pci/rom.c
+++ b/drivers/pci/rom.c
@@ -92,14 +92,14 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem 
*rom, size_t size)
void __iomem *pds;
/* Standard PCI ROMs start out with these bytes 55 AA */
if (readw(image) != 0xAA55) {
-   dev_err(>dev, "Invalid PCI ROM header signature: 
expecting 0xaa55, got %#06x\n",
+   dev_info(>dev, "Invalid PCI ROM header signature: 
expecting 0xaa55, got %#06x\n",
readw(image));
break;
}
/* get the PCI data structure and check its "PCIR" signature */
pds = image + readw(image + 24);
if (readl(pds) != 0x52494350) {
-   dev_err(>dev, "Invalid PCI ROM data signature: 
expecting 0x52494350, got %#010x\n",
+   dev_info(>dev, "Invalid PCI ROM data signature: 
expecting 0x52494350, got %#010x\n",
readl(pds));
break;
}
-- 
2.13.6

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


[PATCH] video: auo_k190x: Delete an error message for a failed memory allocation in auok190x_common_probe()

2017-11-27 Thread SF Markus Elfring
From: Markus Elfring 
Date: Mon, 27 Nov 2017 17:53:05 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 drivers/video/fbdev/auo_k190x.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/auo_k190x.c b/drivers/video/fbdev/auo_k190x.c
index 0d06038324e0..971d155d250f 100644
--- a/drivers/video/fbdev/auo_k190x.c
+++ b/drivers/video/fbdev/auo_k190x.c
@@ -1081,7 +1081,6 @@ int auok190x_common_probe(struct platform_device *pdev,
 sizeof(struct fb_deferred_io),
 GFP_KERNEL);
if (!info->fbdefio) {
-   dev_err(info->device, "Failed to allocate memory\n");
ret = -ENOMEM;
goto err_defio;
}
-- 
2.15.0

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


[PATCH v2] fbdev: pxa3xx: use ktime_get_ts64 for time stamps

2017-11-27 Thread Arnd Bergmann
do_gettimeofday() is deprecated because it is not y2038 safe, so I'm
changing the calculation for the diagnostic output over to using
'timespec64'.

We really only print time deltas here, so changing it to monotonic
time makes this more robust, the correct accessor for this is
ktime_get_ts64().

Signed-off-by: Arnd Bergmann 
---
v2: fix typo
---
 drivers/video/fbdev/pxa3xx-gcu.c | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c
index 55fbb432c053..0955622a1227 100644
--- a/drivers/video/fbdev/pxa3xx-gcu.c
+++ b/drivers/video/fbdev/pxa3xx-gcu.c
@@ -104,7 +104,7 @@ struct pxa3xx_gcu_priv {
wait_queue_head_t wait_idle;
wait_queue_head_t wait_free;
spinlock_tspinlock;
-   struct timevalbase_time;
+   struct timespec64 base_time;
 
struct pxa3xx_gcu_batch *free;
struct pxa3xx_gcu_batch *ready;
@@ -126,18 +126,20 @@ gc_writel(struct pxa3xx_gcu_priv *priv, unsigned int off, 
unsigned long val)
 
 #define QPRINT(priv, level, msg)   \
do {\
-   struct timeval tv;  \
+   struct timespec64 ts;   \
struct pxa3xx_gcu_shared *shared = priv->shared;\
u32 base = gc_readl(priv, REG_GCRBBR);  \
\
-   do_gettimeofday();   \
+   ktime_get_ts64();\
+   ts = timespec64_sub(ts, priv->base_time);   \
\
-   printk(level "%ld.%03ld.%03ld - %-17s: %-21s (%s, " \
+   printk(level "%lld.%03ld.%03ld - %-17s: %-21s (%s, "\
"STATUS "   \
"0x%02lx, B 0x%08lx [%ld], E %5ld, H %5ld, "\
"T %5ld)\n",\
-   tv.tv_sec - priv->base_time.tv_sec, \
-   tv.tv_usec / 1000, tv.tv_usec % 1000,   \
+   (s64)(ts.tv_sec),   \
+   ts.tv_nsec / NSEC_PER_MSEC, \
+   (ts.tv_nsec % NSEC_PER_MSEC) / USEC_PER_MSEC,   \
__func__, msg,  \
shared->hw_running ? "running" : "   idle", \
gc_readl(priv, REG_GCISCR), \
@@ -164,7 +166,7 @@ pxa3xx_gcu_reset(struct pxa3xx_gcu_priv *priv)
priv->shared->buffer_phys = priv->shared_phys;
priv->shared->magic = PXA3XX_GCU_SHARED_MAGIC;
 
-   do_gettimeofday(>base_time);
+   ktime_get_ts64(>base_time);
 
/* set up the ring buffer pointers */
gc_writel(priv, REG_GCRBLR, 0);
-- 
2.9.0

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


[PATCH] video: bf537-lq035: Delete an error message for a failed memory allocation in bfin_lq035_probe()

2017-11-27 Thread SF Markus Elfring
From: Markus Elfring 
Date: Mon, 27 Nov 2017 17:27:51 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 drivers/video/fbdev/bf537-lq035.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/bf537-lq035.c 
b/drivers/video/fbdev/bf537-lq035.c
index ef29fb425122..5142e5724f57 100644
--- a/drivers/video/fbdev/bf537-lq035.c
+++ b/drivers/video/fbdev/bf537-lq035.c
@@ -741,7 +741,6 @@ static int bfin_lq035_probe(struct platform_device *pdev)
sizeof(u32) * 16,
GFP_KERNEL);
if (bfin_lq035_fb.pseudo_palette == NULL) {
-   pr_err("failed to allocate pseudo_palette\n");
ret = -ENOMEM;
goto out_table;
}
-- 
2.15.0

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


Re: [PATCH v6 2/2] staging: ion: create one device entry per heap

2017-11-27 Thread Mark Brown
On Mon, Nov 27, 2017 at 05:12:23PM +0100, Daniel Vetter wrote:

> commit model ftw, we have 400+ patches for 4.16 already merged and tested
> and all ready, right when -rc1 gets tagged. Makes the merge window the
> most relaxed time of all, because all the other maintainers are drowning
> and wont pester you.

> Just saying, this is an entirely fixable problem :-P

Or even just pre-review things and flag them in a mailbox if you want to
wait for -rc1 before applying things.


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/via: use monotonic time for VIA_WAIT_IRQ

2017-11-27 Thread Daniel Vetter
On Mon, Nov 27, 2017 at 12:17:03PM +0100, Arnd Bergmann wrote:
> The normal DRM vblank interrupt events started using monotonic times in
> commit c61eef726a78 ("drm: add support for monotonic vblank timestamps"),
> which is useful for a number of reasons, including the possible y2038
> overflow.
> 
> The VIA_WAIT_IRQ ioctl uses the same drm_wait_vblank_reply as
> DRM_IOCTL_WAIT_VBLANK, but still uses wall-clock time.
> 
> This converts it to using monotonic time as well, which is more
> consistent, and avoids problems with the y2038 overflow as well
> as synchronization issues when the real time skips.
> 
> I could not find the matching user space that calls the VIA_WAIT_IRQ
> ioctl to verify that this is safe, but it very likely is. Please
> either test or review the user space side before applying this.

You need to check out _seriously_ old versions of mesa and X (plus it's
drivers). Git ftw.

The only caller I've found (in the Xv implementation of the via/openchrome
ddx) doesn't even care about the timestamp. I'm mildly tempted to just
report 0 always, but via isn't worth that much bother really.

Applied, thanks for the patch.
-Daniel

> 
> Signed-off-by: Arnd Bergmann 
> ---
>  drivers/gpu/drm/via/via_irq.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c
> index 24e71578af4d..c96830ccc0ec 100644
> --- a/drivers/gpu/drm/via/via_irq.c
> +++ b/drivers/gpu/drm/via/via_irq.c
> @@ -343,7 +343,7 @@ void via_driver_irq_uninstall(struct drm_device *dev)
>  int via_wait_irq(struct drm_device *dev, void *data, struct drm_file 
> *file_priv)
>  {
>   drm_via_irqwait_t *irqwait = data;
> - struct timeval now;
> + struct timespec64 now;
>   int ret = 0;
>   drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private;
>   drm_via_irq_t *cur_irq = dev_priv->via_irqs;
> @@ -377,9 +377,9 @@ int via_wait_irq(struct drm_device *dev, void *data, 
> struct drm_file *file_priv)
>  
>   ret = via_driver_irq_wait(dev, irqwait->request.irq, force_sequence,
> >request.sequence);
> - do_gettimeofday();
> + ktime_get_ts64();
>   irqwait->reply.tval_sec = now.tv_sec;
> - irqwait->reply.tval_usec = now.tv_usec;
> + irqwait->reply.tval_usec = now.tv_nsec / NSEC_PER_USEC;
>  
>   return ret;
>  }
> -- 
> 2.9.0
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 11/18] drm/sun4i: Add A83T support

2017-11-27 Thread Chen-Yu Tsai
On Mon, Nov 27, 2017 at 11:41 PM, Maxime Ripard
 wrote:
> Add support for the A83T display pipeline.
>
> Reviewed-by: Chen-Yu Tsai 
> Signed-off-by: Maxime Ripard 
> ---
>  Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 3 +++

Rob mentioned that he'd like to see these multiple one-liners be
in a separate patch.

>  drivers/gpu/drm/sun4i/sun4i_drv.c | 2 ++
>  drivers/gpu/drm/sun4i/sun4i_tcon.c| 5 +
>  drivers/gpu/drm/sun4i/sun8i_mixer.c   | 4 
>  4 files changed, 14 insertions(+)

Also not sure why you have two patches with the same subject.

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


Re: [PATCH v6 2/2] staging: ion: create one device entry per heap

2017-11-27 Thread Daniel Vetter
On Mon, Nov 27, 2017 at 12:43:57PM +0100, Greg Kroah-Hartman wrote:
> On Mon, Nov 27, 2017 at 11:46:18AM +0100, Benjamin Gaignard wrote:
> > 2017-11-09 22:17 GMT+01:00 Laura Abbott :
> > > On 11/06/2017 07:59 AM, Benjamin Gaignard wrote:
> > >>
> > >> Instead a getting only one common device "/dev/ion" for
> > >> all the heaps this patch allow to create one device
> > >> entry ("/dev/ionX") per heap.
> > >> Getting an entry per heap could allow to set security rules
> > >> per heap and global ones for all heaps.
> > >>
> > >> Allocation requests will be only allowed if the mask_id
> > >> match with device minor.
> > >> Query request could be done on any of the devices.
> > >>
> > >
> > > With this patch, sysfs looks like:
> > >
> > > $ ls /sys/devices/
> > > breakpoint ion platform software system virtual
> > >
> > > From an Ion perspective, you can have
> > >
> > > Acked-by: Laura Abbott 
> > >
> > > Another Ack for the device model stuff would be good but I'll
> > > assume deafening silence means nobody hates it.
> > 
> > Greg, can we get your point of view of this ?
> 
> It's 1 day after the merge window has closed, and my todo patch queue
> looks like this:
>   $ mdfrm -c ~/mail/todo/
>   1523 messages in /home/gregkh/mail/todo/
> 
> Please give me a chance to catch up...

commit model ftw, we have 400+ patches for 4.16 already merged and tested
and all ready, right when -rc1 gets tagged. Makes the merge window the
most relaxed time of all, because all the other maintainers are drowning
and wont pester you.

Just saying, this is an entirely fixable problem :-P

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 18/18] ARM: dts: sun8i: a711: Enable the LCD

2017-11-27 Thread Maxime Ripard
The A711 has 1024x600 LVDS panel, with a PWM-based backlight. Add it to our
DT.

Reviewed-by: Chen-Yu Tsai 
Signed-off-by: Maxime Ripard 
---
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 61 -
 1 file changed, 61 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts 
b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index a021ee6da396..511fca491fe8 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -45,6 +45,7 @@
 #include "sun8i-a83t.dtsi"
 
 #include 
+#include 
 
 / {
model = "TBS A711 Tablet";
@@ -59,6 +60,44 @@
stdout-path = "serial0:115200n8";
};
 
+   backlight: backlight {
+   compatible = "pwm-backlight";
+   pwms = < 0 5 PWM_POLARITY_INVERTED>;
+   enable-gpios = < 3 29 GPIO_ACTIVE_HIGH>;
+
+   brightness-levels = <0 1 2 4 8 16 32 64 128 255>;
+   default-brightness-level = <9>;
+   };
+
+   panel {
+   compatible = "tbs,a711-panel", "panel-lvds";
+   backlight = <>;
+   power-supply = <_sw>;
+
+   width-mm = <153>;
+   height-mm = <90>;
+   data-mapping = "vesa-24";
+
+   panel-timing {
+   /* 1024x600 @60Hz */
+   clock-frequency = <5200>;
+   hactive = <1024>;
+   vactive = <600>;
+   hsync-len = <20>;
+   hfront-porch = <180>;
+   hback-porch = <160>;
+   vfront-porch = <12>;
+   vback-porch = <23>;
+   vsync-len = <5>;
+   };
+
+   port {
+   panel_input: endpoint {
+   remote-endpoint = <_out_lcd>;
+   };
+   };
+   };
+
reg_vbat: reg-vbat {
compatible = "regulator-fixed";
regulator-name = "vbat";
@@ -89,6 +128,10 @@
};
 };
 
+ {
+   status = "okay";
+};
+
 /*
  * An USB-2 hub is connected here, which also means we don't need to
  * enable the OHCI controller.
@@ -142,6 +185,12 @@
status = "okay";
 };
 
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pin>;
+   status = "okay";
+};
+
 _rsb {
status = "okay";
 
@@ -323,6 +372,18 @@
regulator-name = "vcc-lcd";
 };
 
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_lvds_pins>;
+};
+
+_out {
+   tcon0_out_lcd: endpoint@0 {
+   reg = <0>;
+   remote-endpoint = <_input>;
+   };
+};
+
  {
pinctrl-names = "default";
pinctrl-0 = <_pb_pins>;
-- 
git-series 0.9.1
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 17/18] ARM: dts: sun8i: a711: Reinstate the PMIC compatible

2017-11-27 Thread Maxime Ripard
When we added the regulator support in commit 90c5d7cdae64 ("ARM: dts:
sun8i: a711: Add regulator support"), we also dropped the PMIC's
compatible. Since it's not in the PMIC DTSI, unlike most other PMIC
DTSI, it obviously wasn't probing anymore.

Re-add it so that everything works again.

Fixes: 90c5d7cdae64 ("ARM: dts: sun8i: a711: Add regulator support")
Signed-off-by: Maxime Ripard 
---
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts 
b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index 98715538932f..a021ee6da396 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -146,6 +146,7 @@
status = "okay";
 
axp81x: pmic@3a3 {
+   compatible = "x-powers,axp813";
reg = <0x3a3>;
interrupt-parent = <_intc>;
interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-- 
git-series 0.9.1
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 08/18] drm/sun4i: Reorder and document DE2 mixer registers

2017-11-27 Thread Maxime Ripard
Some registers values have been hardcoded so far, or were not as
descriptive as supposed to, because of missing information. The various
BSP that poped up since have given us more details, some hopefully we can
be more explicit about things.

Signed-off-by: Maxime Ripard 
---
 drivers/gpu/drm/sun4i/sun8i_mixer.c | 25 
 drivers/gpu/drm/sun4i/sun8i_mixer.h | 89 --
 2 files changed, 63 insertions(+), 51 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c 
b/drivers/gpu/drm/sun4i/sun8i_mixer.c
index 648a6ad3104a..44d5e639ebb2 100644
--- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
@@ -61,7 +61,7 @@ void sun8i_mixer_layer_enable(struct sun8i_mixer *mixer, 
struct sun8i_ui *ui,
regmap_update_bits(mixer->engine.regs,
   SUN8I_MIXER_CHAN_UI_LAYER_ATTR(ui->chan, ui->id),
   SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_MASK,
-  SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_DEF);
+  SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA(255));
 }
 
 static int sun8i_mixer_drm_format_to_layer(struct drm_plane *plane,
@@ -329,19 +329,20 @@ static int sun8i_mixer_bind(struct device *dev, struct 
device *master,
 
/* Initialize blender */
regmap_write(mixer->engine.regs, SUN8I_MIXER_BLEND_FCOLOR_CTL,
-SUN8I_MIXER_BLEND_FCOLOR_CTL_DEF);
-   regmap_write(mixer->engine.regs, SUN8I_MIXER_BLEND_PREMULTIPLY,
-SUN8I_MIXER_BLEND_PREMULTIPLY_DEF);
+SUN8I_MIXER_BLEND_FCOLOR_CTL_FCOLOR_EN(0) |
+SUN8I_MIXER_BLEND_FCOLOR_CTL_EN(0));
+   regmap_write(mixer->engine.regs, SUN8I_MIXER_BLEND_PREMULTIPLY, 0);
regmap_write(mixer->engine.regs, SUN8I_MIXER_BLEND_BKCOLOR,
-SUN8I_MIXER_BLEND_BKCOLOR_DEF);
+SUN8I_MIXER_BLEND_BKCOLOR_ALPHA(255));
regmap_write(mixer->engine.regs, SUN8I_MIXER_BLEND_MODE(0),
-SUN8I_MIXER_BLEND_MODE_DEF);
-   regmap_write(mixer->engine.regs, SUN8I_MIXER_BLEND_CK_CTL,
-SUN8I_MIXER_BLEND_CK_CTL_DEF);
-
-   regmap_write(mixer->engine.regs,
-SUN8I_MIXER_BLEND_ATTR_FCOLOR(0),
-SUN8I_MIXER_BLEND_ATTR_FCOLOR_DEF);
+SUN8I_MIXER_BLEND_MODE_PIXEL_FS(1) |
+SUN8I_MIXER_BLEND_MODE_PIXEL_FD(3) |
+SUN8I_MIXER_BLEND_MODE_ALPHA_FS(1) |
+SUN8I_MIXER_BLEND_MODE_ALPHA_FD(3));
+   regmap_write(mixer->engine.regs, SUN8I_MIXER_BLEND_CK_CTL, 0);
+
+   regmap_write(mixer->engine.regs, SUN8I_MIXER_BLEND_ATTR_FCOLOR(0),
+SUN8I_MIXER_BLEND_ATTR_FCOLOR_ALPHA(255));
 
/* Select the first UI channel */
DRM_DEBUG_DRIVER("Selecting channel %d (first UI channel)\n",
diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.h 
b/drivers/gpu/drm/sun4i/sun8i_mixer.h
index ce984c436246..b6512198af55 100644
--- a/drivers/gpu/drm/sun4i/sun8i_mixer.h
+++ b/drivers/gpu/drm/sun4i/sun8i_mixer.h
@@ -22,71 +22,82 @@
 #define SUN8I_MIXER_COORD(x, y)((y) << 16 | (x))
 
 #define SUN8I_MIXER_GLOBAL_CTL 0x0
+#define SUN8I_MIXER_GLOBAL_CTL_RT_EN   BIT(0)
+
 #define SUN8I_MIXER_GLOBAL_STATUS  0x4
 #define SUN8I_MIXER_GLOBAL_DBUFF   0x8
-#define SUN8I_MIXER_GLOBAL_SIZE0xc
-
-#define SUN8I_MIXER_GLOBAL_CTL_RT_EN   0x1
+#define SUN8I_MIXER_GLOBAL_DBUFF_ENABLEBIT(0)
 
-#define SUN8I_MIXER_GLOBAL_DBUFF_ENABLE0x1
+#define SUN8I_MIXER_GLOBAL_SIZE0xc
 
 #define SUN8I_MIXER_BLEND_FCOLOR_CTL   0x1000
+#define SUN8I_MIXER_BLEND_FCOLOR_CTL_EN(x) BIT(8 + (x))
+#define SUN8I_MIXER_BLEND_FCOLOR_CTL_FCOLOR_EN(x)  BIT(x)
+
 #define SUN8I_MIXER_BLEND_ATTR_FCOLOR(x)   (0x1004 + 0x10 * (x) + 0x0)
+#define SUN8I_MIXER_BLEND_ATTR_FCOLOR_ALPHA(x) (((x) & 0xff) << 24)
+
 #define SUN8I_MIXER_BLEND_ATTR_INSIZE(x)   (0x1004 + 0x10 * (x) + 0x4)
+
 #define SUN8I_MIXER_BLEND_ATTR_OFFSET(x)   (0x1004 + 0x10 * (x) + 0x8)
 #define SUN8I_MIXER_BLEND_ROUTE0x1080
 #define SUN8I_MIXER_BLEND_PREMULTIPLY  0x1084
+
 #define SUN8I_MIXER_BLEND_BKCOLOR  0x1088
+#define SUN8I_MIXER_BLEND_BKCOLOR_ALPHA(x) (((x) & 0xff) << 24)
+
 #define SUN8I_MIXER_BLEND_OUTSIZE  0x108c
+
 #define SUN8I_MIXER_BLEND_MODE(x)  (0x1090 + 0x04 * (x))
+#define SUN8I_MIXER_BLEND_MODE_ALPHA_FD(x) (((x) & 0xf) << 24)
+#define SUN8I_MIXER_BLEND_MODE_ALPHA_FS(x) (((x) & 0xf) << 16)
+#define SUN8I_MIXER_BLEND_MODE_PIXEL_FD(x) (((x) & 0xf) << 8)
+#define SUN8I_MIXER_BLEND_MODE_PIXEL_FS(x) ((x) & 0xf)
+
 #define SUN8I_MIXER_BLEND_CK_CTL   0x10b0
 #define 

[PATCH v2 01/18] dt-bindings: panel: lvds: Document power-supply property

2017-11-27 Thread Maxime Ripard
The power-supply property is used by a vast majority of panels, including
panel-simple. Let's document it as a common property

Signed-off-by: Maxime Ripard 
---
 Documentation/devicetree/bindings/display/panel/panel-common.txt | 6 ++
 Documentation/devicetree/bindings/display/panel/panel-lvds.txt   | 1 +
 2 files changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.txt 
b/Documentation/devicetree/bindings/display/panel/panel-common.txt
index ec52c472c845..125ea68052af 100644
--- a/Documentation/devicetree/bindings/display/panel/panel-common.txt
+++ b/Documentation/devicetree/bindings/display/panel/panel-common.txt
@@ -78,6 +78,12 @@ used for panels that implement compatible control signals.
   while active. Active high reset signals can be supported by inverting the
   GPIO specifier polarity flag.
 
+Power
+-
+
+- power-supply: many display panels need an additional power supply in
+  order to be fully powered-up. For such panels, power-supply contains
+  a phandle to the regulator powering the panel.
 
 Backlight
 -
diff --git a/Documentation/devicetree/bindings/display/panel/panel-lvds.txt 
b/Documentation/devicetree/bindings/display/panel/panel-lvds.txt
index b938269f841e..250850a2150b 100644
--- a/Documentation/devicetree/bindings/display/panel/panel-lvds.txt
+++ b/Documentation/devicetree/bindings/display/panel/panel-lvds.txt
@@ -32,6 +32,7 @@ Optional properties:
 - label: See panel-common.txt.
 - gpios: See panel-common.txt.
 - backlight: See panel-common.txt.
+- power-supply: See panel-common.txt.
 - data-mirror: If set, reverse the bit order described in the data mappings
   below on all data lanes, transmitting bits for slots 6 to 0 instead of
   0 to 6.
-- 
git-series 0.9.1
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 11/18] drm/sun4i: Add A83T support

2017-11-27 Thread Maxime Ripard
Add support for the A83T display pipeline.

Reviewed-by: Chen-Yu Tsai 
Signed-off-by: Maxime Ripard 
---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 3 +++
 drivers/gpu/drm/sun4i/sun4i_drv.c | 2 ++
 drivers/gpu/drm/sun4i/sun4i_tcon.c| 5 +
 drivers/gpu/drm/sun4i/sun8i_mixer.c   | 4 
 4 files changed, 14 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt 
b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
index d4259a4f5171..d6b52e5c48c0 100644
--- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
+++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
@@ -93,6 +93,7 @@ Required properties:
* allwinner,sun6i-a31s-tcon
* allwinner,sun7i-a20-tcon
* allwinner,sun8i-a33-tcon
+   * allwinner,sun8i-a83t-tcon-lcd
* allwinner,sun8i-v3s-tcon
  - reg: base address and size of memory-mapped region
  - interrupts: interrupt associated to this IP
@@ -224,6 +225,7 @@ supported.
 
 Required properties:
   - compatible: value must be one of:
+* allwinner,sun8i-a83t-de2-mixer
 * allwinner,sun8i-v3s-de2-mixer
   - reg: base address and size of the memory-mapped region.
   - clocks: phandles to the clocks feeding the mixer
@@ -253,6 +255,7 @@ Required properties:
 * allwinner,sun6i-a31s-display-engine
 * allwinner,sun7i-a20-display-engine
 * allwinner,sun8i-a33-display-engine
+* allwinner,sun8i-a83t-display-engine
 * allwinner,sun8i-v3s-display-engine
 
   - allwinner,pipelines: list of phandle to the display engine
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c 
b/drivers/gpu/drm/sun4i/sun4i_drv.c
index 75c76cdd82bc..c418be2f22be 100644
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -193,6 +193,7 @@ static bool sun4i_drv_node_is_tcon(struct device_node *node)
of_device_is_compatible(node, "allwinner,sun6i-a31s-tcon") ||
of_device_is_compatible(node, "allwinner,sun7i-a20-tcon") ||
of_device_is_compatible(node, "allwinner,sun8i-a33-tcon") ||
+   of_device_is_compatible(node, "allwinner,sun8i-a83t-tcon-lcd") 
||
of_device_is_compatible(node, "allwinner,sun8i-v3s-tcon");
 }
 
@@ -353,6 +354,7 @@ static const struct of_device_id sun4i_drv_of_table[] = {
{ .compatible = "allwinner,sun6i-a31s-display-engine" },
{ .compatible = "allwinner,sun7i-a20-display-engine" },
{ .compatible = "allwinner,sun8i-a33-display-engine" },
+   { .compatible = "allwinner,sun8i-a83t-display-engine" },
{ .compatible = "allwinner,sun8i-v3s-display-engine" },
{ }
 };
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c 
b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index 46ce6daa0b1a..871df75793a9 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -1132,6 +1132,10 @@ static const struct sun4i_tcon_quirks sun8i_a33_quirks = 
{
.has_lvds_pll   = true,
 };
 
+static const struct sun4i_tcon_quirks sun8i_a83t_quirks = {
+   /* nothing is supported */
+};
+
 static const struct sun4i_tcon_quirks sun8i_v3s_quirks = {
/* nothing is supported */
 };
@@ -1143,6 +1147,7 @@ static const struct of_device_id sun4i_tcon_of_table[] = {
{ .compatible = "allwinner,sun6i-a31s-tcon", .data = _a31s_quirks 
},
{ .compatible = "allwinner,sun7i-a20-tcon", .data = _a20_quirks },
{ .compatible = "allwinner,sun8i-a33-tcon", .data = _a33_quirks },
+   { .compatible = "allwinner,sun8i-a83t-tcon-lcd", .data = 
_a83t_quirks },
{ .compatible = "allwinner,sun8i-v3s-tcon", .data = _v3s_quirks },
{ }
 };
diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c 
b/drivers/gpu/drm/sun4i/sun8i_mixer.c
index 44d5e639ebb2..5a1376965270 100644
--- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
@@ -395,6 +395,10 @@ static const struct sun8i_mixer_cfg sun8i_v3s_mixer_cfg = {
 
 static const struct of_device_id sun8i_mixer_of_table[] = {
{
+   .compatible = "allwinner,sun8i-a83t-de2-mixer",
+   .data = _v3s_mixer_cfg,
+   },
+   {
.compatible = "allwinner,sun8i-v3s-de2-mixer",
.data = _v3s_mixer_cfg,
},
-- 
git-series 0.9.1
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 09/18] drm/sun4i: Create minimal multipliers and dividers

2017-11-27 Thread Maxime Ripard
The various outputs the TCON can provide have different constraints on the
dotclock divider. Let's make them configurable by the various mode_set
functions.

Reviewed-by: Chen-Yu Tsai 
Signed-off-by: Maxime Ripard 
---
 drivers/gpu/drm/sun4i/sun4i_dotclock.c | 10 +++---
 drivers/gpu/drm/sun4i/sun4i_tcon.c |  2 ++
 drivers/gpu/drm/sun4i/sun4i_tcon.h |  2 ++
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c 
b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
index d401156490f3..023f39bda633 100644
--- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c
+++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
@@ -17,8 +17,9 @@
 #include "sun4i_dotclock.h"
 
 struct sun4i_dclk {
-   struct clk_hw   hw;
-   struct regmap   *regmap;
+   struct clk_hw   hw;
+   struct regmap   *regmap;
+   struct sun4i_tcon   *tcon;
 };
 
 static inline struct sun4i_dclk *hw_to_dclk(struct clk_hw *hw)
@@ -73,11 +74,13 @@ static unsigned long sun4i_dclk_recalc_rate(struct clk_hw 
*hw,
 static long sun4i_dclk_round_rate(struct clk_hw *hw, unsigned long rate,
  unsigned long *parent_rate)
 {
+   struct sun4i_dclk *dclk = hw_to_dclk(hw);
+   struct sun4i_tcon *tcon = dclk->tcon;
unsigned long best_parent = 0;
u8 best_div = 1;
int i;
 
-   for (i = 6; i <= 127; i++) {
+   for (i = tcon->dclk_min_div; i <= tcon->dclk_max_div; i++) {
unsigned long ideal = rate * i;
unsigned long rounded;
 
@@ -167,6 +170,7 @@ int sun4i_dclk_create(struct device *dev, struct sun4i_tcon 
*tcon)
dclk = devm_kzalloc(dev, sizeof(*dclk), GFP_KERNEL);
if (!dclk)
return -ENOMEM;
+   dclk->tcon = tcon;
 
init.name = clk_name;
init.ops = _dclk_ops;
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c 
b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index f4284b51bdca..5b6cd7c43e4b 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -177,6 +177,8 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon 
*tcon,
u8 clk_delay;
u32 val = 0;
 
+   tcon->dclk_min_div = 6;
+   tcon->dclk_max_div = 127;
sun4i_tcon0_mode_set_common(tcon, mode);
 
/* Adjust clock delay */
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.h 
b/drivers/gpu/drm/sun4i/sun4i_tcon.h
index f61bf6d83b4a..4141fbd97ddf 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.h
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.h
@@ -169,6 +169,8 @@ struct sun4i_tcon {
 
/* Pixel clock */
struct clk  *dclk;
+   u8  dclk_max_div;
+   u8  dclk_min_div;
 
/* Reset control */
struct reset_control*lcd_rst;
-- 
git-series 0.9.1
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 04/18] drm/sun4i: Fix error path handling

2017-11-27 Thread Maxime Ripard
The commit 4c7f16d14a33 ("drm/sun4i: Fix TCON clock and regmap
initialization sequence") moved a bunch of logic around, but forgot to
update the gotos after the introduction of the err_free_dotclock label.

It means that if we fail later that the one introduced in that commit,
we'll just to the old label which isn't free the clock we created. This
will result in a breakage as soon as someone tries to do something with
that clock, since its resources will have been long reclaimed.

Cc: 
Fixes: 4c7f16d14a33 ("drm/sun4i: Fix TCON clock and regmap initialization 
sequence")
Signed-off-by: Maxime Ripard 
---
 drivers/gpu/drm/sun4i/sun4i_tcon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c 
b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index e122f5b2a395..f4284b51bdca 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -724,12 +724,12 @@ static int sun4i_tcon_bind(struct device *dev, struct 
device *master,
if (IS_ERR(tcon->crtc)) {
dev_err(dev, "Couldn't create our CRTC\n");
ret = PTR_ERR(tcon->crtc);
-   goto err_free_clocks;
+   goto err_free_dotclock;
}
 
ret = sun4i_rgb_init(drm, tcon);
if (ret < 0)
-   goto err_free_clocks;
+   goto err_free_dotclock;
 
if (tcon->quirks->needs_de_be_mux) {
/*
-- 
git-series 0.9.1
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 05/18] drm/sun4i: Force the mixer rate at 150MHz

2017-11-27 Thread Maxime Ripard
It seems like the mixer can only run properly when clocked at 150MHz. In
order to have something more robust than simply a fire-and-forget
assigned-clocks-rate, let's put that in the code.

Signed-off-by: Maxime Ripard 
---
 drivers/gpu/drm/sun4i/sun8i_mixer.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c 
b/drivers/gpu/drm/sun4i/sun8i_mixer.c
index cb193c5f1686..c0cdccf772a2 100644
--- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
@@ -315,6 +315,13 @@ static int sun8i_mixer_bind(struct device *dev, struct 
device *master,
}
clk_prepare_enable(mixer->mod_clk);
 
+   /*
+* It seems that we need to enforce that rate for whatever
+* reason for the mixer to be functional. Make sure it's the
+* case.
+*/
+   clk_set_rate(mixer->mod_clk, 15000);
+
list_add_tail(>engine.list, >engine_list);
 
/* Reset the registers */
-- 
git-series 0.9.1
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 06/18] drm/sun4i: Rename layers to UI planes

2017-11-27 Thread Maxime Ripard
The currently supported planes for DE2 are actually only UI planes, and the
VI planes will differ both in terms of code and features.

It will make sense to support them in a separate file, so let's make sure
we don't create a confusing file name.

Reviewed-by: Chen-Yu Tsai 
Signed-off-by: Maxime Ripard 
---
 drivers/gpu/drm/sun4i/Makefile  |   2 +-
 drivers/gpu/drm/sun4i/sun8i_layer.c | 134 +-
 drivers/gpu/drm/sun4i/sun8i_layer.h |  36 +
 drivers/gpu/drm/sun4i/sun8i_mixer.c |   4 +-
 drivers/gpu/drm/sun4i/sun8i_ui.c| 134 +-
 drivers/gpu/drm/sun4i/sun8i_ui.h|  36 -
 6 files changed, 173 insertions(+), 173 deletions(-)
 delete mode 100644 drivers/gpu/drm/sun4i/sun8i_layer.c
 delete mode 100644 drivers/gpu/drm/sun4i/sun8i_layer.h
 create mode 100644 drivers/gpu/drm/sun4i/sun8i_ui.c
 create mode 100644 drivers/gpu/drm/sun4i/sun8i_ui.h

diff --git a/drivers/gpu/drm/sun4i/Makefile b/drivers/gpu/drm/sun4i/Makefile
index 0c2f8c7facae..241cce172728 100644
--- a/drivers/gpu/drm/sun4i/Makefile
+++ b/drivers/gpu/drm/sun4i/Makefile
@@ -9,7 +9,7 @@ sun4i-drm-hdmi-y+= sun4i_hdmi_enc.o
 sun4i-drm-hdmi-y   += sun4i_hdmi_i2c.o
 sun4i-drm-hdmi-y   += sun4i_hdmi_tmds_clk.o
 
-sun8i-mixer-y  += sun8i_mixer.o sun8i_layer.o
+sun8i-mixer-y  += sun8i_mixer.o sun8i_ui.o
 
 sun4i-tcon-y   += sun4i_crtc.o
 sun4i-tcon-y   += sun4i_dotclock.o
diff --git a/drivers/gpu/drm/sun4i/sun8i_layer.c 
b/drivers/gpu/drm/sun4i/sun8i_layer.c
deleted file mode 100644
index 23810ff72684..
--- a/drivers/gpu/drm/sun4i/sun8i_layer.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) Icenowy Zheng 
- *
- * Based on sun4i_layer.h, which is:
- *   Copyright (C) 2015 Free Electrons
- *   Copyright (C) 2015 NextThing Co
- *
- *   Maxime Ripard 
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- */
-
-#include 
-#include 
-#include 
-
-#include "sun8i_layer.h"
-#include "sun8i_mixer.h"
-
-struct sun8i_plane_desc {
-  enum drm_plane_type type;
-  const uint32_t  *formats;
-  uint32_tnformats;
-};
-
-static void sun8i_mixer_layer_atomic_disable(struct drm_plane *plane,
-  struct drm_plane_state 
*old_state)
-{
-   struct sun8i_layer *layer = plane_to_sun8i_layer(plane);
-   struct sun8i_mixer *mixer = layer->mixer;
-
-   sun8i_mixer_layer_enable(mixer, layer->id, false);
-}
-
-static void sun8i_mixer_layer_atomic_update(struct drm_plane *plane,
- struct drm_plane_state *old_state)
-{
-   struct sun8i_layer *layer = plane_to_sun8i_layer(plane);
-   struct sun8i_mixer *mixer = layer->mixer;
-
-   sun8i_mixer_update_layer_coord(mixer, layer->id, plane);
-   sun8i_mixer_update_layer_formats(mixer, layer->id, plane);
-   sun8i_mixer_update_layer_buffer(mixer, layer->id, plane);
-   sun8i_mixer_layer_enable(mixer, layer->id, true);
-}
-
-static struct drm_plane_helper_funcs sun8i_mixer_layer_helper_funcs = {
-   .atomic_disable = sun8i_mixer_layer_atomic_disable,
-   .atomic_update  = sun8i_mixer_layer_atomic_update,
-};
-
-static const struct drm_plane_funcs sun8i_mixer_layer_funcs = {
-   .atomic_destroy_state   = drm_atomic_helper_plane_destroy_state,
-   .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
-   .destroy= drm_plane_cleanup,
-   .disable_plane  = drm_atomic_helper_disable_plane,
-   .reset  = drm_atomic_helper_plane_reset,
-   .update_plane   = drm_atomic_helper_update_plane,
-};
-
-static const uint32_t sun8i_mixer_layer_formats[] = {
-   DRM_FORMAT_RGB888,
-   DRM_FORMAT_ARGB,
-   DRM_FORMAT_XRGB,
-};
-
-static const struct sun8i_plane_desc sun8i_mixer_planes[] = {
-   {
-   .type = DRM_PLANE_TYPE_PRIMARY,
-   .formats = sun8i_mixer_layer_formats,
-   .nformats = ARRAY_SIZE(sun8i_mixer_layer_formats),
-   },
-};
-
-static struct sun8i_layer *sun8i_layer_init_one(struct drm_device *drm,
-   struct sun8i_mixer *mixer,
-   const struct sun8i_plane_desc 
*plane)
-{
-   struct sun8i_layer *layer;
-   int ret;
-
-   layer = devm_kzalloc(drm->dev, sizeof(*layer), GFP_KERNEL);
-   if (!layer)
-   return ERR_PTR(-ENOMEM);
-
-   /* possible crtcs are set later */
-   ret = 

[PATCH v2 07/18] drm/sun4i: sun8i: Rework the UI channels code

2017-11-27 Thread Maxime Ripard
The current code makes the assumption that the only channel we want to use
for the first (and only) UI channel is the number of VI channels (so last
VI + 1), which is accurate.

However, it does so in pretty much every plane-related function using a
local variable that makes it quite difficult to rework when we'll have to
deal with multiple UI channels.

Refactor the current code a bit to associate the ID of the channel to the
sun8i_ui structure directly, and have all our callbacks use that instead.

As the current code registers only one UI channel, we'll fill that field
with the same value that was there before (ie number of VI channels), but
this time we'll only have to change it where the planes are instatiated,
and not in the whole code.

Signed-off-by: Maxime Ripard 
---
 drivers/gpu/drm/sun4i/sun8i_mixer.c | 43 +-
 drivers/gpu/drm/sun4i/sun8i_mixer.h | 12 
 drivers/gpu/drm/sun4i/sun8i_ui.c| 12 
 drivers/gpu/drm/sun4i/sun8i_ui.h|  1 +-
 4 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c 
b/drivers/gpu/drm/sun4i/sun8i_mixer.c
index f503bd000893..648a6ad3104a 100644
--- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
@@ -37,14 +37,12 @@ static void sun8i_mixer_commit(struct sunxi_engine *engine)
 SUN8I_MIXER_GLOBAL_DBUFF_ENABLE);
 }
 
-void sun8i_mixer_layer_enable(struct sun8i_mixer *mixer,
-   int layer, bool enable)
+void sun8i_mixer_layer_enable(struct sun8i_mixer *mixer, struct sun8i_ui *ui,
+ bool enable)
 {
u32 val;
-   /* Currently the first UI channel is used */
-   int chan = mixer->cfg->vi_num;
 
-   DRM_DEBUG_DRIVER("Enabling layer %d in channel %d\n", layer, chan);
+   DRM_DEBUG_DRIVER("Enabling layer %d in channel %d\n", ui->id, ui->chan);
 
if (enable)
val = SUN8I_MIXER_CHAN_UI_LAYER_ATTR_EN;
@@ -52,16 +50,16 @@ void sun8i_mixer_layer_enable(struct sun8i_mixer *mixer,
val = 0;
 
regmap_update_bits(mixer->engine.regs,
-  SUN8I_MIXER_CHAN_UI_LAYER_ATTR(chan, layer),
+  SUN8I_MIXER_CHAN_UI_LAYER_ATTR(ui->chan, ui->id),
   SUN8I_MIXER_CHAN_UI_LAYER_ATTR_EN, val);
 
/* Set the alpha configuration */
regmap_update_bits(mixer->engine.regs,
-  SUN8I_MIXER_CHAN_UI_LAYER_ATTR(chan, layer),
+  SUN8I_MIXER_CHAN_UI_LAYER_ATTR(ui->chan, ui->id),
   SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_MODE_MASK,
   SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_MODE_DEF);
regmap_update_bits(mixer->engine.regs,
-  SUN8I_MIXER_CHAN_UI_LAYER_ATTR(chan, layer),
+  SUN8I_MIXER_CHAN_UI_LAYER_ATTR(ui->chan, ui->id),
   SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_MASK,
   SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_DEF);
 }
@@ -90,14 +88,13 @@ static int sun8i_mixer_drm_format_to_layer(struct drm_plane 
*plane,
 }
 
 int sun8i_mixer_update_layer_coord(struct sun8i_mixer *mixer,
-int layer, struct drm_plane *plane)
+  struct sun8i_ui *ui)
 {
+   struct drm_plane *plane = >plane;
struct drm_plane_state *state = plane->state;
struct drm_framebuffer *fb = state->fb;
-   /* Currently the first UI channel is used */
-   int chan = mixer->cfg->vi_num;
 
-   DRM_DEBUG_DRIVER("Updating layer %d\n", layer);
+   DRM_DEBUG_DRIVER("Updating layer %d\n", ui->id);
 
if (plane->type == DRM_PLANE_TYPE_PRIMARY) {
DRM_DEBUG_DRIVER("Primary layer, updating global size W: %u H: 
%u\n",
@@ -115,7 +112,7 @@ int sun8i_mixer_update_layer_coord(struct sun8i_mixer 
*mixer,
  state->crtc_h));
DRM_DEBUG_DRIVER("Updating channel size\n");
regmap_write(mixer->engine.regs,
-SUN8I_MIXER_CHAN_UI_OVL_SIZE(chan),
+SUN8I_MIXER_CHAN_UI_OVL_SIZE(ui->chan),
 SUN8I_MIXER_SIZE(state->crtc_w,
  state->crtc_h));
}
@@ -123,35 +120,34 @@ int sun8i_mixer_update_layer_coord(struct sun8i_mixer 
*mixer,
/* Set the line width */
DRM_DEBUG_DRIVER("Layer line width: %d bytes\n", fb->pitches[0]);
regmap_write(mixer->engine.regs,
-SUN8I_MIXER_CHAN_UI_LAYER_PITCH(chan, layer),
+SUN8I_MIXER_CHAN_UI_LAYER_PITCH(ui->chan, ui->id),
 fb->pitches[0]);
 
/* Set height and width */
DRM_DEBUG_DRIVER("Layer size W: %u H: %u\n",
 state->crtc_w, state->crtc_h);
   

[PATCH v2 15/18] ARM: dts: sun8i: a83t: Add LVDS pins group

2017-11-27 Thread Maxime Ripard
The A83T has an LVDS bus that can be connected to a panel or a bridge. Add
the pinctrl group for it.

Reviewed-by: Chen-Yu Tsai 
Signed-off-by: Maxime Ripard 
---
 arch/arm/boot/dts/sun8i-a83t.dtsi | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi 
b/arch/arm/boot/dts/sun8i-a83t.dtsi
index 2cb71e460ea2..b4615f150dbf 100644
--- a/arch/arm/boot/dts/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
@@ -415,6 +415,12 @@
#interrupt-cells = <3>;
#gpio-cells = <3>;
 
+   lcd_lvds_pins: lcd-lvds-pins {
+   pins = "PD18", "PD19", "PD20", "PD21", "PD22",
+  "PD23", "PD24", "PD25", "PD26", "PD27";
+   function = "lvds0";
+   };
+
mmc0_pins: mmc0-pins {
pins = "PF0", "PF1", "PF2",
   "PF3", "PF4", "PF5";
-- 
git-series 0.9.1
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 02/18] drm/panel: lvds: Add support for the power-supply property

2017-11-27 Thread Maxime Ripard
A significant number of panels need to power up a regulator in order to
operate properly. Add support for the power-supply property to enable and
disable such a regulator whenever needed.

Reviewed-by: Chen-Yu Tsai 
Signed-off-by: Maxime Ripard 
---
 drivers/gpu/drm/panel/panel-lvds.c | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-lvds.c 
b/drivers/gpu/drm/panel/panel-lvds.c
index e2d57c01200b..57e38a9e7ab4 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -39,6 +40,7 @@ struct panel_lvds {
bool data_mirror;
 
struct backlight_device *backlight;
+   struct regulator *supply;
 
struct gpio_desc *enable_gpio;
struct gpio_desc *reset_gpio;
@@ -69,6 +71,9 @@ static int panel_lvds_unprepare(struct drm_panel *panel)
if (lvds->enable_gpio)
gpiod_set_value_cansleep(lvds->enable_gpio, 0);
 
+   if (lvds->supply)
+   regulator_disable(lvds->supply);
+
return 0;
 }
 
@@ -76,6 +81,17 @@ static int panel_lvds_prepare(struct drm_panel *panel)
 {
struct panel_lvds *lvds = to_panel_lvds(panel);
 
+   if (lvds->supply) {
+   int err;
+
+   err = regulator_enable(lvds->supply);
+   if (err < 0) {
+   dev_err(lvds->dev, "failed to enable supply: %d\n",
+   err);
+   return err;
+   }
+   }
+
if (lvds->enable_gpio)
gpiod_set_value_cansleep(lvds->enable_gpio, 1);
 
@@ -196,6 +212,13 @@ static int panel_lvds_probe(struct platform_device *pdev)
if (ret < 0)
return ret;
 
+   lvds->supply = devm_regulator_get_optional(lvds->dev, "power");
+   if (IS_ERR(lvds->supply)) {
+   ret = PTR_ERR(lvds->supply);
+   dev_err(lvds->dev, "failed to request regulator: %d\n", ret);
+   return ret;
+   }
+
/* Get GPIOs and backlight controller. */
lvds->enable_gpio = devm_gpiod_get_optional(lvds->dev, "enable",
 GPIOD_OUT_LOW);
-- 
git-series 0.9.1
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 14/18] ARM: dts: sun8i: a83t: Enable the PWM

2017-11-27 Thread Maxime Ripard
The A83T has the same PWM block than the H3. Add it to our DT.

Reviewed-by: Chen-Yu Tsai 
Signed-off-by: Maxime Ripard 
---
 arch/arm/boot/dts/sun8i-a83t.dtsi |  9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi 
b/arch/arm/boot/dts/sun8i-a83t.dtsi
index 0a91f5c17f51..2cb71e460ea2 100644
--- a/arch/arm/boot/dts/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
@@ -497,6 +497,15 @@
status = "disabled";
};
 
+   pwm: pwm@1c21400 {
+   compatible = "allwinner,sun8i-a83t-pwm",
+"allwinner,sun8i-h3-pwm";
+   reg = <0x01c21400 0x400>;
+   clocks = <>;
+   #pwm-cells = <3>;
+   status = "disabled";
+   };
+
uart0: serial@1c28000 {
compatible = "snps,dw-apb-uart";
reg = <0x01c28000 0x400>;
-- 
git-series 0.9.1
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


  1   2   3   >