[radeon-alex:drm-next-4.20-wip 229/235] drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_vi.c:202:34: sparse: expression using sizeof(void)

2018-08-28 Thread kbuild test robot
tree:   git://people.freedesktop.org/~agd5f/linux.git drm-next-4.20-wip
head:   bdb1922abd620d24715906bac4d119274d98f4c9
commit: 04d5e2765802241b54ee93d1e655123c39fa7385 [229/235] drm/amdgpu: Merge 
amdkfd into amdgpu
reproduce:
# apt-get install sparse
git checkout 04d5e2765802241b54ee93d1e655123c39fa7385
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_vi.c:202:34: sparse: 
>> expression using sizeof(void)
--
>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_v9.c:204:33: sparse: 
>> expression using sizeof(void)
--
>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_kernel_queue_vi.c:134:31: sparse: 
>> expression using sizeof(void)
>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_kernel_queue_vi.c:134:31: sparse: 
>> expression using sizeof(void)
--
   include/linux/slab.h:631:13: sparse: undefined identifier 
'__builtin_mul_overflow'
>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_events.c:648:27: sparse: expression 
>> using sizeof(void)
   include/linux/slab.h:631:13: sparse: call with no type!
--
>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_int_process_v9.c:37:16: sparse: 
>> cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_int_process_v9.c:43:17: sparse: 
cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_int_process_v9.c:47:21: sparse: 
cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_int_process_v9.c:48:21: sparse: 
cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_int_process_v9.c:73:21: sparse: 
cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_int_process_v9.c:74:21: sparse: 
cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_int_process_v9.c:75:17: sparse: 
cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_int_process_v9.c:76:16: sparse: 
cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_int_process_v9.c:77:22: sparse: 
cast to restricted __le32
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_int_process_v9.c:90:36: sparse: 
cast to restricted __le32
--
>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_iommu.c:87:23: sparse: expression 
>> using sizeof(void)
>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_iommu.c:87:23: sparse: expression 
>> using sizeof(void)
--
>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_pm4_headers_ai.h:517:80: sparse: 
>> dubious one-bit signed bitfield

vim +202 drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_vi.c

d696d536f Ben Goz2015-01-12  159  
d696d536f Ben Goz2015-01-12  160  static int __update_mqd(struct 
mqd_manager *mm, void *mqd,
d696d536f Ben Goz2015-01-12  161struct 
queue_properties *q, unsigned int mtype,
d696d536f Ben Goz2015-01-12  162unsigned int 
atc_bit)
d696d536f Ben Goz2015-01-12  163  {
d696d536f Ben Goz2015-01-12  164struct vi_mqd *m;
d696d536f Ben Goz2015-01-12  165  
d696d536f Ben Goz2015-01-12  166m = get_mqd(mqd);
d696d536f Ben Goz2015-01-12  167  
d696d536f Ben Goz2015-01-12  168m->cp_hqd_pq_control = 5 << 
CP_HQD_PQ_CONTROL__RPTR_BLOCK_SIZE__SHIFT |
d696d536f Ben Goz2015-01-12  169atc_bit << 
CP_HQD_PQ_CONTROL__PQ_ATC__SHIFT |
d696d536f Ben Goz2015-01-12  170mtype << 
CP_HQD_PQ_CONTROL__MTYPE__SHIFT;
115c8c410 Felix Kuehling 2017-11-06  171m->cp_hqd_pq_control |= 
order_base_2(q->queue_size / 4) - 1;
79775b627 Kent Russell   2017-08-15  172pr_debug("cp_hqd_pq_control 
0x%x\n", m->cp_hqd_pq_control);
d696d536f Ben Goz2015-01-12  173  
d696d536f Ben Goz2015-01-12  174m->cp_hqd_pq_base_lo = 
lower_32_bits((uint64_t)q->queue_address >> 8);
d696d536f Ben Goz2015-01-12  175m->cp_hqd_pq_base_hi = 
upper_32_bits((uint64_t)q->queue_address >> 8);
d696d536f Ben Goz2015-01-12  176  
d696d536f Ben Goz2015-01-12  177
m->cp_hqd_pq_rptr_report_addr_lo = lower_32_bits((uint64_t)q->read_ptr);
d696d536f Ben Goz2015-01-12  178
m->cp_hqd_pq_rptr_report_addr_hi = upper_32_bits((uint64_t)q->read_ptr);
ee04955af Felix Kuehling 2018-01-04  179m->cp_hqd_pq_wptr_poll_addr_lo 
= lower_32_bits((uint64_t)q->write_ptr);
ee04955af Felix Kuehling 2018-01-04  180m->cp_hqd_pq_wptr_poll_addr_hi 
= upper_32_bits((uint64_t)q->write_ptr);
d696d536f Ben Goz2015-01-12  181  
d696d536f Ben Goz2015-01-12  182m->cp_hqd_pq_doorbell_control =
d696d536f Ben Goz2015-01-12  183q->doorbell_off <<
d696d536f Ben Goz2015-01-12  184
CP_HQD_PQ_DOORBELL_CONTROL__DOORBELL_OFFSET__SHIFT;
79775b627 Kent Russell   2017-08-15  185
pr_debug("cp_hqd_pq_doorbell_control 0x%x\n",
d696d536f Ben Goz2015-01-12

Re: [PATCH] of/platform: Initialise AMBA default DMA masks

2018-08-28 Thread Christoph Hellwig
On Tue, Aug 28, 2018 at 03:14:14PM +0100, Russell King - ARM Linux wrote:
> But yes, the fundamental fact is that AMBA devices don't have any
> care about the differences between coherent and streaming DMA.  The
> distinction that we make in the kernel is purely a software one when
> it comes to these devices.
> 
> Most AMBA devices themselves are not DMA capable, as they are only
> connected to the APB (Amba peripheral bus) and they rely on a
> separate DMA engine for their DMA.  APB devices should not have DMA
> masks - their DMA capabilities are entirely down to the DMA controller.
> So, the majority of AMBA devices should not have any DMA masks.
> 
> Only those connected to a bus that they can master on (eg AXI) should
> have DMA masks - things like the PL08x DMA controllers, PL11x LCD
> controllers, etc.  As I've said above, there is no difference between
> streaming and coherent DMA for these devices.

So for now I plan to apply the patch from Linus to just set a dma
mask, as that gets back the previous behavior where dma did just
work (as it did without a mask).

But if Linus, you or someone else familiar with amba would like to
add an explicit opt-in into dma support eventually that would be
even better.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] of/platform: Initialise AMBA default DMA masks

2018-08-28 Thread Christoph Hellwig
On Tue, Aug 28, 2018 at 03:25:55PM +0200, Linus Walleij wrote:
> Do you think we can proceed with this patch or do you want me to
> revert the split back?

I'll apply this patch (probably with a little common in the source
explaining the situation), based on the feedback from you and Russell.

> 
> FWIW the platform devices have the same problem, but I know
> I know, two wrongs does not make one right :/

I have a patch pending for that..
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH RESEND v6 1/2] drm/panel: Add support for Truly NT35597 panel driver

2018-08-28 Thread Sam Ravnborg
Hi Abhinav.

On Tue, Aug 28, 2018 at 03:39:46PM -0700, Abhinav Kumar wrote:
> From: "abhin...@codeaurora.org" 
> 
> Add support for Truly NT35597 panel driver used
> in MSM reference platforms.
> 
> This panel driver supports both single DSI and dual DSI
> modes.
> 
> However, this patch series adds support only for
> dual DSI mode.
> 
> Changes in v6:
...

Comments from:
https://lists.freedesktop.org/archives/dri-devel/2018-August/187562.html

seems not to be addressed? Did you miss them?

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


[Bug 107652] amdgpu couldn't resume after suspend

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107652

--- Comment #9 from mikhail.v.gavri...@gmail.com ---
> Can you now show memory status after suspend happened and failed ?
> Can you also try repeat the test with minimal graphics enabled(switch to FB
> console, sudo xinit) and then repeat the steps to see if this still happens



(In reply to mikhail.v.gavrilov from comment #6)
> Created attachment 141331 [details]
> memory status before

# systemctl suspend

(In reply to mikhail.v.gavrilov from comment #7)
> Created attachment 141332 [details]
> memory status after

I make this in FB console but result are same:

(In reply to mikhail.v.gavrilov from comment #8)
> Created attachment 141333 [details]
> system log

-- 
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 107652] amdgpu couldn't resume after suspend

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107652

--- Comment #8 from mikhail.v.gavri...@gmail.com ---
Created attachment 141333
  --> https://bugs.freedesktop.org/attachment.cgi?id=141333&action=edit
system log

-- 
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 107213] [amdgpu/DisplayPort] KDE Wayland session is segfaulting right after login

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107213

--- Comment #4 from Shmerl  ---
Still a problem with kernel 4.18.5 and latest firmware for Vega (20180825).

Except now, the session doesn't crash but just hangs with black screen.

Similar dmesg can be seen:

[  162.743804] [drm:generic_reg_wait [amdgpu]] *ERROR* REG_WAIT timeout 10us *
3500 tries - dce_mi_free_dmif line:636
[  162.743830] WARNING: CPU: 6 PID: 1575 at
/build/linux-ETX4PU/linux-4.18.5/drivers/gpu/drm/amd/amdgpu/../display/dc/dc_helper.c:254
generic_reg_wait+0xe8/0x160 [amdgpu]

-- 
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 107652] amdgpu couldn't resume after suspend

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107652

--- Comment #7 from mikhail.v.gavri...@gmail.com ---
Created attachment 141332
  --> https://bugs.freedesktop.org/attachment.cgi?id=141332&action=edit
memory status after

-- 
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 107652] amdgpu couldn't resume after suspend

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107652

--- Comment #6 from mikhail.v.gavri...@gmail.com ---
Created attachment 141331
  --> https://bugs.freedesktop.org/attachment.cgi?id=141331&action=edit
memory status before

-- 
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 v7 2/3] drm/rockchip: Add support for Rockchip Soc RGB output interface

2018-08-28 Thread Sandy Huang
Some Rockchip CRTCs, like rv1108 and px30, can directly output parallel
and serial RGB data to panel or conversion chip.

So add a feature-bit for vops to mark the ability for these direct
outputs and add an internal encoder in that case, that can attach to
bridge chipsor panels.

Signed-off-by: Sandy Huang 
Signed-off-by: Heiko Stuebner 
Reviewed-by: Sean Paul 
Reviewed-by: Mark Yao 
---
 Changes in v7:
1. forget to delete rockchip_rgb_driver and delete it.
 Changes in v6:
1. Update according to Heiko Stuebner' implemention, rgb output is
   part of vop's feature, should not register as a independent
   driver.
Changes in v5:
1. add SPDX-License-Identifier tag
Changes in v4:
1. add support px30;
Changes in v3:
1. update for rgb-mode move to panel node.
Changes in v2:
1. add error log when probe failed;
2. update name_to_output_mode() according to sean's suggest;
3. Fix uninitialized use of ret.
 
 
 drivers/gpu/drm/rockchip/Kconfig|  11 ++
 drivers/gpu/drm/rockchip/Makefile   |   1 +
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c |  16 +++
 drivers/gpu/drm/rockchip/rockchip_drm_vop.h |   1 +
 drivers/gpu/drm/rockchip/rockchip_rgb.c | 173 
 drivers/gpu/drm/rockchip/rockchip_rgb.h |  20 
 6 files changed, 222 insertions(+)
 create mode 100644 drivers/gpu/drm/rockchip/rockchip_rgb.c
 create mode 100644 drivers/gpu/drm/rockchip/rockchip_rgb.h

diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig
index 0ccc762..e88eb71 100644
--- a/drivers/gpu/drm/rockchip/Kconfig
+++ b/drivers/gpu/drm/rockchip/Kconfig
@@ -8,6 +8,7 @@ config DRM_ROCKCHIP
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_RGB if ROCKCHIP_RGB
select SND_SOC_HDMI_CODEC if ROCKCHIP_CDN_DP && SND_SOC
help
  Choose this option if you have a Rockchip soc chipset.
@@ -66,4 +67,14 @@ config ROCKCHIP_LVDS
  Rockchip rk3288 SoC has LVDS TX Controller can be used, and it
  support LVDS, rgb, dual LVDS output mode. say Y to enable its
  driver.
+
+config ROCKCHIP_RGB
+   bool "Rockchip RGB support"
+   depends on DRM_ROCKCHIP
+   depends on PINCTRL
+   help
+ Choose this option to enable support for Rockchip RGB output.
+ Some Rockchip CRTCs, like rv1108, can directly output parallel
+ and serial RGB format to panel or connect to a conversion chip.
+ say Y to enable its driver.
 endif
diff --git a/drivers/gpu/drm/rockchip/Makefile 
b/drivers/gpu/drm/rockchip/Makefile
index a314e21..868263f 100644
--- a/drivers/gpu/drm/rockchip/Makefile
+++ b/drivers/gpu/drm/rockchip/Makefile
@@ -14,5 +14,6 @@ rockchipdrm-$(CONFIG_ROCKCHIP_DW_HDMI) += dw_hdmi-rockchip.o
 rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) += dw-mipi-dsi.o
 rockchipdrm-$(CONFIG_ROCKCHIP_INNO_HDMI) += inno_hdmi.o
 rockchipdrm-$(CONFIG_ROCKCHIP_LVDS) += rockchip_lvds.o
+rockchipdrm-$(CONFIG_ROCKCHIP_RGB) += rockchip_rgb.o
 
 obj-$(CONFIG_DRM_ROCKCHIP) += rockchipdrm.o
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 38f8cae..867b654 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -41,6 +41,7 @@
 #include "rockchip_drm_fb.h"
 #include "rockchip_drm_psr.h"
 #include "rockchip_drm_vop.h"
+#include "rockchip_rgb.h"
 
 #define VOP_WIN_SET(x, win, name, v) \
vop_reg_set(vop, &win->phy->name, win->base, ~0, v, #name)
@@ -92,6 +93,7 @@ struct vop_win {
struct vop *vop;
 };
 
+struct rockchip_rgb;
 struct vop {
struct drm_crtc crtc;
struct device *dev;
@@ -135,6 +137,9 @@ struct vop {
/* vop dclk reset */
struct reset_control *dclk_rst;
 
+   /* optional internal rgb encoder */
+   struct rockchip_rgb *rgb;
+
struct vop_win win[];
 };
 
@@ -1638,6 +1643,14 @@ static int vop_bind(struct device *dev, struct device 
*master, void *data)
if (ret)
goto err_disable_pm_runtime;
 
+   if (vop->data->feature & VOP_FEATURE_INTERNAL_RGB) {
+   vop->rgb = rockchip_rgb_init(dev, &vop->crtc, vop->drm_dev);
+   if (IS_ERR(vop->rgb)) {
+   ret = PTR_ERR(vop->rgb);
+   goto err_disable_pm_runtime;
+   }
+   }
+
return 0;
 
 err_disable_pm_runtime:
@@ -1650,6 +1663,9 @@ static void vop_unbind(struct device *dev, struct device 
*master, void *data)
 {
struct vop *vop = dev_get_drvdata(dev);
 
+   if (vop->rgb)
+   rockchip_rgb_fini(vop->rgb);
+
pm_runtime_disable(dev);
vop_destroy_crtc(vop);
 
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h 
b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
index fcb9104..fd5765d 100644
--- a/drivers/g

[PATCH v7 3/3] drm/rockchip: Add directly output rgb feature for px30

2018-08-28 Thread Sandy Huang
Add this feature bit indicate px30 vop can directly output
parallel or serial rgb data.

Signed-off-by: Sandy Huang 
---
 drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c 
b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
index d824ca6..d2c3a5c 100644
--- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
+++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
@@ -278,6 +278,7 @@ static const struct vop_win_data px30_vop_big_win_data[] = {
 
 static const struct vop_data px30_vop_big = {
.intr = &px30_intr,
+   .feature = VOP_FEATURE_INTERNAL_RGB,
.common = &px30_common,
.modeset = &px30_modeset,
.output = &px30_output,
@@ -292,6 +293,7 @@ static const struct vop_win_data px30_vop_lit_win_data[] = {
 
 static const struct vop_data px30_vop_lit = {
.intr = &px30_intr,
+   .feature = VOP_FEATURE_INTERNAL_RGB,
.common = &px30_common,
.modeset = &px30_modeset,
.output = &px30_output,
-- 
2.7.4


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


[PATCH v7 0/3] Add support rockchip RGB output interface

2018-08-28 Thread Sandy Huang
This patches add support rockchip RGB output, Some Rockchip CRTCs, like
rv1108 and px30 can directly output parallel and serial RGB data to panel
or to conversion chip.
So add a feature-bit for vops to mark the ability for these direct outputs
and add an internal encoder in that case, that can attach to bridge chips
or panels.


Heiko Stuebner (1):
  drm/tockchip: add function to check if endpoint is a subdriver

Sandy Huang (2):
  drm/rockchip: Add support for Rockchip Soc RGB output interface
  drm/rockchip: Add directly output rgb feature for px30

 drivers/gpu/drm/rockchip/Kconfig|  11 ++
 drivers/gpu/drm/rockchip/Makefile   |   1 +
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c |  27 +
 drivers/gpu/drm/rockchip/rockchip_drm_drv.h |   1 +
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c |  16 +++
 drivers/gpu/drm/rockchip/rockchip_drm_vop.h |   1 +
 drivers/gpu/drm/rockchip/rockchip_rgb.c | 173 
 drivers/gpu/drm/rockchip/rockchip_rgb.h |  20 
 drivers/gpu/drm/rockchip/rockchip_vop_reg.c |   2 +
 9 files changed, 252 insertions(+)
 create mode 100644 drivers/gpu/drm/rockchip/rockchip_rgb.c
 create mode 100644 drivers/gpu/drm/rockchip/rockchip_rgb.h

-- 
2.7.4


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


[PATCH v7 1/3] drm/tockchip: add function to check if endpoint is a subdriver

2018-08-28 Thread Sandy Huang
From: Heiko Stuebner 

To be able to have both internal subdrivers and external bridge
drivers as output endpoints of vops, add a function to be able
to distinguish these.

Signed-off-by: Heiko Stuebner 
---
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 27 +++
 drivers/gpu/drm/rockchip/rockchip_drm_drv.h |  1 +
 2 files changed, 28 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index 1d9c4a9..d18f7f8 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -267,6 +268,32 @@ static const struct dev_pm_ops rockchip_drm_pm_ops = {
 static struct platform_driver *rockchip_sub_drivers[MAX_ROCKCHIP_SUB_DRIVERS];
 static int num_rockchip_sub_drivers;
 
+/*
+ * check if a vop output-endpoint is a subdriver or bridge.
+ */
+bool rockchip_drm_endpoint_is_subdriver(struct device_node *ep)
+{
+   struct device_node *node = of_graph_get_remote_port_parent(ep);
+   struct platform_device *pdev;
+   int i;
+
+   if (!node)
+   return false;
+
+   pdev = of_find_device_by_node(node);
+   if (!pdev)
+   return false;
+
+   for (i = 0; i < num_rockchip_sub_drivers; i++) {
+   struct device_driver *drv = pdev->dev.driver;
+
+   if (rockchip_sub_drivers[i] == to_platform_driver(drv))
+   return true;
+   }
+
+   return false;
+}
+
 static int compare_dev(struct device *dev, void *data)
 {
return dev == (struct device *)data;
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h 
b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
index d67ad0a..305b485 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
@@ -64,6 +64,7 @@ void rockchip_drm_dma_detach_device(struct drm_device 
*drm_dev,
struct device *dev);
 int rockchip_drm_wait_vact_end(struct drm_crtc *crtc, unsigned int mstimeout);
 
+bool rockchip_drm_endpoint_is_subdriver(struct device_node *ep);
 extern struct platform_driver cdn_dp_driver;
 extern struct platform_driver dw_hdmi_rockchip_pltfm_driver;
 extern struct platform_driver dw_mipi_dsi_driver;
-- 
2.7.4


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


[Bug 104362] GPU fault detected on wine-nine Path of Exile

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104362

Vladimir Usikov  changed:

   What|Removed |Added

 Attachment #136347|text/x-log  |text/plain
  mime type||

-- 
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 104362] GPU fault detected on wine-nine Path of Exile

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104362

--- Comment #5 from Vladimir Usikov  ---
Created attachment 141330
  --> https://bugs.freedesktop.org/attachment.cgi?id=141330&action=edit
glxinfo

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


[Bug 104362] GPU fault detected on wine-nine Path of Exile

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104362

--- Comment #4 from Vladimir Usikov  ---
Created attachment 141329
  --> https://bugs.freedesktop.org/attachment.cgi?id=141329&action=edit
clean dmesg

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


[radeon-alex:drm-next-4.20-wip 224/235] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:735:46: sparse: Using plain integer as NULL pointer

2018-08-28 Thread kbuild test robot
tree:   git://people.freedesktop.org/~agd5f/linux.git drm-next-4.20-wip
head:   bdb1922abd620d24715906bac4d119274d98f4c9
commit: 46659a83e4662ed92000ec13445b8c0ca96fd2cc [224/235] drm/amd/display: 
Support reading hw state from debugfs file
reproduce:
# apt-get install sparse
git checkout 46659a83e4662ed92000ec13445b8c0ca96fd2cc
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   include/linux/slab.h:631:13: sparse: undefined identifier 
'__builtin_mul_overflow'
   include/linux/slab.h:631:13: sparse: not a function 
   include/linux/slab.h:631:13: sparse: not a function 
   include/linux/slab.h:631:13: sparse: not a function 
   include/linux/slab.h:631:13: sparse: not a function 
>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:735:46: 
>> sparse: Using plain integer as NULL pointer
>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:749:27: 
>> sparse: expression using sizeof(void)
>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:749:27: 
>> sparse: expression using sizeof(void)
   include/linux/slab.h:631:13: sparse: call with no type!

vim +735 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c

   722  
   723  /*
   724   * Writes DTN log state to the user supplied buffer.
   725   * Example usage: cat /sys/kernel/debug/dri/0/amdgpu_dm_dtn_log
   726   */
   727  static ssize_t dtn_log_read(
   728  struct file *f,
   729  char __user *buf,
   730  size_t size,
   731  loff_t *pos)
   732  {
   733  struct amdgpu_device *adev = file_inode(f)->i_private;
   734  struct dc *dc = adev->dm.dc;
 > 735  struct dc_log_buffer_ctx log_ctx = { 0 };
   736  ssize_t result = 0;
   737  
   738  if (!buf || !size)
   739  return -EINVAL;
   740  
   741  if (!dc->hwss.log_hw_state)
   742  return 0;
   743  
   744  dc->hwss.log_hw_state(dc, &log_ctx);
   745  
   746  if (*pos < log_ctx.pos) {
   747  size_t to_copy = log_ctx.pos - *pos;
   748  
 > 749  to_copy = min(to_copy, size);
   750  
   751  if (!copy_to_user(buf, log_ctx.buf + *pos, to_copy)) {
   752  *pos += to_copy;
   753  result = to_copy;
   754  }
   755  }
   756  
   757  kfree(log_ctx.buf);
   758  
   759  return result;
   760  }
   761  

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


[PATCH v6 0/3] Add support rockchip RGB output interface

2018-08-28 Thread Sandy Huang
This patches add support rockchip RGB output, Some Rockchip CRTCs, like
rv1108 and px30 can directly output parallel and serial RGB data to panel
or to conversion chip.
So add a feature-bit for vops to mark the ability for these direct outputs
and add an internal encoder in that case, that can attach to bridge chips
or panels.

Heiko Stuebner (1):
  drm/tockchip: add function to check if endpoint is a subdriver

Sandy Huang (2):
  drm/rockchip: Add support for Rockchip Soc RGB output interface
  drm/rockchip: Add directly output rgb feature for px30

 drivers/gpu/drm/rockchip/Kconfig|  11 ++
 drivers/gpu/drm/rockchip/Makefile   |   1 +
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c |  29 +
 drivers/gpu/drm/rockchip/rockchip_drm_drv.h |   2 +
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c |  16 +++
 drivers/gpu/drm/rockchip/rockchip_drm_vop.h |   1 +
 drivers/gpu/drm/rockchip/rockchip_rgb.c | 173 
 drivers/gpu/drm/rockchip/rockchip_rgb.h |  20 
 drivers/gpu/drm/rockchip/rockchip_vop_reg.c |   2 +
 9 files changed, 255 insertions(+)
 create mode 100644 drivers/gpu/drm/rockchip/rockchip_rgb.c
 create mode 100644 drivers/gpu/drm/rockchip/rockchip_rgb.h

-- 
2.7.4


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


Re: [PATCH 2/2] drm/tinydrm: Switch from CMA to shmem buffers

2018-08-28 Thread kbuild test robot
Hi Noralf,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.19-rc1 next-20180828]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Noralf-Tr-nnes/drm-Add-shmem-GEM-library/20180828-222625
reproduce: make htmldocs

All warnings (new ones prefixed by >>):

   include/net/mac80211.h:977: warning: Function parameter or member 
'status.tx_time' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.is_valid_ack_signal' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.status_driver_data' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'driver_rates' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 'pad' not 
described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'rate_driver_data' not described in 'ieee80211_tx_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'rx_stats_avg' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'rx_stats_avg.signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'rx_stats_avg.chain_signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.filtered' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.retry_failed' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.retry_count' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.lost_packets' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.last_tdls_pkt_time' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.msdu_retries' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.msdu_failed' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.last_ack' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.last_ack_signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.ack_signal_filled' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.avg_ack_signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'tx_stats.packets' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'tx_stats.bytes' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'tx_stats.last_rate' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'tx_stats.msdu' not described in 'sta_info'
   include/linux/mod_devicetable.h:763: warning: Function parameter or member 
'driver_data' not described in 'typec_device_id'
   kernel/sched/fair.c:3371: warning: Function parameter or member 'flags' not 
described in 'attach_entity_load_avg'
   arch/x86/include/asm/atomic.h:84: warning: Excess function parameter 'i' 
description in 'arch_atomic_sub_and_test'
   arch/x86/include/asm/atomic.h:84: warning: Excess function parameter 'v' 
description in 'arch_atomic_sub_and_test'
   arch/x86/include/asm/atomic.h:96: warning: Excess function parameter 'v' 
description in 'arch_atomic_inc'
   arch/x86/include/asm/atomic.h:109: warning: Excess function parameter 'v' 
description in 'arch_atomic_dec'
   arch/x86/include/asm/atomic.h:124: warning: Excess function parameter 'v' 
description in 'arch_atomic_dec_and_test'
   arch/x86/include/asm/atomic.h:138: warning: Excess function parameter 'v' 
description in 'arch_atomic_i

[PATCH v6 1/3] drm/tockchip: add function to check if endpoint is a subdriver

2018-08-28 Thread Sandy Huang
From: Heiko Stuebner 

To be able to have both internal subdrivers and external bridge
drivers as output endpoints of vops, add a function to be able
to distinguish these.

Signed-off-by: Heiko Stuebner 
---
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 27 +++
 drivers/gpu/drm/rockchip/rockchip_drm_drv.h |  1 +
 2 files changed, 28 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index 1d9c4a9..d18f7f8 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -267,6 +268,32 @@ static const struct dev_pm_ops rockchip_drm_pm_ops = {
 static struct platform_driver *rockchip_sub_drivers[MAX_ROCKCHIP_SUB_DRIVERS];
 static int num_rockchip_sub_drivers;
 
+/*
+ * check if a vop output-endpoint is a subdriver or bridge.
+ */
+bool rockchip_drm_endpoint_is_subdriver(struct device_node *ep)
+{
+   struct device_node *node = of_graph_get_remote_port_parent(ep);
+   struct platform_device *pdev;
+   int i;
+
+   if (!node)
+   return false;
+
+   pdev = of_find_device_by_node(node);
+   if (!pdev)
+   return false;
+
+   for (i = 0; i < num_rockchip_sub_drivers; i++) {
+   struct device_driver *drv = pdev->dev.driver;
+
+   if (rockchip_sub_drivers[i] == to_platform_driver(drv))
+   return true;
+   }
+
+   return false;
+}
+
 static int compare_dev(struct device *dev, void *data)
 {
return dev == (struct device *)data;
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h 
b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
index d67ad0a..305b485 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
@@ -64,6 +64,7 @@ void rockchip_drm_dma_detach_device(struct drm_device 
*drm_dev,
struct device *dev);
 int rockchip_drm_wait_vact_end(struct drm_crtc *crtc, unsigned int mstimeout);
 
+bool rockchip_drm_endpoint_is_subdriver(struct device_node *ep);
 extern struct platform_driver cdn_dp_driver;
 extern struct platform_driver dw_hdmi_rockchip_pltfm_driver;
 extern struct platform_driver dw_mipi_dsi_driver;
-- 
2.7.4


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


[PATCH v6 3/3] drm/rockchip: Add directly output rgb feature for px30

2018-08-28 Thread Sandy Huang
Add this feature bit indicate px30 vop can directly output
parallel or serial rgb data.

Signed-off-by: Sandy Huang 
---
 drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c 
b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
index d824ca6..d2c3a5c 100644
--- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
+++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
@@ -278,6 +278,7 @@ static const struct vop_win_data px30_vop_big_win_data[] = {
 
 static const struct vop_data px30_vop_big = {
.intr = &px30_intr,
+   .feature = VOP_FEATURE_INTERNAL_RGB,
.common = &px30_common,
.modeset = &px30_modeset,
.output = &px30_output,
@@ -292,6 +293,7 @@ static const struct vop_win_data px30_vop_lit_win_data[] = {
 
 static const struct vop_data px30_vop_lit = {
.intr = &px30_intr,
+   .feature = VOP_FEATURE_INTERNAL_RGB,
.common = &px30_common,
.modeset = &px30_modeset,
.output = &px30_output,
-- 
2.7.4


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


[PATCH v6 2/3] drm/rockchip: Add support for Rockchip Soc RGB output interface

2018-08-28 Thread Sandy Huang
Some Rockchip CRTCs, like rv1108 and px30, can directly output parallel
and serial RGB data to panel or conversion chip.

So add a feature-bit for vops to mark the ability for these direct
outputs and add an internal encoder in that case, that can attach to
bridge chipsor panels.

Signed-off-by: Sandy Huang 
Signed-off-by: Heiko Stuebner 
Reviewed-by: Sean Paul 
Reviewed-by: Mark Yao 
---
Changes in v6:
1. Update according to Heiko Stuebner' implemention, rgb output is
   part of vop's feature, should not register as a independent
   driver.
Changes in v5:
1. add SPDX-License-Identifier tag
Changes in v4:
1. add support px30;
Changes in v3:
1. update for rgb-mode move to panel node.
Changes in v2:
1. add error log when probe failed;
2. update name_to_output_mode() according to sean's suggest;
3. Fix uninitialized use of ret.


drivers/gpu/drm/rockchip/Kconfig|  11 ++
 drivers/gpu/drm/rockchip/Makefile   |   1 +
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c |   2 +
 drivers/gpu/drm/rockchip/rockchip_drm_drv.h |   1 +
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c |  16 +++
 drivers/gpu/drm/rockchip/rockchip_drm_vop.h |   1 +
 drivers/gpu/drm/rockchip/rockchip_rgb.c | 173 
 drivers/gpu/drm/rockchip/rockchip_rgb.h |  20 
 8 files changed, 225 insertions(+)
 create mode 100644 drivers/gpu/drm/rockchip/rockchip_rgb.c
 create mode 100644 drivers/gpu/drm/rockchip/rockchip_rgb.h

diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig
index 0ccc762..e88eb71 100644
--- a/drivers/gpu/drm/rockchip/Kconfig
+++ b/drivers/gpu/drm/rockchip/Kconfig
@@ -8,6 +8,7 @@ config DRM_ROCKCHIP
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_RGB if ROCKCHIP_RGB
select SND_SOC_HDMI_CODEC if ROCKCHIP_CDN_DP && SND_SOC
help
  Choose this option if you have a Rockchip soc chipset.
@@ -66,4 +67,14 @@ config ROCKCHIP_LVDS
  Rockchip rk3288 SoC has LVDS TX Controller can be used, and it
  support LVDS, rgb, dual LVDS output mode. say Y to enable its
  driver.
+
+config ROCKCHIP_RGB
+   bool "Rockchip RGB support"
+   depends on DRM_ROCKCHIP
+   depends on PINCTRL
+   help
+ Choose this option to enable support for Rockchip RGB output.
+ Some Rockchip CRTCs, like rv1108, can directly output parallel
+ and serial RGB format to panel or connect to a conversion chip.
+ say Y to enable its driver.
 endif
diff --git a/drivers/gpu/drm/rockchip/Makefile 
b/drivers/gpu/drm/rockchip/Makefile
index a314e21..868263f 100644
--- a/drivers/gpu/drm/rockchip/Makefile
+++ b/drivers/gpu/drm/rockchip/Makefile
@@ -14,5 +14,6 @@ rockchipdrm-$(CONFIG_ROCKCHIP_DW_HDMI) += dw_hdmi-rockchip.o
 rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) += dw-mipi-dsi.o
 rockchipdrm-$(CONFIG_ROCKCHIP_INNO_HDMI) += inno_hdmi.o
 rockchipdrm-$(CONFIG_ROCKCHIP_LVDS) += rockchip_lvds.o
+rockchipdrm-$(CONFIG_ROCKCHIP_RGB) += rockchip_rgb.o
 
 obj-$(CONFIG_DRM_ROCKCHIP) += rockchipdrm.o
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index d18f7f8..c093339 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -459,6 +459,8 @@ static int __init rockchip_drm_init(void)
CONFIG_ROCKCHIP_LVDS);
ADD_ROCKCHIP_SUB_DRIVER(rockchip_dp_driver,
CONFIG_ROCKCHIP_ANALOGIX_DP);
+   ADD_ROCKCHIP_SUB_DRIVER(rockchip_rgb_driver,
+   CONFIG_ROCKCHIP_RGB);
ADD_ROCKCHIP_SUB_DRIVER(cdn_dp_driver, CONFIG_ROCKCHIP_CDN_DP);
ADD_ROCKCHIP_SUB_DRIVER(dw_hdmi_rockchip_pltfm_driver,
CONFIG_ROCKCHIP_DW_HDMI);
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h 
b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
index 305b485..92ad06e 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
@@ -71,5 +71,6 @@ extern struct platform_driver dw_mipi_dsi_driver;
 extern struct platform_driver inno_hdmi_driver;
 extern struct platform_driver rockchip_dp_driver;
 extern struct platform_driver rockchip_lvds_driver;
+extern struct platform_driver rockchip_rgb_driver;
 extern struct platform_driver vop_platform_driver;
 #endif /* _ROCKCHIP_DRM_DRV_H_ */
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 38f8cae..867b654 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -41,6 +41,7 @@
 #include "rockchip_drm_fb.h"
 #include "rockchip_drm_psr.h"
 #include "rockchip_drm_vop.h"
+#include "rockchip_rgb.h"
 
 #define VOP_WIN_SET(x, win, name, v) \
vop_reg_s

[Bug 107731] radeon (amdgpu) DisplayPort loss of max-resolution on DP monitor (after monitor power saving / idle)

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107731

Fermulator  changed:

   What|Removed |Added

   See Also||https://bugs.freedesktop.or
   ||g/show_bug.cgi?id=107560

-- 
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 107560] radeon (amdgpu) GDM flip queue failed invalid argument, DisplayPort issues

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107560

Fermulator  changed:

   What|Removed |Added

   See Also||https://bugs.freedesktop.or
   ||g/show_bug.cgi?id=107731

-- 
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 107731] radeon (amdgpu) DisplayPort loss of max-resolution on DP monitor (after monitor power saving / idle)

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107731

Bug ID: 107731
   Summary: radeon (amdgpu) DisplayPort loss of max-resolution on
DP monitor (after monitor power saving / idle)
   Product: DRI
   Version: XOrg git
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: DRM/AMDgpu
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: freedesktop-b...@fermulator.fastmail.org

Created attachment 141328
  --> https://bugs.freedesktop.org/attachment.cgi?id=141328&action=edit
dmesg output post DP disconnect + reconnect to fix resolution

as an extension of the story from:
 * https://bugs.freedesktop.org/show_bug.cgi?id=107560#c9

after a few kernel/driver upgrades and weeks later, that is no longer
reproducible - and is instead replaced by lesser issues still plaguing the
monitor connected via display port

$ uname -r
4.17.17-100.fc27.x86_64


noticed that the same monitor (connected via DisplayPort) had mis-match
capabilities (wasn't able to go max resolution)

```
$ xrandr
Screen 0: minimum 320 x 200, current 3840 x 1200, maximum 16384 x 16384
DisplayPort-0 connected primary 1920x1080+0+0 (normal left inverted right x
axis y axis) 0mm x 0mm
   1920x1080 59.95* 
   1600x1200 59.95  
   1680x1050 59.95  
   1280x1024 59.95  
   1440x900  59.95  
   1280x800  59.95  
   1280x720  59.95  
   1024x768  59.95  
   800x600   59.95  
   640x480   59.95  
HDMI-A-0 disconnected (normal left inverted right x axis y axis)
DVI-D-0 connected 1920x1200+1920+0 (normal left inverted right x axis y axis)
518mm x 324mm
   1920x1200 59.95*+
   1920x1080 59.95  
   1600x1200 60.00  
   1680x1050 59.95  
   1280x1024 60.02  
   1440x900  59.95  
   1280x960  60.00  
   1280x800  59.95  
   1280x720  59.95  
   1024x768  60.00  
   800x600   60.3256.25  
   640x480   59.94  
```

The "   1920x1200 59.95*+" option is missing from the display port monitor.

If I disconnect the DP, and reconnect, it comes back.

```
$ xrandr | grep +
DisplayPort-0 connected primary 1920x1200+0+0 (normal left inverted right x
axis y axis) 518mm x 324mm
   1920x1200 59.95*+
DVI-D-0 connected 1920x1200+1920+0 (normal left inverted right x axis y axis)
518mm x 324mm
   1920x1200 59.95*+
```

---
$ dnf info xorg-x11-drv-amdgpu
Failed to synchronize cache for repo 'mosquito-atom', disabling.
Failed to synchronize cache for repo 'region51-chrome-gnome-shell', disabling.
Failed to synchronize cache for repo 'spacewalk-client', disabling.
Last metadata expiration check: 20 days, 23:02:26 ago on Tue 07 Aug 2018
11:04:16 AM EDT.
Installed Packages
Name : xorg-x11-drv-amdgpu
Version  : 18.0.1
Release  : 1.fc27
Arch : x86_64
Size : 147 k
Source   : xorg-x11-drv-amdgpu-18.0.1-1.fc27.src.rpm
Repo : @System
>From repo: updates
Summary  : AMD GPU video driver
URL  : https://www.x.org/wiki
License  : MIT
Description  : X.Org X11 AMDGPU driver

$ rpm -qa | egrep "amdgpu|gdm|dri-|xorg-x11-server|gnome-session"
mesa-dri-drivers-17.3.9-1.fc27.x86_64
xorg-x11-server-utils-7.7-23.fc27.x86_64
xorg-x11-drv-amdgpu-18.0.1-1.fc27.x86_64
gnome-session-3.26.1-1.fc27.x86_64
gdm-3.26.2.1-3.fc27.x86_64
gnome-session-xsession-3.26.1-1.fc27.x86_64
xorg-x11-server-Xephyr-1.19.6-7.fc27.x86_64
gnome-session-wayland-session-3.26.1-1.fc27.x86_64
pulseaudio-gdm-hooks-12.2-1.fc27.x86_64
xorg-x11-server-Xorg-1.19.6-7.fc27.x86_64
xorg-x11-server-common-1.19.6-7.fc27.x86_64
xorg-x11-server-Xwayland-1.19.6-7.fc27.x86_64

-- 
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 107560] radeon (amdgpu) GDM flip queue failed invalid argument, DisplayPort issues

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107560

Fermulator  changed:

   What|Removed |Added

 Resolution|--- |WORKSFORME
 Status|NEW |RESOLVED

--- Comment #14 from Fermulator  ---
submitted https://bugs.freedesktop.org/show_bug.cgi?id=107731

-- 
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 05/14] drm/msm/dpu: enable master-slave encoders explicitly

2018-08-28 Thread Jeykumar Sankaran
Identify slave-master encoders during initialization and enable
the encoders explicitly as the current logic has redundant and
ambiguous loops.

Signed-off-by: Jeykumar Sankaran 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 46 ++---
 1 file changed, 15 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 991b22c..b223bd2 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -180,6 +180,7 @@ struct dpu_encoder_virt {
unsigned int num_phys_encs;
struct dpu_encoder_phys *phys_encs[MAX_PHYS_ENCODERS_PER_VIRTUAL];
struct dpu_encoder_phys *cur_master;
+   struct dpu_encoder_phys *cur_slave;
struct dpu_hw_pingpong *hw_pp[MAX_CHANNELS_PER_ENC];
 
bool intfs_swapped;
@@ -1141,7 +1142,8 @@ void dpu_encoder_virt_restore(struct drm_encoder *drm_enc)
 static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
 {
struct dpu_encoder_virt *dpu_enc = NULL;
-   int i, ret = 0;
+   struct dpu_encoder_phys *phys  = NULL;
+   int ret = 0;
struct drm_display_mode *cur_mode = NULL;
 
if (!drm_enc) {
@@ -1154,21 +1156,14 @@ static void dpu_encoder_virt_enable(struct drm_encoder 
*drm_enc)
trace_dpu_enc_enable(DRMID(drm_enc), cur_mode->hdisplay,
 cur_mode->vdisplay);
 
-   dpu_enc->cur_master = NULL;
-   for (i = 0; i < dpu_enc->num_phys_encs; i++) {
-   struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];
+   /* always enable slave encoder before master */
+   phys = dpu_enc->cur_slave;
+   if (phys && phys->ops.enable)
+   phys->ops.enable(phys);
 
-   if (phys && phys->ops.is_master && phys->ops.is_master(phys)) {
-   DPU_DEBUG_ENC(dpu_enc, "master is now idx %d\n", i);
-   dpu_enc->cur_master = phys;
-   break;
-   }
-   }
-
-   if (!dpu_enc->cur_master) {
-   DPU_ERROR("virt encoder has no master! num_phys %d\n", i);
-   return;
-   }
+   phys = dpu_enc->cur_master;
+   if (phys && phys->ops.enable)
+   phys->ops.enable(phys);
 
ret = dpu_encoder_resource_control(drm_enc, DPU_ENC_RC_EVENT_KICKOFF);
if (ret) {
@@ -1177,21 +1172,6 @@ static void dpu_encoder_virt_enable(struct drm_encoder 
*drm_enc)
return;
}
 
-   for (i = 0; i < dpu_enc->num_phys_encs; i++) {
-   struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];
-
-   if (!phys)
-   continue;
-
-   if (phys != dpu_enc->cur_master) {
-   if (phys->ops.enable)
-   phys->ops.enable(phys);
-   }
-   }
-
-   if (dpu_enc->cur_master->ops.enable)
-   dpu_enc->cur_master->ops.enable(dpu_enc->cur_master);
-
_dpu_encoder_virt_enable_helper(drm_enc);
 }
 
@@ -2062,6 +2042,11 @@ static int dpu_encoder_virt_add_phys_encs(
++dpu_enc->num_phys_encs;
}
 
+   if (params->split_role == ENC_ROLE_SLAVE)
+   dpu_enc->cur_slave = enc;
+   else
+   dpu_enc->cur_master = enc;
+
return 0;
 }
 
@@ -2228,7 +2213,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct 
drm_encoder *enc,
if (ret)
goto fail;
 
-   dpu_enc->cur_master = NULL;
spin_lock_init(&dpu_enc->enc_spinlock);
 
atomic_set(&dpu_enc->frame_done_timeout, 0);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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


[PATCH 11/14] drm/msm/dpu: rename hw_ctl to lm_ctl

2018-08-28 Thread Jeykumar Sankaran
Rename hw_ctl to lm_ctl to mean the ctl associated
with the hw layer mixer block.

sed -i 's/\([*@.>]\)hw_ctl\([^s]\)/\1lm_ctl\2/g' dpu_crtc.c dpu_crtc.h

Signed-off-by: Jeykumar Sankaran 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 26 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h |  4 ++--
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 7ab320d..aeb0f1a 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -202,7 +202,7 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc 
*crtc,
return;
}
 
-   ctl = mixer->hw_ctl;
+   ctl = mixer->lm_ctl;
lm = mixer->hw_lm;
stage_cfg = &dpu_crtc->stage_cfg;
cstate = to_dpu_crtc_state(crtc->state);
@@ -292,15 +292,15 @@ static void _dpu_crtc_blend_setup(struct drm_crtc *crtc)
}
 
for (i = 0; i < cstate->num_mixers; i++) {
-   if (!mixer[i].hw_lm || !mixer[i].hw_ctl) {
+   if (!mixer[i].hw_lm || !mixer[i].lm_ctl) {
DPU_ERROR("invalid lm or ctl assigned to mixer\n");
return;
}
mixer[i].mixer_op_mode = 0;
mixer[i].flush_mask = 0;
-   if (mixer[i].hw_ctl->ops.clear_all_blendstages)
-   mixer[i].hw_ctl->ops.clear_all_blendstages(
-   mixer[i].hw_ctl);
+   if (mixer[i].lm_ctl->ops.clear_all_blendstages)
+   mixer[i].lm_ctl->ops.clear_all_blendstages(
+   mixer[i].lm_ctl);
}
 
/* initialize stage cfg */
@@ -309,7 +309,7 @@ static void _dpu_crtc_blend_setup(struct drm_crtc *crtc)
_dpu_crtc_blend_setup_mixer(crtc, dpu_crtc, mixer);
 
for (i = 0; i < cstate->num_mixers; i++) {
-   ctl = mixer[i].hw_ctl;
+   ctl = mixer[i].lm_ctl;
lm = mixer[i].hw_lm;
 
lm->ops.setup_alpha_out(lm, mixer[i].mixer_op_mode);
@@ -553,14 +553,14 @@ static void _dpu_crtc_setup_mixer_for_encoder(
if (!dpu_rm_get_hw(rm, &ctl_iter)) {
DPU_DEBUG("no ctl assigned to lm %d, using previous\n",
mixer->hw_lm->idx - LM_0);
-   mixer->hw_ctl = last_valid_ctl;
+   mixer->lm_ctl = last_valid_ctl;
} else {
-   mixer->hw_ctl = (struct dpu_hw_ctl *)ctl_iter.hw;
-   last_valid_ctl = mixer->hw_ctl;
+   mixer->lm_ctl = (struct dpu_hw_ctl *)ctl_iter.hw;
+   last_valid_ctl = mixer->lm_ctl;
}
 
/* Shouldn't happen, mixers are always >= ctls */
-   if (!mixer->hw_ctl) {
+   if (!mixer->lm_ctl) {
DPU_ERROR("no valid ctls found for lm %d\n",
mixer->hw_lm->idx - LM_0);
return;
@@ -572,7 +572,7 @@ static void _dpu_crtc_setup_mixer_for_encoder(
DPU_DEBUG("setup mixer %d: lm %d\n",
i, mixer->hw_lm->idx - LM_0);
DPU_DEBUG("setup mixer %d: ctl %d\n",
-   i, mixer->hw_ctl->idx - CTL_0);
+   i, mixer->lm_ctl->idx - CTL_0);
}
 }
 
@@ -1567,11 +1567,11 @@ static int _dpu_debugfs_status_show(struct seq_file *s, 
void *data)
m = &cstate->mixers[i];
if (!m->hw_lm)
seq_printf(s, "\tmixer[%d] has no lm\n", i);
-   else if (!m->hw_ctl)
+   else if (!m->lm_ctl)
seq_printf(s, "\tmixer[%d] has no ctl\n", i);
else
seq_printf(s, "\tmixer:%d ctl:%d width:%d height:%d\n",
-   m->hw_lm->idx - LM_0, m->hw_ctl->idx - CTL_0,
+   m->hw_lm->idx - LM_0, m->lm_ctl->idx - CTL_0,
out_width, mode->vdisplay);
}
 
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
index 7aa772f..9b1056c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
@@ -83,14 +83,14 @@ struct dpu_crtc_smmu_state_data {
 /**
  * struct dpu_crtc_mixer: stores the map for each virtual pipeline in the CRTC
  * @hw_lm: LM HW Driver context
- * @hw_ctl:CTL Path HW driver context
+ * @lm_ctl:CTL Path HW driver context
  * @encoder:   Encoder attached to this lm & ctl
  * @mixer_op_mode: mixer blending operation mode
  * @flush_mask:mixer flush mask for ctl, mixer and pipe
  */
 struct dpu_crtc_mixer {
struct dpu_hw_mixer *hw_lm;
-   struct dpu_hw_ctl *hw_ctl;

[PATCH 12/14] drm/msm/dpu: remove topology name

2018-08-28 Thread Jeykumar Sankaran
Strip down the support for topology enums. It
can be replaced with simple hw count checks.

Signed-off-by: Jeykumar Sankaran 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c|  3 --
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h|  1 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h   |  9 --
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c   |  7 +++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 36 ++
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h | 24 ---
 6 files changed, 19 insertions(+), 61 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index dbf669e..56ef349 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -1013,7 +1013,6 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder 
*drm_enc,
struct drm_connector *conn = NULL, *conn_iter;
struct dpu_rm_hw_iter pp_iter, ctl_iter;
struct msm_display_topology topology;
-   enum dpu_rm_topology_name topology_name;
struct dpu_hw_ctl *hw_ctl[MAX_CHANNELS_PER_ENC] = { NULL };
int i = 0, ret;
 
@@ -1069,7 +1068,6 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder 
*drm_enc,
hw_ctl[i] = (struct dpu_hw_ctl *)ctl_iter.hw;
}
 
-   topology_name = dpu_rm_get_topology_name(topology);
for (i = 0; i < dpu_enc->num_phys_encs; i++) {
struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];
 
@@ -1089,7 +1087,6 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder 
*drm_enc,
phys->hw_ctl = hw_ctl[i];
 
phys->connector = conn->state->connector;
-   phys->topology_name = topology_name;
if (phys->ops.mode_set)
phys->ops.mode_set(phys, mode, adj_mode);
}
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
index 60f809f..c5600e6 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
@@ -35,7 +35,6 @@
  * @needs_cdm: Encoder requests a CDM based on pixel format conversion needs
  * @display_num_of_h_tiles: Number of horizontal tiles in case of split
  *  interface
- * @topology:   Topology of the display
  */
 struct dpu_encoder_hw_resources {
enum dpu_intf_mode intfs[INTF_MAX];
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h
index b3917e0..b5fc65c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h
@@ -24,6 +24,7 @@
 #include "dpu_hw_top.h"
 #include "dpu_hw_cdm.h"
 #include "dpu_encoder.h"
+#include "dpu_crtc.h"
 
 #define DPU_ENCODER_NAME_MAX   16
 
@@ -213,7 +214,6 @@ struct dpu_encoder_irq {
  * @split_role:Role to play in a split-panel configuration
  * @intf_mode: Interface mode
  * @intf_idx:  Interface index on dpu hardware
- * @topology_name: topology selected for the display
  * @enc_spinlock:  Virtual-Encoder-Wide Spin Lock for IRQ purposes
  * @enable_state:  Enable state tracking
  * @vblank_refcount:   Reference count of vblank request
@@ -243,7 +243,6 @@ struct dpu_encoder_phys {
enum dpu_enc_split_role split_role;
enum dpu_intf_mode intf_mode;
enum dpu_intf intf_idx;
-   enum dpu_rm_topology_name topology_name;
spinlock_t *enc_spinlock;
enum dpu_enc_enable_state enable_state;
atomic_t vblank_refcount;
@@ -361,11 +360,15 @@ struct dpu_encoder_phys *dpu_encoder_phys_cmd_init(
 static inline enum dpu_3d_blend_mode dpu_encoder_helper_get_3d_blend_mode(
struct dpu_encoder_phys *phys_enc)
 {
+   struct dpu_crtc_state *dpu_cstate;
+
if (!phys_enc || phys_enc->enable_state == DPU_ENC_DISABLING)
return BLEND_3D_NONE;
 
+   dpu_cstate = to_dpu_crtc_state(phys_enc->parent->crtc->state);
+
if (phys_enc->split_role == ENC_ROLE_SOLO &&
-   phys_enc->topology_name == DPU_RM_TOPOLOGY_DUALPIPE_3DMERGE)
+   (dpu_cstate->num_mixers == 2))
return BLEND_3D_H_ROW_INT;
 
return BLEND_3D_NONE;
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
index 6de13f4..1643e2f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
@@ -355,13 +355,14 @@ static void dpu_encoder_phys_vid_underrun_irq(void *arg, 
int irq_idx)
 
 static bool _dpu_encoder_phys_is_dual_ctl(struct dpu_encoder_phys *phys_enc)
 {
+   struct dpu_crtc_state *dpu_cstate;
+
if (!phys_enc)
return false;
 
-   if (phys_enc->topology_name == DPU_RM_TOPOLOGY_DUALPIPE)

[PATCH 10/14] drm/msm/dpu: move hw resource tracking to crtc state

2018-08-28 Thread Jeykumar Sankaran
Prep changes for state based resource management.

Moves all the hw block tracking for the crtc to the state
object.

Signed-off-by: Jeykumar Sankaran 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 60 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h | 22 ++--
 2 files changed, 44 insertions(+), 38 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index e061847..7ab320d 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -163,9 +163,9 @@ static void _dpu_crtc_program_lm_output_roi(struct drm_crtc 
*crtc)
crtc_state = to_dpu_crtc_state(crtc->state);
 
lm_horiz_position = 0;
-   for (lm_idx = 0; lm_idx < dpu_crtc->num_mixers; lm_idx++) {
+   for (lm_idx = 0; lm_idx < crtc_state->num_mixers; lm_idx++) {
const struct drm_rect *lm_roi = &crtc_state->lm_bounds[lm_idx];
-   struct dpu_hw_mixer *hw_lm = dpu_crtc->mixers[lm_idx].hw_lm;
+   struct dpu_hw_mixer *hw_lm = crtc_state->mixers[lm_idx].hw_lm;
struct dpu_hw_mixer_cfg cfg;
 
if (!lm_roi || !drm_rect_visible(lm_roi))
@@ -246,7 +246,7 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc 
*crtc,
   fb ? fb->modifier : 0);
 
/* blend config update */
-   for (lm_idx = 0; lm_idx < dpu_crtc->num_mixers; lm_idx++) {
+   for (lm_idx = 0; lm_idx < cstate->num_mixers; lm_idx++) {
_dpu_crtc_setup_blend_cfg(mixer + lm_idx,
pstate, format);
 
@@ -270,7 +270,7 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc 
*crtc,
 static void _dpu_crtc_blend_setup(struct drm_crtc *crtc)
 {
struct dpu_crtc *dpu_crtc;
-   struct dpu_crtc_state *dpu_crtc_state;
+   struct dpu_crtc_state *cstate;
struct dpu_crtc_mixer *mixer;
struct dpu_hw_ctl *ctl;
struct dpu_hw_mixer *lm;
@@ -281,17 +281,17 @@ static void _dpu_crtc_blend_setup(struct drm_crtc *crtc)
return;
 
dpu_crtc = to_dpu_crtc(crtc);
-   dpu_crtc_state = to_dpu_crtc_state(crtc->state);
-   mixer = dpu_crtc->mixers;
+   cstate = to_dpu_crtc_state(crtc->state);
+   mixer = cstate->mixers;
 
DPU_DEBUG("%s\n", dpu_crtc->name);
 
-   if (dpu_crtc->num_mixers > CRTC_DUAL_MIXERS) {
-   DPU_ERROR("invalid number mixers: %d\n", dpu_crtc->num_mixers);
+   if (cstate->num_mixers > CRTC_DUAL_MIXERS) {
+   DPU_ERROR("invalid number mixers: %d\n", cstate->num_mixers);
return;
}
 
-   for (i = 0; i < dpu_crtc->num_mixers; i++) {
+   for (i = 0; i < cstate->num_mixers; i++) {
if (!mixer[i].hw_lm || !mixer[i].hw_ctl) {
DPU_ERROR("invalid lm or ctl assigned to mixer\n");
return;
@@ -308,7 +308,7 @@ static void _dpu_crtc_blend_setup(struct drm_crtc *crtc)
 
_dpu_crtc_blend_setup_mixer(crtc, dpu_crtc, mixer);
 
-   for (i = 0; i < dpu_crtc->num_mixers; i++) {
+   for (i = 0; i < cstate->num_mixers; i++) {
ctl = mixer[i].hw_ctl;
lm = mixer[i].hw_lm;
 
@@ -530,7 +530,7 @@ static void _dpu_crtc_setup_mixer_for_encoder(
struct drm_crtc *crtc,
struct drm_encoder *enc)
 {
-   struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
+   struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state);
struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(crtc);
struct dpu_rm *rm = &dpu_kms->rm;
struct dpu_crtc_mixer *mixer;
@@ -542,8 +542,8 @@ static void _dpu_crtc_setup_mixer_for_encoder(
dpu_rm_init_hw_iter(&ctl_iter, enc->base.id, DPU_HW_BLK_CTL);
 
/* Set up all the mixers and ctls reserved by this encoder */
-   for (i = dpu_crtc->num_mixers; i < ARRAY_SIZE(dpu_crtc->mixers); i++) {
-   mixer = &dpu_crtc->mixers[i];
+   for (i = cstate->num_mixers; i < ARRAY_SIZE(cstate->mixers); i++) {
+   mixer = &cstate->mixers[i];
 
if (!dpu_rm_get_hw(rm, &lm_iter))
break;
@@ -568,7 +568,7 @@ static void _dpu_crtc_setup_mixer_for_encoder(
 
mixer->encoder = enc;
 
-   dpu_crtc->num_mixers++;
+   cstate->num_mixers++;
DPU_DEBUG("setup mixer %d: lm %d\n",
i, mixer->hw_lm->idx - LM_0);
DPU_DEBUG("setup mixer %d: ctl %d\n",
@@ -579,11 +579,11 @@ static void _dpu_crtc_setup_mixer_for_encoder(
 static void _dpu_crtc_setup_mixers(struct drm_crtc *crtc)
 {
struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
+   struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state);
struct drm_encoder *enc;
 
-   dpu_crtc->num_mixers = 0;
-   dpu_crtc->mixers_swapped 

[PATCH 14/14] drm/msm/dpu: remove cdm block support from resource manager

2018-08-28 Thread Jeykumar Sankaran
Support for CDM block is not present in DPU. Remove CDM
handlers from resource manager.

Signed-off-by: Jeykumar Sankaran 
---
 drivers/gpu/drm/msm/Makefile |   1 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h  |   2 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h |   5 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c   | 323 ---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.h   | 139 --
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c   |  14 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h   |   4 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.c   |  18 --
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h   |  17 --
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c   |  68 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h|   4 -
 11 files changed, 2 insertions(+), 593 deletions(-)
 delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c
 delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.h

diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
index 261fa79..19ab521 100644
--- a/drivers/gpu/drm/msm/Makefile
+++ b/drivers/gpu/drm/msm/Makefile
@@ -58,7 +58,6 @@ msm-y := \
disp/dpu1/dpu_formats.o \
disp/dpu1/dpu_hw_blk.o \
disp/dpu1/dpu_hw_catalog.o \
-   disp/dpu1/dpu_hw_cdm.o \
disp/dpu1/dpu_hw_ctl.o \
disp/dpu1/dpu_hw_interrupts.o \
disp/dpu1/dpu_hw_intf.o \
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
index e453271..e844afa 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
@@ -32,11 +32,9 @@
 /**
  * Encoder functions and data types
  * @intfs: Interfaces this encoder is using, INTF_MODE_NONE if unused
- * @needs_cdm: Encoder requests a CDM based on pixel format conversion needs
  */
 struct dpu_encoder_hw_resources {
enum dpu_intf_mode intfs[INTF_MAX];
-   bool needs_cdm;
 };
 
 /**
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h
index b5fc65c..f796683 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h
@@ -22,7 +22,6 @@
 #include "dpu_hw_pingpong.h"
 #include "dpu_hw_ctl.h"
 #include "dpu_hw_top.h"
-#include "dpu_hw_cdm.h"
 #include "dpu_encoder.h"
 #include "dpu_crtc.h"
 
@@ -205,8 +204,6 @@ struct dpu_encoder_irq {
  * @parent_ops:Callbacks exposed by the parent to the phys_enc
  * @hw_mdptop: Hardware interface to the top registers
  * @hw_ctl:Hardware interface to the ctl registers
- * @hw_cdm:Hardware interface to the cdm registers
- * @cdm_cfg:   Chroma-down hardware configuration
  * @hw_pp: Hardware interface to the ping pong registers
  * @dpu_kms:   Pointer to the dpu_kms top level
  * @cached_mode:   DRM mode cached at mode_set time, acted on in enable
@@ -235,8 +232,6 @@ struct dpu_encoder_phys {
const struct dpu_encoder_virt_ops *parent_ops;
struct dpu_hw_mdp *hw_mdptop;
struct dpu_hw_ctl *hw_ctl;
-   struct dpu_hw_cdm *hw_cdm;
-   struct dpu_hw_cdm_cfg cdm_cfg;
struct dpu_hw_pingpong *hw_pp;
struct dpu_kms *dpu_kms;
struct drm_display_mode cached_mode;
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c
deleted file mode 100644
index 554874b..000
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include "dpu_hw_mdss.h"
-#include "dpu_hwio.h"
-#include "dpu_hw_catalog.h"
-#include "dpu_hw_cdm.h"
-#include "dpu_dbg.h"
-#include "dpu_kms.h"
-
-#define CDM_CSC_10_OPMODE  0x000
-#define CDM_CSC_10_BASE0x004
-
-#define CDM_CDWN2_OP_MODE  0x100
-#define CDM_CDWN2_CLAMP_OUT0x104
-#define CDM_CDWN2_PARAMS_3D_0  0x108
-#define CDM_CDWN2_PARAMS_3D_1  0x10C
-#define CDM_CDWN2_COEFF_COSITE_H_0 0x110
-#define CDM_CDWN2_COEFF_COSITE_H_1 0x114
-#define CDM_CDWN2_COEFF_COSITE_H_2 0x118
-#define CDM_CDWN2_COEFF_OFFSITE_H_00x11C
-#define CDM_CDWN2_COEFF_OFFSITE_H_10x120
-#define CDM_CDWN2_COEFF_OFFSITE_H_20x124
-#define CDM_CDWN2_COEFF_COSITE_V   0x128
-#define CDM_CDWN2_COEFF_OFFSITE_V  0x12C
-#d

[PATCH 13/14] drm/msm/dpu: remove display H_TILE from encoder

2018-08-28 Thread Jeykumar Sankaran
Encoder H_TILE values are not used for allocating the hw blocks.
no. of hw_intf blocks provides the info.

Signed-off-by: Jeykumar Sankaran 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 5 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h | 3 ---
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c  | 3 +--
 3 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 56ef349..bfc082d 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -175,8 +175,6 @@ struct dpu_encoder_virt {
spinlock_t enc_spinlock;
uint32_t bus_scaling_client;
 
-   uint32_t display_num_of_h_tiles;
-
unsigned int num_phys_encs;
struct dpu_encoder_phys *phys_encs[MAX_PHYS_ENCODERS_PER_VIRTUAL];
struct dpu_encoder_phys *cur_master;
@@ -455,7 +453,6 @@ void dpu_encoder_get_hw_resources(struct drm_encoder 
*drm_enc,
 
/* Query resources used by phys encs, expected to be without overlap */
memset(hw_res, 0, sizeof(*hw_res));
-   hw_res->display_num_of_h_tiles = dpu_enc->display_num_of_h_tiles;
 
for (i = 0; i < dpu_enc->num_phys_encs; i++) {
struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];
@@ -2103,8 +2100,6 @@ static int dpu_encoder_setup_display(struct 
dpu_encoder_virt *dpu_enc,
 
WARN_ON(disp_info->num_of_h_tiles < 1);
 
-   dpu_enc->display_num_of_h_tiles = disp_info->num_of_h_tiles;
-
DPU_DEBUG("dsi_info->num_of_h_tiles %d\n", disp_info->num_of_h_tiles);
 
if ((disp_info->capabilities & MSM_DISPLAY_CAP_CMD_MODE) ||
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
index c5600e6..e453271 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
@@ -33,13 +33,10 @@
  * Encoder functions and data types
  * @intfs: Interfaces this encoder is using, INTF_MODE_NONE if unused
  * @needs_cdm: Encoder requests a CDM based on pixel format conversion needs
- * @display_num_of_h_tiles: Number of horizontal tiles in case of split
- *  interface
  */
 struct dpu_encoder_hw_resources {
enum dpu_intf_mode intfs[INTF_MAX];
bool needs_cdm;
-   u32 display_num_of_h_tiles;
 };
 
 /**
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
index fbd489f..388ae65 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
@@ -813,8 +813,7 @@ static int _dpu_rm_populate_requirements(
conn_state->connector->connector_type == DRM_MODE_CONNECTOR_DSI)
reqs->top_ctrl |= BIT(DPU_RM_TOPCTL_DS);
 
-   DRM_DEBUG_KMS("top_ctrl: 0x%llX num_h_tiles: %d\n", reqs->top_ctrl,
- reqs->hw_res.display_num_of_h_tiles);
+   DRM_DEBUG_KMS("top_ctrl: 0x%llX\n", reqs->top_ctrl);
DRM_DEBUG_KMS("num_lm: %d num_ctl: %d split_display: %d\n",
  reqs->topology->num_lm, reqs->topology->num_ctl,
  reqs->topology->needs_split_display);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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


[PATCH 08/14] drm/msm/dpu: avoid querying for hw intf before assignment

2018-08-28 Thread Jeykumar Sankaran
Resource manager assigns hw_intf blocks for the encoder only on
modeset. If queried for hw_intf objects during init, it will be
NULL. Since hw_intf objects are needed only during encoder enable,
defer the query to encoder enable which will be triggered after
modeset.

Signed-off-by: Jeykumar Sankaran 
---
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c   | 53 +++---
 1 file changed, 16 insertions(+), 37 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
index ca0963c..6de13f4 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
@@ -462,7 +462,7 @@ static void dpu_encoder_phys_vid_enable(struct 
dpu_encoder_phys *phys_enc)
 {
struct msm_drm_private *priv;
struct dpu_encoder_phys_vid *vid_enc;
-   struct dpu_hw_intf *intf;
+   struct dpu_rm_hw_iter iter;
struct dpu_hw_ctl *ctl;
u32 flush_mask = 0;
 
@@ -474,11 +474,20 @@ static void dpu_encoder_phys_vid_enable(struct 
dpu_encoder_phys *phys_enc)
priv = phys_enc->parent->dev->dev_private;
 
vid_enc = to_dpu_encoder_phys_vid(phys_enc);
-   intf = vid_enc->hw_intf;
ctl = phys_enc->hw_ctl;
-   if (!vid_enc->hw_intf || !phys_enc->hw_ctl) {
-   DPU_ERROR("invalid hw_intf %d hw_ctl %d\n",
-   vid_enc->hw_intf != 0, phys_enc->hw_ctl != 0);
+
+   dpu_rm_init_hw_iter(&iter, phys_enc->parent->base.id, DPU_HW_BLK_INTF);
+   while (dpu_rm_get_hw(&phys_enc->dpu_kms->rm, &iter)) {
+   struct dpu_hw_intf *hw_intf = (struct dpu_hw_intf *)iter.hw;
+
+   if (hw_intf->idx == phys_enc->intf_idx) {
+   vid_enc->hw_intf = hw_intf;
+   break;
+   }
+   }
+
+   if (!vid_enc->hw_intf) {
+   DPU_ERROR("hw_intf not assigned\n");
return;
}
 
@@ -500,7 +509,7 @@ static void dpu_encoder_phys_vid_enable(struct 
dpu_encoder_phys *phys_enc)
!dpu_encoder_phys_vid_is_master(phys_enc))
goto skip_flush;
 
-   ctl->ops.get_bitmask_intf(ctl, &flush_mask, intf->idx);
+   ctl->ops.get_bitmask_intf(ctl, &flush_mask, vid_enc->hw_intf->idx);
ctl->ops.update_pending_flush(ctl, flush_mask);
 
 skip_flush:
@@ -531,22 +540,13 @@ static void dpu_encoder_phys_vid_get_hw_resources(
struct dpu_encoder_hw_resources *hw_res,
struct drm_connector_state *conn_state)
 {
-   struct dpu_encoder_phys_vid *vid_enc;
-
if (!phys_enc || !hw_res) {
DPU_ERROR("invalid arg(s), enc %d hw_res %d conn_state %d\n",
phys_enc != 0, hw_res != 0, conn_state != 0);
return;
}
 
-   vid_enc = to_dpu_encoder_phys_vid(phys_enc);
-   if (!vid_enc->hw_intf) {
-   DPU_ERROR("invalid arg(s), hw_intf\n");
-   return;
-   }
-
-   DPU_DEBUG_VIDENC(vid_enc, "\n");
-   hw_res->intfs[vid_enc->hw_intf->idx - INTF_0] = INTF_MODE_VIDEO;
+   hw_res->intfs[phys_enc->intf_idx - INTF_0] = INTF_MODE_VIDEO;
 }
 
 static int _dpu_encoder_phys_vid_wait_for_vblank(
@@ -781,7 +781,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(
 {
struct dpu_encoder_phys *phys_enc = NULL;
struct dpu_encoder_phys_vid *vid_enc = NULL;
-   struct dpu_rm_hw_iter iter;
struct dpu_encoder_irq *irq;
int i, ret = 0;
 
@@ -801,26 +800,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(
phys_enc->hw_mdptop = p->dpu_kms->hw_mdp;
phys_enc->intf_idx = p->intf_idx;
 
-   /**
-* hw_intf resource permanently assigned to this encoder
-* Other resources allocated at atomic commit time by use case
-*/
-   dpu_rm_init_hw_iter(&iter, 0, DPU_HW_BLK_INTF);
-   while (dpu_rm_get_hw(&p->dpu_kms->rm, &iter)) {
-   struct dpu_hw_intf *hw_intf = (struct dpu_hw_intf *)iter.hw;
-
-   if (hw_intf->idx == p->intf_idx) {
-   vid_enc->hw_intf = hw_intf;
-   break;
-   }
-   }
-
-   if (!vid_enc->hw_intf) {
-   ret = -EINVAL;
-   DPU_ERROR("failed to get hw_intf\n");
-   goto fail;
-   }
-
DPU_DEBUG_VIDENC(vid_enc, "\n");
 
dpu_encoder_phys_vid_init_ops(&phys_enc->ops);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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


[PATCH 04/14] drm/msm/dpu: remove ping pong split topology variables

2018-08-28 Thread Jeykumar Sankaran
removes left out variables of previous ping pong
split topology cleanup.

Signed-off-by: Jeykumar Sankaran 
Reviewed-by: Sean Paul 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
index 5498c00..ec9c538 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
@@ -213,7 +213,6 @@ struct dpu_crtc {
 /**
  * struct dpu_crtc_state - dpu container for atomic crtc state
  * @base: Base drm crtc state structure
- * @is_ppsplit: Whether current topology requires PPSplit special handling
  * @bw_control: true if bw/clk controlled by core bw/clk properties
  * @bw_split_vote : true if bw controlled by llcc/dram bw properties
  * @lm_bounds : LM boundaries based on current mode full resolution, no 
ROI.
@@ -228,8 +227,6 @@ struct dpu_crtc_state {
 
bool bw_control;
bool bw_split_vote;
-
-   bool is_ppsplit;
struct drm_rect lm_bounds[CRTC_DUAL_MIXERS];
 
uint64_t input_fence_timeout_ns;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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


[PATCH 07/14] drm/msm/dpu: iterate for assigned hw ctl in virtual encoder

2018-08-28 Thread Jeykumar Sankaran
Instead of iterating for hw ctrl per physical encoder, this
patch moves the iterations and assignment to the virtual encoder.

Signed-off-by: Jeykumar Sankaran 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c| 22 +++---
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c   | 19 ---
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c   | 19 ---
 3 files changed, 19 insertions(+), 41 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index b223bd2..dbf669e 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -1011,9 +1011,10 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder 
*drm_enc,
struct dpu_kms *dpu_kms;
struct list_head *connector_list;
struct drm_connector *conn = NULL, *conn_iter;
-   struct dpu_rm_hw_iter pp_iter;
+   struct dpu_rm_hw_iter pp_iter, ctl_iter;
struct msm_display_topology topology;
enum dpu_rm_topology_name topology_name;
+   struct dpu_hw_ctl *hw_ctl[MAX_CHANNELS_PER_ENC] = { NULL };
int i = 0, ret;
 
if (!drm_enc) {
@@ -1061,17 +1062,32 @@ static void dpu_encoder_virt_mode_set(struct 
drm_encoder *drm_enc,
dpu_enc->hw_pp[i] = (struct dpu_hw_pingpong *) pp_iter.hw;
}
 
+   dpu_rm_init_hw_iter(&ctl_iter, drm_enc->base.id, DPU_HW_BLK_CTL);
+   for (i = 0; i < MAX_CHANNELS_PER_ENC; i++) {
+   if (!dpu_rm_get_hw(&dpu_kms->rm, &ctl_iter))
+   break;
+   hw_ctl[i] = (struct dpu_hw_ctl *)ctl_iter.hw;
+   }
+
topology_name = dpu_rm_get_topology_name(topology);
for (i = 0; i < dpu_enc->num_phys_encs; i++) {
struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];
 
if (phys) {
if (!dpu_enc->hw_pp[i]) {
-   DPU_ERROR_ENC(dpu_enc,
-   "invalid pingpong block for the encoder\n");
+   DPU_ERROR_ENC(dpu_enc, "no pp block assigned"
+"at idx: %d\n", i);
return;
}
phys->hw_pp = dpu_enc->hw_pp[i];
+
+   if (!hw_ctl[i]) {
+   DPU_ERROR_ENC(dpu_enc, "no ctl block assigned"
+"at idx: %d\n", i);
+   return;
+   }
+   phys->hw_ctl = hw_ctl[i];
+
phys->connector = conn->state->connector;
phys->topology_name = topology_name;
if (phys->ops.mode_set)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
index c8c4612..5c89868 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
@@ -196,9 +196,6 @@ static void dpu_encoder_phys_cmd_mode_set(
 {
struct dpu_encoder_phys_cmd *cmd_enc =
to_dpu_encoder_phys_cmd(phys_enc);
-   struct dpu_rm *rm = &phys_enc->dpu_kms->rm;
-   struct dpu_rm_hw_iter iter;
-   int i, instance;
 
if (!phys_enc || !mode || !adj_mode) {
DPU_ERROR("invalid args\n");
@@ -208,22 +205,6 @@ static void dpu_encoder_phys_cmd_mode_set(
DPU_DEBUG_CMDENC(cmd_enc, "caching mode:\n");
drm_mode_debug_printmodeline(adj_mode);
 
-   instance = phys_enc->split_role == ENC_ROLE_SLAVE ? 1 : 0;
-
-   /* Retrieve previously allocated HW Resources. Shouldn't fail */
-   dpu_rm_init_hw_iter(&iter, phys_enc->parent->base.id, DPU_HW_BLK_CTL);
-   for (i = 0; i <= instance; i++) {
-   if (dpu_rm_get_hw(rm, &iter))
-   phys_enc->hw_ctl = (struct dpu_hw_ctl *)iter.hw;
-   }
-
-   if (IS_ERR_OR_NULL(phys_enc->hw_ctl)) {
-   DPU_ERROR_CMDENC(cmd_enc, "failed to init ctl: %ld\n",
-   PTR_ERR(phys_enc->hw_ctl));
-   phys_enc->hw_ctl = NULL;
-   return;
-   }
-
_dpu_encoder_phys_cmd_setup_irq_hw_idx(phys_enc);
 }
 
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
index ecb8c65..ca0963c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
@@ -395,9 +395,6 @@ static void dpu_encoder_phys_vid_mode_set(
struct drm_display_mode *mode,
struct drm_display_mode *adj_mode)
 {
-   struct dpu_rm *rm;
-   struct dpu_rm_hw_iter iter;
-   int i, instance;
struct dpu_encoder_phys_vid *vid_enc;
 
if (!phys_enc || !phys_enc->dpu_kms) {
@@ -405,7 +402,6 @@ static void

[PATCH 06/14] drm/msm/dpu: use kms stored hw mdp block

2018-08-28 Thread Jeykumar Sankaran
Avoid querying RM for hw mdp block. Use the one
stored in KMS during initialization.

Signed-off-by: Jeykumar Sankaran 
Reviewed-by: Sean Paul 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 12 +---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c |  9 +
 2 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
index 3084675..c8c4612 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
@@ -823,7 +823,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_cmd_init(
 {
struct dpu_encoder_phys *phys_enc = NULL;
struct dpu_encoder_phys_cmd *cmd_enc = NULL;
-   struct dpu_hw_mdp *hw_mdp;
struct dpu_encoder_irq *irq;
int i, ret = 0;
 
@@ -836,14 +835,7 @@ struct dpu_encoder_phys *dpu_encoder_phys_cmd_init(
goto fail;
}
phys_enc = &cmd_enc->base;
-
-   hw_mdp = dpu_rm_get_mdp(&p->dpu_kms->rm);
-   if (IS_ERR_OR_NULL(hw_mdp)) {
-   ret = PTR_ERR(hw_mdp);
-   DPU_ERROR("failed to get mdptop\n");
-   goto fail_mdp_init;
-   }
-   phys_enc->hw_mdptop = hw_mdp;
+   phys_enc->hw_mdptop = p->dpu_kms->hw_mdp;
phys_enc->intf_idx = p->intf_idx;
 
dpu_encoder_phys_cmd_init_ops(&phys_enc->ops);
@@ -898,8 +890,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_cmd_init(
 
return phys_enc;
 
-fail_mdp_init:
-   kfree(cmd_enc);
 fail:
return ERR_PTR(ret);
 }
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
index 6fc3d3f..ecb8c65 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
@@ -801,7 +801,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(
struct dpu_encoder_phys *phys_enc = NULL;
struct dpu_encoder_phys_vid *vid_enc = NULL;
struct dpu_rm_hw_iter iter;
-   struct dpu_hw_mdp *hw_mdp;
struct dpu_encoder_irq *irq;
int i, ret = 0;
 
@@ -818,13 +817,7 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(
 
phys_enc = &vid_enc->base;
 
-   hw_mdp = dpu_rm_get_mdp(&p->dpu_kms->rm);
-   if (IS_ERR_OR_NULL(hw_mdp)) {
-   ret = PTR_ERR(hw_mdp);
-   DPU_ERROR("failed to get mdptop\n");
-   goto fail;
-   }
-   phys_enc->hw_mdptop = hw_mdp;
+   phys_enc->hw_mdptop = p->dpu_kms->hw_mdp;
phys_enc->intf_idx = p->intf_idx;
 
/**
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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


[PATCH 09/14] drm/msm/dpu: make crtc get_mixer_width helper static

2018-08-28 Thread Jeykumar Sankaran
Mark CRTC get_mixer_width helper API static as it is
not used outside the file.

Signed-off-by: Jeykumar Sankaran 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 21 ++---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h | 18 --
 2 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 92eda3e..e061847 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -47,6 +47,20 @@
 #define LEFT_MIXER 0
 #define RIGHT_MIXER 1
 
+static inline int _dpu_crtc_get_mixer_width(struct dpu_crtc *dpu_crtc,
+   struct dpu_crtc_state *cstate, struct drm_display_mode *mode)
+{
+   u32 mixer_width;
+
+   if (!dpu_crtc || !cstate || !mode)
+   return 0;
+
+   mixer_width = (cstate->num_mixers == CRTC_DUAL_MIXERS ?
+   mode->hdisplay / CRTC_DUAL_MIXERS : mode->hdisplay);
+
+   return mixer_width;
+}
+
 static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
 {
struct msm_drm_private *priv;
@@ -601,7 +615,8 @@ static void _dpu_crtc_setup_lm_bounds(struct drm_crtc *crtc,
cstate = to_dpu_crtc_state(state);
 
adj_mode = &state->adjusted_mode;
-   crtc_split_width = dpu_crtc_get_mixer_width(dpu_crtc, cstate, adj_mode);
+   crtc_split_width = _dpu_crtc_get_mixer_width(dpu_crtc, cstate,
+   adj_mode);
 
for (i = 0; i < dpu_crtc->num_mixers; i++) {
struct drm_rect *r = &cstate->lm_bounds[i];
@@ -1299,7 +1314,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
 
memset(pipe_staged, 0, sizeof(pipe_staged));
 
-   mixer_width = dpu_crtc_get_mixer_width(dpu_crtc, cstate, mode);
+   mixer_width = _dpu_crtc_get_mixer_width(dpu_crtc, cstate, mode);
 
_dpu_crtc_setup_lm_bounds(crtc, state);
 
@@ -1536,7 +1551,7 @@ static int _dpu_debugfs_status_show(struct seq_file *s, 
void *data)
 
mutex_lock(&dpu_crtc->crtc_lock);
mode = &crtc->state->adjusted_mode;
-   out_width = dpu_crtc_get_mixer_width(dpu_crtc, cstate, mode);
+   out_width = _dpu_crtc_get_mixer_width(dpu_crtc, cstate, mode);
 
seq_printf(s, "crtc:%d width:%d height:%d\n", crtc->base.id,
mode->hdisplay, mode->vdisplay);
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
index ec9c538..5e4dc5c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
@@ -238,24 +238,6 @@ struct dpu_crtc_state {
container_of(x, struct dpu_crtc_state, base)
 
 /**
- * dpu_crtc_get_mixer_width - get the mixer width
- * Mixer width will be same as panel width(/2 for split)
- */
-static inline int dpu_crtc_get_mixer_width(struct dpu_crtc *dpu_crtc,
-   struct dpu_crtc_state *cstate, struct drm_display_mode *mode)
-{
-   u32 mixer_width;
-
-   if (!dpu_crtc || !cstate || !mode)
-   return 0;
-
-   mixer_width = (dpu_crtc->num_mixers == CRTC_DUAL_MIXERS ?
-   mode->hdisplay / CRTC_DUAL_MIXERS : mode->hdisplay);
-
-   return mixer_width;
-}
-
-/**
  * dpu_crtc_get_mixer_height - get the mixer height
  * Mixer height will be same as panel height
  */
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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


[PATCH 01/14] drm/msm/dpu: remove debugfs support for misr

2018-08-28 Thread Jeykumar Sankaran
Strip down debugfs support for misr data read on layer mixers
and interfaces.

Signed-off-by: Jeykumar Sankaran 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c   | 139 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h   |   6 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c| 127 ---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h   |   6 -
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c   |  28 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c|  29 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h|   7 --
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c  |  29 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h  |   7 --
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c|   3 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h|   6 -
 11 files changed, 387 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 07c2d15..a4fab042 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -47,8 +47,6 @@
 #define LEFT_MIXER 0
 #define RIGHT_MIXER 1
 
-#define MISR_BUFF_SIZE 256
-
 static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
 {
struct msm_drm_private *priv;
@@ -1272,8 +1270,6 @@ static void dpu_crtc_handle_power_event(u32 event_type, 
void *arg)
struct drm_crtc *crtc = arg;
struct dpu_crtc *dpu_crtc;
struct drm_encoder *encoder;
-   struct dpu_crtc_mixer *m;
-   u32 i, misr_status;
 
if (!crtc) {
DPU_ERROR("invalid crtc\n");
@@ -1294,29 +1290,8 @@ static void dpu_crtc_handle_power_event(u32 event_type, 
void *arg)
 
dpu_encoder_virt_restore(encoder);
}
-
-   for (i = 0; i < dpu_crtc->num_mixers; ++i) {
-   m = &dpu_crtc->mixers[i];
-   if (!m->hw_lm || !m->hw_lm->ops.setup_misr ||
-   !dpu_crtc->misr_enable)
-   continue;
-
-   m->hw_lm->ops.setup_misr(m->hw_lm, true,
-   dpu_crtc->misr_frame_count);
-   }
break;
case DPU_POWER_EVENT_PRE_DISABLE:
-   for (i = 0; i < dpu_crtc->num_mixers; ++i) {
-   m = &dpu_crtc->mixers[i];
-   if (!m->hw_lm || !m->hw_lm->ops.collect_misr ||
-   !dpu_crtc->misr_enable)
-   continue;
-
-   misr_status = m->hw_lm->ops.collect_misr(m->hw_lm);
-   dpu_crtc->misr_data[i] = misr_status ? misr_status :
-   dpu_crtc->misr_data[i];
-   }
-   break;
case DPU_POWER_EVENT_POST_DISABLE:
/**
 * Nothing to do. All the planes on the CRTC will be
@@ -1847,113 +1822,6 @@ static int _dpu_debugfs_status_open(struct inode 
*inode, struct file *file)
return single_open(file, _dpu_debugfs_status_show, inode->i_private);
 }
 
-static ssize_t _dpu_crtc_misr_setup(struct file *file,
-   const char __user *user_buf, size_t count, loff_t *ppos)
-{
-   struct dpu_crtc *dpu_crtc;
-   struct dpu_crtc_mixer *m;
-   int i = 0, rc;
-   char buf[MISR_BUFF_SIZE + 1];
-   u32 frame_count, enable;
-   size_t buff_copy;
-
-   if (!file || !file->private_data)
-   return -EINVAL;
-
-   dpu_crtc = file->private_data;
-   buff_copy = min_t(size_t, count, MISR_BUFF_SIZE);
-   if (copy_from_user(buf, user_buf, buff_copy)) {
-   DPU_ERROR("buffer copy failed\n");
-   return -EINVAL;
-   }
-
-   buf[buff_copy] = 0; /* end of string */
-
-   if (sscanf(buf, "%u %u", &enable, &frame_count) != 2)
-   return -EINVAL;
-
-   rc = _dpu_crtc_power_enable(dpu_crtc, true);
-   if (rc)
-   return rc;
-
-   mutex_lock(&dpu_crtc->crtc_lock);
-   dpu_crtc->misr_enable = enable;
-   dpu_crtc->misr_frame_count = frame_count;
-   for (i = 0; i < dpu_crtc->num_mixers; ++i) {
-   dpu_crtc->misr_data[i] = 0;
-   m = &dpu_crtc->mixers[i];
-   if (!m->hw_lm || !m->hw_lm->ops.setup_misr)
-   continue;
-
-   m->hw_lm->ops.setup_misr(m->hw_lm, enable, frame_count);
-   }
-   mutex_unlock(&dpu_crtc->crtc_lock);
-   _dpu_crtc_power_enable(dpu_crtc, false);
-
-   return count;
-}
-
-static ssize_t _dpu_crtc_misr_read(struct file *file,
-   char __user *user_buff, size_t count, loff_t *ppos)
-{
-   struct dpu_crtc *dpu_crtc;
-   struct dpu_crtc_mixer *m;
-   int i = 0, rc;
-   u32 misr_status;
-   ssize_t len = 0;
-   char buf[MISR_BUFF_SIZE + 1] = {'\0'};
-
-   if (*ppos)

[PATCH 03/14] drm/msm/dpu: remove resource pool manager

2018-08-28 Thread Jeykumar Sankaran
resource pool manager utility was introduced to manage
rotator sessions. Removing the support as the rotator
feature doesn't exist.

Signed-off-by: Jeykumar Sankaran 
Reviewed-by: Sean Paul 

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 205 ---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h |  56 -
 2 files changed, 261 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index a4fab042..92eda3e 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -97,187 +97,6 @@ static inline int _dpu_crtc_power_enable(struct dpu_crtc 
*dpu_crtc, bool enable)
return 0;
 }
 
-/**
- * _dpu_crtc_rp_to_crtc - get crtc from resource pool object
- * @rp: Pointer to resource pool
- * return: Pointer to drm crtc if success; null otherwise
- */
-static struct drm_crtc *_dpu_crtc_rp_to_crtc(struct dpu_crtc_respool *rp)
-{
-   if (!rp)
-   return NULL;
-
-   return container_of(rp, struct dpu_crtc_state, rp)->base.crtc;
-}
-
-/**
- * _dpu_crtc_rp_reclaim - reclaim unused, or all if forced, resources in pool
- * @rp: Pointer to resource pool
- * @force: True to reclaim all resources; otherwise, reclaim only unused ones
- * return: None
- */
-static void _dpu_crtc_rp_reclaim(struct dpu_crtc_respool *rp, bool force)
-{
-   struct dpu_crtc_res *res, *next;
-   struct drm_crtc *crtc;
-
-   crtc = _dpu_crtc_rp_to_crtc(rp);
-   if (!crtc) {
-   DPU_ERROR("invalid crtc\n");
-   return;
-   }
-
-   DPU_DEBUG("crtc%d.%u %s\n", crtc->base.id, rp->sequence_id,
-   force ? "destroy" : "free_unused");
-
-   list_for_each_entry_safe(res, next, &rp->res_list, list) {
-   if (!force && !(res->flags & DPU_CRTC_RES_FLAG_FREE))
-   continue;
-   DPU_DEBUG("crtc%d.%u reclaim res:0x%x/0x%llx/%pK/%d\n",
-   crtc->base.id, rp->sequence_id,
-   res->type, res->tag, res->val,
-   atomic_read(&res->refcount));
-   list_del(&res->list);
-   if (res->ops.put)
-   res->ops.put(res->val);
-   kfree(res);
-   }
-}
-
-/**
- * _dpu_crtc_rp_free_unused - free unused resource in pool
- * @rp: Pointer to resource pool
- * return: none
- */
-static void _dpu_crtc_rp_free_unused(struct dpu_crtc_respool *rp)
-{
-   mutex_lock(rp->rp_lock);
-   _dpu_crtc_rp_reclaim(rp, false);
-   mutex_unlock(rp->rp_lock);
-}
-
-/**
- * _dpu_crtc_rp_destroy - destroy resource pool
- * @rp: Pointer to resource pool
- * return: None
- */
-static void _dpu_crtc_rp_destroy(struct dpu_crtc_respool *rp)
-{
-   mutex_lock(rp->rp_lock);
-   list_del_init(&rp->rp_list);
-   _dpu_crtc_rp_reclaim(rp, true);
-   mutex_unlock(rp->rp_lock);
-}
-
-/**
- * _dpu_crtc_hw_blk_get - get callback for hardware block
- * @val: Resource handle
- * @type: Resource type
- * @tag: Search tag for given resource
- * return: Resource handle
- */
-static void *_dpu_crtc_hw_blk_get(void *val, u32 type, u64 tag)
-{
-   DPU_DEBUG("res:%d/0x%llx/%pK\n", type, tag, val);
-   return dpu_hw_blk_get(val, type, tag);
-}
-
-/**
- * _dpu_crtc_hw_blk_put - put callback for hardware block
- * @val: Resource handle
- * return: None
- */
-static void _dpu_crtc_hw_blk_put(void *val)
-{
-   DPU_DEBUG("res://%pK\n", val);
-   dpu_hw_blk_put(val);
-}
-
-/**
- * _dpu_crtc_rp_duplicate - duplicate resource pool and reset reference count
- * @rp: Pointer to original resource pool
- * @dup_rp: Pointer to duplicated resource pool
- * return: None
- */
-static void _dpu_crtc_rp_duplicate(struct dpu_crtc_respool *rp,
-   struct dpu_crtc_respool *dup_rp)
-{
-   struct dpu_crtc_res *res, *dup_res;
-   struct drm_crtc *crtc;
-
-   if (!rp || !dup_rp || !rp->rp_head) {
-   DPU_ERROR("invalid resource pool\n");
-   return;
-   }
-
-   crtc = _dpu_crtc_rp_to_crtc(rp);
-   if (!crtc) {
-   DPU_ERROR("invalid crtc\n");
-   return;
-   }
-
-   DPU_DEBUG("crtc%d.%u duplicate\n", crtc->base.id, rp->sequence_id);
-
-   mutex_lock(rp->rp_lock);
-   dup_rp->sequence_id = rp->sequence_id + 1;
-   INIT_LIST_HEAD(&dup_rp->res_list);
-   dup_rp->ops = rp->ops;
-   list_for_each_entry(res, &rp->res_list, list) {
-   dup_res = kzalloc(sizeof(struct dpu_crtc_res), GFP_KERNEL);
-   if (!dup_res) {
-   mutex_unlock(rp->rp_lock);
-   return;
-   }
-   INIT_LIST_HEAD(&dup_res->list);
-   atomic_set(&dup_res->refcount, 0);
-   dup_res->type = res->type;
-   dup_res->tag = res->tag;
-   dup_res->val = res->val;
-   dup_res->ops = res->ops;
-   

[PATCH 00/14] clean up DPU for RM refactor

2018-08-28 Thread Jeykumar Sankaran
Based on the comments received for the patch series[1] and to
make the review process easy a bit more easy, spliting up the 
patches for cleanup and resource manager refactor. This series 
cleans up and prepares the DPU for upcoming RM changes.

[1] https://patchwork.freedesktop.org/series/44669/

Thanks and Regards,
Jeykumar S.

Jeykumar Sankaran (14):
  drm/msm/dpu: remove debugfs support for misr
  drm/msm/dpu: remove scalar config definitions
  drm/msm/dpu: remove resource pool manager
  drm/msm/dpu: remove ping pong split topology variables
  drm/msm/dpu: enable master-slave encoders explicitly
  drm/msm/dpu: use kms stored hw mdp block
  drm/msm/dpu: iterate for assigned hw ctl in virtual encoder
  drm/msm/dpu: avoid querying for hw intf before assignment
  drm/msm/dpu: make crtc get_mixer_width helper static
  drm/msm/dpu: move hw resource tracking to crtc state
  drm/msm/dpu: rename hw_ctl to lm_ctl
  drm/msm/dpu: remove topology name
  drm/msm/dpu: remove display H_TILE from encoder
  drm/msm/dpu: remove cdm block support from resource manager

 drivers/gpu/drm/msm/Makefile   |   1 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c   | 449 +++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h   | 111 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c| 203 ++
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h|   6 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h   |  20 +-
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c   |  31 +-
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c   | 116 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c | 323 ---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.h | 139 ---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c |  14 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h |   4 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c|  29 --
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h|   7 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c  |  29 --
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h  |   7 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.c |  18 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h |  17 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c|   3 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h|  16 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 107 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h |  24 --
 drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h  |   4 -
 23 files changed, 150 insertions(+), 1528 deletions(-)
 delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c
 delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.h

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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


[PATCH 02/14] drm/msm/dpu: remove scalar config definitions

2018-08-28 Thread Jeykumar Sankaran
cleans up left out scalar config definitions from headers

Signed-off-by: Jeykumar Sankaran 
Reviewed-by: Sean Paul 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h|  2 --
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h | 10 --
 2 files changed, 12 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
index 53484b1..34ce724 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
@@ -161,7 +161,6 @@ struct dpu_crtc_frame_event {
  * @cur_perf  : current performance committed to clock/bandwidth driver
  * @rp_lock   : serialization lock for resource pool
  * @rp_head   : list of active resource pool
- * @scl3_cfg_lut  : qseed3 lut config
  */
 struct dpu_crtc {
struct drm_crtc base;
@@ -172,7 +171,6 @@ struct dpu_crtc {
u32 num_mixers;
bool mixers_swapped;
struct dpu_crtc_mixer mixers[CRTC_DUAL_MIXERS];
-   struct dpu_hw_scaler3_lut_cfg *scl3_lut_cfg;
 
struct drm_pending_vblank_event *event;
u32 vsync_count;
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h
index cb02041..321fc64 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h
@@ -148,16 +148,6 @@ struct dpu_hw_scaler3_cfg {
struct dpu_hw_scaler3_de_cfg de;
 };
 
-struct dpu_hw_scaler3_lut_cfg {
-   bool is_configured;
-   u32 *dir_lut;
-   size_t dir_len;
-   u32 *cir_lut;
-   size_t cir_len;
-   u32 *sep_lut;
-   size_t sep_len;
-};
-
 /**
  * struct dpu_drm_pix_ext_v1 - version 1 of pixel ext structure
  * @num_ext_pxls_lr: Number of total horizontal pixels
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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


[PATCH libdrm v2 3/5] intel: make gen10 use generic gen macro

2018-08-28 Thread Lucas De Marchi
Signed-off-by: Lucas De Marchi 
---
 intel/intel_chipset.c |  1 +
 intel/intel_chipset.h | 34 +-
 2 files changed, 2 insertions(+), 33 deletions(-)

diff --git a/intel/intel_chipset.c b/intel/intel_chipset.c
index 5a549ba4..0c2ba884 100644
--- a/intel/intel_chipset.c
+++ b/intel/intel_chipset.c
@@ -35,6 +35,7 @@ static const struct pci_device {
uint16_t gen;
 } pciids[] = {
INTEL_ICL_11_IDS(11),
+   INTEL_CNL_IDS(10),
 };
 
 bool intel_is_genx(unsigned int devid, int gen)
diff --git a/intel/intel_chipset.h b/intel/intel_chipset.h
index 2bf480d1..6790f728 100644
--- a/intel/intel_chipset.h
+++ b/intel/intel_chipset.h
@@ -246,21 +246,6 @@
 #define PCI_CHIP_WHISKEYLAKE_U_GT3_2 0x3EA3
 #define PCI_CHIP_WHISKEYLAKE_U_GT3_3 0x3EA4
 
-#define PCI_CHIP_CANNONLAKE_0  0x5A51
-#define PCI_CHIP_CANNONLAKE_1  0x5A59
-#define PCI_CHIP_CANNONLAKE_2  0x5A41
-#define PCI_CHIP_CANNONLAKE_3  0x5A49
-#define PCI_CHIP_CANNONLAKE_4  0x5A52
-#define PCI_CHIP_CANNONLAKE_5  0x5A5A
-#define PCI_CHIP_CANNONLAKE_6  0x5A42
-#define PCI_CHIP_CANNONLAKE_7  0x5A4A
-#define PCI_CHIP_CANNONLAKE_8  0x5A50
-#define PCI_CHIP_CANNONLAKE_9  0x5A40
-#define PCI_CHIP_CANNONLAKE_10 0x5A54
-#define PCI_CHIP_CANNONLAKE_11 0x5A5C
-#define PCI_CHIP_CANNONLAKE_12 0x5A44
-#define PCI_CHIP_CANNONLAKE_13 0x5A4C
-
 #define IS_MOBILE(devid)   ((devid) == PCI_CHIP_I855_GM || \
 (devid) == PCI_CHIP_I915_GM || \
 (devid) == PCI_CHIP_I945_GM || \
@@ -527,29 +512,13 @@
 IS_GEMINILAKE(devid) || \
 IS_COFFEELAKE(devid))
 
-#define IS_CANNONLAKE(devid)   ((devid) == PCI_CHIP_CANNONLAKE_0 || \
-(devid) == PCI_CHIP_CANNONLAKE_1 || \
-(devid) == PCI_CHIP_CANNONLAKE_2 || \
-(devid) == PCI_CHIP_CANNONLAKE_3 || \
-(devid) == PCI_CHIP_CANNONLAKE_4 || \
-(devid) == PCI_CHIP_CANNONLAKE_5 || \
-(devid) == PCI_CHIP_CANNONLAKE_6 || \
-(devid) == PCI_CHIP_CANNONLAKE_7 || \
-(devid) == PCI_CHIP_CANNONLAKE_8 || \
-(devid) == PCI_CHIP_CANNONLAKE_9 || \
-(devid) == PCI_CHIP_CANNONLAKE_10 || \
-(devid) == PCI_CHIP_CANNONLAKE_11 || \
-(devid) == PCI_CHIP_CANNONLAKE_12 || \
-(devid) == PCI_CHIP_CANNONLAKE_13)
-
-#define IS_GEN10(devid)(IS_CANNONLAKE(devid))
-
 /* New platforms use kernel pci ids */
 #include 
 
 bool intel_is_genx(unsigned int devid, int gen);
 bool intel_get_genx(unsigned int devid, int *gen);
 
+#define IS_GEN10(devid) intel_is_genx(devid, 10)
 #define IS_GEN11(devid) intel_is_genx(devid, 11)
 
 /* all platforms */
@@ -560,7 +529,6 @@ bool intel_get_genx(unsigned int devid, int *gen);
 IS_GEN7(dev) || \
 IS_GEN8(dev) || \
 IS_GEN9(dev) || \
-IS_GEN10(dev) || \
 intel_get_genx(dev, NULL))
 
 #endif /* _INTEL_CHIPSET_H */
-- 
2.17.1

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


[PATCH libdrm v2 1/5] intel: add generic functions to check PCI ID

2018-08-28 Thread Lucas De Marchi
This will allow platforms to reuse kernel IDs instead of manually
keeping them in sync. In most of the cases we only need to extend
IS_9XX().  Current platforms that fit this requirement can be ported
over to use this macro. Right now it's a nop since it doesn't have any
PCI ID added.

The i915_pciids.h header is in sync with kernel tree on
drm-tip 2018y-08m-20d-21h-41m-11s.

v2: - move to a separate .c so we can have the array in a single
  compilation unit
- use a single array for all gens
- add real functions to get or check gen by pciid
- define our own pci device struct rather than inherit the one
  kernel uses: we can throw away most of the fields

Cc: Chris Wilson 
Signed-off-by: Lucas De Marchi 
---
 intel/Makefile.sources |   1 +
 intel/i915_pciids.h| 461 +
 intel/intel_chipset.c  |  77 +++
 intel/intel_chipset.h  |  10 +-
 intel/meson.build  |   2 +-
 5 files changed, 549 insertions(+), 2 deletions(-)
 create mode 100644 intel/i915_pciids.h
 create mode 100644 intel/intel_chipset.c

diff --git a/intel/Makefile.sources b/intel/Makefile.sources
index 6947ab74..61f43aeb 100644
--- a/intel/Makefile.sources
+++ b/intel/Makefile.sources
@@ -5,6 +5,7 @@ LIBDRM_INTEL_FILES := \
intel_bufmgr_gem.c \
intel_decode.c \
intel_chipset.h \
+   intel_chipset.c \
mm.c \
mm.h \
uthash.h
diff --git a/intel/i915_pciids.h b/intel/i915_pciids.h
new file mode 100644
index ..fd965ffb
--- /dev/null
+++ b/intel/i915_pciids.h
@@ -0,0 +1,461 @@
+/*
+ * Copyright 2013 Intel Corporation
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+#ifndef _I915_PCIIDS_H
+#define _I915_PCIIDS_H
+
+/*
+ * A pci_device_id struct {
+ * __u32 vendor, device;
+ *  __u32 subvendor, subdevice;
+ * __u32 class, class_mask;
+ * kernel_ulong_t driver_data;
+ * };
+ * Don't use C99 here because "class" is reserved and we want to
+ * give userspace flexibility.
+ */
+#define INTEL_VGA_DEVICE(id, info) {   \
+   0x8086, id, \
+   ~0, ~0, \
+   0x03, 0xff, \
+   (unsigned long) info }
+
+#define INTEL_QUANTA_VGA_DEVICE(info) {\
+   0x8086, 0x16a,  \
+   0x152d, 0x8990, \
+   0x03, 0xff, \
+   (unsigned long) info }
+
+#define INTEL_I810_IDS(info)   \
+   INTEL_VGA_DEVICE(0x7121, info), /* I810 */  \
+   INTEL_VGA_DEVICE(0x7123, info), /* I810_DC100 */\
+   INTEL_VGA_DEVICE(0x7125, info)  /* I810_E */
+
+#define INTEL_I815_IDS(info)   \
+   INTEL_VGA_DEVICE(0x1132, info)  /* I815*/
+
+#define INTEL_I830_IDS(info)   \
+   INTEL_VGA_DEVICE(0x3577, info)
+
+#define INTEL_I845G_IDS(info)  \
+   INTEL_VGA_DEVICE(0x2562, info)
+
+#define INTEL_I85X_IDS(info)   \
+   INTEL_VGA_DEVICE(0x3582, info), /* I855_GM */ \
+   INTEL_VGA_DEVICE(0x358e, info)
+
+#define INTEL_I865G_IDS(info)  \
+   INTEL_VGA_DEVICE(0x2572, info) /* I865_G */
+
+#define INTEL_I915G_IDS(info)  \
+   INTEL_VGA_DEVICE(0x2582, info), /* I915_G */ \
+   INTEL_VGA_DEVICE(0x258a, info)  /* E7221_G */
+
+#define INTEL_I915GM_IDS(info) \
+   INTEL_VGA_DEVICE(0x2592, info) /* I915_GM */
+
+#define INTEL_I945G_IDS(info)  \
+   INTEL_VGA_DEVICE(0x2772, info) /* I945_G */
+
+#define INTEL_I945GM_IDS(info) \
+   INTEL_VGA_DEVICE(0x27a2, info), /* I945_GM */ \
+   INTEL_VGA_DEVICE(0x27ae, info)  /* I945_GME */
+
+#defin

[PATCH libdrm v2 2/5] intel: make gen11 use generic gen macro

2018-08-28 Thread Lucas De Marchi
Signed-off-by: Lucas De Marchi 
---
 intel/intel_chipset.c |  1 +
 intel/intel_chipset.h | 27 ++-
 2 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/intel/intel_chipset.c b/intel/intel_chipset.c
index 8af99ad9..5a549ba4 100644
--- a/intel/intel_chipset.c
+++ b/intel/intel_chipset.c
@@ -34,6 +34,7 @@ static const struct pci_device {
uint16_t device;
uint16_t gen;
 } pciids[] = {
+   INTEL_ICL_11_IDS(11),
 };
 
 bool intel_is_genx(unsigned int devid, int gen)
diff --git a/intel/intel_chipset.h b/intel/intel_chipset.h
index 0e14c58f..2bf480d1 100644
--- a/intel/intel_chipset.h
+++ b/intel/intel_chipset.h
@@ -261,16 +261,6 @@
 #define PCI_CHIP_CANNONLAKE_12 0x5A44
 #define PCI_CHIP_CANNONLAKE_13 0x5A4C
 
-#define PCI_CHIP_ICELAKE_11_0  0x8A50
-#define PCI_CHIP_ICELAKE_11_1  0x8A51
-#define PCI_CHIP_ICELAKE_11_2  0x8A5C
-#define PCI_CHIP_ICELAKE_11_3  0x8A5D
-#define PCI_CHIP_ICELAKE_11_4  0x8A52
-#define PCI_CHIP_ICELAKE_11_5  0x8A5A
-#define PCI_CHIP_ICELAKE_11_6  0x8A5B
-#define PCI_CHIP_ICELAKE_11_7  0x8A71
-#define PCI_CHIP_ICELAKE_11_8  0x8A70
-
 #define IS_MOBILE(devid)   ((devid) == PCI_CHIP_I855_GM || \
 (devid) == PCI_CHIP_I915_GM || \
 (devid) == PCI_CHIP_I945_GM || \
@@ -554,26 +544,14 @@
 
 #define IS_GEN10(devid)(IS_CANNONLAKE(devid))
 
-#define IS_ICELAKE_11(devid)   ((devid) == PCI_CHIP_ICELAKE_11_0 || \
-(devid) == PCI_CHIP_ICELAKE_11_1 || \
-(devid) == PCI_CHIP_ICELAKE_11_2 || \
-(devid) == PCI_CHIP_ICELAKE_11_3 || \
-(devid) == PCI_CHIP_ICELAKE_11_4 || \
-(devid) == PCI_CHIP_ICELAKE_11_5 || \
-(devid) == PCI_CHIP_ICELAKE_11_6 || \
-(devid) == PCI_CHIP_ICELAKE_11_7 || \
-(devid) == PCI_CHIP_ICELAKE_11_8)
-
-#define IS_ICELAKE(devid)  (IS_ICELAKE_11(devid))
-
-#define IS_GEN11(devid)(IS_ICELAKE_11(devid))
-
 /* New platforms use kernel pci ids */
 #include 
 
 bool intel_is_genx(unsigned int devid, int gen);
 bool intel_get_genx(unsigned int devid, int *gen);
 
+#define IS_GEN11(devid) intel_is_genx(devid, 11)
+
 /* all platforms */
 #define IS_9XX(dev)(IS_GEN3(dev) || \
 IS_GEN4(dev) || \
@@ -583,7 +561,6 @@ bool intel_get_genx(unsigned int devid, int *gen);
 IS_GEN8(dev) || \
 IS_GEN9(dev) || \
 IS_GEN10(dev) || \
-IS_GEN11(dev) || \
 intel_get_genx(dev, NULL))
 
 #endif /* _INTEL_CHIPSET_H */
-- 
2.17.1

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


[PATCH libdrm v2 5/5] intel: get gen once for gen >= 9

2018-08-28 Thread Lucas De Marchi
We don't need to call IS_GEN() for each gen >= 9: we can rather use the
new intel_is_genx() helper to iterate the pciids array once.

Signed-off-by: Lucas De Marchi 
---
 intel/intel_bufmgr_gem.c | 8 +---
 intel/intel_decode.c | 8 ++--
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 8c3a4b20..d6587b76 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -3656,13 +3656,7 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
bufmgr_gem->gen = 7;
else if (IS_GEN8(bufmgr_gem->pci_device))
bufmgr_gem->gen = 8;
-   else if (IS_GEN9(bufmgr_gem->pci_device))
-   bufmgr_gem->gen = 9;
-   else if (IS_GEN10(bufmgr_gem->pci_device))
-   bufmgr_gem->gen = 10;
-   else if (IS_GEN11(bufmgr_gem->pci_device))
-   bufmgr_gem->gen = 11;
-   else {
+   else if (!intel_get_genx(bufmgr_gem->pci_device, &bufmgr_gem->gen)) {
free(bufmgr_gem);
bufmgr_gem = NULL;
goto exit;
diff --git a/intel/intel_decode.c b/intel/intel_decode.c
index b24861b1..0ff095bc 100644
--- a/intel/intel_decode.c
+++ b/intel/intel_decode.c
@@ -3823,12 +3823,8 @@ drm_intel_decode_context_alloc(uint32_t devid)
ctx->devid = devid;
ctx->out = stdout;
 
-   if (IS_GEN11(devid))
-   ctx->gen = 11;
-   else if (IS_GEN10(devid))
-   ctx->gen = 10;
-   else if (IS_GEN9(devid))
-   ctx->gen = 9;
+   if (intel_get_genx(devid, &ctx->gen))
+   ;
else if (IS_GEN8(devid))
ctx->gen = 8;
else if (IS_GEN7(devid))
-- 
2.17.1

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


[PATCH libdrm v2 4/5] intel: make gen9 use generic gen macro

2018-08-28 Thread Lucas De Marchi
The 2 PCI IDs that are used for the command line overrid mechanism
were left defined. The rest can be gone and then we just use the kernel
defines.

Signed-off-by: Lucas De Marchi 
---
 intel/intel_chipset.c |   5 ++
 intel/intel_chipset.h | 187 +-
 2 files changed, 6 insertions(+), 186 deletions(-)

diff --git a/intel/intel_chipset.c b/intel/intel_chipset.c
index 0c2ba884..c984d8ac 100644
--- a/intel/intel_chipset.c
+++ b/intel/intel_chipset.c
@@ -36,6 +36,11 @@ static const struct pci_device {
 } pciids[] = {
INTEL_ICL_11_IDS(11),
INTEL_CNL_IDS(10),
+   INTEL_CFL_IDS(9),
+   INTEL_GLK_IDS(9),
+   INTEL_KBL_IDS(9),
+   INTEL_BXT_IDS(9),
+   INTEL_SKL_IDS(9),
 };
 
 bool intel_is_genx(unsigned int devid, int gen)
diff --git a/intel/intel_chipset.h b/intel/intel_chipset.h
index 6790f728..19263e19 100644
--- a/intel/intel_chipset.h
+++ b/intel/intel_chipset.h
@@ -165,86 +165,8 @@
 #define PCI_CHIP_CHERRYVIEW_2  0x22b2
 #define PCI_CHIP_CHERRYVIEW_3  0x22b3
 
-#define PCI_CHIP_SKYLAKE_DT_GT10x1902
-#define PCI_CHIP_SKYLAKE_ULT_GT1   0x1906
-#define PCI_CHIP_SKYLAKE_SRV_GT1   0x190A /* Reserved */
-#define PCI_CHIP_SKYLAKE_H_GT1 0x190B
-#define PCI_CHIP_SKYLAKE_ULX_GT1   0x190E /* Reserved */
 #define PCI_CHIP_SKYLAKE_DT_GT20x1912
-#define PCI_CHIP_SKYLAKE_FUSED0_GT20x1913 /* Reserved */
-#define PCI_CHIP_SKYLAKE_FUSED1_GT20x1915 /* Reserved */
-#define PCI_CHIP_SKYLAKE_ULT_GT2   0x1916
-#define PCI_CHIP_SKYLAKE_FUSED2_GT20x1917 /* Reserved */
-#define PCI_CHIP_SKYLAKE_SRV_GT2   0x191A /* Reserved */
-#define PCI_CHIP_SKYLAKE_HALO_GT2  0x191B
-#define PCI_CHIP_SKYLAKE_WKS_GT2   0x191D
-#define PCI_CHIP_SKYLAKE_ULX_GT2   0x191E
-#define PCI_CHIP_SKYLAKE_MOBILE_GT20x1921 /* Reserved */
-#define PCI_CHIP_SKYLAKE_ULT_GT3_0 0x1923
-#define PCI_CHIP_SKYLAKE_ULT_GT3_1 0x1926
-#define PCI_CHIP_SKYLAKE_ULT_GT3_2 0x1927
-#define PCI_CHIP_SKYLAKE_SRV_GT4   0x192A
-#define PCI_CHIP_SKYLAKE_HALO_GT3  0x192B /* Reserved */
-#define PCI_CHIP_SKYLAKE_SRV_GT3   0x192D
-#define PCI_CHIP_SKYLAKE_DT_GT40x1932
-#define PCI_CHIP_SKYLAKE_SRV_GT4X  0x193A
-#define PCI_CHIP_SKYLAKE_H_GT4 0x193B
-#define PCI_CHIP_SKYLAKE_WKS_GT4   0x193D
-
-#define PCI_CHIP_KABYLAKE_ULT_GT2  0x5916
-#define PCI_CHIP_KABYLAKE_ULT_GT1_50x5913
-#define PCI_CHIP_KABYLAKE_ULT_GT1  0x5906
-#define PCI_CHIP_KABYLAKE_ULT_GT3_00x5923
-#define PCI_CHIP_KABYLAKE_ULT_GT3_10x5926
-#define PCI_CHIP_KABYLAKE_ULT_GT3_20x5927
-#define PCI_CHIP_KABYLAKE_ULT_GT2F 0x5921
-#define PCI_CHIP_KABYLAKE_ULX_GT1_50x5915
-#define PCI_CHIP_KABYLAKE_ULX_GT1  0x590E
-#define PCI_CHIP_KABYLAKE_ULX_GT2_00x591E
 #define PCI_CHIP_KABYLAKE_DT_GT2   0x5912
-#define PCI_CHIP_KABYLAKE_M_GT20x5917
-#define PCI_CHIP_KABYLAKE_DT_GT1   0x5902
-#define PCI_CHIP_KABYLAKE_HALO_GT2 0x591B
-#define PCI_CHIP_KABYLAKE_HALO_GT4 0x593B
-#define PCI_CHIP_KABYLAKE_HALO_GT1_0   0x5908
-#define PCI_CHIP_KABYLAKE_HALO_GT1_1   0x590B
-#define PCI_CHIP_KABYLAKE_SRV_GT2  0x591A
-#define PCI_CHIP_KABYLAKE_SRV_GT1  0x590A
-#define PCI_CHIP_KABYLAKE_WKS_GT2  0x591D
-
-#define PCI_CHIP_AMBERLAKE_ULX_GT2_1   0x591C
-#define PCI_CHIP_AMBERLAKE_ULX_GT2_2   0x87C0
-
-#define PCI_CHIP_BROXTON_0 0x0A84
-#define PCI_CHIP_BROXTON_1 0x1A84
-#define PCI_CHIP_BROXTON_2 0x5A84
-#define PCI_CHIP_BROXTON_3 0x1A85
-#define PCI_CHIP_BROXTON_4 0x5A85
-
-#define PCI_CHIP_GLK   0x3184
-#define PCI_CHIP_GLK_2X6   0x3185
-
-#define PCI_CHIP_COFFEELAKE_S_GT1_1 0x3E90
-#define PCI_CHIP_COFFEELAKE_S_GT1_2 0x3E93
-#define PCI_CHIP_COFFEELAKE_S_GT1_3 0x3E99
-#define PCI_CHIP_COFFEELAKE_S_GT2_1 0x3E91
-#define PCI_CHIP_COFFEELAKE_S_GT2_2 0x3E92
-#define PCI_CHIP_COFFEELAKE_S_GT2_3 0x3E96
-#define PCI_CHIP_COFFEELAKE_S_GT2_4 0x3E98
-#define PCI_CHIP_COFFEELAKE_S_GT2_5 0x3E9A
-#define PCI_CHIP_COFFEELAKE_H_GT2_1 0x3E9B
-#define PCI_CHIP_COFFEELAKE_H_GT2_2 0x3E94
-#define PCI_CHIP_COFFEELAKE_U_GT2_1 0x3EA9
-#define PCI_CHIP_COFFEELAKE_U_GT3_1 0x3EA5
-#define PCI_CHIP_COFFEELAKE_U_GT3_2 0x3EA6
-#define PCI_CHIP_COFFEELAKE_U_GT3_3 0x3EA7
-#define PCI_CHIP_COFFEELAKE_U_GT3_4 0x3EA8
-
-#define PCI_CHIP_WHISKEYLAKE_U_GT1_1 0x3EA1
-#define PCI_CHIP_WHISKEYLAKE_U_GT2_1 0x3EA0
-#define PCI_CHIP_WHISKEYLAKE_U_GT3_1 0x3EA2
-#define PCI_CHIP_WHISKEYLAKE_U_GT3_2 0x3EA3
-#define PCI_CHIP_WHISKEYLAKE_U_GT3_3 0x3EA4
 
 #define IS_MOBILE(devid)   ((devid) == PCI_CHIP_I855_GM || \
 (devid) == PCI_CHIP_I915_GM || \
@@ -405,119 +327,13 @@
 #define IS_GEN8(devid) (IS_BROADWELL(devid) || \
 IS_CHERRYVIEW(devid))

[PATCH libdrm v2 0/5] intel: rework how we add PCI IDs

2018-08-28 Thread Lucas De Marchi
Adding PCI IDs to different projects is a boring manual task that
motivated me to create this series. The idea is to centralize the IDs in
the kernel header and let other projects copy it.

Initially my plan was to convert all gens, back to gen2, but that proved
slightly difficult since there are some corner cases to cover and I
didn't want to block the important part, i.e.:  for recent gens, there's
no risk of missing a PCI ID.

v2: address comments from Chris by pulling it out to a separate .c

Lucas De Marchi (5):
  intel: add generic functions to check PCI ID
  intel: make gen11 use generic gen macro
  intel: make gen10 use generic gen macro
  intel: make gen9 use generic gen macro
  intel: get gen once for gen >= 9

 intel/Makefile.sources   |   1 +
 intel/i915_pciids.h  | 461 +++
 intel/intel_bufmgr_gem.c |   8 +-
 intel/intel_chipset.c|  84 +++
 intel/intel_chipset.h| 254 +
 intel/intel_decode.c |   8 +-
 intel/meson.build|   2 +-
 7 files changed, 561 insertions(+), 257 deletions(-)
 create mode 100644 intel/i915_pciids.h
 create mode 100644 intel/intel_chipset.c

-- 
2.17.1

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


Re: [PATCH v3 4/5] dt-bindings: drm/bridge Document Cadence MHDP DPI/DP bridge bindings

2018-08-28 Thread Rob Herring
On Tue, 28 Aug 2018 11:24:47 +0100, Damian Kos wrote:
> From: Quentin Schulz 
> 
> Signed-off-by: Damian Kos 
> ---
>  .../bindings/display/bridge/cdns,mhdp.txt | 43 +++
>  1 file changed, 43 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/display/bridge/cdns,mhdp.txt
> 

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


Re: [PATCH v2] drm/msm: dpu: Allow planes to extend past active display

2018-08-28 Thread Jeykumar Sankaran

On 2018-08-28 15:52, Sean Paul wrote:

On Tue, Aug 28, 2018, 6:04 PM Jeykumar Sankaran
 wrote:


On 2018-08-28 13:50, Sean Paul wrote:

From: Sean Paul 

The atomic_check is a bit too aggressive with respect to planes

which

leave the active area. This caused a bunch of log spew when the

cursor

got to the edge of the screen and stopped it from going all the

way.


This patch removes the conservative bounds checks from atomic and

clips

the dst rect such that we properly display planes which go off the
screen.

Changes in v2:
- Apply the clip to src as well (taking into account scaling)

Cc: Sravanthi Kollukuduru 
Cc: Jeykumar Sankaran 
Signed-off-by: Sean Paul 
---
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c  |  3 +--
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 14 +-
2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 07c2d15b45f2..f0a5e776ba32 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -1551,8 +1551,7 @@ static int dpu_crtc_atomic_check(struct

drm_crtc

*crtc,
cnt++;

dst = drm_plane_state_dest(pstate);
- if (!drm_rect_intersect(&clip, &dst) ||
- !drm_rect_equals(&clip, &dst)) {
+ if (!drm_rect_intersect(&clip, &dst)) {
DPU_ERROR("invalid vertical/horizontal
destination\n");
DPU_ERROR("display: " DRM_RECT_FMT " plane:

"

DRM_RECT_FMT "\n",
DRM_RECT_ARG(&crtc_rect),
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index efdf9b200dd9..adfd16625188 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -1254,7 +1254,8 @@ static int

dpu_plane_sspp_atomic_update(struct

drm_plane *plane,
const struct dpu_format *fmt;
struct drm_crtc *crtc;
struct drm_framebuffer *fb;
- struct drm_rect src, dst;
+ struct drm_rect clip = { 0 }, src, dst;
+ int hscale, vscale;

if (!plane) {
DPU_ERROR("invalid plane\n");
@@ -1300,6 +1301,17 @@ static int

dpu_plane_sspp_atomic_update(struct

drm_plane *plane,

dst = drm_plane_state_dest(state);

+ hscale = drm_rect_calc_hscale(&src, &dst,
+   pdpu->pipe_sblk->maxupscale,
+   pdpu->pipe_sblk->maxdwnscale);
+ vscale = drm_rect_calc_vscale(&src, &dst,
+   pdpu->pipe_sblk->maxupscale,
+   pdpu->pipe_sblk->maxdwnscale);
+
+ clip.x2 = crtc->state->adjusted_mode.hdisplay;
+ clip.y2 = crtc->state->adjusted_mode.vdisplay;
+ drm_rect_clip_scaled(&src, &dst, &clip, hscale, vscale);
+
DPU_DEBUG_PLANE(pdpu, "FB[%u] " DRM_RECT_FMT "->crtc%u "
DRM_RECT_FMT
", %4.4s ubwc %d\n", fb->base.id [1],
DRM_RECT_ARG(&src),
crtc->base.id [1], DRM_RECT_ARG(&dst),


Don't you have to update pdpu->pipe_cfg.src_rect and
pdpu->pipe_cfg.dst_rect with clip?


No, clip is the active area, so it'll always be equal to the adjusted
mode.

Sean



Got it! In that case, can drm_atomic_helper_check_plane_state helper be 
useful here?



--
Jeykumar S



Links:
--
[1] http://base.id


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


[PATCH 2/3] drm/msm/dpu: remove unwanted encoder type mapping

2018-08-28 Thread Jeykumar Sankaran
This change gets rid of unwanted connector-encoder type
mapping used for dsi-staging driver. Now that DPU will
be using upstream DSI driver, remove the stale code.

Signed-off-by: Jeykumar Sankaran 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 20 ++--
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 5b07f63..26c80b6 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -2200,8 +2200,7 @@ static int dpu_encoder_virt_add_phys_encs(
 
 static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
 struct dpu_kms *dpu_kms,
-struct msm_display_info *disp_info,
-int *drm_enc_mode)
+struct msm_display_info *disp_info)
 {
int ret = 0;
int i = 0;
@@ -,16 +2221,11 @@ static int dpu_encoder_setup_display(struct 
dpu_encoder_virt *dpu_enc,
 
DPU_DEBUG("\n");
 
-   if (disp_info->intf_type == DRM_MODE_CONNECTOR_DSI) {
-   *drm_enc_mode = DRM_MODE_ENCODER_DSI;
+   switch (disp_info->intf_type) {
+   case DRM_MODE_CONNECTOR_DSI:
intf_type = INTF_DSI;
-   } else if (disp_info->intf_type == DRM_MODE_CONNECTOR_HDMIA) {
-   *drm_enc_mode = DRM_MODE_ENCODER_TMDS;
-   intf_type = INTF_HDMI;
-   } else if (disp_info->intf_type == DRM_MODE_CONNECTOR_DisplayPort) {
-   *drm_enc_mode = DRM_MODE_ENCODER_TMDS;
-   intf_type = INTF_DP;
-   } else {
+   break;
+   default:
DPU_ERROR_ENC(dpu_enc, "unsupported display interface type\n");
return -EINVAL;
}
@@ -2352,14 +2346,12 @@ int dpu_encoder_setup(struct drm_device *dev, struct 
drm_encoder *enc,
struct dpu_kms *dpu_kms = to_dpu_kms(priv->kms);
struct drm_encoder *drm_enc = NULL;
struct dpu_encoder_virt *dpu_enc = NULL;
-   int drm_enc_mode = DRM_MODE_ENCODER_NONE;
int ret = 0;
 
dpu_enc = to_dpu_encoder_virt(enc);
 
mutex_init(&dpu_enc->enc_lock);
-   ret = dpu_encoder_setup_display(dpu_enc, dpu_kms, disp_info,
-   &drm_enc_mode);
+   ret = dpu_encoder_setup_display(dpu_enc, dpu_kms, disp_info);
if (ret)
goto fail;
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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


[PATCH 0/3] use encoder type to identify display

2018-08-28 Thread Jeykumar Sankaran
DPU is broken with patch [1]. This patch cleans up few stale codes
and fixes the DPU bug by using encoder type to identify displays.

[1] https://patchwork.kernel.org/patch/10568269/

Thanks.

Jeykumar Sankaran (3):
  drm/msm/dpu: remove stale display port programming
  drm/msm/dpu: remove unwanted encoder type mapping
  drm/msm/dpu: use encoder type to identify display type

 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 32 -
 1 file changed, 9 insertions(+), 23 deletions(-)

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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


[PATCH 1/3] drm/msm/dpu: remove stale display port programming

2018-08-28 Thread Jeykumar Sankaran
Remove stale display port programming. It can be
added back with DPU support for display port.

Signed-off-by: Jeykumar Sankaran 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 1b4de34..5b07f63 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -,12 +,6 @@ static void _dpu_encoder_virt_enable_helper(struct 
drm_encoder *drm_enc)
return;
}
 
-   if (dpu_enc->disp_info.intf_type == DRM_MODE_CONNECTOR_DisplayPort &&
-   dpu_enc->cur_master->hw_mdptop &&
-   dpu_enc->cur_master->hw_mdptop->ops.intf_audio_select)
-   dpu_enc->cur_master->hw_mdptop->ops.intf_audio_select(
-   dpu_enc->cur_master->hw_mdptop);
-
if (dpu_enc->cur_master->hw_mdptop &&
dpu_enc->cur_master->hw_mdptop->ops.reset_ubwc)
dpu_enc->cur_master->hw_mdptop->ops.reset_ubwc(
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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


[PATCH 3/3] drm/msm/dpu: use encoder type to identify display type

2018-08-28 Thread Jeykumar Sankaran
With patch [1], DPU is broken since it continues to use
incorrect connector_type to identify the display type. Update
DPU to use the encoder type to get the info.

[1] https://patchwork.kernel.org/patch/10568269/

Signed-off-by: Jeykumar Sankaran 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 26c80b6..5b0e944 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -525,7 +525,7 @@ void dpu_encoder_helper_split_config(
hw_mdptop = phys_enc->hw_mdptop;
disp_info = &dpu_enc->disp_info;
 
-   if (disp_info->intf_type != DRM_MODE_CONNECTOR_DSI)
+   if (disp_info->intf_type != DRM_MODE_ENCODER_DSI)
return;
 
/**
@@ -1873,7 +1873,7 @@ void dpu_encoder_kickoff(struct drm_encoder *drm_enc)
phys->ops.handle_post_kickoff(phys);
}
 
-   if (dpu_enc->disp_info.intf_type == DRM_MODE_CONNECTOR_DSI &&
+   if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI &&
!_dpu_encoder_wakeup_time(drm_enc, &wakeup_time)) {
trace_dpu_enc_early_kickoff(DRMID(drm_enc),
ktime_to_ms(wakeup_time));
@@ -,7 +,7 @@ static int dpu_encoder_setup_display(struct 
dpu_encoder_virt *dpu_enc,
DPU_DEBUG("\n");
 
switch (disp_info->intf_type) {
-   case DRM_MODE_CONNECTOR_DSI:
+   case DRM_MODE_ENCODER_DSI:
intf_type = INTF_DSI;
break;
default:
@@ -2362,7 +2362,7 @@ int dpu_encoder_setup(struct drm_device *dev, struct 
drm_encoder *enc,
timer_setup(&dpu_enc->frame_done_timer,
dpu_encoder_frame_done_timeout, 0);
 
-   if (disp_info->intf_type == DRM_MODE_CONNECTOR_DSI)
+   if (disp_info->intf_type == DRM_MODE_ENCODER_DSI)
timer_setup(&dpu_enc->vsync_event_timer,
dpu_encoder_vsync_event_handler,
0);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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


Re: [PATCH v2] drm/msm: dpu: Allow planes to extend past active display

2018-08-28 Thread Sean Paul
On Tue, Aug 28, 2018, 6:04 PM Jeykumar Sankaran 
wrote:

> On 2018-08-28 13:50, Sean Paul wrote:
> > From: Sean Paul 
> >
> > The atomic_check is a bit too aggressive with respect to planes which
> > leave the active area. This caused a bunch of log spew when the cursor
> > got to the edge of the screen and stopped it from going all the way.
> >
> > This patch removes the conservative bounds checks from atomic and clips
> > the dst rect such that we properly display planes which go off the
> > screen.
> >
> > Changes in v2:
> > - Apply the clip to src as well (taking into account scaling)
> >
> > Cc: Sravanthi Kollukuduru 
> > Cc: Jeykumar Sankaran 
> > Signed-off-by: Sean Paul 
> > ---
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c  |  3 +--
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 14 +-
> >  2 files changed, 14 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> > b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> > index 07c2d15b45f2..f0a5e776ba32 100644
> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> > @@ -1551,8 +1551,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc
> > *crtc,
> >   cnt++;
> >
> >   dst = drm_plane_state_dest(pstate);
> > - if (!drm_rect_intersect(&clip, &dst) ||
> > - !drm_rect_equals(&clip, &dst)) {
> > + if (!drm_rect_intersect(&clip, &dst)) {
> >   DPU_ERROR("invalid vertical/horizontal
> > destination\n");
> >   DPU_ERROR("display: " DRM_RECT_FMT " plane: "
> > DRM_RECT_FMT "\n",
> > DRM_RECT_ARG(&crtc_rect),
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > index efdf9b200dd9..adfd16625188 100644
> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > @@ -1254,7 +1254,8 @@ static int dpu_plane_sspp_atomic_update(struct
> > drm_plane *plane,
> >   const struct dpu_format *fmt;
> >   struct drm_crtc *crtc;
> >   struct drm_framebuffer *fb;
> > - struct drm_rect src, dst;
> > + struct drm_rect clip = { 0 }, src, dst;
> > + int hscale, vscale;
> >
> >   if (!plane) {
> >   DPU_ERROR("invalid plane\n");
> > @@ -1300,6 +1301,17 @@ static int dpu_plane_sspp_atomic_update(struct
> > drm_plane *plane,
> >
> >   dst = drm_plane_state_dest(state);
> >
> > + hscale = drm_rect_calc_hscale(&src, &dst,
> > +   pdpu->pipe_sblk->maxupscale,
> > +   pdpu->pipe_sblk->maxdwnscale);
> > + vscale = drm_rect_calc_vscale(&src, &dst,
> > +   pdpu->pipe_sblk->maxupscale,
> > +   pdpu->pipe_sblk->maxdwnscale);
> > +
> > + clip.x2 = crtc->state->adjusted_mode.hdisplay;
> > + clip.y2 = crtc->state->adjusted_mode.vdisplay;
> > + drm_rect_clip_scaled(&src, &dst, &clip, hscale, vscale);
> > +
> >   DPU_DEBUG_PLANE(pdpu, "FB[%u] " DRM_RECT_FMT "->crtc%u "
> > DRM_RECT_FMT
> >   ", %4.4s ubwc %d\n", fb->base.id,
> > DRM_RECT_ARG(&src),
> >   crtc->base.id, DRM_RECT_ARG(&dst),
>
> Don't you have to update pdpu->pipe_cfg.src_rect and
> pdpu->pipe_cfg.dst_rect with clip?
>

No, clip is the active area, so it'll always be equal to the adjusted mode.

Sean


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


Re: [PATCH 1/2] drm: Add library for shmem backed GEM objects

2018-08-28 Thread kbuild test robot
Hi Noralf,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.19-rc1 next-20180828]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Noralf-Tr-nnes/drm-Add-shmem-GEM-library/20180828-222625
reproduce: make htmldocs

All warnings (new ones prefixed by >>):

   include/net/mac80211.h:977: warning: Function parameter or member 'ack' not 
described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'ack.cookie' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.rates' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.ack_signal' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.ampdu_ack_len' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.ampdu_len' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.antenna' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.tx_time' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.is_valid_ack_signal' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.status_driver_data' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'driver_rates' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 'pad' not 
described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'rate_driver_data' not described in 'ieee80211_tx_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'rx_stats_avg' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'rx_stats_avg.signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'rx_stats_avg.chain_signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.filtered' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.retry_failed' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.retry_count' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.lost_packets' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.last_tdls_pkt_time' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.msdu_retries' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.msdu_failed' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.last_ack' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.last_ack_signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.ack_signal_filled' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.avg_ack_signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'tx_stats.packets' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'tx_stats.bytes' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'tx_stats.last_rate' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'tx_stats.msdu' not described in 'sta_info'
   include/linux/mod_devicetable.h:763: warning: Function parameter or member 
'd

Re: 4.19-rc1 on droid 4: screen not updating

2018-08-28 Thread Pavel Machek
Hi!

> > With Sebastian's patches, display works on Droid 4 in v4.18.
> 
> Hmm care to post your v4.18 patches somewhere too for people?
> I'd have to look around for them since I've been using Linux
> next for past few months.

I don't have patches separated at the moment. I pushed the branch to

g...@gitolite.kernel.org:pub/scm/linux/kernel/git/pavel/linux-n900.git

all-v4.18

> Also, do you have v4.19-rc1 versions of your pending audio
> patches somewhere? I'd like to play with voice calls again
> now with my WIP pending n_gsm serdev patches..

I pushed that to all-v4.19 .

> > I had to do some manual merging, and I see kernel messages in
> > v4.19-rc1, but they are frozen -- no updates.
> > 
> > a) does someone have it working?
> 
> I have had it working for few weeks since I'm following
> Linux next. I just pushed Sebastian's patches I rebased
> earlier today against v4.19-rc1 to [0][1].

Thanks, will take a look tommorow.

> > b) is there some way I can help to get it working in mainline? Droid 4
> > is not exactly new, and this is painful point that makes it hard to
> > use.
> 
> Well since Sebastian is busy according to [2], maybe try to update
> Sebastian's mfd-ti-lmu backlight patches so they can get merged?
> Please check with Sebastian, but that would cut down the pending
> pile by quite a few patches.

Ok, let me take a look.

I currently don't have the patches separated, and yes, the audio ones
work, but no, they are not designed right :-(. 

Best regards,
Pavel

> [0] git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap 
> droid4-pending-v4.19
> [1] 
> https://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git/log/?h=droid4-pending-v4.19
> [2] https://lists.freedesktop.org/archives/dri-devel/2018-August/186226.html

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


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


[PATCH RESEND v6 1/2] drm/panel: Add support for Truly NT35597 panel driver

2018-08-28 Thread Abhinav Kumar
From: "abhin...@codeaurora.org" 

Add support for Truly NT35597 panel driver used
in MSM reference platforms.

This panel driver supports both single DSI and dual DSI
modes.

However, this patch series adds support only for
dual DSI mode.

Changes in v6:
- Introduce panel config to store panel specific
  details
- Bring back the size member for the panel command
  structure to make the design more scalable
- Move the display mode from the DT to driver
- Change the compatible string to indicate which
  which board and panel it will be used for
- Rename the functions to match the panel driver
- Have a data member for each compatible string
- Remove the panel commands split as its not
  required for the panel init functionality

Signed-off-by: Archit Taneja 
Signed-off-by: Abhinav Kumar 
---
 drivers/gpu/drm/panel/Kconfig   |   8 +
 drivers/gpu/drm/panel/Makefile  |   1 +
 drivers/gpu/drm/panel/panel-truly-nt35597.c | 705 
 3 files changed, 714 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-truly-nt35597.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 6020c30..7ae74c2 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -186,4 +186,12 @@ config DRM_PANEL_SITRONIX_ST7789V
  Say Y here if you want to enable support for the Sitronix
  ST7789V controller for 240x320 LCD panels
 
+config DRM_PANEL_TRULY_NT35597_WQXGA
+   tristate "Truly WQXGA"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   select VIDEOMODE_HELPERS
+   help
+ Say Y here if you want to enable support for Truly NT35597 WQXGA Dual 
DSI
+ Video Mode panel
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 5ccaaa9..80fd19f 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -19,3 +19,4 @@ obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o
 obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o
+obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
diff --git a/drivers/gpu/drm/panel/panel-truly-nt35597.c 
b/drivers/gpu/drm/panel/panel-truly-nt35597.c
new file mode 100644
index 000..691be03
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-truly-nt35597.c
@@ -0,0 +1,705 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+static const char * const regulator_names[] = {
+   "vdda",
+   "vdispp",
+   "vdispn",
+};
+
+static unsigned long const regulator_enable_loads[] = {
+   62000,
+   10,
+   10,
+};
+
+static unsigned long const regulator_disable_loads[] = {
+   80,
+   100,
+   100,
+};
+
+struct nt35597_config {
+   u32 width_mm;
+   u32 height_mm;
+   char panel_name[256];
+   void *panel_on_cmds;
+   u32 num_on_cmds;
+   struct drm_display_mode *dm;
+};
+
+struct truly_nt35597 {
+   struct device *dev;
+   struct drm_panel panel;
+
+   struct regulator_bulk_data supplies[ARRAY_SIZE(regulator_names)];
+
+   struct gpio_desc *reset_gpio;
+   struct gpio_desc *mode_gpio;
+
+   struct backlight_device *backlight;
+
+   struct mipi_dsi_device *dsi[2];
+
+   const struct nt35597_config *config;
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct truly_nt35597 *panel_to_ctx(struct drm_panel *panel)
+{
+   return container_of(panel, struct truly_nt35597, panel);
+}
+
+#define MAX_LEN5
+#define SHORT_PACKET 2
+#define LONG_PACKET 4
+
+struct cmd_set {
+   u8 commands[MAX_LEN];
+   int size;
+};
+
+static struct cmd_set qcom_2k_panel_magic_cmds[] = {
+   /* CMD2_P0 */
+   { { 0xff, 0x20 }, 2 },
+   { { 0xfb, 0x01 }, 2 },
+   { { 0x00, 0x01 }, 2 },
+   { { 0x01, 0x55 }, 2 },
+   { { 0x02, 0x45 }, 2 },
+   { { 0x05, 0x40 }, 2 },
+   { { 0x06, 0x19 }, 2 },
+   { { 0x07, 0x1e }, 2 },
+   { { 0x0b, 0x73 }, 2 },
+   { { 0x0c, 0x73 }, 2 },
+   { { 0x0e, 0xb0 }, 2 },
+   { { 0x0f, 0xae }, 2 },
+   { { 0x11, 0xb8 }, 2 },
+   { { 0x13, 0x00 }, 2 },
+   { { 0x58, 0x80 }, 2 },
+   { { 0x59, 0x01 }, 2 },
+   { { 0x5a, 0x00 }, 2 },
+   { { 0x5b, 0x01 }, 2 },
+   { { 0x5c, 0x80 }, 2 },
+   { { 0x5d, 0x81 }, 2 },
+   { { 0x5e, 0x00 }, 2 },
+   { { 0x5f, 0x01 }, 2 },
+   { { 0x72, 0x11 }, 2 },
+   { { 0x68, 0x03 }, 2 },
+   /* CMD2_P4 */
+   { { 0xFF, 0x24 }, 2 },
+   { { 0xFB, 0x01 }, 2 },
+   { { 0x00, 0x1C }, 2 },
+   { { 0x01, 0x0B }, 2 },
+   { { 0x02, 0x0C }, 2 },
+   { { 0x03, 0

[PATCH RESEND v6 2/2] dt-bindings: Add Truly NT35597 panel driver bindings

2018-08-28 Thread Abhinav Kumar
From: "abhin...@codeaurora.org" 

Add the device tree bindings for Truly NT35597 panel driver.
This panel driver supports both single DSI and dual DSI.

However, this patch series supports only dual DSI.

Changes in v6:
  - Change the compatible string to indicate the
reference board and the panel
  - Remove the display timing node

Signed-off-by: Abhinav Kumar 
---
 .../devicetree/bindings/display/truly,nt35597.txt  | 55 ++
 1 file changed, 55 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/truly,nt35597.txt

diff --git a/Documentation/devicetree/bindings/display/truly,nt35597.txt 
b/Documentation/devicetree/bindings/display/truly,nt35597.txt
new file mode 100644
index 000..68960a6
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/truly,nt35597.txt
@@ -0,0 +1,55 @@
+Truly model NT35597 1440x2560 DSI Panel
+
+Required properties:
+- compatible: should be "qcom,sdm845-mtp-2K-display"
+- vdda-supply: phandle of the regulator that provides the supply voltage
+  Power IC supply
+- vdispp-supply: phandle of the regulator that provides the supply voltage
+  for positive LCD bias
+- vdispn-supply: phandle of the regulator that provides the supply voltage
+  for negative LCD bias
+- reset-gpios: phandle of gpio for reset line
+  This should be 8mA, gpio can be configured using mux, pinctrl, pinctrl-names
+- mode-gpios: phandle of the gpio for choosing the mode of the display
+  for single DSI or Dual DSI
+  This should be low for dual DSI and high for single DSI mode
+- ports: This device has two video ports driven by two DSIs. Their connections
+  are modelled using the OF graph bindings specified in
+  Documentation/devicetree/bindings/graph.txt.
+  - port@0: DSI input port driven by master DSI
+  - port@1: DSI input port driven by secondary DSI
+
+Example:
+
+   dsi@ae94000 {
+   panel@0 {
+   compatible = "qcom,sdm845-mtp-2K-display";
+   reg = <0>;
+   vdda-supply = <&pm8998_l14>;
+   vdispp-supply = <&lab_regulator>;
+   vdispn-supply = <&ibb_regulator>;
+   pinctrl-names = "default", "suspend";
+   pinctrl-0 = <&dpu_dsi_active>;
+   pinctrl-1 = <&dpu_dsi_suspend>;
+
+   reset-gpios = <&tlmm 6 0>;
+   mode-gpios = <&tlmm 52 0>;
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   port@0 {
+   reg = <0>;
+   panel0_in: endpoint {
+   remote-endpoint = <&dsi0_out>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+   panel1_in: endpoint {
+   remote-endpoint = <&dsi1_out>;
+   };
+   };
+   };
+   };
+   };
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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


[Bug 107652] amdgpu couldn't resume after suspend

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107652

--- Comment #5 from Andrey Grodzovsky  ---
(In reply to mikhail.v.gavrilov from comment #4)
> Created attachment 141325 [details]
> system log (4.19.0-0.rc1.git0.1)


(In reply to mikhail.v.gavrilov from comment #4)
> Created attachment 141325 [details]
> system log (4.19.0-0.rc1.git0.1)

Can you now show memory status after suspend happened and failed ?
Can you also try repeat the test with minimal graphics enabled(switch to FB
console, sudo xinit) and then repeat the steps to see if this still happens

-- 
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 107045] [4.18rc2] RX470 dGPU on hybrid laptop freezes screen after use

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107045

--- Comment #21 from Andrey Grodzovsky  ---
(In reply to taijian from comment #20)
> OK, here is a new twist: upon further investigating this, I came across some
> weird backlight behaviour that I originally reported here:
> https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/53. However, as
> it turns out, this is not a gnome issue but a kernel one.
> 
> Namely, doing 
> 
>   echo X > /sys/class/backlight/intel_backlight/brightness
> 
> will wake my dGPU, even though it really shouldn't be involved at all (and
> does not have a /sys/class/backlight device registered). Furthermore,
> repeatedly invoking this command before the dGPU has had the chance to go
> back to sleep will not do anything. Thirdly, this seems to be a very good
> way to get the system to hard lock up.
> 
> So, is this an amdgpu issue? A i915 issue? ACPI? where should I take this
> bug report?

What do you mean by 'wake' the dGPU? This should be a separate ticket which you
can submit here + attach dmesg after this 'wake'.

-- 
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 107730] AMDGPU: No feedback when firmware loading fails

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107730

Bug ID: 107730
   Summary: AMDGPU: No feedback when firmware loading fails
   Product: DRI
   Version: unspecified
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: DRM/AMDgpu
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: ern...@gmail.com

Created attachment 141326
  --> https://bugs.freedesktop.org/attachment.cgi?id=141326&action=edit
journalctl from the boot

When booting, my system hang at "fb: switching to amdgpudrmfb from EFI VGA"
I could SysRq and also ctrl-alt-del it, but I couldn't get anything more on the
screen.

Turns out I couldn't load my firmware anymore. My filesystem (or is that
ramdisk on Ubuntu) had been corrupted somehow.

aug 28 23:45:18 mammut kernel: [drm:gfx_v8_0_init_microcode [amdgpu]] 
aug 28 23:45:18 mammut kernel: amdgpu :0a:00.0: Direct firmware load for
amdgpu/fiji_pfp.bin failed with error -2
aug 28 23:45:18 mammut kernel: amdgpu :0a:00.0: gfx8: Failed to load
firmware "amdgpu/fiji_pfp.bin"
aug 28 23:45:18 mammut kernel: [drm:gfx_v8_0_sw_init [amdgpu]] *ERROR* Failed
to load gfx firmware!
aug 28 23:45:18 mammut kernel: [drm:amdgpu_device_init [amdgpu]] *ERROR*
sw_init of IP block  failed -2
aug 28 23:45:18 mammut kernel: amdgpu :0a:00.0: amdgpu_device_ip_init
failed
aug 28 23:45:18 mammut kernel: amdgpu :0a:00.0: Fatal error during GPU init

It would be super nice if the system could go back to VGA mode so I could see
the error in this case.

Kernel 4.18, Ubuntu, FIJI. amdgpu.dc=1/0 didn't make any difference...

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


RE: [PATCH 14/23] drm/dsc: Define the DSC 1.1 and 1.2 Line Buffer depth constants

2018-08-28 Thread Srivatsa, Anusha


>-Original Message-
>From: Navare, Manasi D
>Sent: Monday, July 30, 2018 7:13 PM
>To: intel-...@lists.freedesktop.org
>Cc: ville.syrj...@linux.intel.com; jani.nik...@linux.intel.com; Srivatsa, 
>Anusha
>; Singh, Gaurav K ; dri-
>de...@lists.freedesktop.org; Navare, Manasi D 
>Subject: [PATCH 14/23] drm/dsc: Define the DSC 1.1 and 1.2 Line Buffer depth
>constants
>
>From: Gaurav K Singh 
>
>DSC specification defines linebuf_depth which contains the line buffer bit 
>depth
>used to generate the bitstream.
>These values are defined as per Table 4.1 in DSC 1.2 spec
>
>v2 (From Manasi):
>* Rename as MAX_LINEBUF_DEPTH for DSC 1.1 and DSC 1.2
>
>Cc: dri-devel@lists.freedesktop.org
>Cc: Jani Nikula 
>Cc: Ville Syrjälä 
>Signed-off-by: Gaurav K Singh 
>Signed-off-by: Manasi Navare 
Reviewed-by: Anusha Srivatsa 
>---
> include/drm/drm_dsc.h | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/include/drm/drm_dsc.h b/include/drm/drm_dsc.h index
>30adc15..4cfcd03 100644
>--- a/include/drm/drm_dsc.h
>+++ b/include/drm/drm_dsc.h
>@@ -56,6 +56,9 @@
> #define DSC_PPS_RC_RANGE_MINQP_SHIFT  11
> #define DSC_PPS_RC_RANGE_MAXQP_SHIFT  6
> #define DSC_PPS_NATIVE_420_SHIFT  1
>+#define DSC_1_2_MAX_LINEBUF_DEPTH_BITS16
>+#define DSC_1_2_MAX_LINEBUF_DEPTH_VAL 0
>+#define DSC_1_1_MAX_LINEBUF_DEPTH_BITS13
>
> /* Configuration for a single Rate Control model range */  struct
>dsc_rc_range_parameters {
>--
>2.7.4

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


Re: [PATCH v2] drm/msm: dpu: Allow planes to extend past active display

2018-08-28 Thread Jeykumar Sankaran

On 2018-08-28 13:50, Sean Paul wrote:

From: Sean Paul 

The atomic_check is a bit too aggressive with respect to planes which
leave the active area. This caused a bunch of log spew when the cursor
got to the edge of the screen and stopped it from going all the way.

This patch removes the conservative bounds checks from atomic and clips
the dst rect such that we properly display planes which go off the
screen.

Changes in v2:
- Apply the clip to src as well (taking into account scaling)

Cc: Sravanthi Kollukuduru 
Cc: Jeykumar Sankaran 
Signed-off-by: Sean Paul 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c  |  3 +--
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 14 +-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 07c2d15b45f2..f0a5e776ba32 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -1551,8 +1551,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc
*crtc,
cnt++;

dst = drm_plane_state_dest(pstate);
-   if (!drm_rect_intersect(&clip, &dst) ||
-   !drm_rect_equals(&clip, &dst)) {
+   if (!drm_rect_intersect(&clip, &dst)) {
DPU_ERROR("invalid vertical/horizontal
destination\n");
DPU_ERROR("display: " DRM_RECT_FMT " plane: "
  DRM_RECT_FMT "\n",
DRM_RECT_ARG(&crtc_rect),
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index efdf9b200dd9..adfd16625188 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -1254,7 +1254,8 @@ static int dpu_plane_sspp_atomic_update(struct
drm_plane *plane,
const struct dpu_format *fmt;
struct drm_crtc *crtc;
struct drm_framebuffer *fb;
-   struct drm_rect src, dst;
+   struct drm_rect clip = { 0 }, src, dst;
+   int hscale, vscale;

if (!plane) {
DPU_ERROR("invalid plane\n");
@@ -1300,6 +1301,17 @@ static int dpu_plane_sspp_atomic_update(struct
drm_plane *plane,

dst = drm_plane_state_dest(state);

+   hscale = drm_rect_calc_hscale(&src, &dst,
+ pdpu->pipe_sblk->maxupscale,
+ pdpu->pipe_sblk->maxdwnscale);
+   vscale = drm_rect_calc_vscale(&src, &dst,
+ pdpu->pipe_sblk->maxupscale,
+ pdpu->pipe_sblk->maxdwnscale);
+
+   clip.x2 = crtc->state->adjusted_mode.hdisplay;
+   clip.y2 = crtc->state->adjusted_mode.vdisplay;
+   drm_rect_clip_scaled(&src, &dst, &clip, hscale, vscale);
+
DPU_DEBUG_PLANE(pdpu, "FB[%u] " DRM_RECT_FMT "->crtc%u "
DRM_RECT_FMT
", %4.4s ubwc %d\n", fb->base.id,
DRM_RECT_ARG(&src),
crtc->base.id, DRM_RECT_ARG(&dst),


Don't you have to update pdpu->pipe_cfg.src_rect and 
pdpu->pipe_cfg.dst_rect with clip?


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


[PATCH] drm/msm/dpu: Remove dpu_mdss_isr when dpu_mdss_destroy is called

2018-08-28 Thread Jordan Crouse
The MDSS device is created before the MSM driver attempts to bind the
sub components. If any of the components return -EPROBE_DEFER the MDSS
device is destroyed and tried again later.

If this happens the "dpu_mdss_isr" interrupt created from the DPU MDSS
is not freed when the MDSS device is destroyed and has a risk of
triggering later and hitting a fault by accessing a mmio region that
no longer exists. Even if the interrupt isn't triggered by
accident when the device attempts to reprobe it would error out
when it tries to re-register the interrupt so unconditionally removing
it in the destroy is the right move.

Switch the device managed "dpu_mdss_isr" to be unmanaged and add a
free_irq() in the mdss destroy function.

Signed-off-by: Jordan Crouse 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
index 9e533b86682c..2235ef8129f4 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
@@ -158,6 +158,8 @@ static void dpu_mdss_destroy(struct drm_device *dev)
 
_dpu_mdss_irq_domain_fini(dpu_mdss);
 
+   free_irq(platform_get_irq(pdev, 0), dpu_mdss);
+
msm_dss_put_clk(mp->clk_config, mp->num_clk);
devm_kfree(&pdev->dev, mp->clk_config);
 
@@ -215,7 +217,7 @@ int dpu_mdss_init(struct drm_device *dev)
if (ret)
goto irq_domain_error;
 
-   ret = devm_request_irq(dev->dev, platform_get_irq(pdev, 0),
+   ret = request_irq(platform_get_irq(pdev, 0),
dpu_mdss_irq, 0, "dpu_mdss_isr", dpu_mdss);
if (ret) {
DPU_ERROR("failed to init irq: %d\n", ret);
-- 
2.18.0

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


RE: [PATCH v2 08/23] drm/dsc: Define VESA Display Stream Compression Capabilities

2018-08-28 Thread Srivatsa, Anusha


>-Original Message-
>From: Harry Wentland [mailto:harry.wentl...@amd.com]
>Sent: Thursday, August 23, 2018 1:01 PM
>To: Navare, Manasi D ; intel-
>g...@lists.freedesktop.org
>Cc: Singh, Gaurav K ; dri-
>de...@lists.freedesktop.org; Jani Nikula ; Ville
>Syrjala ; Srivatsa, Anusha
>
>Subject: Re: [PATCH v2 08/23] drm/dsc: Define VESA Display Stream Compression
>Capabilities
>
>On 2018-07-31 05:07 PM, Manasi Navare wrote:
>> From: Gaurav K Singh 
>>
>> This defines all the DSC parameters as per the VESA DSC spec that will
>> be required for DSC encoder/decoder
>>
>> v4 (From Manasi)
>> * Add the DSC_MUX_WORD_SIZE constants (Manasi)
>>
>> v3 (From Manasi)
>> * Remove the duplicate define (Suggested By:Harry Wentland)
>>
>> v2: Define this struct in DRM (From Manasi)
>> * Changed the data types to u8/u16 instead of unsigned longs (Manasi)
>> * Remove driver specific fields (Manasi)
>> * Move this struct definition to DRM (Manasi)
>> * Define DSC 1.2 parameters (Manasi)
>> * Use DSC_NUM_BUF_RANGES (Manasi)
>> * Call it drm_dsc_config (Manasi)
>>
>> Cc: dri-devel@lists.freedesktop.org
>> Cc: Jani Nikula 
>> Cc: Ville Syrjala 
>> Cc: Anusha Srivatsa 
>> Cc: Harry Wentland 
>> Signed-off-by: Manasi Navare 
>> Signed-off-by: Gaurav K Singh 
>
>Acked-by: Harry Wentland 
>
>Harry
Double checked with the Spec, looks good.
Reviewed-by: Anusha Srivatsa 
>> ---
>>  include/drm/drm_dsc.h | 110
>> ++
>>  1 file changed, 110 insertions(+)
>>
>> diff --git a/include/drm/drm_dsc.h b/include/drm/drm_dsc.h index
>> 678e8e6..eda323d 100644
>> --- a/include/drm/drm_dsc.h
>> +++ b/include/drm/drm_dsc.h
>> @@ -30,6 +30,116 @@
>>
>>  /* VESA Display Stream Compression DSC 1.2 constants */
>>  #define DSC_NUM_BUF_RANGES  15
>> +#define DSC_MUX_WORD_SIZE_8_10_BPC  48
>> +#define DSC_MUX_WORD_SIZE_12_BPC64
>> +
>> +/* Configuration for a single Rate Control model range */ struct
>> +dsc_rc_range_parameters {
>> +/* Min Quantization Parameters allowed for this range */
>> +u8 range_min_qp;
>> +/* Max Quantization Parameters allowed for this range */
>> +u8 range_max_qp;
>> +/* Bits/group offset to apply to target for this group */
>> +u8 range_bpg_offset;
>> +};
>> +
>> +struct drm_dsc_config {
>> +/* Bits / component for previous reconstructed line buffer */
>> +u8 line_buf_depth;
>> +/* Bits per component to code (must be 8, 10, or 12) */
>> +u8 bits_per_component;
>> +/*
>> + * Flag indicating to do RGB - YCoCg conversion
>> + * and back (should be 1 for RGB input)
>> + */
>> +bool convert_rgb;
>> +u8 slice_count;
>> +/* Slice Width */
>> +u16 slice_width;
>> +/* Slice Height */
>> +u16 slice_height;
>> +/*
>> + * 4:2:2 enable mode (from PPS, 4:2:2 conversion happens
>> + * outside of DSC encode/decode algorithm)
>> + */
>> +bool enable422;
>> +/* Picture Width */
>> +u16 pic_width;
>> +/* Picture Height */
>> +u16 pic_height;
>> +/* Offset to bits/group used by RC to determine QP adjustment */
>> +u8 rc_tgt_offset_high;
>> +/* Offset to bits/group used by RC to determine QP adjustment */
>> +u8 rc_tgt_offset_low;
>> +/* Bits/pixel target << 4 (ie., 4 fractional bits) */
>> +u16 bits_per_pixel;
>> +/*
>> + * Factor to determine if an edge is present based
>> + * on the bits produced
>> + */
>> +u8 rc_edge_factor;
>> +/* Slow down incrementing once the range reaches this value */
>> +u8 rc_quant_incr_limit1;
>> +/* Slow down incrementing once the range reaches this value */
>> +u8 rc_quant_incr_limit0;
>> +/* Number of pixels to delay the initial transmission */
>> +u16 initial_xmit_delay;
>> +/* Number of pixels to delay the VLD on the decoder,not including SSM
>*/
>> +u16  initial_dec_delay;
>> +/* Block prediction enable */
>> +bool block_pred_enable;
>> +/* Bits/group offset to use for first line of the slice */
>> +u8 first_line_bpg_offset;
>> +/* Value to use for RC model offset at slice start */
>> +u16 initial_offset;
>> +/* Thresholds defining each of the buffer ranges */
>> +u16 rc_buf_thresh[DSC_NUM_BUF_RANGES - 1];
>> +/* Parameters for each of the RC ranges */
>> +struct dsc_rc_range_parameters
>rc_range_params[DSC_NUM_BUF_RANGES];
>> +/* Total size of RC model */
>> +u16 rc_model_size;
>> +/* Minimum QP where flatness information is sent */
>> +u8 flatness_min_qp;
>> +/* Maximum QP where flatness information is sent */
>> +u8 flatness_max_qp;
>> +/* Initial value for scale factor */
>> +u8 initial_scale_value;
>> +/* Decrement scale factor every scale_decrement_interval groups */
>> +u16 scale_decrement_interval;
>> +/* Increment scale factor every scale_increment_interval groups */
>> +u16 scale_increment_interval;
>> +/* Non-first line BPG offset to use */
>> +u16 nfl_bpg_offs

[radeon-alex:drm-next-4.20-wip 231/235] drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_priv.h:655:22: error: field 'mmu_notifier' has incomplete type

2018-08-28 Thread kbuild test robot
tree:   git://people.freedesktop.org/~agd5f/linux.git drm-next-4.20-wip
head:   bdb1922abd620d24715906bac4d119274d98f4c9
commit: 521fb7d021f7952aa3030e56c19edf342309cf9f [231/235] drm/amdgpu: Move KFD 
parameters to amdgpu (v3)
config: i386-randconfig-s0-08280925 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
git checkout 521fb7d021f7952aa3030e56c19edf342309cf9f
# save the attached .config to linux build tree
make ARCH=i386 

All errors (new ones prefixed by >>):

   In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c:42:0:
>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_priv.h:655:22: error: field 
>> 'mmu_notifier' has incomplete type
 struct mmu_notifier mmu_notifier;
 ^~~~

vim +/mmu_notifier +655 drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_priv.h

52a5fdce Alexey Skidanov 2014-11-19  624  
4a488a7a Oded Gabbay 2014-07-16  625  /* Process data */
4a488a7a Oded Gabbay 2014-07-16  626  struct kfd_process {
19f6d2a6 Oded Gabbay 2014-07-16  627/*
19f6d2a6 Oded Gabbay 2014-07-16  628 * kfd_process are stored in an 
mm_struct*->kfd_process*
19f6d2a6 Oded Gabbay 2014-07-16  629 * hash table (kfd_processes in 
kfd_process.c)
19f6d2a6 Oded Gabbay 2014-07-16  630 */
19f6d2a6 Oded Gabbay 2014-07-16  631struct hlist_node kfd_processes;
19f6d2a6 Oded Gabbay 2014-07-16  632  
9b56bb11 Felix Kuehling  2017-10-27  633/*
9b56bb11 Felix Kuehling  2017-10-27  634 * Opaque pointer to mm_struct. 
We don't hold a reference to
9b56bb11 Felix Kuehling  2017-10-27  635 * it so it should never be 
dereferenced from here. This is
9b56bb11 Felix Kuehling  2017-10-27  636 * only used for looking up 
processes by their mm.
9b56bb11 Felix Kuehling  2017-10-27  637 */
9b56bb11 Felix Kuehling  2017-10-27  638void *mm;
19f6d2a6 Oded Gabbay 2014-07-16  639  
5ce10687 Felix Kuehling  2017-11-27  640struct kref ref;
5ce10687 Felix Kuehling  2017-11-27  641struct work_struct release_work;
5ce10687 Felix Kuehling  2017-11-27  642  
19f6d2a6 Oded Gabbay 2014-07-16  643struct mutex mutex;
19f6d2a6 Oded Gabbay 2014-07-16  644  
19f6d2a6 Oded Gabbay 2014-07-16  645/*
19f6d2a6 Oded Gabbay 2014-07-16  646 * In any process, the thread 
that started main() is the lead
19f6d2a6 Oded Gabbay 2014-07-16  647 * thread and outlives the rest.
19f6d2a6 Oded Gabbay 2014-07-16  648 * It is here because 
amd_iommu_bind_pasid wants a task_struct.
894a8293 Felix Kuehling  2017-11-01  649 * It can also be used for 
safely getting a reference to the
894a8293 Felix Kuehling  2017-11-01  650 * mm_struct of the process.
19f6d2a6 Oded Gabbay 2014-07-16  651 */
19f6d2a6 Oded Gabbay 2014-07-16  652struct task_struct *lead_thread;
19f6d2a6 Oded Gabbay 2014-07-16  653  
19f6d2a6 Oded Gabbay 2014-07-16  654/* We want to receive a 
notification when the mm_struct is destroyed */
19f6d2a6 Oded Gabbay 2014-07-16 @655struct mmu_notifier 
mmu_notifier;
19f6d2a6 Oded Gabbay 2014-07-16  656  
19f6d2a6 Oded Gabbay 2014-07-16  657/* Use for delayed freeing of 
kfd_process structure */
19f6d2a6 Oded Gabbay 2014-07-16  658struct rcu_head rcu;
19f6d2a6 Oded Gabbay 2014-07-16  659  
19f6d2a6 Oded Gabbay 2014-07-16  660unsigned int pasid;
a91e70e3 Felix Kuehling  2017-08-26  661unsigned int doorbell_index;
19f6d2a6 Oded Gabbay 2014-07-16  662  
19f6d2a6 Oded Gabbay 2014-07-16  663/*
19f6d2a6 Oded Gabbay 2014-07-16  664 * List of kfd_process_device 
structures,
19f6d2a6 Oded Gabbay 2014-07-16  665 * one for each device the 
process is using.
19f6d2a6 Oded Gabbay 2014-07-16  666 */
19f6d2a6 Oded Gabbay 2014-07-16  667struct list_head 
per_device_data;
19f6d2a6 Oded Gabbay 2014-07-16  668  
45102048 Ben Goz 2014-07-17  669struct process_queue_manager 
pqm;
45102048 Ben Goz 2014-07-17  670  
19f6d2a6 Oded Gabbay 2014-07-16  671/*Is the user space process 32 
bit?*/
19f6d2a6 Oded Gabbay 2014-07-16  672bool is_32bit_user_mode;
f3a39818 Andrew Lewycky  2015-05-10  673  
f3a39818 Andrew Lewycky  2015-05-10  674/* Event-related data */
f3a39818 Andrew Lewycky  2015-05-10  675struct mutex event_mutex;
482f0777 Felix Kuehling  2017-10-27  676/* Event ID allocator and 
lookup */
482f0777 Felix Kuehling  2017-10-27  677struct idr event_idr;
50cb7dd9 Felix Kuehling  2017-10-27  678/* Event page */
50cb7dd9 Felix Kuehling  2017-10-27  679struct kfd_signal_page 
*signal_page;
b9a5d0a5 Felix Kuehling  2017-10-27  680size_t signal_mapped_size;
f3a39818 Andrew Lewycky  2015-05-10  681size_t signal_event_count;
c986

[PATCH v2] drm/msm: dpu: Allow planes to extend past active display

2018-08-28 Thread Sean Paul
From: Sean Paul 

The atomic_check is a bit too aggressive with respect to planes which
leave the active area. This caused a bunch of log spew when the cursor
got to the edge of the screen and stopped it from going all the way.

This patch removes the conservative bounds checks from atomic and clips
the dst rect such that we properly display planes which go off the
screen.

Changes in v2:
- Apply the clip to src as well (taking into account scaling)

Cc: Sravanthi Kollukuduru 
Cc: Jeykumar Sankaran 
Signed-off-by: Sean Paul 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c  |  3 +--
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 14 +-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 07c2d15b45f2..f0a5e776ba32 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -1551,8 +1551,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
cnt++;
 
dst = drm_plane_state_dest(pstate);
-   if (!drm_rect_intersect(&clip, &dst) ||
-   !drm_rect_equals(&clip, &dst)) {
+   if (!drm_rect_intersect(&clip, &dst)) {
DPU_ERROR("invalid vertical/horizontal destination\n");
DPU_ERROR("display: " DRM_RECT_FMT " plane: "
  DRM_RECT_FMT "\n", DRM_RECT_ARG(&crtc_rect),
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index efdf9b200dd9..adfd16625188 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -1254,7 +1254,8 @@ static int dpu_plane_sspp_atomic_update(struct drm_plane 
*plane,
const struct dpu_format *fmt;
struct drm_crtc *crtc;
struct drm_framebuffer *fb;
-   struct drm_rect src, dst;
+   struct drm_rect clip = { 0 }, src, dst;
+   int hscale, vscale;
 
if (!plane) {
DPU_ERROR("invalid plane\n");
@@ -1300,6 +1301,17 @@ static int dpu_plane_sspp_atomic_update(struct drm_plane 
*plane,
 
dst = drm_plane_state_dest(state);
 
+   hscale = drm_rect_calc_hscale(&src, &dst,
+ pdpu->pipe_sblk->maxupscale,
+ pdpu->pipe_sblk->maxdwnscale);
+   vscale = drm_rect_calc_vscale(&src, &dst,
+ pdpu->pipe_sblk->maxupscale,
+ pdpu->pipe_sblk->maxdwnscale);
+
+   clip.x2 = crtc->state->adjusted_mode.hdisplay;
+   clip.y2 = crtc->state->adjusted_mode.vdisplay;
+   drm_rect_clip_scaled(&src, &dst, &clip, hscale, vscale);
+
DPU_DEBUG_PLANE(pdpu, "FB[%u] " DRM_RECT_FMT "->crtc%u " DRM_RECT_FMT
", %4.4s ubwc %d\n", fb->base.id, DRM_RECT_ARG(&src),
crtc->base.id, DRM_RECT_ARG(&dst),
-- 
Sean Paul, Software Engineer, Google / Chromium OS

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


Re: [PATCH] drm/pl111: add in missing sentinel to a of_device_id array

2018-08-28 Thread Linus Walleij
On Thu, Aug 23, 2018 at 1:16 PM zhong jiang  wrote:

> I has posted the same patch about a month ago. but it seems to be ignored.:-(
>
> https://lore.kernel.org/patchwork/patch/971652/

I applied your patch and pushed it.

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


[Bug 107652] amdgpu couldn't resume after suspend

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107652

--- Comment #4 from mikhail.v.gavri...@gmail.com ---
Created attachment 141325
  --> https://bugs.freedesktop.org/attachment.cgi?id=141325&action=edit
system log (4.19.0-0.rc1.git0.1)

-- 
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 107652] amdgpu couldn't resume after suspend

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107652

--- Comment #3 from mikhail.v.gavri...@gmail.com ---
Yep you right.
But suspend mode will be totally useless on the computer on which no programs
are running.
The sence of suspend mode to put the computer to sleep with all running
programs, and then wake up and that everything continues to work.

Anyway, I see that in swap there was enough space for unloading the full size
of RAM.

$ free -m
  totalusedfree  shared  buff/cache   available
Mem:  32158   275001054119336033007
Swap: 655357912   57623


$ cat  /proc/meminfo
MemTotal:   32930572 kB
MemFree: 1149372 kB
MemAvailable:3127012 kB
Buffers:  28 kB
Cached:  3366532 kB
SwapCached:  1007320 kB
Active: 20999764 kB
Inactive:3531864 kB
Active(anon):   19666712 kB
Inactive(anon):  2725324 kB
Active(file):1333052 kB
Inactive(file):   806540 kB
Unevictable:   31468 kB
Mlocked:   31468 kB
SwapTotal:  67108860 kB
SwapFree:   59004668 kB
Dirty:  2008 kB
Writeback: 0 kB
AnonPages:  21151436 kB
Mapped:  1888740 kB
Shmem:   1222624 kB
Slab: 894752 kB
SReclaimable: 301996 kB
SUnreclaim:   592756 kB
KernelStack:   77072 kB
PageTables:   405340 kB
NFS_Unstable:  0 kB
Bounce:0 kB
WritebackTmp:  0 kB
CommitLimit:83574144 kB
Committed_AS:   347269980 kB
VmallocTotal:   34359738367 kB
VmallocUsed:   0 kB
VmallocChunk:  0 kB
Percpu:12864 kB
HardwareCorrupted: 0 kB
AnonHugePages:   2207744 kB
ShmemHugePages:0 kB
ShmemPmdMapped:0 kB
CmaTotal:  0 kB
CmaFree:   0 kB
HugePages_Total:   0
HugePages_Free:0
HugePages_Rsvd:0
HugePages_Surp:0
Hugepagesize:   2048 kB
Hugetlb:   0 kB
DirectMap4k:29582752 kB
DirectMap2M: 3901440 kB
DirectMap1G: 1048576 kB

$ vmstat -s
 32930572 K total memory
 28110600 K used memory
 21000912 K active memory
  3542156 K inactive memory
  1140784 K free memory
   28 K buffer memory
  3679160 K swap cache
 67108860 K total swap
  8103680 K used swap
 59005180 K free swap
 21926506 non-nice user cpu ticks
  1867047 nice user cpu ticks
  4336923 system cpu ticks
101407781 idle cpu ticks
   547470 IO-wait cpu ticks
   452621 IRQ cpu ticks
   266687 softirq cpu ticks
0 stolen cpu ticks
 40223592 pages paged in
 62917184 pages paged out
  2325269 pages swapped in
  4803989 pages swapped out
   2369356089 interrupts
   4293312571 CPU context switches
   1535402349 boot time
   398972 forks

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


[radeon-alex:drm-next-4.20-wip 220/235] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:771:1-3: WARNING: PTR_ERR_OR_ZERO can be used

2018-08-28 Thread kbuild test robot
tree:   git://people.freedesktop.org/~agd5f/linux.git drm-next-4.20-wip
head:   bdb1922abd620d24715906bac4d119274d98f4c9
commit: e498eb7136042aa9a352b1039c678537f4694158 [220/235] drm/amd/display: Add 
support for hw_state logging via debugfs


coccinelle warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:771:1-3: 
>> WARNING: PTR_ERR_OR_ZERO can be used

Please review and possibly fold the followup patch.

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


[PATCH] drm/amd/display: fix ptr_ret.cocci warnings

2018-08-28 Thread kbuild test robot
From: kbuild test robot 

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:771:1-3: 
WARNING: PTR_ERR_OR_ZERO can be used


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Fixes: e498eb713604 ("drm/amd/display: Add support for hw_state logging via 
debugfs")
CC: Nicholas Kazlauskas 
Signed-off-by: kbuild test robot 
---

tree:   git://people.freedesktop.org/~agd5f/linux.git drm-next-4.20-wip
head:   bdb1922abd620d24715906bac4d119274d98f4c9
commit: e498eb7136042aa9a352b1039c678537f4694158 [220/235] drm/amd/display: Add 
support for hw_state logging via debugfs

 amdgpu_dm_debugfs.c |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -768,8 +768,5 @@ int dtn_debugfs_init(struct amdgpu_devic
adev,
&dtn_log_fops);
 
-   if (IS_ERR(ent))
-   return PTR_ERR(ent);
-
-   return 0;
+   return PTR_ERR_OR_ZERO(ent);
 }
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 3/4] drm/dp_mst: Add dp_mst_status debugfs node for all drivers

2018-08-28 Thread kbuild test robot
Hi Lyude,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.19-rc1 next-20180828]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Lyude-Paul/drm-dp_mst-Add-DP-MST-debugfs-nodes-for-all-drivers/20180828-083742
reproduce: make htmldocs

All warnings (new ones prefixed by >>):

   include/net/mac80211.h:977: warning: Function parameter or member 
'ack.cookie' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.rates' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.ack_signal' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.ampdu_ack_len' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.ampdu_len' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.antenna' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.tx_time' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.is_valid_ack_signal' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'status.status_driver_data' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'driver_rates' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 'pad' not 
described in 'ieee80211_tx_info'
   include/net/mac80211.h:977: warning: Function parameter or member 
'rate_driver_data' not described in 'ieee80211_tx_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'rx_stats_avg' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'rx_stats_avg.signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'rx_stats_avg.chain_signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.filtered' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.retry_failed' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.retry_count' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.lost_packets' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.last_tdls_pkt_time' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.msdu_retries' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.msdu_failed' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.last_ack' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.last_ack_signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.ack_signal_filled' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.avg_ack_signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'tx_stats.packets' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'tx_stats.bytes' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'tx_stats.last_rate' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'tx_stats.msdu' not described in 'sta_info'
   include/linux/mod_devicetable.h:763: warning: Function parameter or member 
'driver_data' not described in 'typec_device_id'
   kernel/sched/fair.c:3371: warning: Funct

Re: linux-next: Signed-off-by missing for commit in the drm-misc-fixes tree

2018-08-28 Thread Sean Paul
On Tue, Aug 28, 2018 at 07:29:59AM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> Commit
> 
>   ccb748df0058 ("drm/vc4: Fix the "no scaling" case on multi-planar YUV 
> formats")
> 
> is missing a Signed-off-by from its committer.
> 
> It was rebased.

Hi Stephen,
I've fixed the commit and fixed our tooling to avoid this in the future. Thanks
for the poke,

Sean

> 
> -- 
> Cheers,
> Stephen Rothwell



-- 
Sean Paul, Software Engineer, Google / Chromium OS
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 105251] [Vega10] GPU lockup on boot: VMC page fault

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105251

--- Comment #38 from Andrey Grodzovsky  ---
(In reply to Marek Olšák from comment #37)
> Created attachment 141323 [details] [review]
> patch - fix ddebug BO list reporting
> 
> Hi,
> 
> Can you please get a new ddebug report with the attached patch? Thanks.

Just to be clear, you need to rebuild you mesa library with that patch on top.

-- 
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 105251] [Vega10] GPU lockup on boot: VMC page fault

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105251

--- Comment #37 from Marek Olšák  ---
Created attachment 141323
  --> https://bugs.freedesktop.org/attachment.cgi?id=141323&action=edit
patch - fix ddebug BO list reporting

Hi,

Can you please get a new ddebug report with the attached patch? Thanks.

-- 
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 107729] Nouveau gr BUG

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107729

Ilia Mirkin  changed:

   What|Removed |Added

Product|DRI |xorg
Version|XOrg git|unspecified
   Assignee|dri-devel@lists.freedesktop |nouveau@lists.freedesktop.o
   |.org|rg
  Component|DRM/other   |Driver/nouveau
 QA Contact||xorg-t...@lists.x.org

-- 
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 107729] Nouveau gr BUG

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107729

--- Comment #1 from Ilia Mirkin  ---
(In reply to Alexey from comment #0)
> [20747.330911] nouveau :01:00.0: fifo: DMA_PUSHER - ch 7
> [minetest[12365]] get 03a100 put 080cc8 ib_get 01f6 ib_put
> 01f9 state 800075e0 (err: INVALID_CMD) push 00406040

This is indicative of some sort of error processing commands, anything that
happens after that is just indicative of the screwup.

The 406040 error is a long-standing issue on Tesla-family GPUs. Still no idea
what goes wrong.

-- 
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 200621] Freezing with amdgpu driver

2018-08-28 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=200621

--- Comment #7 from Jon (jon...@gmail.com) ---
Created attachment 278177
  --> https://bugzilla.kernel.org/attachment.cgi?id=278177&action=edit
dmesg output

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


[Bug 107729] Nouveau gr BUG

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107729

Alexey  changed:

   What|Removed |Added

   Keywords||NEEDINFO

-- 
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 107729] Nouveau gr BUG

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107729

Bug ID: 107729
   Summary: Nouveau gr BUG
   Product: DRI
   Version: XOrg git
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: DRM/other
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: ne-vleza...@yandex.ru

[20747.330911] nouveau :01:00.0: fifo: DMA_PUSHER - ch 7 [minetest[12365]]
get 03a100 put 080cc8 ib_get 01f6 ib_put 01f9 state 800075e0
(err: INVALID_CMD) push 00406040
[20747.343913] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.343931] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 0d80 data 
[20747.343949] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.343960] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 0d84 data 3c808081
[20747.343976] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.343986] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 0d88 data 3d30b0b1
[20747.344002] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344010] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 0d8c data 3f80
[20747.344027] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344035] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 0d90 data 3f80
[20747.344051] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344059] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 19d0 data 003d
[20747.344076] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344084] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 12d4 data 1d01
[20747.344123] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344131] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 1688 data 
[20747.344147] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344156] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 1534 data 
[20747.344173] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344181] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 13b0 data 3f80
[20747.344197] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344205] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 1570 data 
[20747.344221] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344229] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 166c data 
[20747.344245] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344254] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 1518 data 3f80
[20747.344269] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344278] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 1520 data 
[20747.344293] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344302] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 1658 data 
[20747.344317] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344326] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 0dac data 1b02
[20747.344342] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344350] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 0db0 data 1b02
[20747.344366] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344374] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 0db4 data 
[20747.344390] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344398] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 1918 data 
[20747.344414] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.344422] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 191c data 0900
[20747.344438] nouveau :01:00.0: gr: DATA_ERROR 000d [BEGIN_END_ACTIVE]
[20747.37] nouveau :01:00.0: gr: 0010 [] ch 7 [000f3de000
minetest[12365]] subc 3 class 8297 mthd 19

[Bug 200621] Freezing with amdgpu driver

2018-08-28 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=200621

Andrey Grodzovsky (andrey.grodzov...@amd.com) changed:

   What|Removed |Added

 CC||andrey.grodzov...@amd.com

--- Comment #6 from Andrey Grodzovsky (andrey.grodzov...@amd.com) ---
(In reply to Jon from comment #5)
> Is there any other information I can provide to help diagnose?  I'm not even
> sure if I have this bug filed in the right place.

Please provide full dmesg log

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


Re: [Freedreno] [PATCH 9/9] arm64: dts: Add interconnect for the GPU on SDM845

2018-08-28 Thread Jordan Crouse
On Mon, Aug 27, 2018 at 09:11:12AM -0600, Jordan Crouse wrote:
> Add the interconnect properties for the GPU on SDM845
> and set the corresponding OPP bandwidth values.
> 
> Signed-off-by: Jordan Crouse 
> ---
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 10 ++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi 
> b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 10db0ceb3699..1e67f4fdd7d1 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -198,36 +198,43 @@ gpu_opp_table: adreno-opp-table {
>   opp-71000 {
>   opp-hz = /bits/ 64 <71000>;
>   qcom,level = <416>;
> + opp-interconnect-bw-port0 = /bits/ 64 <0 721600>;
>   };
>  
>   opp-67500 {
>   opp-hz = /bits/ 64 <67500>;
>   qcom,level = <384>;
> + opp-interconnect-bw-port0 = /bits/ 64 <0 721600>;
>   };
>  
>   opp-59600 {
>   opp-hz = /bits/ 64 <59600>;
>   qcom,level = <320>;
> + opp-interconnect-bw-port0 = /bits/ 64 <0 518400>;
>   };
>  
>   opp-52000 {
>   opp-hz = /bits/ 64 <52000>;
>   qcom,level = <256>;
> + opp-interconnect-bw-port0 = /bits/ 64 <0 406800>;
>   };
>  
>   opp-41400 {
>   opp-hz = /bits/ 64 <41400>;
>   qcom,level = <192>;
> + opp-interconnect-bw-port0 = /bits/ 64 <0 307200>;
>   };
>  
>   opp-34200 {
>   opp-hz = /bits/ 64 <34200>;
>   qcom,level = <128>;
> + opp-interconnect-bw-port0 = /bits/ 64 <0 218800>;
>   };
>  
>   opp-25700 {
>   opp-hz = /bits/ 64 <25700>;
>   qcom,level = <64>;
> + opp-interconnect-bw-port0 = /bits/ 64 <0 12>;
>   };
>   };
>  
> @@ -418,6 +425,9 @@ gpu_opp_table: adreno-opp-table {
>  
>   operating-points-v2 = <&gpu_opp_table>;
>  
> + interconnects = <&qnoc 26 &qnoc 512>;

Pointing out for posterity that the src_id here is incorrect. It should be 36.

Jordan

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


Re: [PATCH v4 7/8] drm/i2c: tda998x: register as a drm bridge

2018-08-28 Thread Russell King - ARM Linux
On Tue, Aug 28, 2018 at 07:49:28PM +0200, Peter Rosin wrote:
> On 2018-07-06 14:43, Russell King - ARM Linux wrote:
> > On Fri, Jul 06, 2018 at 11:03:46AM +0100, Russell King - ARM Linux wrote:
> >> On Wed, Apr 25, 2018 at 11:01:15PM +0300, Jyri Sarha wrote:
> >>> Oh yes. But in this case the substandard solution is already there and
> >>> it is already widely used, despite it being severely broken. I am merely
> >>> trying to fix the existing substandard solution.
> >>>
> >>> I admit that a full integration with component helpers would probably be
> >>> more elegant solution to the problem, but the amount of work is just too
> >>> much. The change would impact the way all the master drm drivers pull
> >>> them selves together. The drivers that already use the component helpers
> >>> for some internal stuff will add their own challenge. Separate component
> >>> matching implementations are needed for device-tree and ACPI (are ther
> >>> more flavors?) etc. I just do not see this happening any time soon (am
> >>> happy to be wrong about this).
> >>
> >> The issue is actually worse than that:
> >>
> >> - drivers that are already componentised can't use bridges
> >> - drivers that use bridges can't use componentised stuff
> >>
> >> because bridges don't register themselves with the component helper,
> >> and the helpers in drm_of.c assume that all graph nodes will be
> >> components.
> >>
> >> The whole thing about whether stuff is componentised or bridge based
> >> is really getting out of hand, and the push is towards bridge based
> >> stuff even though that is technically inferior when it comes to being
> >> able to develop and test (which involves being able to remove and
> >> re-insert modules.)
> >>
> >> Consequently more and more code is being written for bridges, and
> >> the component helper ignored, and the problems with bridges are
> >> being ignored.  This is not healthy.
> >>
> >> The problem is only going to get worse.  Someone needs to bite the
> >> bullet and fix bridges before the problem gets any more out of hand.
> > 
> > This patch (which is actually two patches locally) allows the component
> > helper to know what's going on inside the bridge code wrt bridge
> > availability, and takes the appropriate action at the correct time.
> > No need for device links or similar, or incompatibilities between
> > bridges and components.  The only requirement is that bridges set the
> > "device" member of struct drm_bridge to opt-in to this.
> > 
> > Tested with Armada converted to support bridges, TDA998x as a
> > componentised bridge, and dumb-vga-dac as a non-componentised bridge:
> > 
> > root@cubox:~# less /sys/kernel/debug/device_component/display-subsystem
> > master namestatus
> > -
> > display-subsystem   bound
> > 
> > device namestatus
> > -
> > port   registered
> > port   registered
> > hdmi-encoder   registered
> > vga-bridge registered
> > root@cubox:~# dmesg |grep bound
> > [1.921798] armada-drm display-subsystem: bound f182.lcd-controller 
> > (ops
> > armada_lcd_ops)
> > [1.931014] armada-drm display-subsystem: bound f181.lcd-controller 
> > (ops
> > armada_lcd_ops)
> > [2.069231] armada-drm display-subsystem: bound 1-0070 (ops tda998x_ops)
> > [2.076059] armada-drm display-subsystem: bound vga-bridge (ops 
> > dummy_ops)
> > 
> > Without this, the same DT fails because "vga-bridge" is never added
> > to the component helpers.
> 
> What did you need to do to convert Armada to support bridges? How much
> work is it to convert drivers that support bridges so that they
> support components? Maybe that's not needed? What happens with tda998x?
> I mean, it already calls component_add, and with this there's an
> indirect call in drm_bridge_add which it also calls. I guess I'm asking
> if a component may call component_add several times without things
> sliding sideways?

The difference with tda998x is that with the code below (as it stood
in an earlier revision of the bridge code, when we had a separate
bridge->of_node member), bridge->device is not set for the tda998x,
which avoids the duplicated component_add() - which would be illegal
(and cause problems.)

However, I also hacked tda998x to make tda998x_bind() a no-op - without
such a hack, the DRM driver needs to know whether the bridge is tda998x
or not, so it knows whether it needs to create the encoder.

I don't think there's any simple, non-hacky solution to this problem.

> 
> > 
> > diff --git a/drivers/base/component.c b/drivers/base/component.c
> > index 8946dfee4768..b14b3a3655ea 100644
> > --- a/driver

[radeon-alex:amd-staging-drm-next 640/655] htmldocs: drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:480: warning: Function parameter or member 'level' not described in 'amdgpu_vm_bo_param'

2018-08-28 Thread kbuild test robot
tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next
head:   30c3f838bd24ea52f6d3ebb44996340e4d98890d
commit: 7b7d78f626410923ce18ba9a183048dc8ca7db41 [640/655] drm/amdgpu: add 
helper for VM PD/PT allocation parameters v2
reproduce: make htmldocs

All warnings (new ones prefixed by >>):

   WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick 
(https://www.imagemagick.org)
   mm/mempool.c:228: warning: Function parameter or member 'pool' not described 
in 'mempool_init'
   include/net/cfg80211.h:4279: warning: Function parameter or member 
'wext.ibss' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 
'wext.connect' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 
'wext.keys' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.ie' 
not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 
'wext.ie_len' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 
'wext.bssid' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 
'wext.ssid' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 
'wext.default_key' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 
'wext.default_mgmt_key' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 
'wext.prev_bssid_valid' not described in 'wireless_dev'
   include/net/mac80211.h:2282: warning: Function parameter or member 
'radiotap_timestamp.units_pos' not described in 'ieee80211_hw'
   include/net/mac80211.h:2282: warning: Function parameter or member 
'radiotap_timestamp.accuracy' not described in 'ieee80211_hw'
   include/net/mac80211.h:955: warning: Function parameter or member 
'control.rates' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'control.rts_cts_rate_idx' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'control.use_rts' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'control.use_cts_prot' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'control.short_preamble' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'control.skip_table' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'control.jiffies' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'control.vif' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'control.hw_key' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'control.flags' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'control.enqueue_time' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'ack' not 
described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'ack.cookie' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'status.rates' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'status.ack_signal' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'status.ampdu_ack_len' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'status.ampdu_len' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'status.antenna' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'status.tx_time' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'status.is_valid_ack_signal' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'status.status_driver_data' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'driver_rates' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'pad' not 
described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 
'rate_driver_data' not described in 'ieee80211_tx_info'
   net/mac80

[PATCH v2 4/4] drm/i915: Remove i915_drm_dp_mst_status

2018-08-28 Thread Lyude Paul
Now that DRM can create these debugfs nodes automatically; this isn't
needed.

Signed-off-by: Lyude Paul 
Cc: Maarten Lankhorst 
Cc: Daniel Stone 
---
 drivers/gpu/drm/i915/i915_debugfs.c | 32 -
 1 file changed, 32 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c
index f9ce35da4123..5014828ca022 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -3534,37 +3534,6 @@ static int i915_drrs_status(struct seq_file *m, void 
*unused)
return 0;
 }
 
-static int i915_dp_mst_info(struct seq_file *m, void *unused)
-{
-   struct drm_i915_private *dev_priv = node_to_i915(m->private);
-   struct drm_device *dev = &dev_priv->drm;
-   struct intel_encoder *intel_encoder;
-   struct intel_digital_port *intel_dig_port;
-   struct drm_connector *connector;
-   struct drm_connector_list_iter conn_iter;
-
-   drm_connector_list_iter_begin(dev, &conn_iter);
-   drm_for_each_connector_iter(connector, &conn_iter) {
-   if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort)
-   continue;
-
-   intel_encoder = intel_attached_encoder(connector);
-   if (!intel_encoder || intel_encoder->type == 
INTEL_OUTPUT_DP_MST)
-   continue;
-
-   intel_dig_port = enc_to_dig_port(&intel_encoder->base);
-   if (!intel_dig_port->dp.can_mst)
-   continue;
-
-   seq_printf(m, "MST Source Port %c\n",
-  port_name(intel_dig_port->base.port));
-   drm_dp_mst_dump_topology(m, &intel_dig_port->dp.mst_mgr);
-   }
-   drm_connector_list_iter_end(&conn_iter);
-
-   return 0;
-}
-
 static ssize_t i915_displayport_test_active_write(struct file *file,
  const char __user *ubuf,
  size_t len, loff_t *offp)
@@ -4733,7 +4702,6 @@ static const struct drm_info_list i915_debugfs_list[] = {
{"i915_rcs_topology", i915_rcs_topology, 0},
{"i915_shrinker_info", i915_shrinker_info, 0},
{"i915_shared_dplls_info", i915_shared_dplls_info, 0},
-   {"i915_dp_mst_info", i915_dp_mst_info, 0},
{"i915_wa_registers", i915_wa_registers, 0},
{"i915_ddb_info", i915_ddb_info, 0},
{"i915_sseu_status", i915_sseu_status, 0},
-- 
2.17.1

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


[PATCH v2 1/4] drm/debugfs: Add support for dynamic debugfs initialization

2018-08-28 Thread Lyude Paul
Currently all debugfs related initialization for the DRM core happens in
drm_debugfs_init(), which is called when registering the minor device.
While this works fine for features such as atomic modesetting and GEM,
this doesn't work at all for resources like DP MST topology managers
which can potentially be created both before and after the minor
device has been registered.

So, in order to add driver-wide debugfs files for MST we'll need to be
able to handle debugfs initialization for such resources. We do so by
introducing drm_debugfs_callback_register() and
drm_debugfs_callback_unregister(). These functions allow driver-agnostic
parts of DRM to add additional debugfs initialization callbacks at any
point during a DRM driver's lifetime.

Signed-off-by: Lyude Paul 
Cc: Maarten Lankhorst 
Cc: Daniel Stone 
---
 drivers/gpu/drm/drm_debugfs.c  | 173 +++--
 drivers/gpu/drm/drm_drv.c  |   3 +
 drivers/gpu/drm/drm_internal.h |   5 +
 include/drm/drm_debugfs.h  |  27 +
 include/drm/drm_file.h |   4 +
 5 files changed, 203 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 6f28fe58f169..a53a454b167f 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -39,6 +39,13 @@
 
 #if defined(CONFIG_DEBUG_FS)
 
+struct drm_debugfs_callback {
+   void (*init)(void *data);
+   void (*cleanup_cb)(void *data);
+   void *data;
+   struct list_head list;
+};
+
 /***
  * Initialization, etc.
  **/
@@ -67,6 +74,113 @@ static const struct file_operations drm_debugfs_fops = {
.release = single_release,
 };
 
+/**
+ * drm_debugfs_register_callback - Register a callback for initializing
+ * dynamic driver-agnostic debugfs files
+ * @minor: device minor number
+ * @init: The callback to invoke to perform the debugfs initialization
+ * @cleanup_cb: The callback to invoke to cleanup any resources for the
+ * callback
+ * @data: Data to pass to @init and @cleanup_cb
+ * @out: Where to store the pointer to the callback struct
+ *
+ * Register an initialization callback with debugfs. This callback can be used
+ * to creating debugfs nodes for DRM resources that might get created before
+ * the debugfs node for @minor has been created.
+ *
+ * When a callback is registered with this function before the debugfs root
+ * has been created, the callback's execution will be delayed until all other
+ * debugfs nodes (including those owned by the DRM device's driver) have been
+ * instantiated. If a callback is registered with this function after the
+ * debugfs root has been created, @init and @cleanup_cb will be executed
+ * immediately without creating a &struct drm_debugfs_callback.
+ *
+ * In the event that debugfs creation for the device fails; all registered
+ * debugfs callbacks will have their @cleanup_cb callbacks invoked without
+ * having their @init callbacks invoked. This is to ensure that no resources
+ * are leaked during initialization of debugfs, even if the initialization
+ * process fails. Likewise; any callbacks that are registered after DRM has
+ * failed to initialize it's debugfs files will have their @cleanup_cb
+ * callbacks invoked immediately and all of their respective resources
+ * destroyed.
+ *
+ * Implementations of @cleanup_cb should clean up all resources for the
+ * callback, with the exception of freeing the memory for @out. Freeing @out
+ * will be handled by the DRM core automatically.
+ *
+ * Users of this function should take care to add a symmetric call to
+ * @drm_debugfs_unregister_callback to handle destroying a registered callback
+ * in case the resources for the user of this function are destroyed before
+ * debugfs root is initialized.
+ *
+ */
+int
+drm_debugfs_register_callback(struct drm_minor *minor,
+ void (*init)(void *),
+ void (*cleanup_cb)(void *),
+ void *data, struct drm_debugfs_callback **out)
+{
+   int ret = 0;
+
+   mutex_lock(&minor->debugfs_callback_lock);
+   if (minor->debugfs_callbacks_done) {
+   /* debugfs is already setup, so just handle the callback
+* immediately
+*/
+   if (minor->debugfs_root)
+   (*init)(data);
+   (*cleanup_cb)(data);
+   goto out_unlock;
+   }
+
+   *out = kzalloc(sizeof(**out), GFP_KERNEL);
+   if (!*out) {
+   ret = -ENOMEM;
+   goto out_unlock;
+   }
+
+   (*out)->init = init;
+   (*out)->cleanup_cb = cleanup_cb;
+   (*out)->data = data;
+   list_add(&(*out)->list, &minor->debugfs_callback_list);
+
+out_unlock:
+   mutex_unlock(&minor->debugfs_callback_lock);
+   return ret;
+}
+EXPORT_SYMBOL(drm_debugfs_register

[PATCH v2 0/4] drm/dp_mst: Add DP MST debugfs nodes for all drivers

2018-08-28 Thread Lyude Paul
This is the next version of my patch series for teaching DRM how to
automatically create debugfs nodes for drivers with MST topologies. This
was originally intended just for nouveau, but has since been expanded to
all DRM drivers.

Changes since previous version:
 - Fix documentation error that got noticed by the kbuild bot in
   "drm/dp_mst: Pass entire connector to drm_dp_mst_topology_mgr_init()"

Cc: Maarten Lankhorst 
Cc: Daniel Stone 

Lyude Paul (4):
  drm/debugfs: Add support for dynamic debugfs initialization
  drm/dp_mst: Pass entire connector to drm_dp_mst_topology_mgr_init()
  drm/dp_mst: Add dp_mst_status debugfs node for all drivers
  drm/i915: Remove i915_drm_dp_mst_status

 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   |   2 +-
 drivers/gpu/drm/drm_debugfs.c | 173 +-
 drivers/gpu/drm/drm_dp_mst_topology.c | 116 +++-
 drivers/gpu/drm/drm_drv.c |   3 +
 drivers/gpu/drm/drm_internal.h|   5 +
 drivers/gpu/drm/i915/i915_debugfs.c   |  32 
 drivers/gpu/drm/i915/intel_dp.c   |   2 +-
 drivers/gpu/drm/i915/intel_dp_mst.c   |   6 +-
 drivers/gpu/drm/i915/intel_drv.h  |   3 +-
 drivers/gpu/drm/nouveau/dispnv50/disp.c   |   6 +-
 drivers/gpu/drm/radeon/radeon_dp_mst.c|   2 +-
 include/drm/drm_debugfs.h |  27 +++
 include/drm/drm_dp_mst_helper.h   |  17 +-
 include/drm/drm_file.h|   4 +
 14 files changed, 343 insertions(+), 55 deletions(-)

-- 
2.17.1

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


[PATCH v2 3/4] drm/dp_mst: Add dp_mst_status debugfs node for all drivers

2018-08-28 Thread Lyude Paul
Originally I was just going to be adding dp_mst_status for nouveau until
Daniel Stone pointed out that we should probably just make this so it's
magically added for every DRM driver that's using the DRM DP MST
helpers. So, let's do that!

Signed-off-by: Lyude Paul 
Cc: Maarten Lankhorst 
Cc: Daniel Stone 
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 106 ++
 include/drm/drm_dp_mst_helper.h   |  14 
 2 files changed, 120 insertions(+)

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c 
b/drivers/gpu/drm/drm_dp_mst_topology.c
index acb7633f3f70..a6a2c03af62a 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -3154,6 +3155,104 @@ struct drm_dp_mst_topology_state 
*drm_atomic_get_mst_topology_state(struct drm_a
 }
 EXPORT_SYMBOL(drm_atomic_get_mst_topology_state);
 
+#ifdef CONFIG_DEBUG_FS
+static int drm_dp_mst_debugfs_state_show(struct seq_file *m, void *data)
+{
+   drm_dp_mst_dump_topology(m, m->private);
+   return 0;
+}
+
+static int drm_dp_mst_debugfs_state_open(struct inode *inode,
+struct file *file)
+{
+   struct drm_dp_mst_topology_mgr *mgr = inode->i_private;
+
+   return single_open(file, drm_dp_mst_debugfs_state_show, mgr);
+}
+
+static const struct file_operations drm_dp_mst_debugfs_state_fops = {
+   .owner = THIS_MODULE,
+   .open = drm_dp_mst_debugfs_state_open,
+   .read = seq_read,
+   .llseek = seq_lseek,
+   .release = single_release,
+};
+
+struct drm_dp_mst_debugfs_init_data {
+   struct drm_dp_mst_topology_mgr *mgr;
+   char *connector_name;
+};
+
+static void
+drm_dp_mst_debugfs_init(void *data)
+{
+   struct drm_dp_mst_debugfs_init_data *init_data = data;
+   struct drm_dp_mst_topology_mgr *mgr = init_data->mgr;
+   struct drm_minor *minor = mgr->dev->primary;
+   struct dentry *root;
+   bool put_ref = false;
+
+   /* Create the dp_mst directory for this device if it doesn't exist
+* already
+*/
+   root = debugfs_lookup("dp_mst", minor->debugfs_root);
+   if (root) {
+   put_ref = true;
+   } else {
+   root = debugfs_create_dir("dp_mst", minor->debugfs_root);
+   if (!root || IS_ERR(root))
+   return;
+   }
+
+   mgr->debugfs = debugfs_create_dir(init_data->connector_name, root);
+   if (!mgr->debugfs)
+   goto out_dput;
+
+   debugfs_create_file("state", 0444, mgr->debugfs, mgr,
+   &drm_dp_mst_debugfs_state_fops);
+
+out_dput:
+   if (put_ref)
+   dput(root);
+}
+
+static void
+drm_dp_mst_debugfs_cleanup_cb(void *data)
+{
+   struct drm_dp_mst_debugfs_init_data *init_data = data;
+
+   init_data->mgr->debugfs_init_cb = NULL;
+   kfree(init_data->connector_name);
+   kfree(init_data);
+}
+
+static void
+drm_dp_mst_debugfs_register(struct drm_dp_mst_topology_mgr *mgr,
+   struct drm_connector *connector)
+{
+   struct drm_dp_mst_debugfs_init_data *init_data;
+
+   if (!connector)
+   return;
+
+   init_data = kmalloc(sizeof(*init_data), GFP_KERNEL);
+   if (!init_data)
+   return;
+
+   init_data->mgr = mgr;
+   init_data->connector_name = kstrdup(connector->name, GFP_KERNEL);
+   if (!init_data->connector_name) {
+   kfree(init_data);
+   return;
+   }
+
+   drm_debugfs_register_callback(mgr->dev->primary,
+ drm_dp_mst_debugfs_init,
+ drm_dp_mst_debugfs_cleanup_cb,
+ init_data, &mgr->debugfs_init_cb);
+}
+#endif
+
 /**
  * drm_dp_mst_topology_mgr_init - initialise a topology manager
  * @mgr: manager struct to initialise
@@ -3214,6 +3313,9 @@ int drm_dp_mst_topology_mgr_init(struct 
drm_dp_mst_topology_mgr *mgr,
drm_atomic_private_obj_init(&mgr->base,
&mst_state->base,
&mst_state_funcs);
+#ifdef CONFIG_DEBUG_FS
+   drm_dp_mst_debugfs_register(mgr, connector);
+#endif
 
return 0;
 }
@@ -3225,6 +3327,10 @@ EXPORT_SYMBOL(drm_dp_mst_topology_mgr_init);
  */
 void drm_dp_mst_topology_mgr_destroy(struct drm_dp_mst_topology_mgr *mgr)
 {
+#ifdef CONFIG_DEBUG_FS
+   drm_debugfs_unregister_callback(mgr->dev->primary,
+   mgr->debugfs_init_cb);
+#endif
flush_work(&mgr->work);
flush_work(&mgr->destroy_connector_work);
mutex_lock(&mgr->payload_lock);
diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h
index ef8ba093ae8a..c70b81cd78b1 100644
--- a/include/drm/drm_dp_mst_helper.h
+++ b/include/drm/drm_dp_mst_helper.h
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#i

[PATCH v2 2/4] drm/dp_mst: Pass entire connector to drm_dp_mst_topology_mgr_init()

2018-08-28 Thread Lyude Paul
There's no actual reason we pass the connector ID instead of a pointer
to the connector itself, and we're going to need the entire connector
(but only temporarily) in order to name MST debugfs folders properly
since connector IDs can't be looked up until the driver has been
registered with userspace which happens after debugfs init.

So, just pass the entire drm_connector struct instead of just its id.

Signed-off-by: Lyude Paul 
---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c|  2 +-
 drivers/gpu/drm/drm_dp_mst_topology.c  | 10 ++
 drivers/gpu/drm/i915/intel_dp.c|  2 +-
 drivers/gpu/drm/i915/intel_dp_mst.c|  6 --
 drivers/gpu/drm/i915/intel_drv.h   |  3 ++-
 drivers/gpu/drm/nouveau/dispnv50/disp.c|  6 +++---
 drivers/gpu/drm/radeon/radeon_dp_mst.c |  2 +-
 include/drm/drm_dp_mst_helper.h|  3 ++-
 8 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 9a300732ba37..60da7e8fcca7 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -503,6 +503,6 @@ void amdgpu_dm_initialize_dp_connector(struct 
amdgpu_display_manager *dm,
&aconnector->dm_dp_aux.aux,
16,
4,
-   aconnector->connector_id);
+   &aconnector->base);
 }
 
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c 
b/drivers/gpu/drm/drm_dp_mst_topology.c
index 7780567aa669..acb7633f3f70 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -3161,14 +3161,16 @@ EXPORT_SYMBOL(drm_atomic_get_mst_topology_state);
  * @aux: DP helper aux channel to talk to this device
  * @max_dpcd_transaction_bytes: hw specific DPCD transaction limit
  * @max_payloads: maximum number of payloads this GPU can source
- * @conn_base_id: the connector object ID the MST device is connected to.
+ * @connector: the &struct drm_connector the MST device is connected to.
  *
  * Return 0 for success, or negative error code on failure
  */
 int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr,
-struct drm_device *dev, struct drm_dp_aux *aux,
+struct drm_device *dev,
+struct drm_dp_aux *aux,
 int max_dpcd_transaction_bytes,
-int max_payloads, int conn_base_id)
+int max_payloads,
+struct drm_connector *connector)
 {
struct drm_dp_mst_topology_state *mst_state;
 
@@ -3186,7 +3188,7 @@ int drm_dp_mst_topology_mgr_init(struct 
drm_dp_mst_topology_mgr *mgr,
mgr->aux = aux;
mgr->max_dpcd_transaction_bytes = max_dpcd_transaction_bytes;
mgr->max_payloads = max_payloads;
-   mgr->conn_base_id = conn_base_id;
+   mgr->conn_base_id = connector->base.id;
if (max_payloads + 1 > sizeof(mgr->payload_mask) * 8 ||
max_payloads + 1 > sizeof(mgr->vcpi_mask) * 8)
return -EINVAL;
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index cd0f649b57a5..3688df38dbe7 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -6247,7 +6247,7 @@ intel_dp_init_connector(struct intel_digital_port 
*intel_dig_port,
(port == PORT_B || port == PORT_C ||
 port == PORT_D || port == PORT_F))
intel_dp_mst_encoder_init(intel_dig_port,
- intel_connector->base.base.id);
+ &intel_connector->base);
 
if (!intel_edp_init_connector(intel_dp, intel_connector)) {
intel_dp_aux_fini(intel_dp);
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c 
b/drivers/gpu/drm/i915/intel_dp_mst.c
index 7e3e01607643..6c07c29235df 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -583,7 +583,8 @@ intel_dp_create_fake_mst_encoders(struct intel_digital_port 
*intel_dig_port)
 }
 
 int
-intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int 
conn_base_id)
+intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port,
+ struct drm_connector *connector)
 {
struct intel_dp *intel_dp = &intel_dig_port->dp;
struct drm_device *dev = intel_dig_port->base.base.dev;
@@ -595,7 +596,8 @@ intel_dp_mst_encoder_init(struct intel_digital_port 
*intel_dig_port, int conn_ba
/* create encoders */
intel_dp_create_fake_mst_encoders(intel_dig_port);
ret = drm_dp_mst_topology_mgr_init(&intel_dp->mst_mgr, dev,
-

[Bug 105760] [4.17-rc1] RIP: smu7_populate_single_firmware_entry.isra.6+0x57/0xc0 [amdgpu] RSP: ffffa17901efb930

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105760

Michel Dänzer  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #58 from Michel Dänzer  ---
Resolving per comment 57. Anyone still having issues with current kernels,
please file your own report.

-- 
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] drm/ttm: Initialize local lists in ttm_bo_bulk_move_helper

2018-08-28 Thread Michel Dänzer
From: Michel Dänzer 

The first parameter of list_cut_position() must point to an initialized
list.

Noticed thanks to KASAN pointing out something's fishy here.

Fixes: "drm/ttm: add bulk move function on LRU"
Signed-off-by: Michel Dänzer 
---
 drivers/gpu/drm/ttm/ttm_bo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 39d9d559b279..35d53d81f486 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -250,7 +250,8 @@ EXPORT_SYMBOL(ttm_bo_move_to_lru_tail);
 static void ttm_bo_bulk_move_helper(struct ttm_lru_bulk_move_pos *pos,
struct list_head *lru, bool is_swap)
 {
-   struct list_head entries, before;
+   LIST_HEAD(entries);
+   LIST_HEAD(before);
struct list_head *list1, *list2;
 
list1 = is_swap ? &pos->last->swap : &pos->last->lru;
-- 
2.18.0

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


[Bug 107652] amdgpu couldn't resume after suspend

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107652

--- Comment #2 from Andrey Grodzovsky  ---
>From looking into the log seems your system was out of memory in the time of
calling suspend. I see a few user mode apps like steam crashing  before that,
coudl be related. 
That in turn caused GPU buffers eviction failure during suspend and hence
failures after resume.

See if you can check your memory status before suspending, try to figure out
when memory exhausting problem starts, what use case. 

Use commands from here to check memory status -
https://www.binarytides.com/linux-command-check-memory-usage/

-- 
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 107045] [4.18rc2] RX470 dGPU on hybrid laptop freezes screen after use

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107045

--- Comment #20 from taij...@posteo.de ---
OK, here is a new twist: upon further investigating this, I came across some
weird backlight behaviour that I originally reported here:
https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/53. However, as it
turns out, this is not a gnome issue but a kernel one.

Namely, doing 

  echo X > /sys/class/backlight/intel_backlight/brightness

will wake my dGPU, even though it really shouldn't be involved at all (and does
not have a /sys/class/backlight device registered). Furthermore, repeatedly
invoking this command before the dGPU has had the chance to go back to sleep
will not do anything. Thirdly, this seems to be a very good way to get the
system to hard lock up.

So, is this an amdgpu issue? A i915 issue? ACPI? where should I take this bug
report?

-- 
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 105760] [4.17-rc1] RIP: smu7_populate_single_firmware_entry.isra.6+0x57/0xc0 [amdgpu] RSP: ffffa17901efb930

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105760

--- Comment #57 from taij...@posteo.de ---
Just to reconfirm: This bug is fixed for me as original reporter in the 4.18.y
release.

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


Re: [PATCH v2] drm: Fix crtc color management when doing suspend/resume

2018-08-28 Thread Ville Syrjälä
On Tue, Aug 28, 2018 at 04:58:42PM +0100, Alexandru-Cosmin Gheorghe wrote:
> On Tue, Aug 28, 2018 at 06:46:07PM +0300, Ville Syrjälä wrote:
> > On Tue, Aug 28, 2018 at 04:33:20PM +0100, Alexandru Gheorghe wrote:
> > > When doing suspend/resume drivers usually use the
> > > drm_atomic_helper_suspend/drm_atomic_helper_resume pair for saving the
> > > state and then re-comitting it.
> > > 
> > > The problem is that drm_crtc_state has a bool field called
> > > color_mgmt_changed, which mali-dp and other drivers uses it to detect
> > > if coefficients need to be reprogrammed, but that never happens
> > > because the saved state has color_mgmt_changed set to 0.
> > > 
> > > Fix that by setting color_mgmt_changed to true in
> > > drm_atomic_helper_check_modeset when at least one of gamma_lut,
> > > degamma_lut, ctm is different between the new and the old crtc state.
> > > 
> > > Also, this makes unnecessary the setting of color_mgmt_changed in
> > > places where gamma_lut/degamma_lut/ctm are set in the new crtc_state.
> > 
> > Do all current drivers actually call drm_atomic_helper_check_modeset()
> > for every commit?
> 
> Yes, all drivers that use color_mgmt_changed either call directly
> drm_atomic_helper_check_modeset or they use drm_atomic_helper_check
> which calls drm_atomic_helper_check_modeset.

Awesome.

Reviewed-by: Ville Syrjälä 

> 
> > 
> > > 
> > > Changes since v2:
> > >   - Instead of setting color_mgmt_changed in commit_duplicated_set
> > > just set it in check_modeset and clean up other place where it was
> > > set, suggested by Maarten Lankhorst.
> > > 
> > > Signed-off-by: Alexandru Gheorghe 
> > > ---
> > >  drivers/gpu/drm/drm_atomic.c| 12 +++-
> > >  drivers/gpu/drm/drm_atomic_helper.c |  8 +++-
> > >  drivers/gpu/drm/drm_fb_helper.c |  1 -
> > >  3 files changed, 10 insertions(+), 11 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> > > index d0478abc01bd..9bcada3c299e 100644
> > > --- a/drivers/gpu/drm/drm_atomic.c
> > > +++ b/drivers/gpu/drm/drm_atomic.c
> > > @@ -554,29 +554,23 @@ int drm_atomic_crtc_set_property(struct drm_crtc 
> > > *crtc,
> > >   drm_property_blob_put(mode);
> > >   return ret;
> > >   } else if (property == config->degamma_lut_property) {
> > > - ret = drm_atomic_replace_property_blob_from_id(dev,
> > > + return drm_atomic_replace_property_blob_from_id(dev,
> > >   &state->degamma_lut,
> > >   val,
> > >   -1, sizeof(struct drm_color_lut),
> > >   &replaced);
> > > - state->color_mgmt_changed |= replaced;
> > > - return ret;
> > >   } else if (property == config->ctm_property) {
> > > - ret = drm_atomic_replace_property_blob_from_id(dev,
> > > + return drm_atomic_replace_property_blob_from_id(dev,
> > >   &state->ctm,
> > >   val,
> > >   sizeof(struct drm_color_ctm), -1,
> > >   &replaced);
> > > - state->color_mgmt_changed |= replaced;
> > > - return ret;
> > >   } else if (property == config->gamma_lut_property) {
> > > - ret = drm_atomic_replace_property_blob_from_id(dev,
> > > + return drm_atomic_replace_property_blob_from_id(dev,
> > >   &state->gamma_lut,
> > >   val,
> > >   -1, sizeof(struct drm_color_lut),
> > >   &replaced);
> > > - state->color_mgmt_changed |= replaced;
> > > - return ret;
> > >   } else if (property == config->prop_out_fence_ptr) {
> > >   s32 __user *fence_ptr = u64_to_user_ptr(val);
> > >  
> > > diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
> > > b/drivers/gpu/drm/drm_atomic_helper.c
> > > index 2c23a48482da..fe22e1ad468a 100644
> > > --- a/drivers/gpu/drm/drm_atomic_helper.c
> > > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > > @@ -611,6 +611,13 @@ drm_atomic_helper_check_modeset(struct drm_device 
> > > *dev,
> > >  
> > >   return -EINVAL;
> > >   }
> > > + if (new_crtc_state->degamma_lut != old_crtc_state->degamma_lut 
> > > ||
> > > + new_crtc_state->ctm != old_crtc_state->ctm ||
> > > + new_crtc_state->gamma_lut != old_crtc_state->gamma_lut) {
> > > + DRM_DEBUG_ATOMIC("[CRTC:%d:%s] color management 
> > > changed\n",
> > > +  crtc->base.id, crtc->name);
> > > + new_crtc_state->color_mgmt_changed = true;
> > > + }
> > >   }
> > >  
> > >   ret = handle_conflicting_encoders(state, false);
> > > @@ -3947,7 +3954,6 @@ int drm_atomic_helper_legacy_gamma_set(struct 
> > > drm_crtc *crtc,
> > >   replaced  = drm_property_replac

[Bug 99857] Radeon R7 M260/M265 *ERROR* amdgpu asic reset failed - Suspending notebook freezes it

2018-08-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=99857

--- Comment #5 from Andrey Grodzovsky  ---
Your kernel is a bit old, please try a later kernel - 4.18 for example to see
if you still experience this sort of problem.

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


Re: [PATCH libdrm 1/4] intel: add IS_GENX() generic macro

2018-08-28 Thread Lucas De Marchi
On Tue, Aug 28, 2018 at 09:38:59AM +0100, Chris Wilson wrote:
> Quoting Lucas De Marchi (2018-08-28 02:00:27)
> > On Sat, Aug 25, 2018 at 10:35:23AM +0100, Chris Wilson wrote:
> > > Quoting Lucas De Marchi (2018-08-25 00:56:46)
> > > > diff --git a/intel/intel_chipset.h b/intel/intel_chipset.h
> > > > index 4a34b7be..8a0e3e76 100644
> > > > --- a/intel/intel_chipset.h
> > > > +++ b/intel/intel_chipset.h
> > > > @@ -568,6 +568,26 @@
> > > >  
> > > >  #define IS_GEN11(devid)(IS_ICELAKE_11(devid))
> > > >  
> > > > +/* New platforms use kernel pci ids */
> > > > +#include "i915_pciids.h"
> > > > +
> > > > +struct pci_device_id {
> > > 
> > > Don't call it pci_device_id, depending on caller that name may already
> > > be taken by libpciaccess.
> > > 
> > > > +   uint32_t unused0, device;
> > > > +   uint32_t unused1, unused2;
> > > > +   uint32_t unused3, unused4;
> > > These are all uint16_t.
> > 
> > more on this:
> > 
> > I can make the first 2 uint16_t, but not the rest due to the way they
> > are declared in INTEL_VGA_DEVICE: (~0 has int type by default), unused3
> > and unused4 are clearly not uint16_t
> 
> I had it in my mind that we did have one extra level of macro in there
> that would allow us to drop unused fields. We could redef

we don't have right now, that needs to be added. And for any extra level
of macro we need to redef INTEL_VGA_DEVICE nonetheless because it
expands to "{ ... }". I don't know any cpp trick to remove the extra
fields if it keeps the braces. 

> INTEL_VGA_DEVICE() and INTEL_QUANTA_VGA_DEVICE() but one extra level of
> macro would be easier for future.

So... I don't see a way out except to redef it. This works today for
libdrm (on top of my unsent version of this patch):


[ NO CI ] diff --git a/intel/intel_chipset.c b/intel/intel_chipset.c
[ NO CI ] index 79581819..8ea24194 100644
[ NO CI ] --- a/intel/intel_chipset.c
[ NO CI ] +++ b/intel/intel_chipset.c
@@ -27,11 +27,12 @@
 
 #include "i915_pciids.h"
 
+#undef INTEL_VGA_DEVICE
+#define INTEL_VGA_DEVICE(id, gen) { id, gen }
+
 static const struct pci_device {
-   uint16_t unused0, device;
-   uint32_t unused1, unused2;
-   uint32_t unused3, unused4;
-   int gen;
+   uint16_t device;
+   uint16_t gen;
 } pciids[] = {
INTEL_ICL_11_IDS(11),
INTEL_CNL_IDS(10),

> 
> And then while you are there, add the missing 'u' to ~0u
> -Chris.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2] drm: Fix crtc color management when doing suspend/resume

2018-08-28 Thread Brian Starkey

On Tue, Aug 28, 2018 at 05:08:51PM +0100, Alexandru-Cosmin Gheorghe wrote:

On Tue, Aug 28, 2018 at 04:48:45PM +0100, Brian Starkey wrote:

Hi Alex,

On Tue, Aug 28, 2018 at 04:33:20PM +0100, Alexandru Gheorghe wrote:
>When doing suspend/resume drivers usually use the
>drm_atomic_helper_suspend/drm_atomic_helper_resume pair for saving the
>state and then re-comitting it.
>
>The problem is that drm_crtc_state has a bool field called
>color_mgmt_changed, which mali-dp and other drivers uses it to detect
>if coefficients need to be reprogrammed, but that never happens
>because the saved state has color_mgmt_changed set to 0.
>
>Fix that by setting color_mgmt_changed to true in
>drm_atomic_helper_check_modeset when at least one of gamma_lut,
>degamma_lut, ctm is different between the new and the old crtc state.
>
>Also, this makes unnecessary the setting of color_mgmt_changed in
>places where gamma_lut/degamma_lut/ctm are set in the new crtc_state.
>
>Changes since v2:
> - Instead of setting color_mgmt_changed in commit_duplicated_set
>   just set it in check_modeset and clean up other place where it was
>   set, suggested by Maarten Lankhorst.
>
>Signed-off-by: Alexandru Gheorghe 
>---
>drivers/gpu/drm/drm_atomic.c| 12 +++-
>drivers/gpu/drm/drm_atomic_helper.c |  8 +++-
>drivers/gpu/drm/drm_fb_helper.c |  1 -
>3 files changed, 10 insertions(+), 11 deletions(-)
>
>diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
>index d0478abc01bd..9bcada3c299e 100644
>--- a/drivers/gpu/drm/drm_atomic.c
>+++ b/drivers/gpu/drm/drm_atomic.c
>@@ -554,29 +554,23 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
>drm_property_blob_put(mode);
>return ret;
>} else if (property == config->degamma_lut_property) {
>-   ret = drm_atomic_replace_property_blob_from_id(dev,
>+   return drm_atomic_replace_property_blob_from_id(dev,
>&state->degamma_lut,
>val,
>-1, sizeof(struct drm_color_lut),
>&replaced);
>-   state->color_mgmt_changed |= replaced;
>-   return ret;
>} else if (property == config->ctm_property) {
>-   ret = drm_atomic_replace_property_blob_from_id(dev,
>+   return drm_atomic_replace_property_blob_from_id(dev,
>&state->ctm,
>val,
>sizeof(struct drm_color_ctm), -1,
>&replaced);
>-   state->color_mgmt_changed |= replaced;
>-   return ret;
>} else if (property == config->gamma_lut_property) {
>-   ret = drm_atomic_replace_property_blob_from_id(dev,
>+   return drm_atomic_replace_property_blob_from_id(dev,
>&state->gamma_lut,
>val,
>-1, sizeof(struct drm_color_lut),
>&replaced);
>-   state->color_mgmt_changed |= replaced;
>-   return ret;

Looks like 'replaced' is now unused, so you can remove it.


It's needed as an argument for
drm_atomic_replace_property_blob_from_id, and the prototype of the
function makes sense to me.


Silly me, I thought drm_atomic_replace_property_blob_from_id would
check it against NULL and skip, but I see it doesn't, and that'll
teach me to not trust my memory :-)

Sorry for the noise,
-Brian





Cheers,
-Brian

>} else if (property == config->prop_out_fence_ptr) {
>s32 __user *fence_ptr = u64_to_user_ptr(val);
>
>diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
b/drivers/gpu/drm/drm_atomic_helper.c
>index 2c23a48482da..fe22e1ad468a 100644
>--- a/drivers/gpu/drm/drm_atomic_helper.c
>+++ b/drivers/gpu/drm/drm_atomic_helper.c
>@@ -611,6 +611,13 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
>
>return -EINVAL;
>}
>+   if (new_crtc_state->degamma_lut != old_crtc_state->degamma_lut ||
>+   new_crtc_state->ctm != old_crtc_state->ctm ||
>+   new_crtc_state->gamma_lut != old_crtc_state->gamma_lut) {
>+   DRM_DEBUG_ATOMIC("[CRTC:%d:%s] color management changed\n",
>+crtc->base.id, crtc->name);
>+   new_crtc_state->color_mgmt_changed = true;
>+   }
>}
>
>ret = handle_conflicting_encoders(state, false);
>@@ -3947,7 +3954,6 @@ int drm_atomic_helper_legacy_gamma_set(struct drm_crtc 
*crtc,
>replaced  = drm_property_replace_blob(&crtc_state->degamma_lut, NULL);
>replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL);
>replaced |= drm_property_replace_blob(&crtc_state->gamma_lut, blob);
>-   crtc_state->color_mgmt_changed |= replaced;
>
>ret = drm_atomic_commit(state);
>
>diff --git a/drivers/gpu/drm/drm_fb_he

Re: [PATCH v2] drm: Fix crtc color management when doing suspend/resume

2018-08-28 Thread Alexandru-Cosmin Gheorghe
On Tue, Aug 28, 2018 at 04:48:45PM +0100, Brian Starkey wrote:
> Hi Alex,
> 
> On Tue, Aug 28, 2018 at 04:33:20PM +0100, Alexandru Gheorghe wrote:
> >When doing suspend/resume drivers usually use the
> >drm_atomic_helper_suspend/drm_atomic_helper_resume pair for saving the
> >state and then re-comitting it.
> >
> >The problem is that drm_crtc_state has a bool field called
> >color_mgmt_changed, which mali-dp and other drivers uses it to detect
> >if coefficients need to be reprogrammed, but that never happens
> >because the saved state has color_mgmt_changed set to 0.
> >
> >Fix that by setting color_mgmt_changed to true in
> >drm_atomic_helper_check_modeset when at least one of gamma_lut,
> >degamma_lut, ctm is different between the new and the old crtc state.
> >
> >Also, this makes unnecessary the setting of color_mgmt_changed in
> >places where gamma_lut/degamma_lut/ctm are set in the new crtc_state.
> >
> >Changes since v2:
> > - Instead of setting color_mgmt_changed in commit_duplicated_set
> >   just set it in check_modeset and clean up other place where it was
> >   set, suggested by Maarten Lankhorst.
> >
> >Signed-off-by: Alexandru Gheorghe 
> >---
> >drivers/gpu/drm/drm_atomic.c| 12 +++-
> >drivers/gpu/drm/drm_atomic_helper.c |  8 +++-
> >drivers/gpu/drm/drm_fb_helper.c |  1 -
> >3 files changed, 10 insertions(+), 11 deletions(-)
> >
> >diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> >index d0478abc01bd..9bcada3c299e 100644
> >--- a/drivers/gpu/drm/drm_atomic.c
> >+++ b/drivers/gpu/drm/drm_atomic.c
> >@@ -554,29 +554,23 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
> > drm_property_blob_put(mode);
> > return ret;
> > } else if (property == config->degamma_lut_property) {
> >-ret = drm_atomic_replace_property_blob_from_id(dev,
> >+return drm_atomic_replace_property_blob_from_id(dev,
> > &state->degamma_lut,
> > val,
> > -1, sizeof(struct drm_color_lut),
> > &replaced);
> >-state->color_mgmt_changed |= replaced;
> >-return ret;
> > } else if (property == config->ctm_property) {
> >-ret = drm_atomic_replace_property_blob_from_id(dev,
> >+return drm_atomic_replace_property_blob_from_id(dev,
> > &state->ctm,
> > val,
> > sizeof(struct drm_color_ctm), -1,
> > &replaced);
> >-state->color_mgmt_changed |= replaced;
> >-return ret;
> > } else if (property == config->gamma_lut_property) {
> >-ret = drm_atomic_replace_property_blob_from_id(dev,
> >+return drm_atomic_replace_property_blob_from_id(dev,
> > &state->gamma_lut,
> > val,
> > -1, sizeof(struct drm_color_lut),
> > &replaced);
> >-state->color_mgmt_changed |= replaced;
> >-return ret;
> 
> Looks like 'replaced' is now unused, so you can remove it.

It's needed as an argument for
drm_atomic_replace_property_blob_from_id, and the prototype of the
function makes sense to me.

> 
> Cheers,
> -Brian
> 
> > } else if (property == config->prop_out_fence_ptr) {
> > s32 __user *fence_ptr = u64_to_user_ptr(val);
> >
> >diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
> >b/drivers/gpu/drm/drm_atomic_helper.c
> >index 2c23a48482da..fe22e1ad468a 100644
> >--- a/drivers/gpu/drm/drm_atomic_helper.c
> >+++ b/drivers/gpu/drm/drm_atomic_helper.c
> >@@ -611,6 +611,13 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
> >
> > return -EINVAL;
> > }
> >+if (new_crtc_state->degamma_lut != old_crtc_state->degamma_lut 
> >||
> >+new_crtc_state->ctm != old_crtc_state->ctm ||
> >+new_crtc_state->gamma_lut != old_crtc_state->gamma_lut) {
> >+DRM_DEBUG_ATOMIC("[CRTC:%d:%s] color management 
> >changed\n",
> >+ crtc->base.id, crtc->name);
> >+new_crtc_state->color_mgmt_changed = true;
> >+}
> > }
> >
> > ret = handle_conflicting_encoders(state, false);
> >@@ -3947,7 +3954,6 @@ int drm_atomic_helper_legacy_gamma_set(struct drm_crtc 
> >*crtc,
> > replaced  = drm_property_replace_blob(&crtc_state->degamma_lut, NULL);
> > replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL);
> > replaced |= drm_property_replace_blob(&crtc_state->gamma_lut, blob);
> >-crtc_state->color_mgmt_changed |= replaced;
> >
> > ret = drm_atomic_commit(state);
> >
> >diff --git a/drivers/gpu/drm/drm_fb_helper.c 
> >b/driver

  1   2   >