Re: Msg "PM: pci_pm_suspend(): ast_pm_suspend+0x0/0x40 [ast] returns -22" after migrating to V5.6.7 kernel from v5.5.10.

2020-04-27 Thread David Airlie
Adding dri-devel.

This might need a bisect to work out where it went wrong,

Dave.

On Tue, Apr 28, 2020 at 7:48 AM Cary Garrett  wrote:
>
> Hello,
>
> System won't go into suspend state after migrating to V5.6.7 kernel. Working 
> in V5.5.10.
>
> Journal showing following:
>
> Apr 27 16:07:54 kernel: PM: pci_pm_suspend(): ast_pm_suspend+0x0/0x40 [ast] 
> returns -22
> Apr 27 16:07:54 kernel: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x160 
> returns -22
> Apr 27 16:07:54 kernel: PM: Device :04:00.0 failed to suspend async: 
> error -22
>
> Journalctl output at time of failure:
>
> -- Logs begin at Tue 2020-04-21 17:10:11 CDT, end at Mon 2020-04-27 16:23:33 
> CDT. --
> Apr 27 16:07:54 systemd[1]: Reached target Sleep.
> Apr 27 16:07:54 systemd[1]: Starting Suspend...
> Apr 27 16:07:54 systemd-sleep[1104]: Suspending system...
> Apr 27 16:07:54 kernel: PM: suspend entry (deep)
> Apr 27 16:07:54 kernel: Filesystems sync: 0.091 seconds
> Apr 27 16:07:54 kernel: Freezing user space processes ... (elapsed 0.001 
> seconds) done.
> Apr 27 16:07:54 kernel: OOM killer disabled.
> Apr 27 16:07:54 kernel: Freezing remaining freezable tasks ... (elapsed 0.001 
> seconds) done.
> Apr 27 16:07:54 kernel: printk: Suspending console(s) (use no_console_suspend 
> to debug)
> Apr 27 16:07:54 kernel: sd 6:0:1:0: [sdc] Synchronizing SCSI cache
> Apr 27 16:07:54 kernel: sd 6:0:0:0: [sdb] Synchronizing SCSI cache
> Apr 27 16:07:54 kernel: serial 00:09: disabled
> Apr 27 16:07:54 kernel: serial 00:06: disabled
> Apr 27 16:07:54 kernel: serial 00:05: disabled
> Apr 27 16:07:54 kernel: PM: pci_pm_suspend(): ast_pm_suspend+0x0/0x40 [ast] 
> returns -22
> Apr 27 16:07:54 kernel: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x160 
> returns -22
> Apr 27 16:07:54 kernel: PM: Device :04:00.0 failed to suspend async: 
> error -22
> Apr 27 16:07:54 kernel: sd 0:0:0:0: [sda] Synchronizing SCSI cache
> Apr 27 16:07:54 kernel: sd 0:0:0:0: [sda] Stopping disk
> Apr 27 16:07:54 kernel: PM: Some devices failed to suspend, or early wake 
> event detected
> Apr 27 16:07:54 kernel: sd 0:0:0:0: [sda] Starting disk
> Apr 27 16:07:54 kernel: serial 00:05: activated
> Apr 27 16:07:54 kernel: serial 00:06: activated
> Apr 27 16:07:54 kernel: serial 00:09: activated
> Apr 27 16:07:54 kernel: OOM killer enabled.
> Apr 27 16:07:54 kernel: Restarting tasks ... done.
> Apr 27 16:07:54 kernel: PM: suspend exit
> Apr 27 16:07:54 kernel: PM: suspend entry (s2idle)
> Apr 27 16:07:55 kernel: Filesystems sync: 0.078 seconds
> Apr 27 16:07:55 kernel: Freezing user space processes ... (elapsed 0.001 
> seconds) done.
> Apr 27 16:07:55 kernel: OOM killer disabled.
> Apr 27 16:07:55 kernel: Freezing remaining freezable tasks ... (elapsed 0.001 
> seconds) done.
> Apr 27 16:07:55 kernel: printk: Suspending console(s) (use no_console_suspend 
> to debug)
> Apr 27 16:07:55 kernel: sd 6:0:0:0: [sdb] Synchronizing SCSI cache
> Apr 27 16:07:55 kernel: sd 6:0:1:0: [sdc] Synchronizing SCSI cache
> Apr 27 16:07:55 kernel: serial 00:09: disabled
> Apr 27 16:07:55 kernel: serial 00:06: disabled
> Apr 27 16:07:55 kernel: serial 00:05: disabled
> Apr 27 16:07:55 kernel: PM: pci_pm_suspend(): ast_pm_suspend+0x0/0x40 [ast] 
> returns -22
> Apr 27 16:07:55 kernel: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x160 
> returns -22
> Apr 27 16:07:55 kernel: PM: Device :04:00.0 failed to suspend async: 
> error -22
> Apr 27 16:07:55 kernel: mpt2sas_cm0: pdev=0x03c9e977, 
> slot=:02:00.0, entering operating
> state [D4]
> Apr 27 16:07:55 kernel: mpt2sas_cm0: sending message unit reset !!
> Apr 27 16:07:55 kernel: mpt2sas_cm0: message unit reset: SUCCESS
> Apr 27 16:07:55 kernel: sd 0:0:0:0: [sda] Synchronizing SCSI cache
> Apr 27 16:07:55 kernel: sd 0:0:0:0: [sda] Stopping disk
> Apr 27 16:07:55 kernel: ata3: SATA link down (SStatus 0 SControl 300)
> Apr 27 16:07:55 kernel: ata2: SATA link down (SStatus 0 SControl 300)
> Apr 27 16:07:55 kernel: ata4: SATA link down (SStatus 0 SControl 300)
> Apr 27 16:07:55 kernel: ata6: SATA link down (SStatus 0 SControl 300)
> Apr 27 16:07:55 kernel: ata5: SATA link down (SStatus 0 SControl 300)
> Apr 27 16:07:55 kernel: PM: Some devices failed to suspend, or early wake 
> event detected
> Apr 27 16:07:55 kernel: sd 0:0:0:0: [sda] Starting disk
> Apr 27 16:07:55 kernel: serial 00:05: activated
> Apr 27 16:07:55 kernel: serial 00:06: activated
> Apr 27 16:07:55 kernel: serial 00:09: activated
> Apr 27 16:07:55 kernel: mpt2sas_cm0: pdev=0x03c9e977, 
> slot=:02:00.0, previous operating
> state [D0]
> Apr 27 16:07:55 kernel: mpt2sas_cm0: 64 BIT PCI BUS DMA ADDRESSING SUPPORTED, 
> total mem (16354848
> kB)
> Apr 27 16:07:55 kernel: mpt2sas_cm0: CurrentHostPageSize is 0: Setting 
> default host page size to 4k
> Apr 27 16:07:55 kernel: mpt2sas_cm0: MSI-X vectors supported: 16
> Apr 27 16:07:55 kernel:  no of cores: 8, max_msix_vectors: -1
> Apr 27 16:07:55 kernel: mpt2sas_cm0:  0 8
> Apr 27 16:07:55 kernel: 

Re: [PATCH 1/2] dt-bindings: msm: disp: Add Display Port HPD GPIO bindings

2020-04-27 Thread tanmay

Thanks Rob for reviews.

We are using Display Port Controller block to detect hot plug.
So we won't be using that pin as GPIO.

I found now that we don't need any bindings for that pin in such case.
So I am abandoning this patch series and upload new patch.

Thanks.

On 2020-04-15 08:24, Rob Herring wrote:

On Tue, Apr 07, 2020 at 03:48:28PM -0700, Tanmay Shah wrote:

Add Display Port HPD GPIO description in bindings

This Patch depends on:
https://patchwork.kernel.org/patch/11468505/


This belongs below the '---' and probably means you should send all 
this

as one series.



Signed-off-by: Tanmay Shah 
---
 Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml | 7

+++

 1 file changed, 7 insertions(+)

diff --git

a/Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml
b/Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

index 761a01d..003f5f7 100644
--- a/Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml
+++ b/Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml
@@ -155,6 +155,11 @@ properties:
  data-lanes:
description: Maximum number of lanes that can be used for

Display port.


+ dp-hpd-gpio:


We already have a standard property for this. Use it.

It belongs in the connector node as HPD is part of the connector.


+   maxItems: 1
+   description: Specifies HPD gpio for DP connector without
+USB PHY or AUX switch.
+
  usbplug-cc-gpio:


Note that this too should be in a connector node.


maxItems: 1
description: Specifies the usbplug orientation gpio.
@@ -282,6 +287,8 @@ examples:
 aux-sel-gpio = < 110 1>;
 usbplug-cc-gpio = < 90 1>;

+dp-hpd-gpio = < 117 0>;
+
 ports {
 #address-cells = <1>;
 #size-cells = <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

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


[PATCH 1/1] drm/dp_mst: Kill the second sideband tx slot, save the world

2020-04-27 Thread Lyude Paul
While we support using both tx slots for sideband transmissions, it
appears that DisplayPort devices in the field didn't end up doing a very
good job of supporting it. From section 5.2.1 of the DP 2.0
specification:

  There are MST Sink/Branch devices in the field that do not handle
  interleaved message transactions.

  To facilitate message transaction handling by downstream devices, an
  MST Source device shall generate message transactions in an atomic
  manner (i.e., the MST Source device shall not concurrently interleave
  multiple message transactions). Therefore, an MST Source device shall
  clear the Message_Sequence_No value in the Sideband_MSG_Header to 0.

This might come as a bit of a surprise since the vast majority of hubs
will support using both tx slots even if they don't support interleaved
message transactions, and we've also been using both tx slots since MST
was introduced into the kernel.

However, there is one device we've had trouble getting working
consistently with MST for so long that we actually assumed it was just
broken: the infamous Dell P2415Qb. Previously this monitor would appear
to work sometimes, but in most situations would end up timing out
LINK_ADDRESS messages almost at random until you power cycled the whole
display. After reading section 5.2.1 in the DP 2.0 spec, some closer
investigation into this infamous display revealed it was only ever
timing out on sideband messages in the second TX slot.

Sure enough, avoiding the second TX slot has suddenly made this monitor
function perfectly for the first time in five years. And since they
explicitly mention this in the specification, I doubt this is the only
monitor out there with this issue. This might even explain explain the
seemingly harmless garbage sideband responses we would occasionally see
with MST hubs!

So - rewrite our sideband TX handlers to only support one TX slot. In
order to simplify our sideband handling now that we don't support
transmitting to multiple MSTBs at once, we also move all state tracking
for down replies from mstbs to the topology manager.

Signed-off-by: Lyude Paul 
Fixes: ad7f8a1f9ced ("drm/helper: add Displayport multi-stream helper (v0.6)")
Cc: Sean Paul 
Cc: "Lin, Wayne" 
Cc:  # v3.17+
Reviewed-by: Sean Paul 
Link: 
https://patchwork.freedesktop.org/patch/msgid/20200424181308.770749-1-ly...@redhat.com
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 122 +++---
 include/drm/drm_dp_mst_helper.h   |  18 +---
 2 files changed, 33 insertions(+), 107 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c 
b/drivers/gpu/drm/drm_dp_mst_topology.c
index 9d89ebf3a749..ed6faaf4bbf3 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -1203,16 +1203,8 @@ static int drm_dp_mst_wait_tx_reply(struct 
drm_dp_mst_branch *mstb,
 
/* remove from q */
if (txmsg->state == DRM_DP_SIDEBAND_TX_QUEUED ||
-   txmsg->state == DRM_DP_SIDEBAND_TX_START_SEND) {
+   txmsg->state == DRM_DP_SIDEBAND_TX_START_SEND)
list_del(>next);
-   }
-
-   if (txmsg->state == DRM_DP_SIDEBAND_TX_START_SEND ||
-   txmsg->state == DRM_DP_SIDEBAND_TX_SENT) {
-   mstb->tx_slots[txmsg->seqno] = NULL;
-   }
-   mgr->is_waiting_for_dwn_reply = false;
-
}
 out:
if (unlikely(ret == -EIO) && drm_debug_enabled(DRM_UT_DP)) {
@@ -2691,22 +2683,6 @@ static int set_hdr_from_dst_qlock(struct 
drm_dp_sideband_msg_hdr *hdr,
struct drm_dp_mst_branch *mstb = txmsg->dst;
u8 req_type;
 
-   /* both msg slots are full */
-   if (txmsg->seqno == -1) {
-   if (mstb->tx_slots[0] && mstb->tx_slots[1]) {
-   DRM_DEBUG_KMS("%s: failed to find slot\n", __func__);
-   return -EAGAIN;
-   }
-   if (mstb->tx_slots[0] == NULL && mstb->tx_slots[1] == NULL) {
-   txmsg->seqno = mstb->last_seqno;
-   mstb->last_seqno ^= 1;
-   } else if (mstb->tx_slots[0] == NULL)
-   txmsg->seqno = 0;
-   else
-   txmsg->seqno = 1;
-   mstb->tx_slots[txmsg->seqno] = txmsg;
-   }
-
req_type = txmsg->msg[0] & 0x7f;
if (req_type == DP_CONNECTION_STATUS_NOTIFY ||
req_type == DP_RESOURCE_STATUS_NOTIFY)
@@ -2718,7 +2694,7 @@ static int set_hdr_from_dst_qlock(struct 
drm_dp_sideband_msg_hdr *hdr,
hdr->lcr = mstb->lct - 1;
if (mstb->lct > 1)
memcpy(hdr->rad, mstb->rad, mstb->lct / 2);
-   hdr->seqno = txmsg->seqno;
+
return 0;
 }
 /*
@@ -2733,15 +2709,15 @@ static int process_single_tx_qlock(struct 
drm_dp_mst_topology_mgr *mgr,
int len, space, idx, tosend;
int ret;
 
+   if (txmsg->state == DRM_DP_SIDEBAND_TX_SENT)
+  

Re: [PATCH v3 1/4] dt-bindings: display: Add IPK DSI subsystem bindings

2020-04-27 Thread Rob Herring
On Mon, 27 Apr 2020 16:00:33 +0200, Angelo Ribeiro wrote:
> Add dt-bindings for Synopsys DesignWare MIPI DSI Host and VPG (Video
> Pattern Generator) support in the IPK display subsystem.
> 
> The Synopsys DesignWare IPK display video pipeline is composed by a DSI
> controller (snps,dw-ipk-dsi) and a VPG (snps,dw-ipk-vpg) as DPI
> stimulus. Typically is used the Raspberry Pi
> (raspberrypi,7inch-touchscreen-panel) as DSI panel that requires a
> I2C controller (snps,designware-i2c).
> 
> Reported-by: Rob Herring 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sam Ravnborg 
> Cc: Rob Herring 
> Cc: Mark Rutland 
> Cc: Gustavo Pimentel 
> Cc: Joao Pinto 
> Signed-off-by: Angelo Ribeiro 
> ---
> Changes since v3:
>   - Fixed dt-binding breaking on `make dt_binding_check`.
> 
> Changes since v2:
>   - Fixed dt-bindings issues, see
> https://patchwork.ozlabs.org/patch/1260819/.
> ---
>  .../bindings/display/snps,dw-ipk-dsi.yaml  | 159 
> +
>  .../bindings/display/snps,dw-ipk-vpg.yaml  |  73 ++
>  2 files changed, 232 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/display/snps,dw-ipk-dsi.yaml
>  create mode 100644 
> Documentation/devicetree/bindings/display/snps,dw-ipk-vpg.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/snps,dw-ipk-dsi.example.dt.yaml:
 dw-ipk-dsi@2000: compatible: ['snps,dw-ipk-dsi'] is too short

See https://patchwork.ozlabs.org/patch/1277673

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:

pip3 install git+https://github.com/devicetree-org/dt-schema.git@master 
--upgrade

Please check and re-submit.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 0/1] Backport "drm/dp_mst: Kill the second sideband tx slot, save the world" for drm-fixes

2020-04-27 Thread Lyude Paul
Because this patch will likely end up fixing a lot of MST issues we
either don't know about, or weren't able to figure out a fix for before,
I definitely want to make sure this patch gets cc'd to stable as well.
It doesn't apply cleanly to drm-misc-fixes, so here's a backported
version that does.

Lyude Paul (1):
  drm/dp_mst: Kill the second sideband tx slot, save the world

 drivers/gpu/drm/drm_dp_mst_topology.c | 122 +++---
 include/drm/drm_dp_mst_helper.h   |  18 +---
 2 files changed, 33 insertions(+), 107 deletions(-)

-- 
2.25.3

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


Re: [PATCH 2/3] drm/db9000: Add bindings documentation for LCD controller

2020-04-27 Thread Rob Herring
On Mon, 27 Apr 2020 09:21:48 +0100, Gareth Williams wrote:
> Add the DT bindings information for the Digital Blocks DB9000 LCD
> controller. Also include documentation for the Renesas RZN1 specific
> compatible string.
> 
> Signed-off-by: Gareth Williams 
> ---
>  .../devicetree/bindings/display/db9000,du.yaml | 87 
> ++
>  .../devicetree/bindings/vendor-prefixes.yaml   |  2 +
>  2 files changed, 89 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/display/db9000,du.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

Documentation/devicetree/bindings/display/db9000,du.example.dts:28.35-30.15: 
Warning (unit_address_vs_reg): /example-0/drm@53004000/port/endpoint@0: node 
has a unit name, but no reg or ranges property
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/db9000,du.example.dt.yaml:
 drm@53004000: clock-names:0: 'lcd_eclk' was expected

See https://patchwork.ozlabs.org/patch/1277401

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:

pip3 install git+https://github.com/devicetree-org/dt-schema.git@master 
--upgrade

Please check and re-submit.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 27/91] dt-bindings: display: Convert VC4 bindings to schemas

2020-04-27 Thread Rob Herring
On Fri, 24 Apr 2020 17:34:08 +0200, Maxime Ripard wrote:
> The BCM283x SoCs have a display pipeline composed of several controllers
> with device tree bindings that are supported by Linux.
> 
> Now that we have the DT validation in place, let's split into separate
> files and convert the device tree bindings for those controllers to
> schemas.
> 
> This is just a 1:1 conversion though, and some bindings were incomplete so
> it results in example validation warnings that are going to be addressed in
> the following patches.
> 
> Cc: Rob Herring 
> Cc: devicet...@vger.kernel.org
> Signed-off-by: Maxime Ripard 
> ---
>  Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt  | 
> 174 +
>  Documentation/devicetree/bindings/display/brcm,bcm2835-dpi.yaml |  
> 66 +++-
>  Documentation/devicetree/bindings/display/brcm,bcm2835-dsi0.yaml|  
> 73 ++-
>  Documentation/devicetree/bindings/display/brcm,bcm2835-hdmi.yaml|  
> 75 +++-
>  Documentation/devicetree/bindings/display/brcm,bcm2835-hvs.yaml |  
> 37 +++-
>  Documentation/devicetree/bindings/display/brcm,bcm2835-pixelvalve0.yaml |  
> 40 +-
>  Documentation/devicetree/bindings/display/brcm,bcm2835-txp.yaml |  
> 37 +++-
>  Documentation/devicetree/bindings/display/brcm,bcm2835-v3d.yaml |  
> 42 +-
>  Documentation/devicetree/bindings/display/brcm,bcm2835-vc4.yaml |  
> 34 ++-
>  Documentation/devicetree/bindings/display/brcm,bcm2835-vec.yaml |  
> 44 ++-
>  MAINTAINERS |   
> 2 +-
>  11 files changed, 449 insertions(+), 175 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt
>  create mode 100644 
> Documentation/devicetree/bindings/display/brcm,bcm2835-dpi.yaml
>  create mode 100644 
> Documentation/devicetree/bindings/display/brcm,bcm2835-dsi0.yaml
>  create mode 100644 
> Documentation/devicetree/bindings/display/brcm,bcm2835-hdmi.yaml
>  create mode 100644 
> Documentation/devicetree/bindings/display/brcm,bcm2835-hvs.yaml
>  create mode 100644 
> Documentation/devicetree/bindings/display/brcm,bcm2835-pixelvalve0.yaml
>  create mode 100644 
> Documentation/devicetree/bindings/display/brcm,bcm2835-txp.yaml
>  create mode 100644 
> Documentation/devicetree/bindings/display/brcm,bcm2835-v3d.yaml
>  create mode 100644 
> Documentation/devicetree/bindings/display/brcm,bcm2835-vc4.yaml
>  create mode 100644 
> Documentation/devicetree/bindings/display/brcm,bcm2835-vec.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/brcm,bcm2835-dsi0.yaml:
 properties: '#clock-cells' is a dependency of 'clock-output-names'
Documentation/devicetree/bindings/Makefile:11: recipe for target 
'Documentation/devicetree/bindings/display/brcm,bcm2835-dsi0.example.dts' failed
make[1]: *** 
[Documentation/devicetree/bindings/display/brcm,bcm2835-dsi0.example.dts] Error 
1
make[1]: *** Waiting for unfinished jobs
Makefile:1300: recipe for target 'dt_binding_check' failed
make: *** [dt_binding_check] Error 2

See https://patchwork.ozlabs.org/patch/1276439

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:

pip3 install git+https://github.com/devicetree-org/dt-schema.git@master 
--upgrade

Please check and re-submit.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH V2] get_maintainer: Add email addresses from .yaml files

2020-04-27 Thread Joe Perches
.yaml files can contain maintainer/author addresses and it seems
unlikely or unnecessary that individual MAINTAINER file section
entries for each .yaml file will be created.

So add the email addresses found in .yaml files to the default
get_maintainer output.

The email addresses are marked with "(in file)" when using the
"--roles" or "--rolestats" options.

Miscellanea:

o Change $file_emails to $email_file_emails to avoid visual
  naming conflicts with @file_emails

Signed-off-by: Joe Perches 
Acked-by: Sam Ravnborg 
Tested-by: Sam Ravnborg 
---

V2: Fix dd/add typo
Add Sam's sign-offs
Resend using git format-patch git send-email and UTF-8 not 8-bit

 scripts/get_maintainer.pl | 44 ++-
 1 file changed, 29 insertions(+), 15 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 6cbcd1..6d973f 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -57,7 +57,7 @@ my $status = 0;
 my $letters = "";
 my $keywords = 1;
 my $sections = 0;
-my $file_emails = 0;
+my $email_file_emails = 0;
 my $from_filename = 0;
 my $pattern_depth = 0;
 my $self_test = undef;
@@ -69,6 +69,12 @@ my $vcs_used = 0;
 
 my $exit = 0;
 
+my @files = ();
+my @fixes = ();# If a patch description includes 
Fixes: lines
+my @range = ();
+my @keyword_tvi = ();
+my @file_emails = ();
+
 my %commit_author_hash;
 my %commit_signer_hash;
 
@@ -266,7 +272,7 @@ if (!GetOptions(
'pattern-depth=i' => \$pattern_depth,
'k|keywords!' => \$keywords,
'sections!' => \$sections,
-   'fe|file-emails!' => \$file_emails,
+   'fe|file-emails!' => \$email_file_emails,
'f|file' => \$from_filename,
'find-maintainer-files' => \$find_maintainer_files,
'mpath|maintainer-path=s' => \$maintainer_path,
@@ -424,6 +430,22 @@ sub read_all_maintainer_files {
 }
 }
 
+sub maintainers_in_file {
+my ($file) = @_;
+
+return if ($file =~ m@\bMAINTAINERS$@);
+
+if (-f $file && ($email_file_emails || $file =~ /\.yaml$/)) {
+   open(my $f, '<', $file)
+   or die "$P: Can't open $file: $!\n";
+   my $text = do { local($/) ; <$f> };
+   close($f);
+
+   my @poss_addr = $text =~ m$[A-Za-zÀ-ÿ\"\' 
\,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+\.[A-Za-z0-9]+[\)\>\}]{0,1}$g;
+   push(@file_emails, clean_file_emails(@poss_addr));
+}
+}
+
 #
 # Read mail address map
 #
@@ -504,12 +526,6 @@ sub read_mailmap {
 
 ## use the filenames on the command line or find the filenames in the 
patchfiles
 
-my @files = ();
-my @fixes = ();# If a patch description includes 
Fixes: lines
-my @range = ();
-my @keyword_tvi = ();
-my @file_emails = ();
-
 if (!@ARGV) {
 push(@ARGV, "");
 }
@@ -527,7 +543,7 @@ foreach my $file (@ARGV) {
$file =~ s/^\Q${cur_path}\E//;  #strip any absolute path
$file =~ s/^\Q${lk_path}\E//;   #or the path to the lk tree
push(@files, $file);
-   if ($file ne "MAINTAINERS" && -f $file && ($keywords || $file_emails)) {
+   if ($file ne "MAINTAINERS" && -f $file && $keywords) {
open(my $f, '<', $file)
or die "$P: Can't open $file: $!\n";
my $text = do { local($/) ; <$f> };
@@ -539,10 +555,6 @@ foreach my $file (@ARGV) {
}
}
}
-   if ($file_emails) {
-   my @poss_addr = $text =~ m$[A-Za-zÀ-ÿ\"\' 
\,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+\.[A-Za-z0-9]+[\)\>\}]{0,1}$g;
-   push(@file_emails, clean_file_emails(@poss_addr));
-   }
}
 } else {
my $file_cnt = @files;
@@ -923,6 +935,8 @@ sub get_maintainers {
print("\n");
}
}
+
+   maintainers_in_file($file);
 }
 
 if ($keywords) {
@@ -1835,7 +1849,7 @@ tm toggle maintainers
 tg toggle git entries
 tl toggle open list entries
 ts toggle subscriber list entries
-f  emails in file   [$file_emails]
+f  emails in file   [$email_file_emails]
 k  keywords in file [$keywords]
 r  remove duplicates[$email_remove_duplicates]
 p# pattern match depth  [$pattern_depth]
@@ -1960,7 +1974,7 @@ EOT
bool_invert(\$email_git_all_signature_types);
$rerun = 1;
} elsif ($sel eq "f") {
-   bool_invert(\$file_emails);
+   bool_invert(\$email_file_emails);
$rerun = 1;
} elsif ($sel eq "r") {
bool_invert(\$email_remove_duplicates);
-- 
2.26.0

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


Re: [PATCH] drm: enable render nodes wherever buffer sharing is supported

2020-04-27 Thread Eric Anholt
On Mon, Apr 27, 2020 at 1:05 PM Peter Collingbourne  wrote:
>
> Render nodes are not just useful for devices supporting GPU hardware
> acceleration. Even on devices that only support dumb frame buffers,
> they are useful in situations where composition (using software
> rasterization) and KMS are done in different processes with buffer
> sharing being used to send frame buffers between them. This is the
> situation on Android, where surfaceflinger is the compositor and the
> composer HAL uses KMS to display the buffers. Thus it is beneficial
> to expose render nodes on all devices that support buffer sharing.
>
> Because all drivers that currently support render nodes also support
> buffer sharing, the DRIVER_RENDER flag is no longer necessary to mark
> devices as supporting render nodes, so remove it and just rely on
> the presence of a prime_handle_to_fd function pointer to determine
> whether buffer sharing is supported.

I'm definitely interested in seeing a patch like this land, as I think
the current state is an ugly historical artifact.  We just have to be
careful.

Were there any instances of drivers with render engines exposing PRIME
but not RENDER?  We should be careful to make sure that we're not
exposing new privileges for those through adding render nodes.

There's a UAPI risk I see here.  Right now, on a system with a single
renderer GPU, we can just open /dev/dri/renderD128 and get the GPU for
rendering, and various things are relying on that (such as libwaffle,
used in piglit among other things)   Adding render nodes for kms-only
drivers could displace the actual GPU to 129, and the question is
whether this will be disruptive.  For Mesa, I think this works out,
because kmsro should load on the kms device's node and then share
buffers over to the real GPU that it digs around to find at init time.
Just saying, I'm not sure I know all of the userspace well enough to
say "this should be safe despite that"

(And, maybe, if we decide that it's not safe enough, we could punt
kms-only drivers to a higher starting number?)

> @@ -260,12 +258,6 @@ static int vc4_drm_bind(struct device *dev)
> if (!vc4)
> return -ENOMEM;
>
> -   /* If VC4 V3D is missing, don't advertise render nodes. */
> -   node = of_find_matching_node_and_match(NULL, vc4_v3d_dt_match, NULL);
> -   if (!node || !of_device_is_available(node))
> -   vc4_drm_driver.driver_features &= ~DRIVER_RENDER;
> -   of_node_put(node);
> -
> drm = drm_dev_alloc(_drm_driver, dev);
> if (IS_ERR(drm))
> return PTR_ERR(drm);

Looks like dropping this code from vc4 should be fine -- kmsro looks
for a render node from each driver name it supports in turn, so even
if v3d moves from renderD128 to renderD129, things should still work.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] get_maintainer: Add email addresses from .yaml files

2020-04-27 Thread Sam Ravnborg
Hi Andrew.

> The patch assumes that we have
> 
> - if ($file_emails) {
> - my @poss_addr = $text =~ m$[A-Za-z_-_\"\' 
> \,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+\.[A-Za-z0-9]+[\)\>\}]{0,1}$g;
> - push(@file_emails, clean_file_emails(@poss_addr));
> - }

If you look in the original mail it has:
> - my @poss_addr = $text =~ m$[A-Za-zÀ-ÿ

So somehow "À-ÿ" is silently converted to _-_ when the patch is saved or
processed by further tools.

Strange, maybe an encoding thing of the mail?

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


Re: [PATCH] get_maintainer: Add email addresses from .yaml files

2020-04-27 Thread Joe Perches
On Mon, 2020-04-27 at 13:04 -0700, Andrew Morton wrote:
> On Sun, 26 Apr 2020 23:33:02 -0700 Joe Perches  wrote:
> 
> > On Mon, 2020-04-27 at 07:57 +0200, Sam Ravnborg wrote:
> > > Hi Joe.
> > 
> > Hi Sam.
> > 
> > > On Sun, Apr 26, 2020 at 10:40:52PM -0700, Joe Perches wrote:
> > > > .yaml files can contain maintainer/author addresses and it seems
> > > > unlikely or unnecessary that individual MAINTAINER file section
> > > > entries for each .yaml file will be created.
> > > > 
> > > > So dd the email addresses found in .yaml files to the default
> > >  ^
> > >  add
> > 
> > Andrew, can you add the a to this please?
> > 
> > > Signed-off-by: Joe Perches 
> > > Acked-by: Sam Ravnborg 
> > > Tested-by: Sam Ravnborg 
> > > 
> > > The patch did not apply on top of -rc3, but it was trivial to fix.
> > > Tested and works like a charm.
> > > Thanks for doing this!
> > 
> > As most of my patches, it was done using -next
> > 
> 
> The patch assumes that we have
> 
> - if ($file_emails) {
> - my @poss_addr = $text =~ m$[A-Za-z_-_\"\' 
> \,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+\.[A-Za-z0-9]+[\)\>\}]{0,1}$g;
> - push(@file_emails, clean_file_emails(@poss_addr));
> - }
> 
> but today's next has
> 
>   if ($file_emails) {
>   my @poss_addr = $text =~ m$[A-Za-zÀ-ÿ\"\' 
> \,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+\.[A-Za-z0-9]+[\)\>\}]{0,1}$g;
>   push(@file_emails, clean_file_emails(@poss_addr));
>   }
> 
> so what do do here?

It's not "do do" nor "doo doo", but it is odd.
Must be some weirdness with the evolution email composer again.

I'll resubmit with Sam's sign-offs using a proper git-send-email
(and I'll fix the dd/add typo, thanks Sam)



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


Re: [PATCH] get_maintainer: Add email addresses from .yaml files

2020-04-27 Thread Andrew Morton
On Sun, 26 Apr 2020 23:33:02 -0700 Joe Perches  wrote:

> On Mon, 2020-04-27 at 07:57 +0200, Sam Ravnborg wrote:
> > Hi Joe.
> 
> Hi Sam.
> 
> > On Sun, Apr 26, 2020 at 10:40:52PM -0700, Joe Perches wrote:
> > > .yaml files can contain maintainer/author addresses and it seems
> > > unlikely or unnecessary that individual MAINTAINER file section
> > > entries for each .yaml file will be created.
> > > 
> > > So dd the email addresses found in .yaml files to the default
> >  ^
> >  add
> 
> Andrew, can you add the a to this please?
> 
> > Signed-off-by: Joe Perches 
> > Acked-by: Sam Ravnborg 
> > Tested-by: Sam Ravnborg 
> > 
> > The patch did not apply on top of -rc3, but it was trivial to fix.
> > Tested and works like a charm.
> > Thanks for doing this!
> 
> As most of my patches, it was done using -next
> 

The patch assumes that we have

-   if ($file_emails) {
-   my @poss_addr = $text =~ m$[A-Za-z_-_\"\' 
\,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+\.[A-Za-z0-9]+[\)\>\}]{0,1}$g;
-   push(@file_emails, clean_file_emails(@poss_addr));
-   }

but today's next has

if ($file_emails) {
my @poss_addr = $text =~ m$[A-Za-zÀ-ÿ\"\' 
\,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+\.[A-Za-z0-9]+[\)\>\}]{0,1}$g;
push(@file_emails, clean_file_emails(@poss_addr));
}

so what do do here?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v8 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver

2020-04-27 Thread Sam Ravnborg
Hi Xin Ji

On Mon, Apr 27, 2020 at 02:18:44PM +0800, Xin Ji wrote:
> The ANX7625 is an ultra-low power 4K Mobile HD Transmitter designed
> for portable device. It converts MIPI DSI/DPI to DisplayPort 1.3 4K.
> 
> The ANX7625 can support both USB Type-C PD feature and MIPI DSI/DPI
> to DP feature. This driver only enabled MIPI DSI/DPI to DP feature.

You are sending this patch in an interesting time for bridge drivers.
We are migrating to an approach where the individual brdge drivers
exposes operations and where the connector creation is now optional.

Laurent Pinchart is the architect behind it - and the required
interfaces is well documented.
You may find inspiration in a patchset I sent today:
https://lore.kernel.org/dri-devel/20200427081850.17512-1-...@ravnborg.org/T/#t
This is not reviewed - so keep an eye out for feedback.

It would be great to base this on top of drm-misc-next, as this is where
we will apply it eventually.
As it is now it will not build due to internal API changes.

The driver looks well structured with nice coding. 

I am missing an explanation why the current analogix infrastructure
cannot be used. I have no clue but I just see other
drivers in same dir that benefits from the infrastructure.
So the questions seems relevant to be addressed.

See a few more comments in the following, which you need to decide
what to follow and what to ignore.
I will make it obvious when something is a must to change,
if I find anything such.

Sorry for providing such massive feedback on v8.
Please keep up the spirit and submit a v9 soon!

Sam

> 
> Signed-off-by: Xin Ji 
> ---
>  drivers/gpu/drm/bridge/Makefile   |2 +-
>  drivers/gpu/drm/bridge/analogix/Kconfig   |6 +
>  drivers/gpu/drm/bridge/analogix/Makefile  |1 +
>  drivers/gpu/drm/bridge/analogix/anx7625.c | 2158 
> +
>  drivers/gpu/drm/bridge/analogix/anx7625.h |  410 ++
>  5 files changed, 2576 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.c
>  create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.h
> 
> diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
> index 4934fcf..bcd388a 100644
> --- a/drivers/gpu/drm/bridge/Makefile
> +++ b/drivers/gpu/drm/bridge/Makefile
> @@ -12,8 +12,8 @@ obj-$(CONFIG_DRM_SII9234) += sii9234.o
>  obj-$(CONFIG_DRM_THINE_THC63LVD1024) += thc63lvd1024.o
>  obj-$(CONFIG_DRM_TOSHIBA_TC358764) += tc358764.o
>  obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o
> -obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/
>  obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/
>  obj-$(CONFIG_DRM_TI_SN65DSI86) += ti-sn65dsi86.o
>  obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o
> +obj-y += analogix/
>  obj-y += synopsys/
With this change we will always visit analogix/
which will trigger build of too much i think.
Use:
obj-$(CONFIG_ANALOGIX_ANX7625) += analogix/
like the other drivers do, if for nothing else then for consistency.

> diff --git a/drivers/gpu/drm/bridge/analogix/Kconfig 
> b/drivers/gpu/drm/bridge/analogix/Kconfig
> index e930ff9..b2f127e 100644
> --- a/drivers/gpu/drm/bridge/analogix/Kconfig
> +++ b/drivers/gpu/drm/bridge/analogix/Kconfig
> @@ -2,3 +2,9 @@
>  config DRM_ANALOGIX_DP
>   tristate
>   depends on DRM
> +
> +config ANALOGIX_ANX7625
> + tristate "Analogix MIPI to DP interface support"
> + help
> + ANX7625 is an ultra-low power 4K mobile HD transmitter designed
> + for portable devices. It converts MIPI/DPI to DisplayPort1.3 4K.
> diff --git a/drivers/gpu/drm/bridge/analogix/Makefile 
> b/drivers/gpu/drm/bridge/analogix/Makefile
> index fdbf3fd..8a52867 100644
> --- a/drivers/gpu/drm/bridge/analogix/Makefile
> +++ b/drivers/gpu/drm/bridge/analogix/Makefile
> @@ -1,3 +1,4 @@
>  # SPDX-License-Identifier: GPL-2.0-only
> +obj-$(CONFIG_ANALOGIX_ANX7625) += anx7625.o
>  analogix_dp-objs := analogix_dp_core.o analogix_dp_reg.o
>  obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix_dp.o
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c 
> b/drivers/gpu/drm/bridge/analogix/anx7625.c
> new file mode 100644
> index 000..fff7a49
> --- /dev/null
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -0,0 +1,2158 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright(c) 2016, Analogix Semiconductor. All rights reserved.
2020?

> + *
> + */
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +#include "anx7625.h"
> +
> +/*
> + * there is a sync issue while access I2C register between AP(CPU) and
> + * internal firmware(OCM), to avoid the race condition, AP should access
> + * the reserved slave address before slave address occurs changes.
> + */
Nit - start comments 

[Bug 207383] [Regression] 5.7-rc: amdgpu/polaris11 gpf: amdgpu_atomic_commit_tail

2020-04-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=207383

--- Comment #6 from Alex Deucher (alexdeuc...@gmail.com) ---
Can you bisect?

-- 
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 207383] [Regression] 5.7-rc: amdgpu/polaris11 gpf: amdgpu_atomic_commit_tail

2020-04-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=207383

--- Comment #5 from Duncan (1i5t5.dun...@cox.net) ---
Well, that didn't take long.  Four konsole terminals open to do (various
aspects of) a system update.  Just a few seconds after I entered the
(git-based) sync command, display-FREEZE!

Back on 5.6.0 now.  I'll probably test again with rc4, perhaps earlier if I see
a set of drm/amdgpu updates in mainline git.

-- 
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: [PATCH] drm/amd/display: remove conversion to bool in dc_link_ddc.c

2020-04-27 Thread Alex Deucher
Applied.  Thanks!

Alex

On Mon, Apr 27, 2020 at 4:03 AM Christian König
 wrote:
>
> Am 27.04.20 um 08:37 schrieb Jason Yan:
> > The '>' expression itself is bool, no need to convert it to bool again.
> > This fixes the following coccicheck warning:
> >
> > drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c:602:28-33: WARNING:
> > conversion to bool not needed here
> >
> > Signed-off-by: Jason Yan 
>
> Reviewed-by: Christian König 
>
> > ---
> >   drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c 
> > b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> > index 256889eed93e..aefd29a440b5 100644
> > --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> > @@ -599,7 +599,7 @@ bool dal_ddc_submit_aux_command(struct ddc_service *ddc,
> >   do {
> >   struct aux_payload current_payload;
> >   bool is_end_of_payload = (retrieved + 
> > DEFAULT_AUX_MAX_DATA_SIZE) >
> > - payload->length ? true : false;
> > + payload->length;
> >
> >   current_payload.address = payload->address;
> >   current_payload.data = >data[retrieved];
>
> ___
> amd-gfx mailing list
> amd-...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/amd/display: remove conversion to bool in dcn20_mpc.c

2020-04-27 Thread Alex Deucher
Applied.  Thanks!

Alex

On Mon, Apr 27, 2020 at 4:03 AM Christian König
 wrote:
>
> Am 27.04.20 um 08:37 schrieb Jason Yan:
> > The '==' expression itself is bool, no need to convert it to bool again.
> > This fixes the following coccicheck warning:
> >
> > drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c:455:70-75: WARNING:
> > conversion to bool not needed here
> >
> > Signed-off-by: Jason Yan 
>
> Reviewed-by: Christian König 
>
> > ---
> >   drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c 
> > b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
> > index de9c857ab3e9..9d7432f3fb16 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
> > +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
> > @@ -452,7 +452,7 @@ void mpc2_set_output_gamma(
> >   next_mode = LUT_RAM_A;
> >
> >   mpc20_power_on_ogam_lut(mpc, mpcc_id, true);
> > - mpc20_configure_ogam_lut(mpc, mpcc_id, next_mode == LUT_RAM_A ? 
> > true:false);
> > + mpc20_configure_ogam_lut(mpc, mpcc_id, next_mode == LUT_RAM_A);
> >
> >   if (next_mode == LUT_RAM_A)
> >   mpc2_program_luta(mpc, mpcc_id, params);
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/amdgpu: remove conversion to bool in amdgpu_device.c

2020-04-27 Thread Alex Deucher
Applied.  thanks!

Alex

On Mon, Apr 27, 2020 at 4:02 AM Christian König
 wrote:
>
> Am 27.04.20 um 08:36 schrieb Jason Yan:
> > The '>' expression itself is bool, no need to convert it to bool again.
> > This fixes the following coccicheck warning:
> >
> > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:3004:68-73: WARNING:
> > conversion to bool not needed here
> >
> > Signed-off-by: Jason Yan 
>
> Reviewed-by: Christian König 
>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > index 3d601d5dd5af..ad94de3632d8 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > @@ -3000,7 +3000,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
> >   INIT_WORK(>xgmi_reset_work, amdgpu_device_xgmi_reset_func);
> >
> >   adev->gfx.gfx_off_req_count = 1;
> > - adev->pm.ac_power = power_supply_is_system_supplied() > 0 ? true : 
> > false;
> > + adev->pm.ac_power = power_supply_is_system_supplied() > 0;
> >
> >   /* Registers mapping */
> >   /* TODO: block userspace mapping of io register */
>
> ___
> amd-gfx mailing list
> amd-...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 207383] [Regression] 5.7-rc: amdgpu/polaris11 gpf: amdgpu_atomic_commit_tail

2020-04-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=207383

Duncan (1i5t5.dun...@cox.net) changed:

   What|Removed |Added

 Kernel Version|5.7-rc1, 5.7-rc2|5.7-rc1, 5.7-rc2, 5.7-rc3

--- Comment #4 from Duncan (1i5t5.dun...@cox.net) ---
Still there with 5.7-rc3, altho /maybe/ it's not triggering as quickly.  Took
13 hours to trigger this time and I'd almost decided it was fixed as it had
been triggering sooner than that, but could simply be luck.  Rebooted to rc3
again.  We'll see...

-- 
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 206987] [drm] [amdgpu] Whole system crashes when the driver is in mode_support_and_system_configuration

2020-04-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206987

Cyrax (ev...@hotmail.com) changed:

   What|Removed |Added

 Kernel Version|5.6.7   |5.7.0-rc3

-- 
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 206987] [drm] [amdgpu] Whole system crashes when the driver is in mode_support_and_system_configuration

2020-04-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206987

--- Comment #11 from Cyrax (ev...@hotmail.com) ---
Created attachment 288781
  --> https://bugzilla.kernel.org/attachment.cgi?id=288781=edit
dmesg output from Linux 5.7-rc3

This is starting to be real problem, I can't do anything remotely productive.
Crash will happen in just 12 hours (give or take) when system is rebooted from
previous one.

I'm running four LXC containers which I have setup to run GUI programs in hosts
system by following this help :
https://wiki.archlinux.org/index.php/Linux_Containers#Xorg_program_considerations_(optional)

Also I have running VirtualBox but its VM's aren't accessing 3D functions from
host at all.

-- 
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: [PATCH] drm/rockchip: Remove unneeded semicolon

2020-04-27 Thread Heiko Stuebner
On Fri, 24 Apr 2020 15:44:10 +0800, Zheng Bin wrote:
> Fixes coccicheck warning:
> 
> drivers/gpu/drm/rockchip/cdn-dp-reg.c:604:2-3: Unneeded semicolon
> drivers/gpu/drm/rockchip/cdn-dp-reg.c:622:2-3: Unneeded semicolon
> drivers/gpu/drm/rockchip/cdn-dp-reg.c:703:2-3: Unneeded semicolon
> 
> Reported-by: Hulk Robot 
> Signed-off-by: Zheng Bin 
> 
> [...]

Applied, thanks!

[1/1] drm/rockchip: Remove unneeded semicolon
  commit: 611e22b1d9f61a8742c99433de9ff40795574c61

Best regards,
-- 
Heiko Stuebner 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/rockchip: cdn-dp-core: Make cdn_dp_core_suspend/resume static

2020-04-27 Thread Heiko Stuebner
On Sun, 26 Apr 2020 18:16:53 +0200, Enric Balletbo i Serra wrote:
> This fixes the following warning detected when running make with W=1
> 
> drivers/gpu/drm/rockchip//cdn-dp-core.c:1112:5: warning: no previous
> prototype for ‘cdn_dp_suspend’ [-Wmissing-prototypes]
> 
> drivers/gpu/drm/rockchip//cdn-dp-core.c:1126:5: warning: no previous
> prototype for ‘cdn_dp_resume’ [-Wmissing-prototypes]
> 
> [...]

Applied, thanks!

[1/1] drm/rockchip: cdn-dp-core: Make cdn_dp_core_suspend/resume static
  commit: 7c49abb4c2f8853520abc05b7f7e8b751fbb3086

Best regards,
-- 
Heiko Stuebner 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v8 0/2] Add initial support for slimport anx7625

2020-04-27 Thread Sam Ravnborg
Hi Xin Ji

On Mon, Apr 27, 2020 at 02:16:49PM +0800, Xin Ji wrote:
> Hi all,
> 
> The following series add support for the Slimport ANX7625 transmitter, a
> ultra-low power Full-HD 4K MIPI to DP transmitter designed for portable 
> device.
> 
> This is the v8 version, any mistakes, please let me know, I will fix it in
> the next series. This series fix several coding format and description.


It would be great if you can add a summary of changes like this:

v8:
  - fix several coding format
  - update description

v7:
  - Bla bla

I see no reason to dig out the old changelog, but start from now on.
The cover letter (this mail) should give a general intro to the changes.
The individual patches the detailed changelog.
For each entry is is also a good practice to tell who gave the feedback
that triggered the changes.

There are many ways to handle this, take a look at a few submissions 
to dri-devel to be inspired.

Sam

> 
> Thanks,
> Xin
> 
> 
> 
> Xin Ji (2):
>   dt-bindings: drm/bridge: anx7625: MIPI to DP transmitter binding
>   drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver
> 
>  .../bindings/display/bridge/anx7625.yaml   |   91 +
>  drivers/gpu/drm/bridge/Makefile|2 +-
>  drivers/gpu/drm/bridge/analogix/Kconfig|6 +
>  drivers/gpu/drm/bridge/analogix/Makefile   |1 +
>  drivers/gpu/drm/bridge/analogix/anx7625.c  | 2158 
> 
>  drivers/gpu/drm/bridge/analogix/anx7625.h  |  410 
>  6 files changed, 2667 insertions(+), 1 deletion(-)
>  create mode 100644 
> Documentation/devicetree/bindings/display/bridge/anx7625.yaml
>  create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.c
>  create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.h
> 
> -- 
> 2.7.4
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v8 1/2] dt-bindings: drm/bridge: anx7625: MIPI to DP transmitter binding

2020-04-27 Thread Sam Ravnborg
Hi Xin Ji

On Mon, Apr 27, 2020 at 02:17:46PM +0800, Xin Ji wrote:
> The ANX7625 is an ultra-low power 4K Mobile HD Transmitter designed
> for portable device. It converts MIPI to DisplayPort 1.3 4K.

Thanks for providing this binding.
When you re-submit please also send to devicet...@vger.kernel.org.

Running the binding through dt_binding_check gives me:

/home/sam/drm/linux.git/Documentation/devicetree/bindings/display/bridge/anx7625.yaml:
 ignoring, error in schema:
warning: no schema found in file: 
/home/sam/drm/linux.git/Documentation/devicetree/bindings/display/bridge/anx7625.yaml
make[2]: *** 
[/home/sam/drm/linux.git/Documentation/devicetree/bindings/Makefile:42: 
Documentation/devicetree/bindings/processed-schema.yaml] Error 255
make[2]: *** Waiting for unfinished jobs
/home/sam/drm/linux.git/Documentation/devicetree/bindings/display/bridge/anx7625.yaml:
 Additional properties are not allowed ('example' was unexpected)
/home/sam/drm/linux.git/Documentation/devicetree/bindings/display/bridge/anx7625.yaml:
 Additional properties are not allowed ('example' was unexpected)

See writing-schemas.rst for instruction installing tools etc.

> 
> You can add support to your board with binding.
> 
> Example:
>   anx7625_bridge: encoder@58 {
>   compatible = "analogix,anx7625";
>   reg = <0x58>;
>   status = "okay";
>   panel-flags = <1>;
>   enable-gpios = < 45 GPIO_ACTIVE_HIGH>;
>   reset-gpios = < 73 GPIO_ACTIVE_HIGH>;
>   #address-cells = <1>;
>   #size-cells = <0>;
> 
>   port@0 {
> reg = <0>;
> anx_1_in: endpoint {
>   remote-endpoint = <_dsi>;
> };
>   };
> 
>   port@2 {
> reg = <2>;
> anx_1_out: endpoint {
>   remote-endpoint = <_in>;
> };
>   };
>   };
> 
> Signed-off-by: Xin Ji 
> ---
>  .../bindings/display/bridge/anx7625.yaml   | 91 
> ++
>  1 file changed, 91 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/display/bridge/anx7625.yaml
> 
> diff --git a/Documentation/devicetree/bindings/display/bridge/anx7625.yaml 
> b/Documentation/devicetree/bindings/display/bridge/anx7625.yaml
> new file mode 100644
> index 000..1149ebb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/bridge/anx7625.yaml

Name the file "analogix,anx7625.yaml".
(We should rename anx6345.yaml, so others do not omit the company name)

> @@ -0,0 +1,91 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +# Copyright 2019 Analogix Semiconductor, Inc.
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/display/bridge/anx7625.yaml#;
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#;
> +
> +title: Analogix ANX7625 SlimPort (4K Mobile HD Transmitter)
> +
> +maintainers:
> +  - Xin Ji 
> +
> +description: |
> +  The ANX7625 is an ultra-low power 4K Mobile HD Transmitter
> +  designed for portable devices.
> +
> +properties:
> +  "#address-cells": true
> +  "#size-cells": true
> +
> +  compatible:
> +items:
> +  - const: analogix,anx7625
> +
> +  reg:
> +maxItems: 1
> +
> +  panel-flags:
> +description: indicate the panel is internal or external.
> +maxItems: 1
This property hint at something needs to be modelled in a different way.
I do not recall other bindings need similar info.

> +
> +  interrupts:
> +maxItems: 1
A description would be nice.

> +
> +  enable-gpios:
> +description: used for power on chip control, POWER_EN pin D2.
> +maxItems: 1
> +
> +  reset-gpios:
> +description: used for reset chip control, RESET_N pin B7.
> +maxItems: 1
> +
> +  port@0:
> +type: object
> +description:
> +  A port node pointing to MIPI DSI host port node.
> +
> +  port@1:
> +type: object
> +description:
> +  A port node pointing to MIPI DPI host port node.
Maybe explain how it differs from port@0 and why it is optional.

> +
> +  port@2:
> +type: object
> +description:
> +  A port node pointing to panel port node.
Unless there is a good reason not to then please use a ports node, like
you see in almost (all?) other bridge bindings.

> +
> +required:
> +  - "#address-cells"
> +  - "#size-cells"
> +  - compatible
> +  - reg
> +  - port@0
> +  - port@2

additionalProperties: false??


> +
> +example:
It must be named "examples:" - this is what dt_binding_check complains
about.

> +  - |
> +anx7625_bridge: encoder@58 {
> +compatible = "analogix,anx7625";
> +reg = <0x58>;
> +status = "okay";
No status in examples.

> +panel-flags = <1>;
> +enable-gpios = < 45 GPIO_ACTIVE_HIGH>;
You need to include a header file to pull in GPIO_ACTIVE_HIGH - see what
other bindings do.
> +reset-gpios = < 73 GPIO_ACTIVE_HIGH>;
> +#address-cells = <1>;
> +

Re: [PATCH v8 05/10] drm: imx: Add i.MX 6 MIPI DSI host platform driver

2020-04-27 Thread Adrian Ratiu

Hi Enric,

Thank you very much for your review, comments below.

I'll leave this a bit more on review before resending with your 
suggested fixes.


On Mon, 27 Apr 2020, Enric Balletbo i Serra 
 wrote:
Hi Adrian 


Thank you for your patch.




On 27/4/20 10:19, Adrian Ratiu wrote: 
This adds support for the Synopsis DesignWare MIPI DSI v1.01 
host controller which is embedded in i.MX 6 SoCs.   Based on 
following patches, but updated/extended to work with existing 
support found in the kernel:  - drm: imx: Support Synopsys 
DesignWare MIPI DSI host controller 
  Signed-off-by: Liu Ying  
 Cc: Fabio Estevam  Cc: Enric Balletbo 
Serra  Reviewed-by: Emil Velikov 
 Tested-by: Adrian Pop 
 Tested-by: Arnaud Ferraris 
 Signed-off-by: Sjoerd Simons 
 Signed-off-by: Martyn Welch 
 Signed-off-by: Adrian Ratiu 
 --- Changes since v7: 
  - Removed encoder helper ops and added drm_bridge (Laurent) - 
  Brought back drm_simple_encoder_init and dropped dependency 
  on external unify encoder creation patch (Laurent) - Minor 
  typo fixes 
 Changes since v6: 
  - Replaced custom noop encoder with the simple drm encoder 
  (Enric) - Added CONFIG_DRM_IMX6_MIPI_DSI depends on CONFIG_OF 
  (Enric) - Dropped imx_mipi_dsi_register() because now it only 
  creates the dummy encoder which can easily be done directly 
  in imx_dsi_bind() 
 Changes since v5: 
  - Reword to remove unrelated device tree patch mention 
  (Fabio) - Move pllref_clk enable/disable to bind/unbind 
  (Ezequiel) - Fix freescale.com -> nxp.com email addresses 
  (Fabio) - Also added myself as module author (Fabio) - Use 
  DRM_DEV_* macros for consistency, print more error msg 
 Changes since v4: 
  - Split off driver-specific configuration of phy timings due 
  to new upstream API.  - Move regmap infrastructure logic to 
  separate commit (Ezequiel) - Move dsi v1.01 layout addition 
  to a separate commit (Ezequiel) - Minor warnings and driver 
  name fixes 
 Changes since v3: 
  - Renamed platform driver to reflect it's i.MX6 only. (Fabio) 
 Changes since v2: 
  - Fixed commit tags. (Emil) 
 Changes since v1: 
  - Moved register definitions & regmap initialization into 
  bridge module. Platform drivers get the regmap via plat_data 
  after calling the bridge probe. (Emil) 
--- 
 drivers/gpu/drm/imx/Kconfig|   8 + 
 drivers/gpu/drm/imx/Makefile   |   1 + 
 drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c | 399 
 + 3 files changed, 408 insertions(+) 
 create mode 100644 drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c 
 diff --git a/drivers/gpu/drm/imx/Kconfig 
b/drivers/gpu/drm/imx/Kconfig index 
207bf7409dfba..0dffc72df7922 100644 --- 
a/drivers/gpu/drm/imx/Kconfig +++ b/drivers/gpu/drm/imx/Kconfig 
@@ -39,3 +39,11 @@ config DRM_IMX_HDMI 
 	depends on DRM_IMX help Choose this if you want to use 
 HDMI on i.MX6. 
+ +config DRM_IMX6_MIPI_DSI +	tristate "Freescale i.MX6 
DRM MIPI DSI" +	select DRM_DW_MIPI_DSI +	depends on 
DRM_IMX +	depends on OF +	help +	  Choose this if you want 
to use MIPI DSI on i.MX6.  diff --git 
a/drivers/gpu/drm/imx/Makefile b/drivers/gpu/drm/imx/Makefile 
index 21cdcc2faabc8..9a7843c593478 100644 --- 
a/drivers/gpu/drm/imx/Makefile +++ 
b/drivers/gpu/drm/imx/Makefile @@ -9,3 +9,4 @@ 
obj-$(CONFIG_DRM_IMX_TVE) += imx-tve.o 
 obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o 
 obj-$(CONFIG_DRM_IMX_HDMI) += dw_hdmi-imx.o 
+obj-$(CONFIG_DRM_IMX6_MIPI_DSI) += dw_mipi_dsi-imx6.o diff 
--git a/drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c 
b/drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c new file mode 100644 
index 0..492decc418bc3 --- /dev/null +++ 
b/drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c @@ -0,0 +1,399 @@ +// 
SPDX-License-Identifier: GPL-2.0+ +/* + * i.MX6 drm driver - 
MIPI DSI Host Controller + * + * Copyright (C) 2011-2015 
Freescale Semiconductor, Inc.  + * Copyright (C) 2019-2020 
Collabora, Ltd.  + */ + +#include  +#include 
 +#include  +#include 
 +#include 
 +#include  +#include 
 +#include  +#include 
 +#include 
 +#include 
 +#include  
+#include  +#include  +#include 
 + +#include "imx-drm.h" + 
+#define DSI_PWR_UP			0x04 +#define RESET 
0 +#define POWERUPBIT(0) + +#define 
DSI_PHY_IF_CTRL			0x5c +#define 
PHY_IF_CTRL_RESET		0x0 + +#define DSI_PHY_TST_CTRL0 
0x64 +#define PHY_TESTCLK			BIT(1) +#define 
PHY_UNTESTCLK			0 +#define PHY_TESTCLR 
BIT(0) +#define PHY_UNTESTCLR			0 + 
+#define DSI_PHY_TST_CTRL1		0x68 +#define PHY_TESTEN 
BIT(16) +#define PHY_UNTESTEN			0 +#define 
PHY_TESTDOUT(n)			(((n) & 0xff) << 8) 
+#define PHY_TESTDIN(n)			(((n) & 0xff) << 
0) + +struct imx_mipi_dsi { +	struct drm_encoder 
encoder; +	struct drm_bridge bridge; +	struct device 
*dev; +	struct regmap *mux_sel; +	struct dw_mipi_dsi 
*mipi_dsi; +	struct clk *pllref_clk; + +	void __iomem 
*base; +	unsigned int lane_mbps; +}; + +struct 
dphy_pll_testdin_map { +	unsigned int max_mbps; +	u8 
testdin; +}; + +/* The table is based on 27MHz DPHY pll 
reference clock. */ +static const struct dphy_pll_testdin_map 
dptdin_map[] = { +	{160, 

Re: [RESEND PATCH v3 1/1] lib/vsprintf: Add support for printing V4L2 and DRM fourccs

2020-04-27 Thread Joe Perches
On Mon, 2020-04-27 at 09:02 -0700, Joe Perches wrote:
> On Mon, 2020-04-27 at 17:53 +0300, Sakari Ailus wrote:
> > Add a printk modifier %p4cc (for pixel format) for printing V4L2 and DRM
> > pixel formats denoted by fourccs. The fourcc encoding is the same for both
> > so the same implementation can be used.
> []
> > - Added WARN_ON_ONCE() sanity checks. Comments on these are welcome; I'd
> >   expect them mostly be covered by the tests.

perhaps this is simpler?
---
 lib/vsprintf.c | 43 +++
 1 file changed, 43 insertions(+)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 7c488a..3e1dbd7 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1721,6 +1721,46 @@ char *netdev_bits(char *buf, char *end, const void *addr,
return special_hex_number(buf, end, num, size);
 }
 
+static noinline_for_stack
+char *fourcc_string(char *buf, char *end, const u32 *fourcc,
+   struct printf_spec spec, const char *fmt)
+{
+   char output[sizeof("(xx)(xx)(xx)(xx) little-endian (0x01234567)")];
+   char *p = output;
+   int i;
+   u32 val;
+
+   if (check_pointer(, end, fourcc, spec))
+   return buf;
+
+   if (fmt[1] != 'c' || fmt[2] != 'c')
+   return error_string(buf, end, "(%p4?)", spec);
+
+   val = *fourcc & ~BIT(31);
+
+   for (i = 0; i < 4; i++) {
+   unsigned char c = val >> (i * 8);
+
+   if (isascii(c) && isprint(c)) {
+   *p++ = c;
+   } else {
+   *p++ = '(';
+   p = hex_byte_pack(p, c);
+   *p++ = ')';
+   }
+   }
+
+   strcpy(p, *fourcc & BIT(31) ? "big endian" : "little endian");
+   p += strlen(p);
+   *p++ = ' ';
+   *p++ = '(';
+   p = special_hex_number(p, p + 10, val, 4);
+   *p++ = ')';
+   *p = 0;
+
+   return string(buf, end, output, spec);
+}
+
 static noinline_for_stack
 char *address_val(char *buf, char *end, const void *addr,
  struct printf_spec spec, const char *fmt)
@@ -2131,6 +2171,7 @@ char *fwnode_string(char *buf, char *end, struct 
fwnode_handle *fwnode,
  *   correctness of the format string and va_list arguments.
  * - 'K' For a kernel pointer that should be hidden from unprivileged users
  * - 'NF' For a netdev_features_t
+ * - '4cc' V4L2 or DRM FourCC code, with endianness and raw numerical value.
  * - 'h[CDN]' For a variable-length buffer, it prints it as a hex string with
  *a certain separator (' ' by default):
  *  C colon
@@ -2223,6 +2264,8 @@ char *pointer(const char *fmt, char *buf, char *end, void 
*ptr,
return restricted_pointer(buf, end, ptr, spec);
case 'N':
return netdev_bits(buf, end, ptr, spec, fmt);
+   case '4':
+   return fourcc_string(buf, end, ptr, spec, fmt);
case 'a':
return address_val(buf, end, ptr, spec, fmt);
case 'd':

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


[Bug 205089] amdgpu : drm:amdgpu_cs_ioctl : Failed to initialize parser -125

2020-04-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205089

--- Comment #10 from Bruno Jacquet (maxi...@free.fr) ---
With a more recent stack it seems I am no longer experiencing this.
Kernel 5.4.35 and mesa 20.0.5 seems stable for me.

Andreas, did you try upgrading your SW components and see if you still have the
issue?

-- 
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: [PATCH] drm: pl111: enable render node

2020-04-27 Thread Eric Anholt
On Mon, Apr 27, 2020 at 7:45 AM Emil Velikov  wrote:
>
> On Fri, 24 Apr 2020 at 19:54, Peter Collingbourne  wrote:
> >
> > On Fri, Apr 24, 2020 at 4:11 AM Emil Velikov  
> > wrote:
> > >
> > > On Thu, 23 Apr 2020 at 23:51, Peter Collingbourne  wrote:
> > > >
> > > > The render node is required by Android which does not support the legacy
> > > > drmAuth authentication process.
> > > >
> > > > Signed-off-by: Peter Collingbourne 
> > > > ---
> > > >  drivers/gpu/drm/pl111/pl111_drv.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > The summary talks about drmAuth, yet exposes a render node. Even
> > > through there's no rendering engine in the HW, as mentioned by Eric.
> > >
> > > AFAICT the only way drmAuth is relevant with pl111 is when you want to
> > > export/import dma bufs.
> > > Although that is handled in core and the artificial DRM_AUTH
> > > restriction has been lifted with commit [1].
> > >
> > > -Emil
> > >
> > > [1] 
> > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.7-rc2=30a958526d2cc6df38347336a602479d048d92e7
> >
> > Okay, most likely drmAuth is irrelevant here (I don't know much about
> > it to be honest; I know that Android uses render nodes, so I figured
> > that drmAuth must therefore be the thing that it doesn't use). Sorry
> > for the confusion. Here is a better explanation of why I needed this
> > change.
> >
> > Android has a composer process that opens the primary node and uses
> > DRM_IOCTL_MODE_ATOMIC to switch between frame buffers, and a renderer
> > process (surfaceflinger) that opens the render node, prepares frame
> > buffers and sends them to the composer. One idea for adapting this
> > architecture to devices without render nodes is to have the renderer
> > process open the primary node instead. But this runs into a problem:
> > suppose that the renderer process starts before the composer process.
> > In this case, the kernel makes the renderer the DRM master, so the
> > composer can't change the frame buffer. Render nodes don't have this
> > problem because opening them doesn't affect the master.
> >
> > I considered fixing this by having the composer issue
> > DRM_IOCTL_SET_MASTER, but this requires root privileges. If we require
> > drivers to provide render nodes and control access to the primary node
> > while opening up the render node, we can ensure that only authorized
> > processes can become the master without requiring them to be root.
> >
> I think that the crux, is trying to open a _primary_ node for
> _rendering_ purposes.
> While that may work - as you outline above - it's usually a bad idea.
>
> To step back a bit, in practise we have three SoC combinations:
>  - complete lack of render device - then you default to software rendering [1]
>  - display and render device are one and the same - no change needed,
> things should just work
>  - display and render devices are separate - surfaceflinger should
> open the correct _rendering_ device node.
>
> [1] Mesa's libEGL (don't recall exact name on Android) can open VGEM
> render node, to work with the kms-swrast_dri.so software rasteriser
> module.
>
> While I did not try [1] with Android, it was working fine with CrOS. I
> suggest giving it a try and reporting bugs.

VGEM is not a solution, because it doesn't coordinate caching behavior
with your display node and so you get corruption if you try to to
share dma-bufs between them.  In cros it's used only for some tests as
far as I've heard, and it's been a source of pain.

If we want to go the route of "kms-only nodes also provide a render
node interface for doing swrast on", I think that would be a good
idea, but we should do this at a core DRM level (probably "does this
driver expose dma-buf? then also expose render nodes") rather than per
kms driver.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [RESEND PATCH v3 1/1] lib/vsprintf: Add support for printing V4L2 and DRM fourccs

2020-04-27 Thread Joe Perches
On Mon, 2020-04-27 at 17:53 +0300, Sakari Ailus wrote:
> Add a printk modifier %p4cc (for pixel format) for printing V4L2 and DRM
> pixel formats denoted by fourccs. The fourcc encoding is the same for both
> so the same implementation can be used.
[]
> - Added WARN_ON_ONCE() sanity checks. Comments on these are welcome; I'd
>   expect them mostly be covered by the tests.

All the WARN_ON_ONCE uses are not necessary.

> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
[]
> @@ -1721,6 +1721,89 @@ char *netdev_bits(char *buf, char *end, const void 
> *addr,
>   return special_hex_number(buf, end, num, size);
>  }
>  
> +static noinline_for_stack
> +char *fourcc_string(char *buf, char *end, const u32 *__fourcc,
> + struct printf_spec spec, const char *fmt)

There's no reason to use __ prefixed argument names here.

> +{
> +#define FOURCC_HEX_CHAR_STR  "(xx)"
> +#define FOURCC_BIG_ENDIAN_STR" big-endian"
> +#define FOURCC_LITTLE_ENDIAN_STR " little-endian"

I don't believe used-once macro defines are useful.

> +#define FOURCC_HEX_NUMBER" (0x01234567)"

> +#define FOURCC_STRING_MAX\
> + FOURCC_HEX_CHAR_STR FOURCC_HEX_CHAR_STR FOURCC_HEX_CHAR_STR \
> + FOURCC_HEX_CHAR_STR FOURCC_LITTLE_ENDIAN_STR FOURCC_HEX_NUMBER

This is very difficult to read and is size dependent on
the size of little-endian > big_endian

I'd write it out

FOURCC_STRING_MAX   sizeof("(xx)(xx)(xx)(xx) little-endian 
(0x01234567)")

and then not have the define at all but use
the written out string in the declaration.

> + struct printf_spec my_spec = {
> + .type = FORMAT_TYPE_UINT,
> + .field_width = 2,
> + .flags = SMALL,
> + .base = 16,
> + .precision = -1,
> + };

my_spec isn't usefully named, likely not necessary at all,
and if really necessary, it should be static const

> + char __s[sizeof(FOURCC_STRING_MAX)];

I'd declare the buffer

char fourcc[sizeof("(xx)(xx)(xx)(xx) little-endian (0x01234567)"];

like all the other specialty functions do.

> + char *s = __s;

There's no reason to use __ prefixed variable names here either.
All the other specialty function use:

char *p = ;

> + unsigned int i;

just int i; is typical

> + /*
> +  * The 31st bit defines the endianness of the data, so save its printing
> +  * for later.
> +  */
> + u32 fourcc = *__fourcc & ~BIT(31);

bool be = fourcc & BIT(31);

> + int ret;
> +
> + if (check_pointer(, end, __fourcc, spec))
> + return buf;
> +
> + if (fmt[1] != 'c' || fmt[2] != 'c')
> + return error_string(buf, end, "(%p4?)", spec);
> +
> + for (i = 0; i < sizeof(fourcc); i++, fourcc >>= 8) {
> + unsigned char c = fourcc >> (i*8);

Please remove the fourcc >>= 8 from the loop and use

unsigned char c = fourcc >> (i*8);

If I understand this correctly, I think this is simpler:

if (isascii(c) && isprint(c)) {
*s++ = c;
} else {
*s++ = '(';
s = hex_byte_pack(s, c);
*s++ = ')';
}

> +
> + /* Weed out spaces */
> + if (c == ' ')
> + continue;
> +
> + /* Print non-control characters as-is */
> + if (c > ' ') {
> + *s = c;
> + s++;
> + continue;
> + }
> +
> + if (WARN_ON_ONCE(sizeof(__s) <
> +  (s - __s) + sizeof(FOURCC_HEX_CHAR_STR)))
> + break;
> +
> + *s = '(';
> + s++;
> + s = number(s, s + 2, c, my_spec);
> + *s = ')';
> + s++;
> + }
> +
> + ret = strscpy(s, *__fourcc & BIT(31) ? FOURCC_BIG_ENDIAN_STR
> +  : FOURCC_LITTLE_ENDIAN_STR,
> +   sizeof(__s) - (s - __s));

If you size the initial buffer correctly, strscpy is unnecessary.

strcpy(s,  ? "big endian" : "little endian");
s += strlen(s);

> + if (!WARN_ON_ONCE(ret < 0))
> + s += ret;
> +
> + if (!WARN_ON_ONCE(sizeof(__s) <
> +   (s - __s) + sizeof(FOURCC_HEX_NUMBER))) {
> + *s = ' ';
> + s++;
> + *s = '(';
> + s++;

*s++ = ' ';
*s++ = '(';

+   /* subtract parentheses and the space from the size */
> + special_hex_number(s, s + sizeof(FOURCC_HEX_NUMBER) - 3,
> +*__fourcc, sizeof(u32));
> + s += sizeof(u32) * 2 + 2 /* 0x */;
> + *s = ')';
> + s++;
*s++ = ')';

> + *s = '\0';
> + }
> +
> + return string(buf, end, __s, 

Re: [PATCH v7 08/12] arm: dts: s5pv210: Add node for SGX 540

2020-04-27 Thread Krzysztof Kozlowski
On Sun, Apr 26, 2020 at 07:57:12AM -0700, Jonathan Bakker wrote:
> Hi Paul,
> 
> On 2020-04-26 5:56 a.m., Paul Cercueil wrote:
> > 
> > 
> > Le ven. 24 avril 2020 à 22:34, H. Nikolaus Schaller  a 
> > écrit :
> >> From: Jonathan Bakker 
> >>
> >> All s5pv210 devices have a PowerVR SGX 540 (revision 120) attached.
> >>
> >> There is no external regulator for it so it can be enabled by default.
> >>
> >> Signed-off-by: Jonathan Bakker 
> >> Signed-off-by: H. Nikolaus Schaller 
> >> ---
> >>  arch/arm/boot/dts/s5pv210.dtsi | 13 +
> >>  1 file changed, 13 insertions(+)
> >>
> >> diff --git a/arch/arm/boot/dts/s5pv210.dtsi 
> >> b/arch/arm/boot/dts/s5pv210.dtsi
> >> index 2ad642f51fd9..abbdda205c1b 100644
> >> --- a/arch/arm/boot/dts/s5pv210.dtsi
> >> +++ b/arch/arm/boot/dts/s5pv210.dtsi
> >> @@ -512,6 +512,19 @@ vic3: interrupt-controller@f230 {
> >>  #interrupt-cells = <1>;
> >>  };
> >>
> >> +    gpu: gpu@f300 {
> >> +    compatible = "samsung,s5pv210-sgx540-120";

This should not pass the bindings check because you missed last
compatibles.

> >> +    reg = <0xf300 0x1>;
> >> +    interrupt-parent = <>;
> >> +    interrupts = <10>;
> >> +    clock-names = "core";
> >> +    clocks = < CLK_G3D>;
> >> +
> >> +    assigned-clocks = < MOUT_G3D>, < DOUT_G3D>;
> >> +    assigned-clock-rates = <0>, <6670>;
> >> +    assigned-clock-parents = < MOUT_MPLL>;
> > 
> > What are these clocks for, and why are they reparented / reclocked?
> > 
> > Shouldn't they be passed to 'clocks' as well?
> > 
> > -Paul
> > 
> 
> The G3D clock system can have multiple parents, and for stable operation
> it's recommended to use the MPLL clock as the parent (which in turn
> is actually a mux as well).  MOUT_G3D is simply the mux for CLK_G3D
> (SGX core clock), DOUT_G3D is the divider.  DOUT_G3D could equally be CLK_G3D
> (and probably should be, for readability) as CLK_G3D is simply the gate and
> DOUT_G3D is the divider for it.

Good point, it should be CLK_G3D instead of DOUT.  Can you fix this as
well?

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


Re: [PATCH] misc: sram: Add dma-heap-export reserved SRAM area type

2020-04-27 Thread Rob Herring
On Fri, Apr 24, 2020 at 5:27 PM Andrew F. Davis  wrote:
>
> This new export type exposes to userspace the SRAM area as a DMA-Heap,
> this allows for allocations as DMA-BUFs that can be consumed by various
> DMA-BUF supporting devices.
>
> Signed-off-by: Andrew F. Davis 
> ---
>  .../devicetree/bindings/sram/sram.yaml|   8 +

Separate patch and needs to go to DT list...

>  drivers/misc/Kconfig  |   7 +
>  drivers/misc/Makefile |   1 +
>  drivers/misc/sram-dma-heap.c  | 243 ++
>  drivers/misc/sram.c   |  20 +-
>  drivers/misc/sram.h   |  17 ++
>  6 files changed, 292 insertions(+), 4 deletions(-)
>  create mode 100644 drivers/misc/sram-dma-heap.c
>
> diff --git a/Documentation/devicetree/bindings/sram/sram.yaml 
> b/Documentation/devicetree/bindings/sram/sram.yaml
> index 7b83cc6c9bfa..b8e33c8d205d 100644
> --- a/Documentation/devicetree/bindings/sram/sram.yaml
> +++ b/Documentation/devicetree/bindings/sram/sram.yaml
> @@ -105,6 +105,14 @@ patternProperties:
>manipulation of the page attributes.
>  type: boolean
>
> +  dma-heap-export:
> +description:
> +  Similar to 'pool' and 'export' this region will be exported for use
> +  by drivers, devices, and userspace using the DMA-Heaps framework.
> +  NOTE: This region must be page aligned on start and end in order to
> +  properly allow manipulation of the page attributes.
> +type: boolean

Though I'm not sure this should be in DT. You have to change your
firmware to enable a new kernel feature? We also already have 'export'
which sounds like the same function. Or 'pool' though reading the
description, I don't really understand it's use.

What combination of all 3 of these options would be valid?

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


Re: [PATCH v2 6/7] debugfs: switch to simplefs inode creation API

2020-04-27 Thread Paolo Bonzini
On 21/04/20 15:57, Emanuele Giuseppe Esposito wrote:
> - inode = debugfs_get_inode(dentry->d_sb);

You're not removing debugfs_get_inode so I think you're going to get a
warning (same in tracefs)?

You can wait a few more days for reviews and/or Acked-bys (especially
for patches 6 and 7) and then post v3.

Since the touch-everything patch (#2) has already been reviewed, and
it's mechanical and not introducing any semantic change, you can
probably reduce the To/Cc list to filesystem, debugfs and tracefs
maintainers.

Thanks,

Paolo

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


Re: [PATCH 1/1] lib/vsprintf: Add support for printing V4L2 and DRM fourccs

2020-04-27 Thread Sakari Ailus
On Mon, Apr 27, 2020 at 05:50:07PM +0300, Sakari Ailus wrote:
> Add a printk modifier %p4cc (for pixel format) for printing V4L2 and DRM
> pixel formats denoted by fourccs. The fourcc encoding is the same for both
> so the same implementation can be used.
> 
> Suggested-by: Mauro Carvalho Chehab 
> Signed-off-by: Sakari Ailus 

Please ignore this one.

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


[RESEND PATCH v3 1/1] lib/vsprintf: Add support for printing V4L2 and DRM fourccs

2020-04-27 Thread Sakari Ailus
Add a printk modifier %p4cc (for pixel format) for printing V4L2 and DRM
pixel formats denoted by fourccs. The fourcc encoding is the same for both
so the same implementation can be used.

Suggested-by: Mauro Carvalho Chehab 
Signed-off-by: Sakari Ailus 
---
since v2:

- Add comments to explain why things are being done

- Print characters under 32 (space) as hexadecimals in parenthesis.

- Do not print spaces in the fourcc codes.

- Make use of a loop over the fourcc characters instead of
  put_unaligned_le32(). This is necessary to omit spaces in the output.

- Use DRM style format instead of V4L2. This provides the precise code as
  a numerical value as well as explicit endianness information.

- Added WARN_ON_ONCE() sanity checks. Comments on these are welcome; I'd
  expect them mostly be covered by the tests.

- Added tests for %p4cc in lib/test_printf.c

 Documentation/core-api/printk-formats.rst | 12 
 lib/test_printf.c | 17 +
 lib/vsprintf.c| 86 +++
 3 files changed, 115 insertions(+)

diff --git a/Documentation/core-api/printk-formats.rst 
b/Documentation/core-api/printk-formats.rst
index 8ebe46b1af39..7aa0451e06fb 100644
--- a/Documentation/core-api/printk-formats.rst
+++ b/Documentation/core-api/printk-formats.rst
@@ -545,6 +545,18 @@ For printing netdev_features_t.
 
 Passed by reference.
 
+V4L2 and DRM FourCC code (pixel format)
+---
+
+::
+
+   %p4cc
+
+Print a FourCC code used by V4L2 or DRM, including format endianness and
+its numerical value as hexadecimal.
+
+Passed by reference.
+
 Thanks
 ==
 
diff --git a/lib/test_printf.c b/lib/test_printf.c
index 2d9f520d2f27..a14754086707 100644
--- a/lib/test_printf.c
+++ b/lib/test_printf.c
@@ -624,6 +624,22 @@ static void __init fwnode_pointer(void)
software_node_unregister_nodes(softnodes);
 }
 
+static void __init fourcc_pointer(void)
+{
+   struct {
+   u32 code;
+   char *str;
+   } const try[] = {
+   { 0x20104646, "FF(10) little-endian (0x20104646)", },
+   { 0xa0104646, "FF(10) big-endian (0xa0104646)", },
+   { 0x10111213, "(13)(12)(11)(10) little-endian (0x10111213)", },
+   };
+   unsigned int i;
+
+   for (i = 0; i < ARRAY_SIZE(try); i++)
+   test(try[i].str, "%p4cc", [i].code);
+}
+
 static void __init
 errptr(void)
 {
@@ -668,6 +684,7 @@ test_pointer(void)
flags();
errptr();
fwnode_pointer();
+   fourcc_pointer();
 }
 
 static void __init selftest(void)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 7c488a1ce318..02e7906619c0 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1721,6 +1721,89 @@ char *netdev_bits(char *buf, char *end, const void *addr,
return special_hex_number(buf, end, num, size);
 }
 
+static noinline_for_stack
+char *fourcc_string(char *buf, char *end, const u32 *__fourcc,
+   struct printf_spec spec, const char *fmt)
+{
+#define FOURCC_HEX_CHAR_STR"(xx)"
+#define FOURCC_BIG_ENDIAN_STR  " big-endian"
+#define FOURCC_LITTLE_ENDIAN_STR   " little-endian"
+#define FOURCC_HEX_NUMBER  " (0x01234567)"
+#define FOURCC_STRING_MAX  \
+   FOURCC_HEX_CHAR_STR FOURCC_HEX_CHAR_STR FOURCC_HEX_CHAR_STR \
+   FOURCC_HEX_CHAR_STR FOURCC_LITTLE_ENDIAN_STR FOURCC_HEX_NUMBER
+   struct printf_spec my_spec = {
+   .type = FORMAT_TYPE_UINT,
+   .field_width = 2,
+   .flags = SMALL,
+   .base = 16,
+   .precision = -1,
+   };
+   char __s[sizeof(FOURCC_STRING_MAX)];
+   char *s = __s;
+   unsigned int i;
+   /*
+* The 31st bit defines the endianness of the data, so save its printing
+* for later.
+*/
+   u32 fourcc = *__fourcc & ~BIT(31);
+   int ret;
+
+   if (check_pointer(, end, __fourcc, spec))
+   return buf;
+
+   if (fmt[1] != 'c' || fmt[2] != 'c')
+   return error_string(buf, end, "(%p4?)", spec);
+
+   for (i = 0; i < sizeof(fourcc); i++, fourcc >>= 8) {
+   unsigned char c = fourcc;
+
+   /* Weed out spaces */
+   if (c == ' ')
+   continue;
+
+   /* Print non-control characters as-is */
+   if (c > ' ') {
+   *s = c;
+   s++;
+   continue;
+   }
+
+   if (WARN_ON_ONCE(sizeof(__s) <
+(s - __s) + sizeof(FOURCC_HEX_CHAR_STR)))
+   break;
+
+   *s = '(';
+   s++;
+   s = number(s, s + 2, c, my_spec);
+   *s = ')';
+   s++;
+   }
+
+   ret = strscpy(s, *__fourcc & BIT(31) ? FOURCC_BIG_ENDIAN_STR
+  

[Bug 207463] [amdgpu] System freeze / corrupted graphics

2020-04-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=207463

Alex Deucher (alexdeuc...@gmail.com) changed:

   What|Removed |Added

 CC||alexdeuc...@gmail.com

--- Comment #2 from Alex Deucher (alexdeuc...@gmail.com) ---
This is most likely an application or mesa bug.  The GPU has hung and the
kernel driver has recovered it.  You'll need to restart your GUI after a GPU
reset.

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


[PATCH 1/1] lib/vsprintf: Add support for printing V4L2 and DRM fourccs

2020-04-27 Thread Sakari Ailus
Add a printk modifier %p4cc (for pixel format) for printing V4L2 and DRM
pixel formats denoted by fourccs. The fourcc encoding is the same for both
so the same implementation can be used.

Suggested-by: Mauro Carvalho Chehab 
Signed-off-by: Sakari Ailus 
---
 Documentation/core-api/printk-formats.rst | 12 
 lib/test_printf.c | 17 +
 lib/vsprintf.c| 86 +++
 3 files changed, 115 insertions(+)

diff --git a/Documentation/core-api/printk-formats.rst 
b/Documentation/core-api/printk-formats.rst
index 8ebe46b1af39..7aa0451e06fb 100644
--- a/Documentation/core-api/printk-formats.rst
+++ b/Documentation/core-api/printk-formats.rst
@@ -545,6 +545,18 @@ For printing netdev_features_t.
 
 Passed by reference.
 
+V4L2 and DRM FourCC code (pixel format)
+---
+
+::
+
+   %p4cc
+
+Print a FourCC code used by V4L2 or DRM, including format endianness and
+its numerical value as hexadecimal.
+
+Passed by reference.
+
 Thanks
 ==
 
diff --git a/lib/test_printf.c b/lib/test_printf.c
index 2d9f520d2f27..a14754086707 100644
--- a/lib/test_printf.c
+++ b/lib/test_printf.c
@@ -624,6 +624,22 @@ static void __init fwnode_pointer(void)
software_node_unregister_nodes(softnodes);
 }
 
+static void __init fourcc_pointer(void)
+{
+   struct {
+   u32 code;
+   char *str;
+   } const try[] = {
+   { 0x20104646, "FF(10) little-endian (0x20104646)", },
+   { 0xa0104646, "FF(10) big-endian (0xa0104646)", },
+   { 0x10111213, "(13)(12)(11)(10) little-endian (0x10111213)", },
+   };
+   unsigned int i;
+
+   for (i = 0; i < ARRAY_SIZE(try); i++)
+   test(try[i].str, "%p4cc", [i].code);
+}
+
 static void __init
 errptr(void)
 {
@@ -668,6 +684,7 @@ test_pointer(void)
flags();
errptr();
fwnode_pointer();
+   fourcc_pointer();
 }
 
 static void __init selftest(void)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 7c488a1ce318..02e7906619c0 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1721,6 +1721,89 @@ char *netdev_bits(char *buf, char *end, const void *addr,
return special_hex_number(buf, end, num, size);
 }
 
+static noinline_for_stack
+char *fourcc_string(char *buf, char *end, const u32 *__fourcc,
+   struct printf_spec spec, const char *fmt)
+{
+#define FOURCC_HEX_CHAR_STR"(xx)"
+#define FOURCC_BIG_ENDIAN_STR  " big-endian"
+#define FOURCC_LITTLE_ENDIAN_STR   " little-endian"
+#define FOURCC_HEX_NUMBER  " (0x01234567)"
+#define FOURCC_STRING_MAX  \
+   FOURCC_HEX_CHAR_STR FOURCC_HEX_CHAR_STR FOURCC_HEX_CHAR_STR \
+   FOURCC_HEX_CHAR_STR FOURCC_LITTLE_ENDIAN_STR FOURCC_HEX_NUMBER
+   struct printf_spec my_spec = {
+   .type = FORMAT_TYPE_UINT,
+   .field_width = 2,
+   .flags = SMALL,
+   .base = 16,
+   .precision = -1,
+   };
+   char __s[sizeof(FOURCC_STRING_MAX)];
+   char *s = __s;
+   unsigned int i;
+   /*
+* The 31st bit defines the endianness of the data, so save its printing
+* for later.
+*/
+   u32 fourcc = *__fourcc & ~BIT(31);
+   int ret;
+
+   if (check_pointer(, end, __fourcc, spec))
+   return buf;
+
+   if (fmt[1] != 'c' || fmt[2] != 'c')
+   return error_string(buf, end, "(%p4?)", spec);
+
+   for (i = 0; i < sizeof(fourcc); i++, fourcc >>= 8) {
+   unsigned char c = fourcc;
+
+   /* Weed out spaces */
+   if (c == ' ')
+   continue;
+
+   /* Print non-control characters as-is */
+   if (c > ' ') {
+   *s = c;
+   s++;
+   continue;
+   }
+
+   if (WARN_ON_ONCE(sizeof(__s) <
+(s - __s) + sizeof(FOURCC_HEX_CHAR_STR)))
+   break;
+
+   *s = '(';
+   s++;
+   s = number(s, s + 2, c, my_spec);
+   *s = ')';
+   s++;
+   }
+
+   ret = strscpy(s, *__fourcc & BIT(31) ? FOURCC_BIG_ENDIAN_STR
+: FOURCC_LITTLE_ENDIAN_STR,
+ sizeof(__s) - (s - __s));
+   if (!WARN_ON_ONCE(ret < 0))
+   s += ret;
+
+   if (!WARN_ON_ONCE(sizeof(__s) <
+ (s - __s) + sizeof(FOURCC_HEX_NUMBER))) {
+   *s = ' ';
+   s++;
+   *s = '(';
+   s++;
+   /* subtract parentheses and the space from the size */
+   special_hex_number(s, s + sizeof(FOURCC_HEX_NUMBER) - 3,
+  *__fourcc, sizeof(u32));
+   s += sizeof(u32) * 2 + 2 /* 0x */;
+  

Re: [PATCH v3 4/4] MAINTAINERS: Add IPK MIPI DSI Host driver entry

2020-04-27 Thread Joe Perches
On Mon, 2020-04-27 at 16:00 +0200, Angelo Ribeiro wrote:
> Creates entry for Synopsys DesignWare IPK DRM driver and
> adds myself as maintainer.
[]
> diff --git a/MAINTAINERS b/MAINTAINERS
[]
> @@ -5507,6 +5507,14 @@ T: git git://anongit.freedesktop.org/drm/drm-misc
>  F:   Documentation/devicetree/bindings/display/ste,mcde.txt
>  F:   drivers/gpu/drm/mcde/
>  
> +DRM DRIVER FOR SYNOPSYS DESIGNWARE IPK
> +M:   Angelo Ribeiro 
> +L:   dri-devel@lists.freedesktop.org
> +S:   Maintained
> +F:   drivers/gpu/drm/ipk/
> +F:   Documentation/devicetree/bindings/display/ipk/
> +T:   git git://anongit.freedesktop.org/drm/drm-misc

There is now a preferred order for the entries in a section.

Please use:

DRM DRIVER FOR SYNOPSYS DESIGNWARE IPK
M:  Angelo Ribeiro 
L:  dri-devel@lists.freedesktop.org>
S:  Maintained
T:  git git://anongit.freedesktop.org/drm/drm-misc
F:  Document
ation/devicetree/bindings/display/ipk/>
F:  drivers/gpu/drm/ipk/


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


Re: [PATCH] drm: pl111: enable render node

2020-04-27 Thread Emil Velikov
On Fri, 24 Apr 2020 at 19:54, Peter Collingbourne  wrote:
>
> On Fri, Apr 24, 2020 at 4:11 AM Emil Velikov  wrote:
> >
> > On Thu, 23 Apr 2020 at 23:51, Peter Collingbourne  wrote:
> > >
> > > The render node is required by Android which does not support the legacy
> > > drmAuth authentication process.
> > >
> > > Signed-off-by: Peter Collingbourne 
> > > ---
> > >  drivers/gpu/drm/pl111/pl111_drv.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > The summary talks about drmAuth, yet exposes a render node. Even
> > through there's no rendering engine in the HW, as mentioned by Eric.
> >
> > AFAICT the only way drmAuth is relevant with pl111 is when you want to
> > export/import dma bufs.
> > Although that is handled in core and the artificial DRM_AUTH
> > restriction has been lifted with commit [1].
> >
> > -Emil
> >
> > [1] 
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.7-rc2=30a958526d2cc6df38347336a602479d048d92e7
>
> Okay, most likely drmAuth is irrelevant here (I don't know much about
> it to be honest; I know that Android uses render nodes, so I figured
> that drmAuth must therefore be the thing that it doesn't use). Sorry
> for the confusion. Here is a better explanation of why I needed this
> change.
>
> Android has a composer process that opens the primary node and uses
> DRM_IOCTL_MODE_ATOMIC to switch between frame buffers, and a renderer
> process (surfaceflinger) that opens the render node, prepares frame
> buffers and sends them to the composer. One idea for adapting this
> architecture to devices without render nodes is to have the renderer
> process open the primary node instead. But this runs into a problem:
> suppose that the renderer process starts before the composer process.
> In this case, the kernel makes the renderer the DRM master, so the
> composer can't change the frame buffer. Render nodes don't have this
> problem because opening them doesn't affect the master.
>
> I considered fixing this by having the composer issue
> DRM_IOCTL_SET_MASTER, but this requires root privileges. If we require
> drivers to provide render nodes and control access to the primary node
> while opening up the render node, we can ensure that only authorized
> processes can become the master without requiring them to be root.
>
I think that the crux, is trying to open a _primary_ node for
_rendering_ purposes.
While that may work - as you outline above - it's usually a bad idea.

To step back a bit, in practise we have three SoC combinations:
 - complete lack of render device - then you default to software rendering [1]
 - display and render device are one and the same - no change needed,
things should just work
 - display and render devices are separate - surfaceflinger should
open the correct _rendering_ device node.

[1] Mesa's libEGL (don't recall exact name on Android) can open VGEM
render node, to work with the kms-swrast_dri.so software rasteriser
module.

While I did not try [1] with Android, it was working fine with CrOS. I
suggest giving it a try and reporting bugs.

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


[Bug 107381] radeon VCE init error (-110) -- AMD/Intel Mars Hybrid Graphics

2020-04-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=107381

Alex Deucher (alexdeuc...@gmail.com) changed:

   What|Removed |Added

 CC||alexdeuc...@gmail.com

--- Comment #22 from Alex Deucher (alexdeuc...@gmail.com) ---
(In reply to Mahmoud Elagdar from comment #21)
> 
> A workaround for your card is to use amdgpu instead of radeon
> There're several ways to do this here:
> https://wiki.archlinux.org/index.php/
> AMDGPU#Enable_Southern_Islands_(SI)_and_Sea_Islands_(CIK)_support

amdgpu does not have support for vce at the moment for these asics.

-- 
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: KASAN: use-after-free Read in vkms_dumb_create

2020-04-27 Thread Ezequiel Garcia
On Mon, 27 Apr 2020 at 00:48, syzbot
 wrote:
>
> Hello,
>
> syzbot found the following crash on:
>
> HEAD commit:c578ddb3 Merge tag 'linux-kselftest-5.7-rc3' of git://git...
> git tree:   upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=10fbf0d810
> kernel config:  https://syzkaller.appspot.com/x/.config?x=b7a70e992f2f9b68
> dashboard link: https://syzkaller.appspot.com/bug?extid=e3372a2afe1e7ef04bc7
> compiler:   gcc (GCC) 9.0.0 20181231 (experimental)
> syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=1543833010
>
> Bisection is inconclusive: the first bad commit could be any of:
>
> 85b5bafb drm/cma-helper: Remove drm_fb_cma_fbdev_init_with_funcs()
> dff1c703 drm/tinydrm: Use drm_fbdev_generic_setup()
> 23167fa9 drm/panel: simple: Add support for Rocktech RK070ER9427 LCD panel
> 9060d7f4 drm/fb-helper: Finish the generic fbdev emulation
> 2230ca12 dt-bindings: display: Document the EDT et* displays in one file.
> e896c132 drm/debugfs: Add internal client debugfs file
> 894a677f drm/cma-helper: Use the generic fbdev emulation
> aa7e6455 drm/panel: Add support for the EDT ETM0700G0BDH6
> 244007ec drm/pl111: Set .gem_prime_vmap and .gem_prime_mmap
> aad34de2 drm/panel: Add support for the EDT ETM0700G0EDH6
> 7a6aca49 dt-bindings: Add vendor prefix for DLC Display Co., Ltd.
> d536540f drm/fb-helper: Add generic fbdev emulation .fb_probe function
> 0ca0c827 drm/panel: simple: Add DLC DLC0700YZG-1 panel
> c76f0f7c drm: Begin an API for in-kernel clients
> 5ba57bab drm: vkms: select DRM_KMS_HELPER
> 5fa8e4a2 drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of 
> NULL
> 008095e0 drm/vc4: Add support for the transposer block
> c59eb3cf drm/panel: Let of_drm_find_panel() return -ENODEV when the panel is 
> disabled
> 1ebe99a7 drm/vc4: Call drm_atomic_helper_fake_vblank() in the commit path
> 2e64a174 drm/of: Make drm_of_find_panel_or_bridge() fail when the device is 
> disabled
> 1b9883ea drm/vc4: Support the case where the DSI device is disabled
> 6fb42b66 drm/atomic: Call fake_vblank() from the generic commit_tail() helpers
> b0b7aa40 dt-bindings: display: Add DT bindings for BOE HV070WSA-100 panel
> b25c60af drm/crtc: Add a generic infrastructure to fake VBLANK events
> 184d3cf4 drm/vc4: Use wait_for_flip_done() instead of wait_for_vblanks()
> ae8cf41b drm/panel: simple: Add support for BOE HV070WSA-100 panel to 
> simple-panel
> 814bde99 drm/connector: Make ->atomic_commit() optional
> 955f60db drm: Add support for extracting sync signal drive edge from videomode
> 3b39ad7a drm/panel: simple: Add newhaven, nhd-4.3-480272ef-atxl LCD
> 425132fd drm/connector: Pass a drm_connector_state to ->atomic_commit()
> a5d2ade6 drm/panel: simple: Add support for Innolux G070Y2-L01
> b82c1f8f drm/atomic: Avoid connector to writeback_connector casts
> 03fa9aa3 dt-bindings: Add DataImage, Inc. vendor prefix
> 73915b2b drm/writeback: Fix the "overview" section of the doc
> 97ceb1fb drm/panel: simple: Add support for DataImage SCF0700C48GGU18
> e22e9531 Merge drm-upstream/drm-next into drm-misc-next
> 3d5664f9 drm/panel: ili9881c: Fix missing assignment to error return ret
> a0120245 drm/crc: Only report a single overflow when a CRC fd is opened
> 7ad4e463 drm/panel: p079zca: Refactor panel driver to support multiple panels
> 8adbbb2e drm/stm: ltdc: rework reset sequence
> 48bd379a drm/panel: p079zca: Add variable unprepare_delay properties
> 7868e507 drm/stm: ltdc: filter mode pixel clock vs pad constraint
> 731edd4c dt-bindings: Add Innolux P097PFG panel bindings
> f8878bb2 drm: print plane state normalized zpos value
> ca52bea9 drm/atomic-helper: Use bitwise or for filling a bitmask
> de04a462 drm/panel: p079zca: Support Innolux P097PFG panel
> 2bb7a39c dt-bindings: Add vendor prefix for kingdisplay
> a65020d0 drm/v3d: Fix a grammar nit in the scheduler docs.
> 2dd4f211 drm/v3d: Add missing v3d documentation structure.
> ebc950fd dt-bindings: Add KINGDISPLAY KD097D04 panel bindings
> cd0e0ca6 drm/panel: type promotion bug in s6e8aa0_read_mtp_id()
> e0d01811 drm/v3d: Remove unnecessary dma_fence_ops.
> 624bb0c0 drm/v3d: Delay the scheduler timeout if we're still making progress.
> b6d83fcc drm/panel: p079zca: Use of_device_get_match_data()
> 408633d2 drm/v3d: use new return type vm_fault_t in v3d_gem_fault
> decac6b0 dt-bindings: display: sun4i-drm: Add R40 display engine compatible
> 0b7510d1 drm/tilcdc: Use drm_connector_has_possible_encoder()
> d978a94b drm/sun4i: Add R40 display engine compatible
> af11942e drm/sun4i: tcon-top: Cleanup clock handling
> f8222409 drm/msm: Use drm_connector_has_possible_encoder()
> 38cb8d96 drm: Add drm_connector_has_possible_encoder()
> da82107e drm/sun4i: tcon: Release node when traversing of graph
> 7a667775 dt-bindings: display: sun4i-drm: Add R40 TV TCON description
> 7b71ca24 drm/radeon: Use drm_connector_for_each_possible_encoder()
> 4a068c5c drm/sun4i: DW HDMI: Release nodes if error happens during CRTC search
> 

[Bug 207463] [amdgpu] System freeze / corrupted graphics

2020-04-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=207463

--- Comment #1 from Rokas Kupstys (rokups+kernel-b...@zoho.com) ---
Tested 5.4.35-1-lts kernel as well, corruption does happen, but looks bit
different visually. Also i can access another VT without issues, rendering is
ok there. Restarting X11 does not help to recover system, reboot is still
needed.

I also forgot to specify my GPU: AMD RX 580

Kernel command line: initrd=\amd-ucode.img initrd=\initramfs-linux-lts.img
rd.luks.name=<...>=cryptolvm rd.luks.options=discard,keyfile-timeout=10s
rd.luks.key=<...>=/keys/root.key:UUID=<...> root=/dev/mapper/system-root
resume=/dev/mapper/system-swap fastboot rw amd_iommu=on amd_iommu=pt
nohz_full=8-15,24-31 rcu_nocbs=8-15,24-31 rcu_nocb_poll user_namespace.enable=1

And some info from early boot, should it be useful:

bal. 27 15:46:49 archlinux kernel: [drm] amdgpu kernel modesetting enabled.
bal. 27 15:46:49 archlinux kernel: fb0: switching to amdgpudrmfb from EFI VGA
bal. 27 15:46:49 archlinux kernel: amdgpu :08:00.0: vgaarb: deactivate vga
console
bal. 27 15:46:49 archlinux kernel: [drm] initializing kernel modesetting
(POLARIS10 0x1002:0x67DF 0x1462:0x3417 0xE7).
bal. 27 15:46:49 archlinux kernel: [drm] register mmio base: 0xF7C0
bal. 27 15:46:49 archlinux kernel: [drm] register mmio size: 262144
bal. 27 15:46:49 archlinux kernel: [drm] add ip block number 0 
bal. 27 15:46:49 archlinux kernel: [drm] add ip block number 1 
bal. 27 15:46:49 archlinux kernel: [drm] add ip block number 2 
bal. 27 15:46:49 archlinux kernel: [drm] add ip block number 3 
bal. 27 15:46:49 archlinux kernel: [drm] add ip block number 4 
bal. 27 15:46:49 archlinux kernel: [drm] add ip block number 5 
bal. 27 15:46:49 archlinux kernel: [drm] add ip block number 6 
bal. 27 15:46:49 archlinux kernel: [drm] add ip block number 7 
bal. 27 15:46:49 archlinux kernel: [drm] add ip block number 8 
bal. 27 15:46:49 archlinux kernel: amdgpu :08:00.0: No more image in the
PCI ROM
bal. 27 15:46:49 archlinux kernel: [drm] UVD is enabled in VM mode
bal. 27 15:46:49 archlinux kernel: [drm] UVD ENC is enabled in VM mode
bal. 27 15:46:49 archlinux kernel: [drm] VCE enabled in VM mode
bal. 27 15:46:49 archlinux kernel: [drm] vm size is 512 GB, 2 levels, block
size is 10-bit, fragment size is 9-bit
bal. 27 15:46:49 archlinux kernel: amdgpu :08:00.0: VRAM: 8192M
0x00F4 - 0x00F5 (8192M used)
bal. 27 15:46:49 archlinux kernel: amdgpu :08:00.0: GART: 256M
0x00FF - 0x00FF0FFF
bal. 27 15:46:49 archlinux kernel: [drm] Detected VRAM RAM=8192M, BAR=256M
bal. 27 15:46:49 archlinux kernel: [drm] RAM width 256bits GDDR5
bal. 27 15:46:49 archlinux kernel: [drm] amdgpu: 8192M of VRAM memory ready
bal. 27 15:46:49 archlinux kernel: [drm] amdgpu: 8192M of GTT memory ready.
bal. 27 15:46:49 archlinux kernel: [drm] GART: num cpu pages 65536, num gpu
pages 65536
bal. 27 15:46:49 archlinux kernel: [drm] PCIE GART of 256M enabled (table at
0x00F40030).
bal. 27 15:46:49 archlinux kernel: [drm] Chained IB support enabled!
bal. 27 15:46:49 archlinux kernel: amdgpu: [powerplay] hwmgr_sw_init smu backed
is polaris10_smu
bal. 27 15:46:49 archlinux kernel: [drm] Found UVD firmware Version: 1.130
Family ID: 16
bal. 27 15:46:49 archlinux kernel: [drm] Found VCE firmware Version: 53.26
Binary ID: 3
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB: values for Engine clock
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB: 30
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB: 60
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB: 927000
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB: 1179000
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB: 1251000
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB: 1294000
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB: 1339000
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB: 138
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB: Validation clocks:
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB:engine_max_clock: 138000
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB:memory_max_clock: 20
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB:level   : 8
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB: values for Memory clock
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB: 30
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB: 100
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB: 200
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB: Validation clocks:
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB:engine_max_clock: 138000
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB:memory_max_clock: 20
bal. 27 15:46:49 archlinux kernel: [drm] DM_PPLIB:level   : 8
bal. 27 15:46:49 archlinux kernel: [drm] Display Core initialized with v3.2.69!
bal. 27 15:46:49 archlinux kernel: [drm] Supports vblank timestamp caching Rev
2 

Re: [PATCH] drm/dp_mst: Fix drm_dp_send_dpcd_write() return code

2020-04-27 Thread Sean Paul
On Fri, Apr 24, 2020 at 3:07 PM Lyude Paul  wrote:
>
> drm_dp_mst_wait_tx_reply() returns > 1 if time elapsed in
> wait_event_timeout() before check_txmsg_state(mgr, txmsg) evaluated to
> true. However, we make the mistake of returning this time from
> drm_dp_send_dpcd_write() on success instead of returning the number of
> bytes written - causing spontaneous failures during link probing:
>
> [drm:drm_dp_send_link_address [drm_kms_helper]] *ERROR* GUID check on
> 10:01 failed: 3975
>
> Yikes! So, fix this by returning the number of bytes written on success
> instead.
>
> Signed-off-by: Lyude Paul 
> Fixes: cb897542c6d2 ("drm/dp_mst: Fix W=1 warnings")
> Cc: Benjamin Gaignard 
> Cc: Sean Paul 

Reviewed-by: Sean Paul 

> ---
>  drivers/gpu/drm/drm_dp_mst_topology.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c 
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 03a1496f6120..21dc78cb4ba6 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -3436,8 +3436,12 @@ static int drm_dp_send_dpcd_write(struct 
> drm_dp_mst_topology_mgr *mgr,
> drm_dp_queue_down_tx(mgr, txmsg);
>
> ret = drm_dp_mst_wait_tx_reply(mstb, txmsg);
> -   if (ret > 0 && txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK)
> -   ret = -EIO;
> +   if (ret > 0) {
> +   if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK)
> +   ret = -EIO;
> +   else
> +   ret = size;
> +   }
>
> kfree(txmsg);
>  fail_put:
> --
> 2.25.3
>
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/dp_mst: Kill the second sideband tx slot, save the world

2020-04-27 Thread Sean Paul
On Fri, Apr 24, 2020 at 2:13 PM Lyude Paul  wrote:
>
> While we support using both tx slots for sideband transmissions, it
> appears that DisplayPort devices in the field didn't end up doing a very
> good job of supporting it. From section 5.2.1 of the DP 2.0
> specification:
>
>   There are MST Sink/Branch devices in the field that do not handle
>   interleaved message transactions.
>
>   To facilitate message transaction handling by downstream devices, an
>   MST Source device shall generate message transactions in an atomic
>   manner (i.e., the MST Source device shall not concurrently interleave
>   multiple message transactions). Therefore, an MST Source device shall
>   clear the Message_Sequence_No value in the Sideband_MSG_Header to 0.
>
> This might come as a bit of a surprise since the vast majority of hubs
> will support using both tx slots even if they don't support interleaved
> message transactions, and we've also been using both tx slots since MST
> was introduced into the kernel.
>
> However, there is one device we've had trouble getting working
> consistently with MST for so long that we actually assumed it was just
> broken: the infamous Dell P2415Qb. Previously this monitor would appear
> to work sometimes, but in most situations would end up timing out
> LINK_ADDRESS messages almost at random until you power cycled the whole
> display. After reading section 5.2.1 in the DP 2.0 spec, some closer
> investigation into this infamous display revealed it was only ever
> timing out on sideband messages in the second TX slot.
>
> Sure enough, avoiding the second TX slot has suddenly made this monitor
> function perfectly for the first time in five years. And since they
> explicitly mention this in the specification, I doubt this is the only
> monitor out there with this issue. This might even explain explain the
> seemingly harmless garbage sideband responses we would occasionally see
> with MST hubs!
>
> So - rewrite our sideband TX handlers to only support one TX slot. In
> order to simplify our sideband handling now that we don't support
> transmitting to multiple MSTBs at once, we also move all state tracking
> for down replies from mstbs to the topology manager.
>
> Signed-off-by: Lyude Paul 
> Fixes: ad7f8a1f9ced ("drm/helper: add Displayport multi-stream helper (v0.6)")
> Cc: Sean Paul 

Reviewed-by: Sean Paul 

> Cc: "Lin, Wayne" 
> Cc:  # v3.17+
> ---
>  drivers/gpu/drm/drm_dp_mst_topology.c | 149 --
>  include/drm/drm_dp_mst_helper.h   |  29 ++---
>  2 files changed, 50 insertions(+), 128 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c 
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 03a1496f6120..dec5df82eef4 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -1197,16 +1197,8 @@ static int drm_dp_mst_wait_tx_reply(struct 
> drm_dp_mst_branch *mstb,
>
> /* remove from q */
> if (txmsg->state == DRM_DP_SIDEBAND_TX_QUEUED ||
> -   txmsg->state == DRM_DP_SIDEBAND_TX_START_SEND) {
> +   txmsg->state == DRM_DP_SIDEBAND_TX_START_SEND)
> list_del(>next);
> -   }
> -
> -   if (txmsg->state == DRM_DP_SIDEBAND_TX_START_SEND ||
> -   txmsg->state == DRM_DP_SIDEBAND_TX_SENT) {
> -   mstb->tx_slots[txmsg->seqno] = NULL;
> -   }
> -   mgr->is_waiting_for_dwn_reply = false;
> -
> }
>  out:
> if (unlikely(ret == -EIO) && drm_debug_enabled(DRM_UT_DP)) {
> @@ -2685,22 +2677,6 @@ static int set_hdr_from_dst_qlock(struct 
> drm_dp_sideband_msg_hdr *hdr,
> struct drm_dp_mst_branch *mstb = txmsg->dst;
> u8 req_type;
>
> -   /* both msg slots are full */
> -   if (txmsg->seqno == -1) {
> -   if (mstb->tx_slots[0] && mstb->tx_slots[1]) {
> -   DRM_DEBUG_KMS("%s: failed to find slot\n", __func__);
> -   return -EAGAIN;
> -   }
> -   if (mstb->tx_slots[0] == NULL && mstb->tx_slots[1] == NULL) {
> -   txmsg->seqno = mstb->last_seqno;
> -   mstb->last_seqno ^= 1;
> -   } else if (mstb->tx_slots[0] == NULL)
> -   txmsg->seqno = 0;
> -   else
> -   txmsg->seqno = 1;
> -   mstb->tx_slots[txmsg->seqno] = txmsg;
> -   }
> -
> req_type = txmsg->msg[0] & 0x7f;
> if (req_type == DP_CONNECTION_STATUS_NOTIFY ||
> req_type == DP_RESOURCE_STATUS_NOTIFY)
> @@ -2712,7 +2688,7 @@ static int set_hdr_from_dst_qlock(struct 
> drm_dp_sideband_msg_hdr *hdr,
> hdr->lcr = mstb->lct - 1;
> if (mstb->lct > 1)
> memcpy(hdr->rad, mstb->rad, mstb->lct / 2);
> -   hdr->seqno = txmsg->seqno;
> +
> return 0;
>  }
>  /*
> @@ -2727,15 +2703,15 @@ static int 

Re: [PATCH v13 01/11] drm/i915: Use 64-bit division macro

2020-04-27 Thread Jani Nikula
On Fri, 24 Apr 2020, Guru Das Srinagesh  wrote:
> On Fri, Apr 24, 2020 at 09:17:58AM +0300, Jani Nikula wrote:
>> On Tue, 21 Apr 2020, Guru Das Srinagesh  wrote:
>> > Since the PWM framework is switching struct pwm_state.duty_cycle's
>> > datatype to u64, prepare for this transition by using DIV_ROUND_UP_ULL
>> > to handle a 64-bit dividend.
>> >
>> > To: Jani Nikula 
>> > Cc: Joonas Lahtinen 
>> > Cc: David Airlie 
>> > Cc: Daniel Vetter 
>> > Cc: Chris Wilson 
>> > Cc: "Ville Syrjälä" 
>> > Cc: intel-...@lists.freedesktop.org
>> > Cc: dri-devel@lists.freedesktop.org
>> >
>> 
>> Superfluous blank line.
>
> Will remove.
>
>> 
>> Anyway, please preserve the existing acks and reviews [1] so people
>> don't have to do it again.
>> 
>> BR,
>> Jani.
>> 
>> [1] http://lore.kernel.org/r/87h7yleb0i@intel.com
>
> I dropped your Acked-by as the patch had to changed to resolve a merge
> conflict when I rebased to tip. Could you please re-review this patch?

Reviewed-by: Jani Nikula 
Acked-by: Jani Nikula 


-- 
Jani Nikula, Intel Open Source Graphics Center
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 207463] New: [amdgpu] System freeze / corrupted graphics

2020-04-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=207463

Bug ID: 207463
   Summary: [amdgpu] System freeze / corrupted graphics
   Product: Drivers
   Version: 2.5
Kernel Version: 5.6.7-arch1-1
  Hardware: x86-64
OS: Linux
  Tree: Mainline
Status: NEW
  Severity: high
  Priority: P1
 Component: Video(DRI - non Intel)
  Assignee: drivers_video-...@kernel-bugs.osdl.org
  Reporter: rokups+kernel-b...@zoho.com
Regression: No

Created attachment 288763
  --> https://bugzilla.kernel.org/attachment.cgi?id=288763=edit
Corrupted graphics

Application i am working on somehow causes AMDGPU driver to fail, which results
in soft-ish system lockup. Graphics get corrupted, system does react to some
keypresses (can switch VT, sysrq works).

Problem is reproducible *always*.

Steps to reproduce:
git clone --branch=hdpi-support-fontscale-viewport
https://github.com/rokups/imgui   
cd imgui/examples/example_sdl_opengl3 
make
./example_sdl_opengl3

Interact with program a bit, try to drag windows outside of main viewport.
Issue happens within seconds.


bal. 27 16:30:21 rk-PC systemd-coredump[15701]: Process 15649 (example_sdl_ope)
of user 1000 dumped core.

Stack trace of thread 15649:
#0  0x7fed0b12ace5 raise
(libc.so.6 + 0x3bce5)
#1  0x7fed0b114857 abort
(libc.so.6 + 0x25857)
#2  0x7fed0b16e2b0
__libc_message (libc.so.6 + 0x7f2b0)
#3  0x7fed0b1fe06a
__fortify_fail (libc.so.6 + 0x10f06a)
#4  0x7fed0b1fc904
__chk_fail (libc.so.6 + 0x10d904)
#5  0x7fed085ab0b3 n/a
(radeonsi_dri.so + 0x6340b3)
#6  0x7fed080f28b7 n/a
(radeonsi_dri.so + 0x17b8b7)
#7  0x7fed080b71b8 n/a
(radeonsi_dri.so + 0x1401b8)
#8  0x7fed080a8fcb n/a
(radeonsi_dri.so + 0x131fcb)
#9  0x7fed082e8a63 n/a
(radeonsi_dri.so + 0x371a63)
#10 0x7fed082e8e82 n/a
(radeonsi_dri.so + 0x371e82)
#11 0x5564903169b5 n/a
(/home/rk/src/games/Libs/imgui/cmake-build-debug/bin/example_sdl_opengl3 +
0x2a9b5)
#12 0x556490313e69 n/a
(/home/rk/src/games/Libs/imgui/cmake-build-debug/bin/example_sdl_opengl3 +
0x27e69)
#13 0x7fed0b116023
__libc_start_main (libc.so.6 + 0x27023)
#14 0x5564903136ce n/a
(/home/rk/src/games/Libs/imgui/cmake-build-debug/bin/example_sdl_opengl3 +
0x276ce)

<...>

bal. 27 16:30:33 rk-PC kernel: [drm:amdgpu_dm_atomic_commit_tail [amdgpu]]
*ERROR* Waiting for fences timed out!
bal. 27 16:30:37 rk-PC kernel: [drm:amdgpu_dm_atomic_commit_tail [amdgpu]]
*ERROR* Waiting for fences timed out!
bal. 27 16:30:38 rk-PC kernel: [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring
gfx timeout, signaled seq=542239, emitted seq=542241
bal. 27 16:30:38 rk-PC kernel: [drm:amdgpu_job_timedout [amdgpu]] *ERROR*
Process information: process example_sdl_ope pid 15735 thread example_sd:cs0
pid 15741
bal. 27 16:30:38 rk-PC kernel: amdgpu :08:00.0: GPU reset begin!
bal. 27 16:30:38 rk-PC kernel: amdgpu :08:00.0:
[drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring kiq_2.1.0 test failed
(-110)
bal. 27 16:30:38 rk-PC kernel: [drm:gfx_v8_0_hw_fini [amdgpu]] *ERROR* KCQ
disable failed
bal. 27 16:30:39 rk-PC kernel: cp is busy, skip halt cp
bal. 27 16:30:39 rk-PC kernel: rlc is busy, skip halt rlc
bal. 27 16:30:39 rk-PC kernel: amdgpu :08:00.0: GPU BACO reset
bal. 27 16:30:39 rk-PC kernel: amdgpu :08:00.0: GPU reset succeeded, trying
to resume
bal. 27 16:30:39 rk-PC kernel: [drm] PCIE GART of 256M enabled (table at
0x00F40030).
bal. 27 16:30:39 rk-PC kernel: [drm] VRAM is lost due to GPU reset!
bal. 27 16:30:40 rk-PC kernel: [drm] UVD and UVD ENC initialized successfully.
bal. 27 16:30:40 rk-PC rtkit-daemon[7614]: Supervising 8 threads of 5 processes
of 1 users.
bal. 27 16:30:40 rk-PC rtkit-daemon[7614]: Successfully made thread 15789 of
process 7410 owned by '1000' RT at priority 5.
bal. 27 16:30:40 rk-PC rtkit-daemon[7614]: Supervising 9 threads of 5 processes
of 1 users.
bal. 27 16:30:40 rk-PC kernel: [drm] VCE initialized successfully.
bal. 27 16:30:40 rk-PC kernel: [drm] recover vram bo from shadow start
bal. 27 16:30:40 rk-PC kernel: [drm] recover vram bo from shadow done
bal. 27 16:30:40 rk-PC kernel: [drm] Skip scheduling 

Re: [PATCH net-next] net: lpc-enet: fix error return code in lpc_mii_init()

2020-04-27 Thread Vladimir Zapolskiy
On 4/27/20 3:15 PM, Wei Yongjun wrote:
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: b7370112f519 ("lpc32xx: Added ethernet driver")
> Signed-off-by: Wei Yongjun 

Acked-by: Vladimir Zapolskiy 

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


Re: [PATCH] backlight: lp855x: Ensure regulators are disabled on probe failure

2020-04-27 Thread Jon Hunter
Hi Lee,

On 16/03/2020 09:05, Daniel Thompson wrote:
> On Fri, Mar 13, 2020 at 02:16:16PM +, Jon Hunter wrote:
>> Hi Lee, Daniel,
>>
>> On 24/02/2020 14:37, Daniel Thompson wrote:
>>> On Mon, Feb 24, 2020 at 02:07:48PM +, Jon Hunter wrote:
 If probing the LP885x backlight fails after the regulators have been
 enabled, then the following warning is seen when releasing the
 regulators ...

  WARNING: CPU: 1 PID: 289 at drivers/regulator/core.c:2051 
 _regulator_put.part.28+0x158/0x160
  Modules linked in: tegra_xudc lp855x_bl(+) host1x pwm_tegra ip_tables 
 x_tables ipv6 nf_defrag_ipv6
  CPU: 1 PID: 289 Comm: systemd-udevd Not tainted 5.6.0-rc2-next-20200224 #1
  Hardware name: NVIDIA Jetson TX1 Developer Kit (DT)

  ...

 Fix this by ensuring that the regulators are disabled, if enabled, on
 probe failure.

 Finally, ensure that the vddio regulator is disabled in the driver
 remove handler.

 Signed-off-by: Jon Hunter 
>>>
>>> Reviewed-by: Daniel Thompson 
>> I received a bounce from Milo's email and so I am not sure that his
>> email address is still valid.
>>
>> Can either of you pick this up?
> 
> Lee generally starts to hoover up patches about this stage in the dev
> cycle so I'd expect this to move fairly soon.

Does not look like this ever got picked up. Please let me know if you
can queue this one. Note it still applies cleanly to -next.

Jon

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


Re: KASAN: use-after-free Read in vkms_dumb_create

2020-04-27 Thread Ezequiel Garcia
On Mon, 27 Apr 2020 at 00:48, syzbot
 wrote:
>
> Hello,
>
> syzbot found the following crash on:
>
> HEAD commit:c578ddb3 Merge tag 'linux-kselftest-5.7-rc3' of git://git...
> git tree:   upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=10fbf0d810
> kernel config:  https://syzkaller.appspot.com/x/.config?x=b7a70e992f2f9b68
> dashboard link: https://syzkaller.appspot.com/bug?extid=e3372a2afe1e7ef04bc7
> compiler:   gcc (GCC) 9.0.0 20181231 (experimental)
> syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=1543833010
>
> Bisection is inconclusive: the first bad commit could be any of:
>
> 85b5bafb drm/cma-helper: Remove drm_fb_cma_fbdev_init_with_funcs()
> dff1c703 drm/tinydrm: Use drm_fbdev_generic_setup()
> 23167fa9 drm/panel: simple: Add support for Rocktech RK070ER9427 LCD panel
> 9060d7f4 drm/fb-helper: Finish the generic fbdev emulation
> 2230ca12 dt-bindings: display: Document the EDT et* displays in one file.
> e896c132 drm/debugfs: Add internal client debugfs file
> 894a677f drm/cma-helper: Use the generic fbdev emulation
> aa7e6455 drm/panel: Add support for the EDT ETM0700G0BDH6
> 244007ec drm/pl111: Set .gem_prime_vmap and .gem_prime_mmap
> aad34de2 drm/panel: Add support for the EDT ETM0700G0EDH6
> 7a6aca49 dt-bindings: Add vendor prefix for DLC Display Co., Ltd.
> d536540f drm/fb-helper: Add generic fbdev emulation .fb_probe function
> 0ca0c827 drm/panel: simple: Add DLC DLC0700YZG-1 panel
> c76f0f7c drm: Begin an API for in-kernel clients
> 5ba57bab drm: vkms: select DRM_KMS_HELPER
> 5fa8e4a2 drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of 
> NULL
> 008095e0 drm/vc4: Add support for the transposer block
> c59eb3cf drm/panel: Let of_drm_find_panel() return -ENODEV when the panel is 
> disabled
> 1ebe99a7 drm/vc4: Call drm_atomic_helper_fake_vblank() in the commit path
> 2e64a174 drm/of: Make drm_of_find_panel_or_bridge() fail when the device is 
> disabled
> 1b9883ea drm/vc4: Support the case where the DSI device is disabled
> 6fb42b66 drm/atomic: Call fake_vblank() from the generic commit_tail() helpers
> b0b7aa40 dt-bindings: display: Add DT bindings for BOE HV070WSA-100 panel
> b25c60af drm/crtc: Add a generic infrastructure to fake VBLANK events
> 184d3cf4 drm/vc4: Use wait_for_flip_done() instead of wait_for_vblanks()
> ae8cf41b drm/panel: simple: Add support for BOE HV070WSA-100 panel to 
> simple-panel
> 814bde99 drm/connector: Make ->atomic_commit() optional
> 955f60db drm: Add support for extracting sync signal drive edge from videomode
> 3b39ad7a drm/panel: simple: Add newhaven, nhd-4.3-480272ef-atxl LCD
> 425132fd drm/connector: Pass a drm_connector_state to ->atomic_commit()
> a5d2ade6 drm/panel: simple: Add support for Innolux G070Y2-L01
> b82c1f8f drm/atomic: Avoid connector to writeback_connector casts
> 03fa9aa3 dt-bindings: Add DataImage, Inc. vendor prefix
> 73915b2b drm/writeback: Fix the "overview" section of the doc
> 97ceb1fb drm/panel: simple: Add support for DataImage SCF0700C48GGU18
> e22e9531 Merge drm-upstream/drm-next into drm-misc-next
> 3d5664f9 drm/panel: ili9881c: Fix missing assignment to error return ret
> a0120245 drm/crc: Only report a single overflow when a CRC fd is opened
> 7ad4e463 drm/panel: p079zca: Refactor panel driver to support multiple panels
> 8adbbb2e drm/stm: ltdc: rework reset sequence
> 48bd379a drm/panel: p079zca: Add variable unprepare_delay properties
> 7868e507 drm/stm: ltdc: filter mode pixel clock vs pad constraint
> 731edd4c dt-bindings: Add Innolux P097PFG panel bindings
> f8878bb2 drm: print plane state normalized zpos value
> ca52bea9 drm/atomic-helper: Use bitwise or for filling a bitmask
> de04a462 drm/panel: p079zca: Support Innolux P097PFG panel
> 2bb7a39c dt-bindings: Add vendor prefix for kingdisplay
> a65020d0 drm/v3d: Fix a grammar nit in the scheduler docs.
> 2dd4f211 drm/v3d: Add missing v3d documentation structure.
> ebc950fd dt-bindings: Add KINGDISPLAY KD097D04 panel bindings
> cd0e0ca6 drm/panel: type promotion bug in s6e8aa0_read_mtp_id()
> e0d01811 drm/v3d: Remove unnecessary dma_fence_ops.
> 624bb0c0 drm/v3d: Delay the scheduler timeout if we're still making progress.
> b6d83fcc drm/panel: p079zca: Use of_device_get_match_data()
> 408633d2 drm/v3d: use new return type vm_fault_t in v3d_gem_fault
> decac6b0 dt-bindings: display: sun4i-drm: Add R40 display engine compatible
> 0b7510d1 drm/tilcdc: Use drm_connector_has_possible_encoder()
> d978a94b drm/sun4i: Add R40 display engine compatible
> af11942e drm/sun4i: tcon-top: Cleanup clock handling
> f8222409 drm/msm: Use drm_connector_has_possible_encoder()
> 38cb8d96 drm: Add drm_connector_has_possible_encoder()
> da82107e drm/sun4i: tcon: Release node when traversing of graph
> 7a667775 dt-bindings: display: sun4i-drm: Add R40 TV TCON description
> 7b71ca24 drm/radeon: Use drm_connector_for_each_possible_encoder()
> 4a068c5c drm/sun4i: DW HDMI: Release nodes if error happens during CRTC search
> 

[PATCH v3] dt-bindings: display: anx7814.txt: convert to yaml

2020-04-27 Thread Ricardo Cañuelo
This converts the Analogix ANX7814 bridge DT binding to yaml. Port
definitions and descriptions were expanded, apart from that it's a
direct translation from the original binding.

Signed-off-by: Ricardo Cañuelo 
Acked-by: Sam Ravnborg 
---
Changes in v3 (suggested by Sam Ravnborg):
  - Rename example node i2c0 to i2c.

Changes in v2 (suggested by Enric Balletbo):
  - File name change: use full compatible string.
  - Binding description removed.
  - #address-cells and #size-cells properties removed from ports node.
  - Example node renamed: anx7814 -> bridge.

Tested with:
make dt_binding_check ARCH=arm64 DT_SCHEMA_FILES=<.../analogix,anx7814.yaml>
make dtbs_check ARCH=arm64 DT_SCHEMA_FILES=<.../analogix,anx7814.yaml>

 .../display/bridge/analogix,anx7814.yaml  | 124 ++
 .../bindings/display/bridge/anx7814.txt   |  42 --
 2 files changed, 124 insertions(+), 42 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/display/bridge/analogix,anx7814.yaml
 delete mode 100644 Documentation/devicetree/bindings/display/bridge/anx7814.txt

diff --git 
a/Documentation/devicetree/bindings/display/bridge/analogix,anx7814.yaml 
b/Documentation/devicetree/bindings/display/bridge/analogix,anx7814.yaml
new file mode 100644
index ..13f0b52edefd
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/bridge/analogix,anx7814.yaml
@@ -0,0 +1,124 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/analogix,anx7814.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analogix ANX7814 SlimPort (Full-HD Transmitter)
+
+maintainers:
+  - Enric Balletbo i Serra 
+
+properties:
+  compatible:
+enum:
+  - analogix,anx7808
+  - analogix,anx7812
+  - analogix,anx7814
+  - analogix,anx7818
+
+  reg:
+maxItems: 1
+description: I2C address of the device.
+
+  interrupts:
+maxItems: 1
+description: Should contain the INTP interrupt.
+
+  hpd-gpios:
+maxItems: 1
+description: Which GPIO to use for hpd.
+
+  pd-gpios:
+maxItems: 1
+description: Which GPIO to use for power down.
+
+  reset-gpios:
+maxItems: 1
+description: Which GPIO to use for reset.
+
+  dvdd10-supply:
+maxItems: 1
+description: Regulator for 1.0V digital core power.
+
+  ports:
+type: object
+description:
+  A node containing input and output port nodes with endpoint
+  definitions as documented in
+  Documentation/devicetree/bindings/media/video-interfaces.txt
+  Documentation/devicetree/bindings/graph.txt
+
+properties:
+  port@0:
+type: object
+description: Video port for HDMI input.
+
+properties:
+  reg:
+const: 0
+
+  port@1:
+type: object
+description:
+  Video port for SlimPort, DisplayPort, eDP or MyDP output.
+
+properties:
+  reg:
+const: 1
+
+required:
+  - port@0
+  - port@1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - hpd-gpios
+  - pd-gpios
+  - reset-gpios
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+#include 
+
+i2c {
+#address-cells = <1>;
+#size-cells = <0>;
+
+anx7814: bridge@38 {
+compatible = "analogix,anx7814";
+reg = <0x38>;
+interrupt-parent = <>;
+interrupts = <99 IRQ_TYPE_LEVEL_LOW>;   /* INTP */
+hpd-gpios = < 36 GPIO_ACTIVE_HIGH>;
+pd-gpios = < 33 GPIO_ACTIVE_HIGH>;
+reset-gpios = < 98 GPIO_ACTIVE_HIGH>;
+
+ports {
+#address-cells = <1>;
+#size-cells = <0>;
+
+port@0 {
+reg = <0>;
+anx7814_in: endpoint {
+remote-endpoint = <_out>;
+};
+};
+
+port@1 {
+reg = <1>;
+anx7814_out: endpoint {
+remote-endpoint = <_out>;
+};
+};
+};
+};
+};
+
+...
diff --git a/Documentation/devicetree/bindings/display/bridge/anx7814.txt 
b/Documentation/devicetree/bindings/display/bridge/anx7814.txt
deleted file mode 100644
index 17258747fff6..
--- a/Documentation/devicetree/bindings/display/bridge/anx7814.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-Analogix ANX7814 SlimPort (Full-HD Transmitter)

-
-The ANX7814 is an ultra-low power Full-HD (1080p60) SlimPort transmitter
-designed for portable devices.
-
-Required properties:
-
- - compatible  : Must be one of:
- "analogix,anx7808"
- "analogix,anx7812"
- "analogix,anx7814"
- "analogix,anx7818"
- - reg : I2C address of the device
- - 

Re: [PATCH v2] dt-bindings: display: anx7814.txt: convert to yaml

2020-04-27 Thread Ricardo Cañuelo
On lun 27-04-2020 11:09:00, Sam Ravnborg wrote:
> Hi Ricardo.
> 
> On Mon, Apr 27, 2020 at 10:46:58AM +0200, Ricardo Cañuelo wrote:
> > This converts the Analogix ANX7814 bridge DT binding to yaml. Port
> > definitions and descriptions were expanded, apart from that it's a
> > direct translation from the original binding.
> > 
> > Signed-off-by: Ricardo Cañuelo 
> 
> One comment below, with that fixed:
> Acked-by: Sam Ravnborg 
>
> ...
>
> > +
> > +i2c0 {
> Name this i2c

Hi Sam,

Thanks for the review, I'll do that.

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


Re: [PATCH v1] staging: fbtft: fb_st7789v: Initialize the Display

2020-04-27 Thread Dan Carpenter
On Mon, Apr 27, 2020 at 10:36:42AM +0200, Oliver Graute wrote:
> On 09/04/20, Dan Carpenter wrote:
> > On Thu, Apr 09, 2020 at 11:25:32AM +0200, Oliver Graute wrote:
> > > From: Oliver Graute 
> > > 
> > > Set Gamma Values and Register Values for the HSD20_IPS
> > > 
> > > Signed-off-by: Oliver Graute 
> > > ---
> > >  drivers/staging/fbtft/fb_st7789v.c | 12 ++--
> > >  1 file changed, 6 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/drivers/staging/fbtft/fb_st7789v.c 
> > > b/drivers/staging/fbtft/fb_st7789v.c
> > > index 84c5af2dc9a0..b0aa96b703a8 100644
> > > --- a/drivers/staging/fbtft/fb_st7789v.c
> > > +++ b/drivers/staging/fbtft/fb_st7789v.c
> > > @@ -17,8 +17,8 @@
> > >  #define DRVNAME "fb_st7789v"
> > >  
> > >  #define DEFAULT_GAMMA \
> > > - "70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25\n" \
> > > - "70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25"
> > > + "D0 05 0A 09 08 05 2E 44 45 0F 17 16 2B 33\n" \
> > > + "D0 05 0A 09 08 05 2E 43 45 0F 16 16 2B 33"
> > 
> > How do you know this won't break someone else's setup?
> 
> Should I declare an extra define for my values?
> 
> +#define HSD20_IPS_GAMMA \
> + "D0 05 0A 09 08 05 2E 44 45 0F 17 16 2B 33\n" \
> + "D0 05 0A 09 08 05 2E 43 45 0F 16 16 2B 33"
> 

That's fine, but it can't be a compile time thing.  Both types of
hardware have to be working/available at run time.

regards,
dan carpenter


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


Re: [PATCH 2/8] dt-bindings: intc: Convert ingenic,intc.txt to YAML

2020-04-27 Thread Sergei Shtylyov

Hello!

On 26.04.2020 21:58, Paul Cercueil wrote:


Convert the ingenic,intc.txt doc file to ingenic,intc.yaml.

Some compatible strings now require a fallback, as the controller
generally works the same across the SoCs families.

Signed-off-by: Paul Cercueil 

[...]

diff --git 
a/Documentation/devicetree/bindings/interrupt-controller/ingenic,intc.yaml 
b/Documentation/devicetree/bindings/interrupt-controller/ingenic,intc.yaml
new file mode 100644
index ..28b27e1a6e9d
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/ingenic,intc.yaml
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/ingenic,intc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Ingenic SoCs interrupt controller devicetree bindings
+
+maintainers:
+  - Paul Cercueil 
+
+properties:
+  $nodename:
+pattern: "^interrupt-controller@[0-9a-f]+$"
+
+  compatible:
+oneOf:
+  - enum:
+- ingenic,jz4740-intc
+- ingenic,jz4760-intc
+- ingenic,jz4780-intc
+  - items:
+- enum:
+  - ingenic,jz4775-intc
+  - ingenic,jz4770-intc
+- const: ingenic,jz4760-intc
+  - items:
+- const: ingenic,x1000-intc
+- const: ingenic,jz4780-intc
+  - items:
+- const: ingenic,jz4725b-intc
+- const: ingenic,jz4740-intc
+
+  "#interrupt-cells":
+const: 1


   Do double quotes work the same as the single ones?

[...]

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


Re: [PATCH v2] dt-bindings: display: anx7814.txt: convert to yaml

2020-04-27 Thread Sam Ravnborg
Hi Ricardo.

On Mon, Apr 27, 2020 at 10:46:58AM +0200, Ricardo Cañuelo wrote:
> This converts the Analogix ANX7814 bridge DT binding to yaml. Port
> definitions and descriptions were expanded, apart from that it's a
> direct translation from the original binding.
> 
> Signed-off-by: Ricardo Cañuelo 

One comment below, with that fixed:
Acked-by: Sam Ravnborg 

> ---
> Changes in v2 (suggested by Enric Balletbo):
> 
>   - File name change: use full compatible string.
>   - Binding description removed.
>   - #address-cells and #size-cells properties removed from ports node.
>   - Example node renamed: anx7814 -> bridge.
> 
> Tested with:
> make dt_binding_check ARCH=arm64 DT_SCHEMA_FILES=<.../analogix,anx7814.yaml>
> make dtbs_check ARCH=arm64 DT_SCHEMA_FILES=<.../analogix,anx7814.yaml>
> 
>  .../display/bridge/analogix,anx7814.yaml  | 124 ++
>  .../bindings/display/bridge/anx7814.txt   |  42 --
>  2 files changed, 124 insertions(+), 42 deletions(-)
>  create mode 100644 
> Documentation/devicetree/bindings/display/bridge/analogix,anx7814.yaml
>  delete mode 100644 
> Documentation/devicetree/bindings/display/bridge/anx7814.txt
> 
> diff --git 
> a/Documentation/devicetree/bindings/display/bridge/analogix,anx7814.yaml 
> b/Documentation/devicetree/bindings/display/bridge/analogix,anx7814.yaml
> new file mode 100644
> index ..5459336ac2f5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/bridge/analogix,anx7814.yaml
> @@ -0,0 +1,124 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/bridge/analogix,anx7814.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analogix ANX7814 SlimPort (Full-HD Transmitter)
> +
> +maintainers:
> +  - Enric Balletbo i Serra 
> +
> +properties:
> +  compatible:
> +enum:
> +  - analogix,anx7808
> +  - analogix,anx7812
> +  - analogix,anx7814
> +  - analogix,anx7818
> +
> +  reg:
> +maxItems: 1
> +description: I2C address of the device.
> +
> +  interrupts:
> +maxItems: 1
> +description: Should contain the INTP interrupt.
> +
> +  hpd-gpios:
> +maxItems: 1
> +description: Which GPIO to use for hpd.
> +
> +  pd-gpios:
> +maxItems: 1
> +description: Which GPIO to use for power down.
> +
> +  reset-gpios:
> +maxItems: 1
> +description: Which GPIO to use for reset.
> +
> +  dvdd10-supply:
> +maxItems: 1
> +description: Regulator for 1.0V digital core power.
> +
> +  ports:
> +type: object
> +description:
> +  A node containing input and output port nodes with endpoint
> +  definitions as documented in
> +  Documentation/devicetree/bindings/media/video-interfaces.txt
> +  Documentation/devicetree/bindings/graph.txt
> +
> +properties:
> +  port@0:
> +type: object
> +description: Video port for HDMI input.
> +
> +properties:
> +  reg:
> +const: 0
> +
> +  port@1:
> +type: object
> +description:
> +  Video port for SlimPort, DisplayPort, eDP or MyDP output.
> +
> +properties:
> +  reg:
> +const: 1
> +
> +required:
> +  - port@0
> +  - port@1
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - hpd-gpios
> +  - pd-gpios
> +  - reset-gpios
> +  - ports
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +#include 
> +#include 
> +
> +i2c0 {
Name this i2c

> +#address-cells = <1>;
> +#size-cells = <0>;
> +
> +anx7814: bridge@38 {
> +compatible = "analogix,anx7814";
> +reg = <0x38>;
> +interrupt-parent = <>;
> +interrupts = <99 IRQ_TYPE_LEVEL_LOW>;   /* INTP */
> +hpd-gpios = < 36 GPIO_ACTIVE_HIGH>;
> +pd-gpios = < 33 GPIO_ACTIVE_HIGH>;
> +reset-gpios = < 98 GPIO_ACTIVE_HIGH>;
> +
> +ports {
> +#address-cells = <1>;
> +#size-cells = <0>;
> +
> +port@0 {
> +reg = <0>;
> +anx7814_in: endpoint {
> +remote-endpoint = <_out>;
> +};
> +};
> +
> +port@1 {
> +reg = <1>;
> +anx7814_out: endpoint {
> +remote-endpoint = <_out>;
> +};
> +};
> +};
> +};
> +};
> +
> +...
> diff --git a/Documentation/devicetree/bindings/display/bridge/anx7814.txt 
> b/Documentation/devicetree/bindings/display/bridge/anx7814.txt
> deleted file mode 100644
> index 17258747fff6..
> --- a/Documentation/devicetree/bindings/display/bridge/anx7814.txt
> +++ /dev/null
> @@ -1,42 +0,0 @@
> -Analogix ANX7814 SlimPort (Full-HD Transmitter)
> 
> -
> -The ANX7814 is an 

[PATCH v2] dt-bindings: display: anx7814.txt: convert to yaml

2020-04-27 Thread Ricardo Cañuelo
This converts the Analogix ANX7814 bridge DT binding to yaml. Port
definitions and descriptions were expanded, apart from that it's a
direct translation from the original binding.

Signed-off-by: Ricardo Cañuelo 
---
Changes in v2 (suggested by Enric Balletbo):

  - File name change: use full compatible string.
  - Binding description removed.
  - #address-cells and #size-cells properties removed from ports node.
  - Example node renamed: anx7814 -> bridge.

Tested with:
make dt_binding_check ARCH=arm64 DT_SCHEMA_FILES=<.../analogix,anx7814.yaml>
make dtbs_check ARCH=arm64 DT_SCHEMA_FILES=<.../analogix,anx7814.yaml>

 .../display/bridge/analogix,anx7814.yaml  | 124 ++
 .../bindings/display/bridge/anx7814.txt   |  42 --
 2 files changed, 124 insertions(+), 42 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/display/bridge/analogix,anx7814.yaml
 delete mode 100644 Documentation/devicetree/bindings/display/bridge/anx7814.txt

diff --git 
a/Documentation/devicetree/bindings/display/bridge/analogix,anx7814.yaml 
b/Documentation/devicetree/bindings/display/bridge/analogix,anx7814.yaml
new file mode 100644
index ..5459336ac2f5
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/bridge/analogix,anx7814.yaml
@@ -0,0 +1,124 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/analogix,anx7814.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analogix ANX7814 SlimPort (Full-HD Transmitter)
+
+maintainers:
+  - Enric Balletbo i Serra 
+
+properties:
+  compatible:
+enum:
+  - analogix,anx7808
+  - analogix,anx7812
+  - analogix,anx7814
+  - analogix,anx7818
+
+  reg:
+maxItems: 1
+description: I2C address of the device.
+
+  interrupts:
+maxItems: 1
+description: Should contain the INTP interrupt.
+
+  hpd-gpios:
+maxItems: 1
+description: Which GPIO to use for hpd.
+
+  pd-gpios:
+maxItems: 1
+description: Which GPIO to use for power down.
+
+  reset-gpios:
+maxItems: 1
+description: Which GPIO to use for reset.
+
+  dvdd10-supply:
+maxItems: 1
+description: Regulator for 1.0V digital core power.
+
+  ports:
+type: object
+description:
+  A node containing input and output port nodes with endpoint
+  definitions as documented in
+  Documentation/devicetree/bindings/media/video-interfaces.txt
+  Documentation/devicetree/bindings/graph.txt
+
+properties:
+  port@0:
+type: object
+description: Video port for HDMI input.
+
+properties:
+  reg:
+const: 0
+
+  port@1:
+type: object
+description:
+  Video port for SlimPort, DisplayPort, eDP or MyDP output.
+
+properties:
+  reg:
+const: 1
+
+required:
+  - port@0
+  - port@1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - hpd-gpios
+  - pd-gpios
+  - reset-gpios
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+#include 
+
+i2c0 {
+#address-cells = <1>;
+#size-cells = <0>;
+
+anx7814: bridge@38 {
+compatible = "analogix,anx7814";
+reg = <0x38>;
+interrupt-parent = <>;
+interrupts = <99 IRQ_TYPE_LEVEL_LOW>;   /* INTP */
+hpd-gpios = < 36 GPIO_ACTIVE_HIGH>;
+pd-gpios = < 33 GPIO_ACTIVE_HIGH>;
+reset-gpios = < 98 GPIO_ACTIVE_HIGH>;
+
+ports {
+#address-cells = <1>;
+#size-cells = <0>;
+
+port@0 {
+reg = <0>;
+anx7814_in: endpoint {
+remote-endpoint = <_out>;
+};
+};
+
+port@1 {
+reg = <1>;
+anx7814_out: endpoint {
+remote-endpoint = <_out>;
+};
+};
+};
+};
+};
+
+...
diff --git a/Documentation/devicetree/bindings/display/bridge/anx7814.txt 
b/Documentation/devicetree/bindings/display/bridge/anx7814.txt
deleted file mode 100644
index 17258747fff6..
--- a/Documentation/devicetree/bindings/display/bridge/anx7814.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-Analogix ANX7814 SlimPort (Full-HD Transmitter)

-
-The ANX7814 is an ultra-low power Full-HD (1080p60) SlimPort transmitter
-designed for portable devices.
-
-Required properties:
-
- - compatible  : Must be one of:
- "analogix,anx7808"
- "analogix,anx7812"
- "analogix,anx7814"
- "analogix,anx7818"
- - reg : I2C address of the device
- - interrupts  : Should contain the INTP interrupt
- - hpd-gpios   : Which GPIO to use for 

Re: [PATCH 3/3] drm/panel: simple: Add Newhaven ATXL#-CTP panel

2020-04-27 Thread Sam Ravnborg
Hi Gareth.

Looking forward to see the other patches - they seem to be stuck
awaiting approval.

A few comments in the following.

Sam

On Mon, Apr 27, 2020 at 09:21:49AM +0100, Gareth Williams wrote:
> This commit adds support for the Newhaven ATXL#-CTP panel used by the
> Renesas RZ/N1 Demo Board.
> 
> Signed-off-by: Gareth Williams 
> ---
>  drivers/gpu/drm/panel/panel-simple.c | 27 +++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-simple.c 
> b/drivers/gpu/drm/panel/panel-simple.c
> index 5a93c4e..0b57b0e 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -2021,6 +2021,30 @@ static const struct panel_desc 
> newhaven_nhd_43_480272ef_atxl = {
>DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
>  };
>  
> +static const struct display_timing newhaven_nhd_50_800480tf_atxl_timing = {
> + .pixelclock = { 3330, 3340, 3350 },
> + .hactive = { 800, 800, 800 },
> + .hfront_porch = { 40, 40, 40 },
> + .hback_porch = { 88, 88, 88 },
> + .hsync_len = { 1, 1, 1 },
> + .vactive = { 480, 480, 480 },
> + .vfront_porch = { 13, 13, 13 },
> + .vback_porch = { 32, 32, 32 },
> + .vsync_len = { 3, 3, 3 },
> + .flags = DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_HIGH,
> +};
> +
> +static const struct panel_desc newhaven_nhd_50_800480tf_atxl = {
> + .timings = _nhd_50_800480tf_atxl_timing,
> + .num_timings = 1,
> + .bpc = 8,
> + .size = {
> + .width = 400,
> + .height = 300,
> + },
> + .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Please add DRM_BUS_FLAG_PIXDATA too - as I assume this is an LVDS panel.

> +};
For new panels .connector_type is mandatory.


> +
>  static const struct display_timing nlt_nl192108ac18_02d_timing = {
>   .pixelclock = { 13000, 14835, 16300 },
>   .hactive = { 1920, 1920, 1920 },
> @@ -2964,6 +2988,9 @@ static const struct of_device_id platform_of_match[] = {
>   .compatible = "newhaven,nhd-4.3-480272ef-atxl",
>   .data = _nhd_43_480272ef_atxl,
>   }, {
> + .compatible = "newhaven,nhd-5.0-800480tf-atxl",
> + .data = _nhd_50_800480tf_atxl,
> + }, {

I did not see the other patches - so this is maybe covered.
But newhaven,nhd-5.0-800480tf-atxl must be documented in
panel-simple.yaml before we can apply this.

Sam

>   .compatible = "nlt,nl192108ac18-02d",
>   .data = _nl192108ac18_02d,
>   }, {
> -- 
> 2.7.4
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 03/21] drm/bridge: tc358764: drop drm_connector_(un)register

2020-04-27 Thread Sam Ravnborg
Drop drm_connector handling that is not needed:

- drm_dev_register() in the display controller driver takes
  care of registering connectors.
  So the call to drm_connector_register() call is not needed in the bridge
  driver.

- Use of drm_connector_unregister() is only required for drivers that
  explicit have called drm_dev_register.

- The reference counting using drm_connector_put() is likewise not needed.

Signed-off-by: Sam Ravnborg 
Reviewed-by: Laurent Pinchart 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 drivers/gpu/drm/bridge/tc358764.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/bridge/tc358764.c 
b/drivers/gpu/drm/bridge/tc358764.c
index 5ac1430fab04..a277739fab58 100644
--- a/drivers/gpu/drm/bridge/tc358764.c
+++ b/drivers/gpu/drm/bridge/tc358764.c
@@ -375,7 +375,6 @@ static int tc358764_attach(struct drm_bridge *bridge,
drm_connector_attach_encoder(>connector, bridge->encoder);
drm_panel_attach(ctx->panel, >connector);
ctx->connector.funcs->reset(>connector);
-   drm_connector_register(>connector);
 
return 0;
 }
@@ -384,10 +383,8 @@ static void tc358764_detach(struct drm_bridge *bridge)
 {
struct tc358764 *ctx = bridge_to_tc358764(bridge);
 
-   drm_connector_unregister(>connector);
drm_panel_detach(ctx->panel);
ctx->panel = NULL;
-   drm_connector_put(>connector);
 }
 
 static const struct drm_bridge_funcs tc358764_bridge_funcs = {
-- 
2.20.1

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


[PATCH v2 18/21] drm/bridge: nxp-ptn3460: add drm_panel_bridge support

2020-04-27 Thread Sam Ravnborg
Prepare the bridge driver for use in a chained setup by
replacing direct use of drm_panel with drm_panel_bridge support.

Note: the bridge panel will use the connector type from the panel.

Signed-off-by: Sam Ravnborg 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 drivers/gpu/drm/bridge/nxp-ptn3460.c | 51 
 1 file changed, 14 insertions(+), 37 deletions(-)

diff --git a/drivers/gpu/drm/bridge/nxp-ptn3460.c 
b/drivers/gpu/drm/bridge/nxp-ptn3460.c
index 438e566ce0a4..0bd9f0e451b3 100644
--- a/drivers/gpu/drm/bridge/nxp-ptn3460.c
+++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c
@@ -30,7 +30,7 @@ struct ptn3460_bridge {
struct i2c_client *client;
struct drm_bridge bridge;
struct edid *edid;
-   struct drm_panel *panel;
+   struct drm_bridge *panel_bridge;
struct gpio_desc *gpio_pd_n;
struct gpio_desc *gpio_rst_n;
u32 edid_emulation;
@@ -127,11 +127,6 @@ static void ptn3460_pre_enable(struct drm_bridge *bridge)
usleep_range(10, 20);
gpiod_set_value(ptn_bridge->gpio_rst_n, 1);
 
-   if (drm_panel_prepare(ptn_bridge->panel)) {
-   DRM_ERROR("failed to prepare panel\n");
-   return;
-   }
-
/*
 * There's a bug in the PTN chip where it falsely asserts hotplug before
 * it is fully functional. We're forced to wait for the maximum start up
@@ -146,16 +141,6 @@ static void ptn3460_pre_enable(struct drm_bridge *bridge)
ptn_bridge->enabled = true;
 }
 
-static void ptn3460_enable(struct drm_bridge *bridge)
-{
-   struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
-
-   if (drm_panel_enable(ptn_bridge->panel)) {
-   DRM_ERROR("failed to enable panel\n");
-   return;
-   }
-}
-
 static void ptn3460_disable(struct drm_bridge *bridge)
 {
struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
@@ -165,25 +150,10 @@ static void ptn3460_disable(struct drm_bridge *bridge)
 
ptn_bridge->enabled = false;
 
-   if (drm_panel_disable(ptn_bridge->panel)) {
-   DRM_ERROR("failed to disable panel\n");
-   return;
-   }
-
gpiod_set_value(ptn_bridge->gpio_rst_n, 1);
gpiod_set_value(ptn_bridge->gpio_pd_n, 0);
 }
 
-static void ptn3460_post_disable(struct drm_bridge *bridge)
-{
-   struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
-
-   if (drm_panel_unprepare(ptn_bridge->panel)) {
-   DRM_ERROR("failed to unprepare panel\n");
-   return;
-   }
-}
-
 static int ptn3460_get_modes(struct drm_connector *connector)
 {
struct ptn3460_bridge *ptn_bridge;
@@ -242,6 +212,11 @@ static int ptn3460_bridge_attach(struct drm_bridge *bridge,
struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
int ret;
 
+   ret = drm_bridge_attach(bridge->encoder, ptn_bridge->panel_bridge,
+   bridge, flags);
+   if (ret < 0)
+   return ret;
+
if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
DRM_ERROR("Fix bridge driver to make connector optional!");
return -EINVAL;
@@ -265,9 +240,6 @@ static int ptn3460_bridge_attach(struct drm_bridge *bridge,
drm_connector_attach_encoder(_bridge->connector,
bridge->encoder);
 
-   if (ptn_bridge->panel)
-   drm_panel_attach(ptn_bridge->panel, _bridge->connector);
-
drm_helper_hpd_irq_event(ptn_bridge->connector.dev);
 
return ret;
@@ -275,9 +247,7 @@ static int ptn3460_bridge_attach(struct drm_bridge *bridge,
 
 static const struct drm_bridge_funcs ptn3460_bridge_funcs = {
.pre_enable = ptn3460_pre_enable,
-   .enable = ptn3460_enable,
.disable = ptn3460_disable,
-   .post_disable = ptn3460_post_disable,
.attach = ptn3460_bridge_attach,
 };
 
@@ -286,6 +256,8 @@ static int ptn3460_probe(struct i2c_client *client,
 {
struct device *dev = >dev;
struct ptn3460_bridge *ptn_bridge;
+   struct drm_bridge *pbridge;
+   struct drm_panel *panel;
int ret;
 
ptn_bridge = devm_kzalloc(dev, sizeof(*ptn_bridge), GFP_KERNEL);
@@ -293,10 +265,15 @@ static int ptn3460_probe(struct i2c_client *client,
return -ENOMEM;
}
 
-   ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, 
_bridge->panel, NULL);
+   ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, , NULL);
if (ret)
return ret;
 
+   pbridge = devm_drm_panel_bridge_add(dev, panel);
+   if (IS_ERR(pbridge))
+   return PTR_ERR(pbridge);
+
+   ptn_bridge->panel_bridge = pbridge;
ptn_bridge->client = client;
 
ptn_bridge->gpio_pd_n = devm_gpiod_get(>dev, "powerdown",
-- 
2.20.1

___
dri-devel 

[PATCH v2 17/21] drm/bridge: megachips: make connector creation optional

2020-04-27 Thread Sam Ravnborg
Make the connector creation optional to enable usage of the
megachips-stdp-ge-b850v3-fw bridge with the DRM bridge connector helper.

Signed-off-by: Sam Ravnborg 
Cc: Peter Senna Tschudin 
Cc: Martin Donnelly 
Cc: Martyn Welch 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 .../drm/bridge/megachips-stdp-ge-b850v3-fw.c  | 15 ---
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c 
b/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c
index 5f06e18f0a61..991417ab35b6 100644
--- a/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c
+++ b/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c
@@ -251,16 +251,6 @@ static int ge_b850v3_lvds_attach(struct drm_bridge *bridge,
 {
struct i2c_client *stdp4028_i2c
= ge_b850v3_lvds_ptr->stdp4028_i2c;
-   int ret;
-
-   if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
-   DRM_ERROR("Fix bridge driver to make connector optional!");
-   return -EINVAL;
-   }
-
-   ret = ge_b850v3_lvds_create_connector(bridge);
-   if (ret)
-   return ret;
 
/* Configures the bridge to re-enable interrupts after each ack. */
i2c_smbus_write_word_data(stdp4028_i2c,
@@ -272,7 +262,10 @@ static int ge_b850v3_lvds_attach(struct drm_bridge *bridge,
  STDP4028_DPTX_IRQ_EN_REG,
  STDP4028_DPTX_IRQ_CONFIG);
 
-   return 0;
+   if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
+   return 0;
+
+   return ge_b850v3_lvds_create_connector(bridge);
 }
 
 static const struct drm_bridge_funcs ge_b850v3_lvds_funcs = {
-- 
2.20.1

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


[PATCH v2 21/21] drm/bridge: ti-sn65dsi86: add drm_panel_bridge support

2020-04-27 Thread Sam Ravnborg
Prepare the bridge driver for use in a chained setup by
replacing direct use of drm_panel with drm_panel_bridge support.

Note: the bridge panel will use the connector type from the panel.

Signed-off-by: Sam Ravnborg 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 drivers/gpu/drm/bridge/ti-sn65dsi86.c | 27 +--
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c 
b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
index 6ad688b320ae..c306d3069037 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
@@ -98,7 +98,7 @@ struct ti_sn_bridge {
struct device_node  *host_node;
struct mipi_dsi_device  *dsi;
struct clk  *refclk;
-   struct drm_panel*panel;
+   struct drm_bridge   *panel_bridge;
struct gpio_desc*enable_gpio;
struct regulator_bulk_data  supplies[SN_REGULATOR_SUPPLY_NUM];
int dp_lanes;
@@ -208,7 +208,7 @@ static int ti_sn_bridge_connector_get_modes(struct 
drm_connector *connector)
 {
struct ti_sn_bridge *pdata = connector_to_ti_sn_bridge(connector);
 
-   return drm_panel_get_modes(pdata->panel, connector);
+   return drm_bridge_get_modes(pdata->panel_bridge, connector);
 }
 
 static enum drm_mode_status
@@ -340,9 +340,8 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge,
pdata->dsi = dsi;
 
/* attach panel to bridge */
-   drm_panel_attach(pdata->panel, >connector);
-
-   return 0;
+   return drm_bridge_attach(bridge->encoder, pdata->panel_bridge,
+bridge, flags);
 
 err_dsi_attach:
mipi_dsi_device_unregister(dsi);
@@ -355,16 +354,12 @@ static void ti_sn_bridge_disable(struct drm_bridge 
*bridge)
 {
struct ti_sn_bridge *pdata = bridge_to_ti_sn_bridge(bridge);
 
-   drm_panel_disable(pdata->panel);
-
/* disable video stream */
regmap_update_bits(pdata->regmap, SN_ENH_FRAME_REG, VSTREAM_ENABLE, 0);
/* semi auto link training mode OFF */
regmap_write(pdata->regmap, SN_ML_TX_MODE_REG, 0);
/* disable DP PLL */
regmap_write(pdata->regmap, SN_PLL_ENABLE_REG, 0);
-
-   drm_panel_unprepare(pdata->panel);
 }
 
 static u32 ti_sn_bridge_get_dsi_freq(struct ti_sn_bridge *pdata)
@@ -731,8 +726,6 @@ static void ti_sn_bridge_enable(struct drm_bridge *bridge)
/* enable video stream */
regmap_update_bits(pdata->regmap, SN_ENH_FRAME_REG, VSTREAM_ENABLE,
   VSTREAM_ENABLE);
-
-   drm_panel_enable(pdata->panel);
 }
 
 static void ti_sn_bridge_pre_enable(struct drm_bridge *bridge)
@@ -762,8 +755,6 @@ static void ti_sn_bridge_pre_enable(struct drm_bridge 
*bridge)
 */
regmap_update_bits(pdata->regmap, SN_HPD_DISABLE_REG, HPD_DISABLE,
   HPD_DISABLE);
-
-   drm_panel_prepare(pdata->panel);
 }
 
 static void ti_sn_bridge_post_disable(struct drm_bridge *bridge)
@@ -878,6 +869,8 @@ static int ti_sn_bridge_probe(struct i2c_client *client,
  const struct i2c_device_id *id)
 {
struct ti_sn_bridge *pdata;
+   struct drm_bridge *bridge;
+   struct drm_panel *panel;
int ret;
 
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
@@ -900,12 +893,18 @@ static int ti_sn_bridge_probe(struct i2c_client *client,
pdata->dev = >dev;
 
ret = drm_of_find_panel_or_bridge(pdata->dev->of_node, 1, 0,
- >panel, NULL);
+ , NULL);
if (ret) {
DRM_ERROR("could not find any panel node\n");
return ret;
}
 
+   bridge = devm_drm_panel_bridge_add(pdata->dev, panel);
+   if (IS_ERR(bridge))
+   return PTR_ERR(bridge);
+
+   pdata->panel_bridge = bridge;
+
dev_set_drvdata(>dev, pdata);
 
pdata->enable_gpio = devm_gpiod_get(pdata->dev, "enable",
-- 
2.20.1

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


[PATCH v8 09/10] drm: bridge: dw-mipi-dsi: split low power cfg register into fields

2020-04-27 Thread Adrian Ratiu
According to the Host Registers documentation for IMX, STM and RK
the LP cfg register should not be written entirely in one go because
some bits are reserved and should be kept to reset values, for eg.
BIT(15) which is reserved in all versions.

This also cleans up the code by removing the the ugly defines
and making field ranges & values written more explicit.

Tested-by: Adrian Pop 
Tested-by: Arnaud Ferraris 
Signed-off-by: Adrian Ratiu 
---
New in v6.
---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 105 ++
 1 file changed, 33 insertions(+), 72 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c 
b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index 140ff40fa1b62..0903ec37289dd 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -120,60 +120,6 @@
 #define DSI_TO_CNT_CFG_V1010x40
 #define DSI_PCKHDL_CFG_V1010x18
 
-#define MAX_RD_PKT_SIZE_LP BIT(24)
-#define DCS_LW_TX_LP   BIT(19)
-#define DCS_SR_0P_TX_LPBIT(18)
-#define DCS_SW_1P_TX_LPBIT(17)
-#define DCS_SW_0P_TX_LPBIT(16)
-#define GEN_LW_TX_LP   BIT(14)
-#define GEN_SR_2P_TX_LPBIT(13)
-#define GEN_SR_1P_TX_LPBIT(12)
-#define GEN_SR_0P_TX_LPBIT(11)
-#define GEN_SW_2P_TX_LPBIT(10)
-#define GEN_SW_1P_TX_LPBIT(9)
-#define GEN_SW_0P_TX_LPBIT(8)
-#define TEAR_FX_EN BIT(0)
-
-#define CMD_MODE_ALL_LP(MAX_RD_PKT_SIZE_LP | \
-DCS_LW_TX_LP | \
-DCS_SR_0P_TX_LP | \
-DCS_SW_1P_TX_LP | \
-DCS_SW_0P_TX_LP | \
-GEN_LW_TX_LP | \
-GEN_SR_2P_TX_LP | \
-GEN_SR_1P_TX_LP | \
-GEN_SR_0P_TX_LP | \
-GEN_SW_2P_TX_LP | \
-GEN_SW_1P_TX_LP | \
-GEN_SW_0P_TX_LP)
-
-#define EN_TEAR_FX_V101BIT(14)
-#define DCS_LW_TX_LP_V101  BIT(12)
-#define GEN_LW_TX_LP_V101  BIT(11)
-#define MAX_RD_PKT_SIZE_LP_V101BIT(10)
-#define DCS_SW_2P_TX_LP_V101   BIT(9)
-#define DCS_SW_1P_TX_LP_V101   BIT(8)
-#define DCS_SW_0P_TX_LP_V101   BIT(7)
-#define GEN_SR_2P_TX_LP_V101   BIT(6)
-#define GEN_SR_1P_TX_LP_V101   BIT(5)
-#define GEN_SR_0P_TX_LP_V101   BIT(4)
-#define GEN_SW_2P_TX_LP_V101   BIT(3)
-#define GEN_SW_1P_TX_LP_V101   BIT(2)
-#define GEN_SW_0P_TX_LP_V101   BIT(1)
-
-#define CMD_MODE_ALL_LP_V101   (DCS_LW_TX_LP_V101 | \
-GEN_LW_TX_LP_V101 | \
-MAX_RD_PKT_SIZE_LP_V101 | \
-DCS_SW_2P_TX_LP_V101 | \
-DCS_SW_1P_TX_LP_V101 | \
-DCS_SW_0P_TX_LP_V101 | \
-GEN_SR_2P_TX_LP_V101 | \
-GEN_SR_1P_TX_LP_V101 | \
-GEN_SR_0P_TX_LP_V101 | \
-GEN_SW_2P_TX_LP_V101 | \
-GEN_SW_1P_TX_LP_V101 | \
-GEN_SW_0P_TX_LP_V101)
-
 #define DSI_GEN_HDR0x6c
 #define DSI_GEN_PLD_DATA   0x70
 
@@ -257,7 +203,11 @@ struct dw_mipi_dsi {
struct regmap_field *field_dpi_vsync_active_low;
struct regmap_field *field_dpi_hsync_active_low;
struct regmap_field *field_cmd_mode_ack_rqst_en;
-   struct regmap_field *field_cmd_mode_all_lp_en;
+   struct regmap_field *field_cmd_mode_gen_sw_sr_en;
+   struct regmap_field *field_cmd_mode_dcs_sw_sr_en;
+   struct regmap_field *field_cmd_mode_gen_lw_en;
+   struct regmap_field *field_cmd_mode_dcs_lw_en;
+   struct regmap_field *field_cmd_mode_max_rd_pkt_size;
struct regmap_field *field_cmd_mode_en;
struct regmap_field *field_cmd_pkt_status;
struct regmap_field *field_vid_mode_en;
@@ -315,7 +265,11 @@ struct dw_mipi_dsi_variant {
struct reg_fieldcfg_dpi_hsync_active_low;
struct reg_fieldcfg_cmd_mode_en;
struct reg_fieldcfg_cmd_mode_ack_rqst_en;
-   struct reg_fieldcfg_cmd_mode_all_lp_en;
+   struct reg_fieldcfg_cmd_mode_gen_sw_sr_en;
+   struct 

[PATCH v2 08/21] drm/bridge: tc358767: add get_edid bride operation

2020-04-27 Thread Sam Ravnborg
Prepare for chained bridge with the addition of
get_edid support.

Signed-off-by: Sam Ravnborg 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 drivers/gpu/drm/bridge/tc358767.c | 24 +---
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/bridge/tc358767.c 
b/drivers/gpu/drm/bridge/tc358767.c
index 211a058c7243..42a153bcde64 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -1316,6 +1316,20 @@ static void tc_bridge_mode_set(struct drm_bridge *bridge,
tc->mode = *mode;
 }
 
+static struct edid *tc_get_edid(struct drm_bridge *bridge,
+   struct drm_connector *connector)
+{
+   struct tc_data *tc = bridge_to_tc(bridge);
+   struct edid *edid;
+
+   edid = drm_get_edid(connector, >aux.ddc);
+
+   kfree(tc->edid);
+   tc->edid = edid;
+
+   return edid;
+}
+
 static int tc_connector_get_modes(struct drm_connector *connector)
 {
struct tc_data *tc = connector_to_tc(connector);
@@ -1335,12 +1349,7 @@ static int tc_connector_get_modes(struct drm_connector 
*connector)
return count;
}
 
-   edid = drm_get_edid(connector, >aux.ddc);
-
-   kfree(tc->edid);
-   tc->edid = edid;
-   if (!edid)
-   return 0;
+   edid = tc_get_edid(>bridge, connector);
 
drm_connector_update_edid_property(connector, edid);
count = drm_add_edid_modes(connector, edid);
@@ -1451,6 +1460,7 @@ static const struct drm_bridge_funcs tc_bridge_funcs = {
.disable = tc_bridge_disable,
.mode_fixup = tc_bridge_mode_fixup,
.detect = tc_bridge_detect,
+   .get_edid = tc_get_edid,
 };
 
 static bool tc_readable_reg(struct device *dev, unsigned int reg)
@@ -1684,7 +1694,7 @@ static int tc_probe(struct i2c_client *client, const 
struct i2c_device_id *id)
return ret;
 
tc->bridge.funcs = _bridge_funcs;
-   tc->bridge.ops = DRM_BRIDGE_OP_DETECT;
+   tc->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID;
 
tc->bridge.of_node = dev->of_node;
drm_bridge_add(>bridge);
-- 
2.20.1

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


[PATCH v2 15/21] drm/bridge: megachips: enable detect bridge operation

2020-04-27 Thread Sam Ravnborg
To prepare for use in a chained bridge setup enable the
detect operation.

Signed-off-by: Sam Ravnborg 
Cc: Peter Senna Tschudin 
Cc: Martin Donnelly 
Cc: Martyn Welch 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 .../gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c 
b/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c
index cf1dfbc88acf..78a9afe8f063 100644
--- a/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c
+++ b/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c
@@ -163,8 +163,8 @@ drm_connector_helper_funcs 
ge_b850v3_lvds_connector_helper_funcs = {
.mode_valid = ge_b850v3_lvds_mode_valid,
 };
 
-static enum drm_connector_status ge_b850v3_lvds_detect(
-   struct drm_connector *connector, bool force)
+static enum drm_connector_status ge_b850v3_lvds_bridge_detect(
+   struct drm_bridge *bridge)
 {
struct i2c_client *stdp4028_i2c =
ge_b850v3_lvds_ptr->stdp4028_i2c;
@@ -182,6 +182,12 @@ static enum drm_connector_status ge_b850v3_lvds_detect(
return connector_status_unknown;
 }
 
+static enum drm_connector_status ge_b850v3_lvds_detect(
+   struct drm_connector *connector, bool force)
+{
+   return ge_b850v3_lvds_bridge_detect(_b850v3_lvds_ptr->bridge);
+}
+
 static const struct drm_connector_funcs ge_b850v3_lvds_connector_funcs = {
.fill_modes = drm_helper_probe_single_connector_modes,
.detect = ge_b850v3_lvds_detect,
@@ -263,6 +269,7 @@ static int ge_b850v3_lvds_attach(struct drm_bridge *bridge,
 
 static const struct drm_bridge_funcs ge_b850v3_lvds_funcs = {
.attach = ge_b850v3_lvds_attach,
+   .detect = ge_b850v3_lvds_bridge_detect,
 };
 
 static int ge_b850v3_lvds_init(struct device *dev)
@@ -317,6 +324,7 @@ static int stdp4028_ge_b850v3_fw_probe(struct i2c_client 
*stdp4028_i2c,
 
/* drm bridge initialization */
ge_b850v3_lvds_ptr->bridge.funcs = _b850v3_lvds_funcs;
+   ge_b850v3_lvds_ptr->bridge.ops = DRM_BRIDGE_OP_DETECT;
ge_b850v3_lvds_ptr->bridge.of_node = dev->of_node;
drm_bridge_add(_b850v3_lvds_ptr->bridge);
 
-- 
2.20.1

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


[PATCH v2 20/21] drm/bridge: nxp-ptn3460: make connector creation optional

2020-04-27 Thread Sam Ravnborg
Make the connector creation optional to enable usage of the
nxp-ptn3460 bridge with the DRM bridge connector helper.

Signed-off-by: Sam Ravnborg 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 drivers/gpu/drm/bridge/nxp-ptn3460.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/bridge/nxp-ptn3460.c 
b/drivers/gpu/drm/bridge/nxp-ptn3460.c
index e253c185f94c..6a65657087f9 100644
--- a/drivers/gpu/drm/bridge/nxp-ptn3460.c
+++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c
@@ -229,10 +229,8 @@ static int ptn3460_bridge_attach(struct drm_bridge *bridge,
if (ret < 0)
return ret;
 
-   if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
-   DRM_ERROR("Fix bridge driver to make connector optional!");
-   return -EINVAL;
-   }
+   if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
+   return 0;
 
if (!bridge->encoder) {
DRM_ERROR("Parent encoder object not found");
-- 
2.20.1

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


[PATCH v2 07/21] drm/bridge: tc358767: add detect bridge operation

2020-04-27 Thread Sam Ravnborg
Prepare the bridge driver for chained operation by adding
support for the detect operation.

Signed-off-by: Sam Ravnborg 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 drivers/gpu/drm/bridge/tc358767.c | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/bridge/tc358767.c 
b/drivers/gpu/drm/bridge/tc358767.c
index 51f80ded6235..211a058c7243 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -1352,10 +1352,9 @@ static const struct drm_connector_helper_funcs 
tc_connector_helper_funcs = {
.get_modes = tc_connector_get_modes,
 };
 
-static enum drm_connector_status tc_connector_detect(struct drm_connector 
*connector,
-bool force)
+static enum drm_connector_status tc_bridge_detect(struct drm_bridge *bridge)
 {
-   struct tc_data *tc = connector_to_tc(connector);
+   struct tc_data *tc = bridge_to_tc(bridge);
bool conn;
u32 val;
int ret;
@@ -1379,6 +1378,14 @@ static enum drm_connector_status 
tc_connector_detect(struct drm_connector *conne
return connector_status_disconnected;
 }
 
+static enum drm_connector_status
+tc_connector_detect(struct drm_connector *connector, bool force)
+{
+   struct tc_data *tc = connector_to_tc(connector);
+
+   return tc_bridge_detect(>bridge);
+}
+
 static const struct drm_connector_funcs tc_connector_funcs = {
.detect = tc_connector_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
@@ -1443,6 +1450,7 @@ static const struct drm_bridge_funcs tc_bridge_funcs = {
.enable = tc_bridge_enable,
.disable = tc_bridge_disable,
.mode_fixup = tc_bridge_mode_fixup,
+   .detect = tc_bridge_detect,
 };
 
 static bool tc_readable_reg(struct device *dev, unsigned int reg)
@@ -1676,6 +1684,8 @@ static int tc_probe(struct i2c_client *client, const 
struct i2c_device_id *id)
return ret;
 
tc->bridge.funcs = _bridge_funcs;
+   tc->bridge.ops = DRM_BRIDGE_OP_DETECT;
+
tc->bridge.of_node = dev->of_node;
drm_bridge_add(>bridge);
 
-- 
2.20.1

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


[PATCH v2 09/21] drm/bridge: tc358767: make connector creation optional

2020-04-27 Thread Sam Ravnborg
Display drivers are in the new model expected to create
the connector using drm_bridge_connector_init().
Allow users of this bridge driver to support the new
model by introducing support for optional connector creation.

Signed-off-by: Sam Ravnborg 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 drivers/gpu/drm/bridge/tc358767.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/tc358767.c 
b/drivers/gpu/drm/bridge/tc358767.c
index 42a153bcde64..991e7d67b692 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -1420,8 +1420,7 @@ static int tc_bridge_attach(struct drm_bridge *bridge,
}
 
if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
-   DRM_ERROR("Fix bridge driver to make connector optional!");
-   return -EINVAL;
+   return 0;
}
 
/* Create DP/eDP connector */
-- 
2.20.1

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


[PATCH v2 16/21] drm/bridge: megachips: add get_edid bridge operation

2020-04-27 Thread Sam Ravnborg
To prepare for a chained bridge setup add support for the
get_edid bridge operation.

Signed-off-by: Sam Ravnborg 
Cc: Peter Senna Tschudin 
Cc: Martin Donnelly 
Cc: Martyn Welch 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 .../bridge/megachips-stdp-ge-b850v3-fw.c  | 26 +--
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c 
b/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c
index 78a9afe8f063..5f06e18f0a61 100644
--- a/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c
+++ b/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c
@@ -131,21 +131,29 @@ static u8 *stdp2690_get_edid(struct i2c_client *client)
return NULL;
 }
 
-static int ge_b850v3_lvds_get_modes(struct drm_connector *connector)
+static struct edid *ge_b850v3_lvds_get_edid(
+   struct drm_bridge *bridge, struct drm_connector *connector)
 {
struct i2c_client *client;
-   int num_modes = 0;
 
client = ge_b850v3_lvds_ptr->stdp2690_i2c;
 
kfree(ge_b850v3_lvds_ptr->edid);
ge_b850v3_lvds_ptr->edid = (struct edid *)stdp2690_get_edid(client);
 
-   if (ge_b850v3_lvds_ptr->edid) {
-   drm_connector_update_edid_property(connector,
- ge_b850v3_lvds_ptr->edid);
-   num_modes = drm_add_edid_modes(connector,
-  ge_b850v3_lvds_ptr->edid);
+   return ge_b850v3_lvds_ptr->edid;
+}
+
+static int ge_b850v3_lvds_get_modes(struct drm_connector *connector)
+{
+   struct edid *edid;
+   int num_modes = 0;
+
+   edid = ge_b850v3_lvds_get_edid(_b850v3_lvds_ptr->bridge, connector);
+
+   if (edid) {
+   drm_connector_update_edid_property(connector, edid);
+   num_modes = drm_add_edid_modes(connector, edid);
}
 
return num_modes;
@@ -270,6 +278,7 @@ static int ge_b850v3_lvds_attach(struct drm_bridge *bridge,
 static const struct drm_bridge_funcs ge_b850v3_lvds_funcs = {
.attach = ge_b850v3_lvds_attach,
.detect = ge_b850v3_lvds_bridge_detect,
+   .get_edid = ge_b850v3_lvds_get_edid,
 };
 
 static int ge_b850v3_lvds_init(struct device *dev)
@@ -324,7 +333,8 @@ static int stdp4028_ge_b850v3_fw_probe(struct i2c_client 
*stdp4028_i2c,
 
/* drm bridge initialization */
ge_b850v3_lvds_ptr->bridge.funcs = _b850v3_lvds_funcs;
-   ge_b850v3_lvds_ptr->bridge.ops = DRM_BRIDGE_OP_DETECT;
+   ge_b850v3_lvds_ptr->bridge.ops = DRM_BRIDGE_OP_DETECT |
+DRM_BRIDGE_OP_EDID;
ge_b850v3_lvds_ptr->bridge.of_node = dev->of_node;
drm_bridge_add(_b850v3_lvds_ptr->bridge);
 
-- 
2.20.1

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


[PATCH v2 14/21] drm/bridge: megachips: get drm_device from bridge

2020-04-27 Thread Sam Ravnborg
Fix so drm_device is read from the bridge.
This is a preparation for the connector being optional.

Signed-off-by: Sam Ravnborg 
Cc: Peter Senna Tschudin 
Cc: Martin Donnelly 
Cc: Martyn Welch 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c 
b/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c
index 258e0525cdcc..cf1dfbc88acf 100644
--- a/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c
+++ b/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c
@@ -226,8 +226,8 @@ static irqreturn_t ge_b850v3_lvds_irq_handler(int irq, void 
*dev_id)
  STDP4028_DPTX_IRQ_STS_REG,
  STDP4028_DPTX_IRQ_CLEAR);
 
-   if (ge_b850v3_lvds_ptr->connector.dev)
-   drm_kms_helper_hotplug_event(ge_b850v3_lvds_ptr->connector.dev);
+   if (ge_b850v3_lvds_ptr->bridge.dev)
+   drm_kms_helper_hotplug_event(ge_b850v3_lvds_ptr->bridge.dev);
 
return IRQ_HANDLED;
 }
-- 
2.20.1

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


[PATCH v2 10/21] drm/bridge: ti-tpd12s015: make connector creation optional

2020-04-27 Thread Sam Ravnborg
The ti-tpd12s015 do not create any connector, so ignore
the flags argument, just pass it on to the next bridge
in the chain.

Signed-off-by: Sam Ravnborg 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 drivers/gpu/drm/bridge/ti-tpd12s015.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/bridge/ti-tpd12s015.c 
b/drivers/gpu/drm/bridge/ti-tpd12s015.c
index 514cbf0eac75..4f1666422ab2 100644
--- a/drivers/gpu/drm/bridge/ti-tpd12s015.c
+++ b/drivers/gpu/drm/bridge/ti-tpd12s015.c
@@ -43,9 +43,6 @@ static int tpd12s015_attach(struct drm_bridge *bridge,
struct tpd12s015_device *tpd = to_tpd12s015(bridge);
int ret;
 
-   if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
-   return -EINVAL;
-
ret = drm_bridge_attach(bridge->encoder, tpd->next_bridge,
bridge, flags);
if (ret < 0)
-- 
2.20.1

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


[PATCH v2 13/21] drm/bridge: megachips: add helper to create connector

2020-04-27 Thread Sam Ravnborg
Factor out connector creation to a small helper function.

Signed-off-by: Sam Ravnborg 
Cc: Peter Senna Tschudin 
Cc: Martin Donnelly 
Cc: Martyn Welch 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 .../bridge/megachips-stdp-ge-b850v3-fw.c  | 47 +++
 1 file changed, 27 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c 
b/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c
index 6200f12a37e6..258e0525cdcc 100644
--- a/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c
+++ b/drivers/gpu/drm/bridge/megachips-stdp-ge-b850v3-fw.c
@@ -191,6 +191,32 @@ static const struct drm_connector_funcs 
ge_b850v3_lvds_connector_funcs = {
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
 };
 
+static int ge_b850v3_lvds_create_connector(struct drm_bridge *bridge)
+{
+   struct drm_connector *connector = _b850v3_lvds_ptr->connector;
+   int ret;
+
+   if (!bridge->encoder) {
+   DRM_ERROR("Parent encoder object not found");
+   return -ENODEV;
+   }
+
+   connector->polled = DRM_CONNECTOR_POLL_HPD;
+
+   drm_connector_helper_add(connector,
+_b850v3_lvds_connector_helper_funcs);
+
+   ret = drm_connector_init(bridge->dev, connector,
+_b850v3_lvds_connector_funcs,
+DRM_MODE_CONNECTOR_DisplayPort);
+   if (ret) {
+   DRM_ERROR("Failed to initialize connector with drm\n");
+   return ret;
+   }
+
+   return drm_connector_attach_encoder(connector, bridge->encoder);
+}
+
 static irqreturn_t ge_b850v3_lvds_irq_handler(int irq, void *dev_id)
 {
struct i2c_client *stdp4028_i2c
@@ -209,7 +235,6 @@ static irqreturn_t ge_b850v3_lvds_irq_handler(int irq, void 
*dev_id)
 static int ge_b850v3_lvds_attach(struct drm_bridge *bridge,
 enum drm_bridge_attach_flags flags)
 {
-   struct drm_connector *connector = _b850v3_lvds_ptr->connector;
struct i2c_client *stdp4028_i2c
= ge_b850v3_lvds_ptr->stdp4028_i2c;
int ret;
@@ -219,25 +244,7 @@ static int ge_b850v3_lvds_attach(struct drm_bridge *bridge,
return -EINVAL;
}
 
-   if (!bridge->encoder) {
-   DRM_ERROR("Parent encoder object not found");
-   return -ENODEV;
-   }
-
-   connector->polled = DRM_CONNECTOR_POLL_HPD;
-
-   drm_connector_helper_add(connector,
-_b850v3_lvds_connector_helper_funcs);
-
-   ret = drm_connector_init(bridge->dev, connector,
-_b850v3_lvds_connector_funcs,
-DRM_MODE_CONNECTOR_DisplayPort);
-   if (ret) {
-   DRM_ERROR("Failed to initialize connector with drm\n");
-   return ret;
-   }
-
-   ret = drm_connector_attach_encoder(connector, bridge->encoder);
+   ret = ge_b850v3_lvds_create_connector(bridge);
if (ret)
return ret;
 
-- 
2.20.1

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


[PATCH v8 03/10] drm: bridge: dw_mipi_dsi: add dsi v1.01 support

2020-04-27 Thread Adrian Ratiu
The Synopsis MIPI DSI v1.01 host controller is quite widely used
on platforms like i.mx6 and is not very different from the other
versions like the 1.31/1.30 used on rockchip/stm. The protocols
appear to be the same, only the register layout is different and
the newer versions have new features symbolized by new registers
so adding support for it is just a matter of defining the new
layout and adding a couple of dsi version checks.

Tested-by: Adrian Pop 
Tested-by: Arnaud Ferraris 
Signed-off-by: Adrian Ratiu 
---
Changes since v7:
  - Minor commit msg rewording for consistency

Changes since v5:
  - Fixed cfg_phy_status range from [0,0] to [0,2]

New in v5.
---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 125 +-
 1 file changed, 119 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c 
b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index f453df4eb5072..16fd87055e7b7 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -32,6 +32,7 @@
 
 #define HWVER_131  0x31333100  /* IP version 1.31 */
 #define HWVER_130  0x31333000  /* IP version 1.30 */
+#define HWVER_101  0x31303000  /* IP version 1.01 */
 
 #define DSI_VERSION0x00
 #define VERSIONGENMASK(31, 8)
@@ -100,6 +101,25 @@
 #define DSI_EDPI_CMD_SIZE  0x64
 
 #define DSI_CMD_MODE_CFG   0x68
+
+#define DSI_DPI_CFG0x0c
+#define DSI_TMR_LINE_CFG   0x28
+#define DSI_VTIMING_CFG0x2c
+#define DSI_PHY_TMR_CFG_V101   0x30
+#define DSI_PHY_IF_CFG_V1010x58
+#define DSI_PHY_IF_CTRL0x5c
+#define DSI_PHY_RSTZ_V101  0x54
+#define DSI_PHY_STATUS_V1010x60
+#define DSI_PHY_TST_CTRL0_V101 0x64
+#define DSI_GEN_HDR_V101   0x34
+#define DSI_GEN_PLD_DATA_V101  0x38
+#define DSI_CMD_MODE_CFG_V101  0x24
+#define DSI_CMD_PKT_STATUS_V1010x3c
+#define DSI_VID_PKT_CFG0x20
+#define DSI_VID_MODE_CFG_V101  0x1c
+#define DSI_TO_CNT_CFG_V1010x40
+#define DSI_PCKHDL_CFG_V1010x18
+
 #define MAX_RD_PKT_SIZE_LP BIT(24)
 #define DCS_LW_TX_LP   BIT(19)
 #define DCS_SR_0P_TX_LPBIT(18)
@@ -127,6 +147,33 @@
 GEN_SW_1P_TX_LP | \
 GEN_SW_0P_TX_LP)
 
+#define EN_TEAR_FX_V101BIT(14)
+#define DCS_LW_TX_LP_V101  BIT(12)
+#define GEN_LW_TX_LP_V101  BIT(11)
+#define MAX_RD_PKT_SIZE_LP_V101BIT(10)
+#define DCS_SW_2P_TX_LP_V101   BIT(9)
+#define DCS_SW_1P_TX_LP_V101   BIT(8)
+#define DCS_SW_0P_TX_LP_V101   BIT(7)
+#define GEN_SR_2P_TX_LP_V101   BIT(6)
+#define GEN_SR_1P_TX_LP_V101   BIT(5)
+#define GEN_SR_0P_TX_LP_V101   BIT(4)
+#define GEN_SW_2P_TX_LP_V101   BIT(3)
+#define GEN_SW_1P_TX_LP_V101   BIT(2)
+#define GEN_SW_0P_TX_LP_V101   BIT(1)
+
+#define CMD_MODE_ALL_LP_V101   (DCS_LW_TX_LP_V101 | \
+GEN_LW_TX_LP_V101 | \
+MAX_RD_PKT_SIZE_LP_V101 | \
+DCS_SW_2P_TX_LP_V101 | \
+DCS_SW_1P_TX_LP_V101 | \
+DCS_SW_0P_TX_LP_V101 | \
+GEN_SR_2P_TX_LP_V101 | \
+GEN_SR_1P_TX_LP_V101 | \
+GEN_SR_0P_TX_LP_V101 | \
+GEN_SW_2P_TX_LP_V101 | \
+GEN_SW_1P_TX_LP_V101 | \
+GEN_SW_0P_TX_LP_V101)
+
 #define DSI_GEN_HDR0x6c
 #define DSI_GEN_PLD_DATA   0x70
 
@@ -165,6 +212,11 @@
 #define DSI_INT_MSK0   0xc4
 #define DSI_INT_MSK1   0xc8
 
+#define DSI_ERROR_ST0_V101 0x44
+#define DSI_ERROR_ST1_V101 0x48
+#define DSI_ERROR_MSK0_V1010x4c
+#define DSI_ERROR_MSK1_V1010x50
+
 #define DSI_PHY_TMR_RD_CFG 0xf4
 
 #define PHY_STATUS_TIMEOUT_US  1
@@ -359,6 +411,49 @@ static const struct dw_mipi_dsi_variant 
dw_mipi_dsi_v130_v131_layout = {
.cfg_gen_payload =  REG_FIELD(DSI_GEN_PLD_DATA, 0, 31),
 };
 
+static const struct dw_mipi_dsi_variant dw_mipi_dsi_v101_layout = {
+   .cfg_dpi_vid =  REG_FIELD(DSI_DPI_CFG, 0, 1),
+   .cfg_dpi_color_coding = REG_FIELD(DSI_DPI_CFG, 2, 4),
+   .cfg_dpi_18loosely_en = REG_FIELD(DSI_DPI_CFG, 10, 10),
+   

[PATCH v8 06/10] ARM: dts: imx6qdl: add missing mipi dsi properties

2020-04-27 Thread Adrian Ratiu
Now that we have a proper driver for the imx6 mipi dsi host controller
we can fill in the missing properties to get it working.

Cc: Laurent Pinchart 
Cc: Rob Herring 
Cc: devicet...@vger.kernel.org
Signed-off-by: Adrian Ratiu 
---
New in v8.
---
 arch/arm/boot/dts/imx6qdl.dtsi | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index 98da446aa0f27..5f754c3cec052 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -1203,7 +1203,15 @@ mipi_csi: mipi@21dc000 {
};
 
mipi_dsi: mipi@21e {
+   compatible = "fsl,imx6-mipi-dsi", 
"snps,dw-mipi-dsi";
+   #address-cells = <1>;
+   #size-cells = <0>;
reg = <0x021e 0x4000>;
+   interrupts = <0 102 IRQ_TYPE_LEVEL_HIGH>;
+   fsl,gpr = <>;
+   clocks = < IMX6QDL_CLK_MIPI_CORE_CFG>,
+< IMX6QDL_CLK_MIPI_IPG>;
+   clock-names = "ref", "pclk";
status = "disabled";
 
ports {
-- 
2.26.0

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


[PATCH v8 05/10] drm: imx: Add i.MX 6 MIPI DSI host platform driver

2020-04-27 Thread Adrian Ratiu
This adds support for the Synopsis DesignWare MIPI DSI v1.01 host
controller which is embedded in i.MX 6 SoCs.

Based on following patches, but updated/extended to work with existing
support found in the kernel:

- drm: imx: Support Synopsys DesignWare MIPI DSI host controller
  Signed-off-by: Liu Ying 

Cc: Fabio Estevam 
Cc: Enric Balletbo Serra 
Reviewed-by: Emil Velikov 
Tested-by: Adrian Pop 
Tested-by: Arnaud Ferraris 
Signed-off-by: Sjoerd Simons 
Signed-off-by: Martyn Welch 
Signed-off-by: Adrian Ratiu 
---
Changes since v7:
  - Removed encoder helper ops and added drm_bridge (Laurent)
  - Brought back drm_simple_encoder_init and dropped dependency on
  external unify encoder creation patch (Laurent)
  - Minor typo fixes

Changes since v6:
  - Replaced custom noop encoder with the simple drm encoder (Enric)
  - Added CONFIG_DRM_IMX6_MIPI_DSI depends on CONFIG_OF (Enric)
  - Dropped imx_mipi_dsi_register() because now it only creates the
  dummy encoder which can easily be done directly in imx_dsi_bind()

Changes since v5:
  - Reword to remove unrelated device tree patch mention (Fabio)
  - Move pllref_clk enable/disable to bind/unbind (Ezequiel)
  - Fix freescale.com -> nxp.com email addresses (Fabio)
  - Also added myself as module author (Fabio)
  - Use DRM_DEV_* macros for consistency, print more error msg

Changes since v4:
  - Split off driver-specific configuration of phy timings due
  to new upstream API.
  - Move regmap infrastructure logic to separate commit (Ezequiel)
  - Move dsi v1.01 layout addition to a separate commit (Ezequiel)
  - Minor warnings and driver name fixes

Changes since v3:
  - Renamed platform driver to reflect it's i.MX6 only. (Fabio)

Changes since v2:
  - Fixed commit tags. (Emil)

Changes since v1:
  - Moved register definitions & regmap initialization into bridge
  module. Platform drivers get the regmap via plat_data after
  calling the bridge probe. (Emil)
---
 drivers/gpu/drm/imx/Kconfig|   8 +
 drivers/gpu/drm/imx/Makefile   |   1 +
 drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c | 399 +
 3 files changed, 408 insertions(+)
 create mode 100644 drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c

diff --git a/drivers/gpu/drm/imx/Kconfig b/drivers/gpu/drm/imx/Kconfig
index 207bf7409dfba..0dffc72df7922 100644
--- a/drivers/gpu/drm/imx/Kconfig
+++ b/drivers/gpu/drm/imx/Kconfig
@@ -39,3 +39,11 @@ config DRM_IMX_HDMI
depends on DRM_IMX
help
  Choose this if you want to use HDMI on i.MX6.
+
+config DRM_IMX6_MIPI_DSI
+   tristate "Freescale i.MX6 DRM MIPI DSI"
+   select DRM_DW_MIPI_DSI
+   depends on DRM_IMX
+   depends on OF
+   help
+ Choose this if you want to use MIPI DSI on i.MX6.
diff --git a/drivers/gpu/drm/imx/Makefile b/drivers/gpu/drm/imx/Makefile
index 21cdcc2faabc8..9a7843c593478 100644
--- a/drivers/gpu/drm/imx/Makefile
+++ b/drivers/gpu/drm/imx/Makefile
@@ -9,3 +9,4 @@ obj-$(CONFIG_DRM_IMX_TVE) += imx-tve.o
 obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o
 
 obj-$(CONFIG_DRM_IMX_HDMI) += dw_hdmi-imx.o
+obj-$(CONFIG_DRM_IMX6_MIPI_DSI) += dw_mipi_dsi-imx6.o
diff --git a/drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c 
b/drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c
new file mode 100644
index 0..492decc418bc3
--- /dev/null
+++ b/drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c
@@ -0,0 +1,399 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * i.MX6 drm driver - MIPI DSI Host Controller
+ *
+ * Copyright (C) 2011-2015 Freescale Semiconductor, Inc.
+ * Copyright (C) 2019-2020 Collabora, Ltd.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "imx-drm.h"
+
+#define DSI_PWR_UP 0x04
+#define RESET  0
+#define POWERUPBIT(0)
+
+#define DSI_PHY_IF_CTRL0x5c
+#define PHY_IF_CTRL_RESET  0x0
+
+#define DSI_PHY_TST_CTRL0  0x64
+#define PHY_TESTCLKBIT(1)
+#define PHY_UNTESTCLK  0
+#define PHY_TESTCLRBIT(0)
+#define PHY_UNTESTCLR  0
+
+#define DSI_PHY_TST_CTRL1  0x68
+#define PHY_TESTEN BIT(16)
+#define PHY_UNTESTEN   0
+#define PHY_TESTDOUT(n)(((n) & 0xff) << 8)
+#define PHY_TESTDIN(n) (((n) & 0xff) << 0)
+
+struct imx_mipi_dsi {
+   struct drm_encoder encoder;
+   struct drm_bridge bridge;
+   struct device *dev;
+   struct regmap *mux_sel;
+   struct dw_mipi_dsi *mipi_dsi;
+   struct clk *pllref_clk;
+
+   void __iomem *base;
+   unsigned int lane_mbps;
+};
+
+struct dphy_pll_testdin_map {
+   unsigned int max_mbps;
+   u8 testdin;
+};
+
+/* The table is based on 27MHz DPHY pll reference clock. */
+static const struct dphy_pll_testdin_map dptdin_map[] = {
+   {160, 

[PATCH v8 04/10] drm: bridge: dw_mipi_dsi: allow bridge daisy chaining

2020-04-27 Thread Adrian Ratiu
Up until now the assumption was that the synopsis dsi bridge will
directly connect to an encoder provided by the platform driver, but
the current practice for drivers is to leave the encoder empty via
the simple encoder API and add their logic to their own drm_bridge.

Thus we need an ablility to connect the DSI bridge to another bridge
provided by the platform driver, so we extend the dw_mipi_dsi bind()
API with a new "previous bridge" arg instead of just hardcoding NULL.

Cc: Laurent Pinchart 
Signed-off-by: Adrian Ratiu 
---
New in v8.
---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c   | 6 --
 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 2 +-
 include/drm/bridge/dw_mipi_dsi.h| 5 -
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c 
b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index 16fd87055e7b7..140ff40fa1b62 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -1456,11 +1456,13 @@ EXPORT_SYMBOL_GPL(dw_mipi_dsi_remove);
 /*
  * Bind/unbind API, used from platforms based on the component framework.
  */
-int dw_mipi_dsi_bind(struct dw_mipi_dsi *dsi, struct drm_encoder *encoder)
+int dw_mipi_dsi_bind(struct dw_mipi_dsi *dsi,
+struct drm_encoder *encoder,
+struct drm_bridge *prev_bridge)
 {
int ret;
 
-   ret = drm_bridge_attach(encoder, >bridge, NULL, 0);
+   ret = drm_bridge_attach(encoder, >bridge, prev_bridge, 0);
if (ret) {
DRM_ERROR("Failed to initialize bridge with drm\n");
return ret;
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c 
b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index 3feff0c45b3f7..83ef43be78135 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -929,7 +929,7 @@ static int dw_mipi_dsi_rockchip_bind(struct device *dev,
return ret;
}
 
-   ret = dw_mipi_dsi_bind(dsi->dmd, >encoder);
+   ret = dw_mipi_dsi_bind(dsi->dmd, >encoder, NULL);
if (ret) {
DRM_DEV_ERROR(dev, "Failed to bind: %d\n", ret);
return ret;
diff --git a/include/drm/bridge/dw_mipi_dsi.h b/include/drm/bridge/dw_mipi_dsi.h
index b0e390b3288e8..699b3531f5b36 100644
--- a/include/drm/bridge/dw_mipi_dsi.h
+++ b/include/drm/bridge/dw_mipi_dsi.h
@@ -14,6 +14,7 @@
 #include 
 
 struct drm_display_mode;
+struct drm_bridge;
 struct drm_encoder;
 struct dw_mipi_dsi;
 struct mipi_dsi_device;
@@ -62,7 +63,9 @@ struct dw_mipi_dsi *dw_mipi_dsi_probe(struct platform_device 
*pdev,
  const struct dw_mipi_dsi_plat_data
  *plat_data);
 void dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi);
-int dw_mipi_dsi_bind(struct dw_mipi_dsi *dsi, struct drm_encoder *encoder);
+int dw_mipi_dsi_bind(struct dw_mipi_dsi *dsi,
+struct drm_encoder *encoder,
+struct drm_bridge *prev_bridge);
 void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi);
 void dw_mipi_dsi_set_slave(struct dw_mipi_dsi *dsi, struct dw_mipi_dsi *slave);
 
-- 
2.26.0

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


[PATCH v2 12/21] drm/bridge: parade-ps8622: make connector creation optional

2020-04-27 Thread Sam Ravnborg
Make the connector creation optional to enable usage of the
parade-ps8622 bridge with the DRM bridge connector helper.

This change moves drm_helper_hpd_irq_event() call in the attach
function up before the connector creation.

Signed-off-by: Sam Ravnborg 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 drivers/gpu/drm/bridge/parade-ps8622.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c 
b/drivers/gpu/drm/bridge/parade-ps8622.c
index 6ab6f60b9091..54aa5270d2c9 100644
--- a/drivers/gpu/drm/bridge/parade-ps8622.c
+++ b/drivers/gpu/drm/bridge/parade-ps8622.c
@@ -459,10 +459,8 @@ static int ps8622_attach(struct drm_bridge *bridge,
ret = drm_bridge_attach(ps8622->bridge.encoder, ps8622->panel_bridge,
>bridge, flags);
 
-   if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
-   DRM_ERROR("Fix bridge driver to make connector optional!");
-   return -EINVAL;
-   }
+   if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
+   return 0;
 
if (!bridge->encoder) {
DRM_ERROR("Parent encoder object not found");
@@ -482,7 +480,7 @@ static int ps8622_attach(struct drm_bridge *bridge,
drm_connector_attach_encoder(>connector,
bridge->encoder);
 
-   drm_helper_hpd_irq_event(ps8622->connector.dev);
+   drm_helper_hpd_irq_event(ps8622->bridge.dev);
 
return ret;
 }
-- 
2.20.1

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


[PATCH v2 19/21] drm/bridge: nxp-ptn3460: add get_modes bridge operation

2020-04-27 Thread Sam Ravnborg
Add the get_modes() bridge operation to prepare for
use as a chained bridge.
Add helper function that is also used by the connector.

Signed-off-by: Sam Ravnborg 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 drivers/gpu/drm/bridge/nxp-ptn3460.c | 52 ++--
 1 file changed, 33 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/bridge/nxp-ptn3460.c 
b/drivers/gpu/drm/bridge/nxp-ptn3460.c
index 0bd9f0e451b3..e253c185f94c 100644
--- a/drivers/gpu/drm/bridge/nxp-ptn3460.c
+++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c
@@ -154,17 +154,13 @@ static void ptn3460_disable(struct drm_bridge *bridge)
gpiod_set_value(ptn_bridge->gpio_pd_n, 0);
 }
 
-static int ptn3460_get_modes(struct drm_connector *connector)
+static struct edid *ptn3460_get_edid(struct drm_bridge *bridge,
+struct drm_connector *connector)
 {
-   struct ptn3460_bridge *ptn_bridge;
-   u8 *edid;
-   int ret, num_modes = 0;
+   struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
bool power_off;
-
-   ptn_bridge = connector_to_ptn3460(connector);
-
-   if (ptn_bridge->edid)
-   return drm_add_edid_modes(connector, ptn_bridge->edid);
+   u8 *edid;
+   int ret;
 
power_off = !ptn_bridge->enabled;
ptn3460_pre_enable(_bridge->bridge);
@@ -172,30 +168,46 @@ static int ptn3460_get_modes(struct drm_connector 
*connector)
edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
if (!edid) {
DRM_ERROR("Failed to allocate EDID\n");
-   return 0;
+   return NULL;
}
 
ret = ptn3460_read_bytes(ptn_bridge, PTN3460_EDID_ADDR, edid,
-   EDID_LENGTH);
+EDID_LENGTH);
if (ret) {
kfree(edid);
-   goto out;
+   return NULL;
}
 
+   if (power_off)
+   ptn3460_disable(_bridge->bridge);
+
+   kfree(ptn_bridge->edid);
ptn_bridge->edid = (struct edid *)edid;
-   drm_connector_update_edid_property(connector, ptn_bridge->edid);
 
-   num_modes = drm_add_edid_modes(connector, ptn_bridge->edid);
+   return ptn_bridge->edid;
+}
 
-out:
-   if (power_off)
-   ptn3460_disable(_bridge->bridge);
+static int ptn3460_connector_get_modes(struct drm_connector *connector)
+{
+   struct ptn3460_bridge *ptn_bridge;
+   struct edid *edid;
+
+   ptn_bridge = connector_to_ptn3460(connector);
+
+   if (ptn_bridge->edid)
+   return drm_add_edid_modes(connector, ptn_bridge->edid);
+
+   edid = ptn3460_get_edid(_bridge->bridge, connector);
+   if (!edid)
+   return 0;
+
+   drm_connector_update_edid_property(connector, edid);
 
-   return num_modes;
+   return drm_add_edid_modes(connector, edid);
 }
 
 static const struct drm_connector_helper_funcs ptn3460_connector_helper_funcs 
= {
-   .get_modes = ptn3460_get_modes,
+   .get_modes = ptn3460_connector_get_modes,
 };
 
 static const struct drm_connector_funcs ptn3460_connector_funcs = {
@@ -249,6 +261,7 @@ static const struct drm_bridge_funcs ptn3460_bridge_funcs = 
{
.pre_enable = ptn3460_pre_enable,
.disable = ptn3460_disable,
.attach = ptn3460_bridge_attach,
+   .get_edid = ptn3460_get_edid,
 };
 
 static int ptn3460_probe(struct i2c_client *client,
@@ -304,6 +317,7 @@ static int ptn3460_probe(struct i2c_client *client,
}
 
ptn_bridge->bridge.funcs = _bridge_funcs;
+   ptn_bridge->bridge.ops = DRM_BRIDGE_OP_EDID;
ptn_bridge->bridge.of_node = dev->of_node;
drm_bridge_add(_bridge->bridge);
 
-- 
2.20.1

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


[PATCH v2 05/21] drm/bridge: tc358764: make connector creation optional

2020-04-27 Thread Sam Ravnborg
Make the connector creation optional to enable usage of the
tc358764 bridge with the DRM bridge connector helper.

Signed-off-by: Sam Ravnborg 
Reviewed-by: Laurent Pinchart 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 drivers/gpu/drm/bridge/tc358764.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/bridge/tc358764.c 
b/drivers/gpu/drm/bridge/tc358764.c
index 3adb2c191499..4013add64119 100644
--- a/drivers/gpu/drm/bridge/tc358764.c
+++ b/drivers/gpu/drm/bridge/tc358764.c
@@ -337,10 +337,8 @@ static int tc358764_attach(struct drm_bridge *bridge,
if (ret < 0)
return ret;
 
-   if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
-   DRM_ERROR("Fix bridge driver to make connector optional!");
-   return -EINVAL;
-   }
+   if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
+   return 0;
 
ctx->connector.polled = DRM_CONNECTOR_POLL_HPD;
ret = drm_connector_init(drm, >connector,
-- 
2.20.1

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


[PATCH v8 07/10] dt-bindings: display: add i.MX6 MIPI DSI host controller doc

2020-04-27 Thread Adrian Ratiu
This provides an example DT binding for the MIPI DSI host controller
present on the i.MX6 SoC based on Synopsis DesignWare v1.01 IP.

Cc: Rob Herring 
Cc: Neil Armstrong 
Cc: Fabio Estevam 
Cc: Laurent Pinchart 
Cc: devicet...@vger.kernel.org
Tested-by: Adrian Pop 
Tested-by: Arnaud Ferraris 
Signed-off-by: Sjoerd Simons 
Signed-off-by: Martyn Welch 
Signed-off-by: Adrian Ratiu 
---
Changes since v7:
  - Clarified port@0,1 descriptions, marked them as required and
  added missing port@0 in example (Laurent)

Changes since v6:
  - Added ref to the newly created snps,dw-mipi-dsi.yaml (Laurent)
  - Moved *-cells properties outside patternProperties (Laurent)
  - Removed the panel port documentation (Laurent)
  - Wrapped lines at 80 chars, typo fixes, sort includes (Laurent)

Changes since v5:
  - Fixed missing reg warning (Fabio)
  - Updated dt-schema and fixed warnings (Rob)

Changes since v4:
  - Fixed yaml binding to pass `make dt_binding_check dtbs_check`
  and addressed received binding feedback (Rob)

Changes since v3:
  - Added commit message (Neil)
  - Converted to yaml format (Neil)
  - Minor dt node + driver fixes (Rob)
  - Added small panel example to the host controller binding

Changes since v2:
  - Fixed commit tags (Emil)
---
 .../display/imx/fsl,mipi-dsi-imx6.yaml| 145 ++
 1 file changed, 145 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/imx/fsl,mipi-dsi-imx6.yaml

diff --git 
a/Documentation/devicetree/bindings/display/imx/fsl,mipi-dsi-imx6.yaml 
b/Documentation/devicetree/bindings/display/imx/fsl,mipi-dsi-imx6.yaml
new file mode 100644
index 0..c2c3489e63fa3
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/imx/fsl,mipi-dsi-imx6.yaml
@@ -0,0 +1,145 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/imx/fsl,mipi-dsi-imx6.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX6 DW MIPI DSI Host Controller
+
+maintainers:
+  - Adrian Ratiu 
+
+description: |
+  The i.MX6 DSI host controller is a Synopsys DesignWare MIPI DSI v1.01
+  IP block with a companion PHY IP.
+
+  These DT bindings follow the Synopsys DW MIPI DSI bindings defined in
+  Documentation/devicetree/bindings/display/bridge/dw_mipi_dsi.txt with
+  the following device-specific properties.
+
+allOf:
+  - $ref: ../bridge/snps,dw-mipi-dsi.yaml#
+
+properties:
+  '#address-cells':
+const: 1
+
+  '#size-cells':
+const: 0
+
+  compatible:
+items:
+  - const: fsl,imx6q-mipi-dsi
+  - const: snps,dw-mipi-dsi
+
+  reg:
+maxItems: 1
+
+  interrupts:
+maxItems: 1
+
+  clocks:
+items:
+  - description: Module Clock
+  - description: DSI bus clock
+
+  clock-names:
+items:
+  - const: ref
+  - const: pclk
+
+  fsl,gpr:
+description:
+  Phandle to the iomuxc-gpr region containing the multiplexer ctrl 
register.
+$ref: /schemas/types.yaml#/definitions/phandle
+
+  ports:
+type: object
+description: |
+  A node containing DSI input & output port nodes with endpoint
+  definitions as documented in
+  Documentation/devicetree/bindings/media/video-interfaces.txt
+  Documentation/devicetree/bindings/graph.txt
+properties:
+  port@0:
+type: object
+description:
+  DSI input port connected to a parallel RGB LTDC output port.
+
+  port@1:
+type: object
+description:
+  DSI serial RGB output port connected to a panel or bridge input port.
+
+required:
+  - port@0
+  - port@1
+
+additionalProperties: false
+
+patternProperties:
+  "^panel@[0-3]$":
+type: object
+
+required:
+  - "#address-cells"
+  - "#size-cells"
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - ports
+
+examples:
+  - |+
+#include 
+#include 
+#include 
+
+dsi: dsi@21e {
+#address-cells = <1>;
+#size-cells = <0>;
+compatible = "fsl,imx6q-mipi-dsi", "snps,dw-mipi-dsi";
+reg = <0x021e 0x4000>;
+interrupts = <0 102 IRQ_TYPE_LEVEL_HIGH>;
+fsl,gpr = <>;
+clocks = < IMX6QDL_CLK_MIPI_CORE_CFG>,
+ < IMX6QDL_CLK_MIPI_IPG>;
+clock-names = "ref", "pclk";
+
+ports {
+#address-cells = <1>;
+#size-cells = <0>;
+port@0 {
+reg = <0>;
+mipi_mux_0: endpoint {
+remote-endpoint = <_di0_mipi>;
+};
+};
+port@1 {
+reg = <1>;
+dsi_out: endpoint {
+remote-endpoint = <_in>;
+};
+};
+};
+
+panel@0 {
+compatible = "sharp,ls032b3sx01";
+reg = <0>;
+reset-gpios = < 8 GPIO_ACTIVE_LOW>;
+ports {
+#address-cells = <1>;
+#size-cells = <0>;
+  

[PATCH v2 11/21] drm/bridge: parade-ps8622: add drm_panel_bridge support

2020-04-27 Thread Sam Ravnborg
Prepare the bridge driver for use in a chained setup by
replacing direct use of drm_panel with drm_panel_bridge support.

Note: the bridge panel will use the connector type from the panel.

Signed-off-by: Sam Ravnborg 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 drivers/gpu/drm/bridge/parade-ps8622.c | 46 --
 1 file changed, 13 insertions(+), 33 deletions(-)

diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c 
b/drivers/gpu/drm/bridge/parade-ps8622.c
index d789ea2a7fb9..6ab6f60b9091 100644
--- a/drivers/gpu/drm/bridge/parade-ps8622.c
+++ b/drivers/gpu/drm/bridge/parade-ps8622.c
@@ -45,7 +45,7 @@ struct ps8622_bridge {
struct drm_connector connector;
struct i2c_client *client;
struct drm_bridge bridge;
-   struct drm_panel *panel;
+   struct drm_bridge *panel_bridge;
struct regulator *v12;
struct backlight_device *bl;
 
@@ -365,11 +365,6 @@ static void ps8622_pre_enable(struct drm_bridge *bridge)
DRM_ERROR("fails to enable ps8622->v12");
}
 
-   if (drm_panel_prepare(ps8622->panel)) {
-   DRM_ERROR("failed to prepare panel\n");
-   return;
-   }
-
gpiod_set_value(ps8622->gpio_slp, 1);
 
/*
@@ -399,24 +394,8 @@ static void ps8622_pre_enable(struct drm_bridge *bridge)
ps8622->enabled = true;
 }
 
-static void ps8622_enable(struct drm_bridge *bridge)
-{
-   struct ps8622_bridge *ps8622 = bridge_to_ps8622(bridge);
-
-   if (drm_panel_enable(ps8622->panel)) {
-   DRM_ERROR("failed to enable panel\n");
-   return;
-   }
-}
-
 static void ps8622_disable(struct drm_bridge *bridge)
 {
-   struct ps8622_bridge *ps8622 = bridge_to_ps8622(bridge);
-
-   if (drm_panel_disable(ps8622->panel)) {
-   DRM_ERROR("failed to disable panel\n");
-   return;
-   }
msleep(PS8622_PWMO_END_T12_MS);
 }
 
@@ -436,11 +415,6 @@ static void ps8622_post_disable(struct drm_bridge *bridge)
 */
gpiod_set_value(ps8622->gpio_slp, 0);
 
-   if (drm_panel_unprepare(ps8622->panel)) {
-   DRM_ERROR("failed to unprepare panel\n");
-   return;
-   }
-
if (ps8622->v12)
regulator_disable(ps8622->v12);
 
@@ -461,7 +435,7 @@ static int ps8622_get_modes(struct drm_connector *connector)
 
ps8622 = connector_to_ps8622(connector);
 
-   return drm_panel_get_modes(ps8622->panel, connector);
+   return drm_bridge_get_modes(ps8622->panel_bridge, connector);
 }
 
 static const struct drm_connector_helper_funcs ps8622_connector_helper_funcs = 
{
@@ -482,6 +456,9 @@ static int ps8622_attach(struct drm_bridge *bridge,
struct ps8622_bridge *ps8622 = bridge_to_ps8622(bridge);
int ret;
 
+   ret = drm_bridge_attach(ps8622->bridge.encoder, ps8622->panel_bridge,
+   >bridge, flags);
+
if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
DRM_ERROR("Fix bridge driver to make connector optional!");
return -EINVAL;
@@ -505,9 +482,6 @@ static int ps8622_attach(struct drm_bridge *bridge,
drm_connector_attach_encoder(>connector,
bridge->encoder);
 
-   if (ps8622->panel)
-   drm_panel_attach(ps8622->panel, >connector);
-
drm_helper_hpd_irq_event(ps8622->connector.dev);
 
return ret;
@@ -515,7 +489,6 @@ static int ps8622_attach(struct drm_bridge *bridge,
 
 static const struct drm_bridge_funcs ps8622_bridge_funcs = {
.pre_enable = ps8622_pre_enable,
-   .enable = ps8622_enable,
.disable = ps8622_disable,
.post_disable = ps8622_post_disable,
.attach = ps8622_attach,
@@ -533,16 +506,23 @@ static int ps8622_probe(struct i2c_client *client,
 {
struct device *dev = >dev;
struct ps8622_bridge *ps8622;
+   struct drm_bridge *pbridge;
+   struct drm_panel *panel;
int ret;
 
ps8622 = devm_kzalloc(dev, sizeof(*ps8622), GFP_KERNEL);
if (!ps8622)
return -ENOMEM;
 
-   ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, >panel, 
NULL);
+   ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, , NULL);
if (ret)
return ret;
 
+   pbridge = devm_drm_panel_bridge_add(dev, panel);
+   if (IS_ERR(pbridge))
+   return PTR_ERR(pbridge);
+
+   ps8622->panel_bridge = pbridge;
ps8622->client = client;
 
ps8622->v12 = devm_regulator_get(dev, "vdd12");
-- 
2.20.1

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


[PATCH v2 04/21] drm/bridge: tc358764: add drm_panel_bridge support

2020-04-27 Thread Sam Ravnborg
Prepare the bridge driver for use in a chained setup by
replacing direct use of drm_panel with drm_panel_bridge support.

The bridge panel will use the connector type reported by the panel,
where the connector for this driver hardcode DRM_MODE_CONNECTOR_LVDS.

Signed-off-by: Sam Ravnborg 
Reviewed-by: Laurent Pinchart 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 drivers/gpu/drm/bridge/tc358764.c | 59 +--
 1 file changed, 16 insertions(+), 43 deletions(-)

diff --git a/drivers/gpu/drm/bridge/tc358764.c 
b/drivers/gpu/drm/bridge/tc358764.c
index a277739fab58..3adb2c191499 100644
--- a/drivers/gpu/drm/bridge/tc358764.c
+++ b/drivers/gpu/drm/bridge/tc358764.c
@@ -156,7 +156,7 @@ struct tc358764 {
struct drm_connector connector;
struct regulator_bulk_data supplies[ARRAY_SIZE(tc358764_supplies)];
struct gpio_desc *gpio_reset;
-   struct drm_panel *panel;
+   struct drm_bridge *panel_bridge;
int error;
 };
 
@@ -282,7 +282,7 @@ static int tc358764_get_modes(struct drm_connector 
*connector)
 {
struct tc358764 *ctx = connector_to_tc358764(connector);
 
-   return drm_panel_get_modes(ctx->panel, connector);
+   return drm_bridge_get_modes(ctx->panel_bridge, connector);
 }
 
 static const
@@ -298,23 +298,11 @@ static const struct drm_connector_funcs 
tc358764_connector_funcs = {
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
 };
 
-static void tc358764_disable(struct drm_bridge *bridge)
-{
-   struct tc358764 *ctx = bridge_to_tc358764(bridge);
-   int ret = drm_panel_disable(bridge_to_tc358764(bridge)->panel);
-
-   if (ret < 0)
-   dev_err(ctx->dev, "error disabling panel (%d)\n", ret);
-}
-
 static void tc358764_post_disable(struct drm_bridge *bridge)
 {
struct tc358764 *ctx = bridge_to_tc358764(bridge);
int ret;
 
-   ret = drm_panel_unprepare(ctx->panel);
-   if (ret < 0)
-   dev_err(ctx->dev, "error unpreparing panel (%d)\n", ret);
tc358764_reset(ctx);
usleep_range(1, 15000);
ret = regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
@@ -335,18 +323,6 @@ static void tc358764_pre_enable(struct drm_bridge *bridge)
ret = tc358764_init(ctx);
if (ret < 0)
dev_err(ctx->dev, "error initializing bridge (%d)\n", ret);
-   ret = drm_panel_prepare(ctx->panel);
-   if (ret < 0)
-   dev_err(ctx->dev, "error preparing panel (%d)\n", ret);
-}
-
-static void tc358764_enable(struct drm_bridge *bridge)
-{
-   struct tc358764 *ctx = bridge_to_tc358764(bridge);
-   int ret = drm_panel_enable(ctx->panel);
-
-   if (ret < 0)
-   dev_err(ctx->dev, "error enabling panel (%d)\n", ret);
 }
 
 static int tc358764_attach(struct drm_bridge *bridge,
@@ -356,6 +332,11 @@ static int tc358764_attach(struct drm_bridge *bridge,
struct drm_device *drm = bridge->dev;
int ret;
 
+   ret = drm_bridge_attach(bridge->encoder, ctx->panel_bridge,
+   bridge, flags);
+   if (ret < 0)
+   return ret;
+
if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
DRM_ERROR("Fix bridge driver to make connector optional!");
return -EINVAL;
@@ -373,32 +354,21 @@ static int tc358764_attach(struct drm_bridge *bridge,
drm_connector_helper_add(>connector,
 _connector_helper_funcs);
drm_connector_attach_encoder(>connector, bridge->encoder);
-   drm_panel_attach(ctx->panel, >connector);
ctx->connector.funcs->reset(>connector);
 
return 0;
 }
 
-static void tc358764_detach(struct drm_bridge *bridge)
-{
-   struct tc358764 *ctx = bridge_to_tc358764(bridge);
-
-   drm_panel_detach(ctx->panel);
-   ctx->panel = NULL;
-}
-
 static const struct drm_bridge_funcs tc358764_bridge_funcs = {
-   .disable = tc358764_disable,
.post_disable = tc358764_post_disable,
-   .enable = tc358764_enable,
.pre_enable = tc358764_pre_enable,
.attach = tc358764_attach,
-   .detach = tc358764_detach,
 };
 
 static int tc358764_parse_dt(struct tc358764 *ctx)
 {
struct device *dev = ctx->dev;
+   struct drm_panel *panel;
int ret;
 
ctx->gpio_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
@@ -407,12 +377,15 @@ static int tc358764_parse_dt(struct tc358764 *ctx)
return PTR_ERR(ctx->gpio_reset);
}
 
-   ret = drm_of_find_panel_or_bridge(ctx->dev->of_node, 1, 0, >panel,
- NULL);
-   if (ret && ret != -EPROBE_DEFER)
-   dev_err(dev, "cannot find panel (%d)\n", ret);
+   ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, , NULL);
+   if (ret)
+   return ret;
 
-   return ret;
+   ctx->panel_bridge = 

[PATCH v8 10/10] drm: bridge: dw-mipi-dsi: fix bad register field offsets

2020-04-27 Thread Adrian Ratiu
According to the DSI Host Registers sections available in the IMX,
STM and RK ref manuals for 1.01, 1.30 and 1.31, the register fields
are smaller or bigger than what's coded in the driver, leading to
r/w in reserved spaces which might cause undefined behaviours.

Tested-by: Adrian Pop 
Tested-by: Arnaud Ferraris 
Signed-off-by: Adrian Ratiu 
---
New in v6.
---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 46 +--
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c 
b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index 0903ec37289dd..bf22b04761fdf 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -316,7 +316,7 @@ struct dw_mipi_dsi_variant {
 static const struct dw_mipi_dsi_variant dw_mipi_dsi_v130_v131_layout = {
.cfg_dpi_color_coding = REG_FIELD(DSI_DPI_COLOR_CODING, 0, 3),
.cfg_dpi_18loosely_en = REG_FIELD(DSI_DPI_COLOR_CODING, 8, 8),
-   .cfg_dpi_vid =  REG_FIELD(DSI_DPI_VCID, 0, 2),
+   .cfg_dpi_vid =  REG_FIELD(DSI_DPI_VCID, 0, 1),
.cfg_dpi_vsync_active_low = REG_FIELD(DSI_DPI_CFG_POL, 1, 1),
.cfg_dpi_hsync_active_low = REG_FIELD(DSI_DPI_CFG_POL, 2, 2),
.cfg_cmd_mode_ack_rqst_en = REG_FIELD(DSI_CMD_MODE_CFG, 1, 1),
@@ -325,29 +325,29 @@ static const struct dw_mipi_dsi_variant 
dw_mipi_dsi_v130_v131_layout = {
.cfg_cmd_mode_dcs_sw_sr_en =REG_FIELD(DSI_CMD_MODE_CFG, 16, 18),
.cfg_cmd_mode_dcs_lw_en =   REG_FIELD(DSI_CMD_MODE_CFG, 19, 19),
.cfg_cmd_mode_max_rd_pkt_size = REG_FIELD(DSI_CMD_MODE_CFG, 24, 24),
-   .cfg_cmd_mode_en =  REG_FIELD(DSI_MODE_CFG, 0, 31),
-   .cfg_cmd_pkt_status =   REG_FIELD(DSI_CMD_PKT_STATUS, 0, 31),
-   .cfg_vid_mode_en =  REG_FIELD(DSI_MODE_CFG, 0, 31),
+   .cfg_cmd_mode_en =  REG_FIELD(DSI_MODE_CFG, 0, 0),
+   .cfg_cmd_pkt_status =   REG_FIELD(DSI_CMD_PKT_STATUS, 0, 6),
+   .cfg_vid_mode_en =  REG_FIELD(DSI_MODE_CFG, 0, 0),
.cfg_vid_mode_type =REG_FIELD(DSI_VID_MODE_CFG, 0, 1),
.cfg_vid_mode_low_power =   REG_FIELD(DSI_VID_MODE_CFG, 8, 13),
.cfg_vid_mode_vpg_en =  REG_FIELD(DSI_VID_MODE_CFG, 16, 16),
.cfg_vid_mode_vpg_horiz =   REG_FIELD(DSI_VID_MODE_CFG, 24, 24),
-   .cfg_vid_pkt_size = REG_FIELD(DSI_VID_PKT_SIZE, 0, 10),
-   .cfg_vid_hsa_time = REG_FIELD(DSI_VID_HSA_TIME, 0, 31),
-   .cfg_vid_hbp_time = REG_FIELD(DSI_VID_HBP_TIME, 0, 31),
-   .cfg_vid_hline_time =   REG_FIELD(DSI_VID_HLINE_TIME, 0, 31),
-   .cfg_vid_vsa_time = REG_FIELD(DSI_VID_VSA_LINES, 0, 31),
-   .cfg_vid_vbp_time = REG_FIELD(DSI_VID_VBP_LINES, 0, 31),
-   .cfg_vid_vfp_time = REG_FIELD(DSI_VID_VFP_LINES, 0, 31),
-   .cfg_vid_vactive_time = REG_FIELD(DSI_VID_VACTIVE_LINES, 0, 31),
+   .cfg_vid_pkt_size = REG_FIELD(DSI_VID_PKT_SIZE, 0, 13),
+   .cfg_vid_hsa_time = REG_FIELD(DSI_VID_HSA_TIME, 0, 11),
+   .cfg_vid_hbp_time = REG_FIELD(DSI_VID_HBP_TIME, 0, 11),
+   .cfg_vid_hline_time =   REG_FIELD(DSI_VID_HLINE_TIME, 0, 14),
+   .cfg_vid_vsa_time = REG_FIELD(DSI_VID_VSA_LINES, 0, 9),
+   .cfg_vid_vbp_time = REG_FIELD(DSI_VID_VBP_LINES, 0, 9),
+   .cfg_vid_vfp_time = REG_FIELD(DSI_VID_VFP_LINES, 0, 9),
+   .cfg_vid_vactive_time = REG_FIELD(DSI_VID_VACTIVE_LINES, 0, 13),
.cfg_phy_txrequestclkhs =   REG_FIELD(DSI_LPCLK_CTRL, 0, 0),
-   .cfg_phy_bta_time = REG_FIELD(DSI_BTA_TO_CNT, 0, 31),
-   .cfg_phy_max_rd_time =  REG_FIELD(DSI_PHY_TMR_CFG, 0, 15),
+   .cfg_phy_bta_time = REG_FIELD(DSI_BTA_TO_CNT, 0, 15),
+   .cfg_phy_max_rd_time =  REG_FIELD(DSI_PHY_TMR_CFG, 0, 14),
.cfg_phy_lp2hs_time =   REG_FIELD(DSI_PHY_TMR_CFG, 16, 23),
.cfg_phy_hs2lp_time =   REG_FIELD(DSI_PHY_TMR_CFG, 24, 31),
-   .cfg_phy_max_rd_time_v131 = REG_FIELD(DSI_PHY_TMR_RD_CFG, 0, 15),
-   .cfg_phy_lp2hs_time_v131 =  REG_FIELD(DSI_PHY_TMR_CFG, 0, 15),
-   .cfg_phy_hs2lp_time_v131 =  REG_FIELD(DSI_PHY_TMR_CFG, 16, 31),
+   .cfg_phy_max_rd_time_v131 = REG_FIELD(DSI_PHY_TMR_RD_CFG, 0, 14),
+   .cfg_phy_lp2hs_time_v131 =  REG_FIELD(DSI_PHY_TMR_CFG, 0, 9),
+   .cfg_phy_hs2lp_time_v131 =  REG_FIELD(DSI_PHY_TMR_CFG, 16, 25),
.cfg_phy_clklp2hs_time =REG_FIELD(DSI_PHY_TMR_LPCLK_CFG, 0, 15),
.cfg_phy_clkhs2lp_time =REG_FIELD(DSI_PHY_TMR_LPCLK_CFG, 16, 
31),
.cfg_phy_testclr =  REG_FIELD(DSI_PHY_TST_CTRL0, 0, 0),
@@ -361,11 +361,11 @@ static const struct dw_mipi_dsi_variant 

[PATCH v2 06/21] drm/bridge: tc358767: add drm_panel_bridge support

2020-04-27 Thread Sam Ravnborg
Prepare the bridge driver for use in a chained setup by
replacing direct use of drm_panel with drm_panel_bridge support.

The bridge driver assume the panel is optional.
The relevant tests are migrated over to check for the
pnale bridge to keep the same functionality.

Note: the bridge panel will use the connector type from the panel.

Signed-off-by: Sam Ravnborg 
Cc: Andrzej Hajda 
Cc: Neil Armstrong 
Cc: Laurent Pinchart 
Cc: Jonas Karlman 
Cc: Jernej Skrabec 
---
 drivers/gpu/drm/bridge/tc358767.c | 57 +++
 1 file changed, 27 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/bridge/tc358767.c 
b/drivers/gpu/drm/bridge/tc358767.c
index e4c0ea03ae3a..51f80ded6235 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -244,8 +244,8 @@ struct tc_data {
struct drm_dp_aux   aux;
 
struct drm_bridge   bridge;
+   struct drm_bridge   *panel_bridge;
struct drm_connectorconnector;
-   struct drm_panel*panel;
 
/* link settings */
struct tc_edp_link  link;
@@ -1236,13 +1236,6 @@ static int tc_stream_disable(struct tc_data *tc)
return 0;
 }
 
-static void tc_bridge_pre_enable(struct drm_bridge *bridge)
-{
-   struct tc_data *tc = bridge_to_tc(bridge);
-
-   drm_panel_prepare(tc->panel);
-}
-
 static void tc_bridge_enable(struct drm_bridge *bridge)
 {
struct tc_data *tc = bridge_to_tc(bridge);
@@ -1266,8 +1259,6 @@ static void tc_bridge_enable(struct drm_bridge *bridge)
tc_main_link_disable(tc);
return;
}
-
-   drm_panel_enable(tc->panel);
 }
 
 static void tc_bridge_disable(struct drm_bridge *bridge)
@@ -1275,8 +1266,6 @@ static void tc_bridge_disable(struct drm_bridge *bridge)
struct tc_data *tc = bridge_to_tc(bridge);
int ret;
 
-   drm_panel_disable(tc->panel);
-
ret = tc_stream_disable(tc);
if (ret < 0)
dev_err(tc->dev, "main link stream stop error: %d\n", ret);
@@ -1286,13 +1275,6 @@ static void tc_bridge_disable(struct drm_bridge *bridge)
dev_err(tc->dev, "main link disable error: %d\n", ret);
 }
 
-static void tc_bridge_post_disable(struct drm_bridge *bridge)
-{
-   struct tc_data *tc = bridge_to_tc(bridge);
-
-   drm_panel_unprepare(tc->panel);
-}
-
 static bool tc_bridge_mode_fixup(struct drm_bridge *bridge,
 const struct drm_display_mode *mode,
 struct drm_display_mode *adj)
@@ -1347,9 +1329,11 @@ static int tc_connector_get_modes(struct drm_connector 
*connector)
return 0;
}
 
-   count = drm_panel_get_modes(tc->panel, connector);
-   if (count > 0)
-   return count;
+   if (tc->panel_bridge) {
+   count = drm_bridge_get_modes(tc->panel_bridge, connector);
+   if (count > 0)
+   return count;
+   }
 
edid = drm_get_edid(connector, >aux.ddc);
 
@@ -1377,7 +1361,7 @@ static enum drm_connector_status 
tc_connector_detect(struct drm_connector *conne
int ret;
 
if (tc->hpd_pin < 0) {
-   if (tc->panel)
+   if (tc->panel_bridge)
return connector_status_connected;
else
return connector_status_unknown;
@@ -1412,6 +1396,13 @@ static int tc_bridge_attach(struct drm_bridge *bridge,
struct drm_device *drm = bridge->dev;
int ret;
 
+   if (tc->panel_bridge) {
+   ret = drm_bridge_attach(tc->bridge.encoder, tc->panel_bridge,
+   >bridge, flags);
+   if (ret < 0)
+   return ret;
+   }
+
if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
DRM_ERROR("Fix bridge driver to make connector optional!");
return -EINVAL;
@@ -1420,7 +1411,7 @@ static int tc_bridge_attach(struct drm_bridge *bridge,
/* Create DP/eDP connector */
drm_connector_helper_add(>connector, _connector_helper_funcs);
ret = drm_connector_init(drm, >connector, _connector_funcs,
-tc->panel ? DRM_MODE_CONNECTOR_eDP :
+tc->panel_bridge ? DRM_MODE_CONNECTOR_eDP :
 DRM_MODE_CONNECTOR_DisplayPort);
if (ret)
return ret;
@@ -1434,9 +1425,6 @@ static int tc_bridge_attach(struct drm_bridge *bridge,
   DRM_CONNECTOR_POLL_DISCONNECT;
}
 
-   if (tc->panel)
-   drm_panel_attach(tc->panel, >connector);
-
drm_display_info_set_bus_formats(>connector.display_info,
 _format, 1);
tc->connector.display_info.bus_flags =
@@ -1452,10 +1440,8 @@ static const struct drm_bridge_funcs tc_bridge_funcs = {
.attach = 

[PATCH v8 01/10] drm: bridge: dw_mipi_dsi: add initial regmap infrastructure

2020-04-27 Thread Adrian Ratiu
In order to support multiple versions of the Synopsis MIPI DSI host
controller, which have different register layouts but almost identical
HW protocols, we add a regmap infrastructure which can abstract away
register accesses for platform drivers using the bridge.

The controller HW revision is detected during bridge probe which will
be used in future commits to load the relevant register layout which
the bridge will use transparently to the platform drivers.

Cc: Enric Balletbo Serra 
Suggested-by: Ezequiel Garcia 
Tested-by: Adrian Pop 
Tested-by: Arnaud Ferraris 
Signed-off-by: Adrian Ratiu 
---
Chnages since v7:
  - Minor checkpatch line fix

Changes since v6:
  - Select REGMAP_MMIO in Kconfig (Enric)
  - Drop unnecessary stack variable inits (Enric)
  - Make bridge error ASAP after a bad revision read (Enric)
  - Drop redundant read of hw_version in dphy_timing_config (Enric)

New in v5.
---
 drivers/gpu/drm/bridge/synopsys/Kconfig   |   1 +
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 210 ++
 2 files changed, 121 insertions(+), 90 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/Kconfig 
b/drivers/gpu/drm/bridge/synopsys/Kconfig
index 21a1be3ced0f3..080146093b68e 100644
--- a/drivers/gpu/drm/bridge/synopsys/Kconfig
+++ b/drivers/gpu/drm/bridge/synopsys/Kconfig
@@ -39,3 +39,4 @@ config DRM_DW_MIPI_DSI
select DRM_KMS_HELPER
select DRM_MIPI_DSI
select DRM_PANEL_BRIDGE
+   select REGMAP_MMIO
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c 
b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index 5ef0f154aa7bd..34b8668ae24ea 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -227,6 +228,7 @@ struct dw_mipi_dsi {
struct drm_bridge *panel_bridge;
struct device *dev;
void __iomem *base;
+   struct regmap *regs;
 
struct clk *pclk;
 
@@ -235,6 +237,7 @@ struct dw_mipi_dsi {
u32 lanes;
u32 format;
unsigned long mode_flags;
+   u32 hw_version;
 
 #ifdef CONFIG_DEBUG_FS
struct dentry *debugfs;
@@ -249,6 +252,13 @@ struct dw_mipi_dsi {
const struct dw_mipi_dsi_plat_data *plat_data;
 };
 
+static const struct regmap_config dw_mipi_dsi_regmap_cfg = {
+   .reg_bits = 32,
+   .val_bits = 32,
+   .reg_stride = 4,
+   .name = "dw-mipi-dsi",
+};
+
 /*
  * Check if either a link to a master or slave is present
  */
@@ -280,16 +290,6 @@ static inline struct dw_mipi_dsi *bridge_to_dsi(struct 
drm_bridge *bridge)
return container_of(bridge, struct dw_mipi_dsi, bridge);
 }
 
-static inline void dsi_write(struct dw_mipi_dsi *dsi, u32 reg, u32 val)
-{
-   writel(val, dsi->base + reg);
-}
-
-static inline u32 dsi_read(struct dw_mipi_dsi *dsi, u32 reg)
-{
-   return readl(dsi->base + reg);
-}
-
 static int dw_mipi_dsi_host_attach(struct mipi_dsi_host *host,
   struct mipi_dsi_device *device)
 {
@@ -366,8 +366,8 @@ static void dw_mipi_message_config(struct dw_mipi_dsi *dsi,
if (lpm)
val |= CMD_MODE_ALL_LP;
 
-   dsi_write(dsi, DSI_LPCLK_CTRL, lpm ? 0 : PHY_TXREQUESTCLKHS);
-   dsi_write(dsi, DSI_CMD_MODE_CFG, val);
+   regmap_write(dsi->regs, DSI_LPCLK_CTRL, lpm ? 0 : PHY_TXREQUESTCLKHS);
+   regmap_write(dsi->regs, DSI_CMD_MODE_CFG, val);
 }
 
 static int dw_mipi_dsi_gen_pkt_hdr_write(struct dw_mipi_dsi *dsi, u32 hdr_val)
@@ -375,20 +375,20 @@ static int dw_mipi_dsi_gen_pkt_hdr_write(struct 
dw_mipi_dsi *dsi, u32 hdr_val)
int ret;
u32 val, mask;
 
-   ret = readl_poll_timeout(dsi->base + DSI_CMD_PKT_STATUS,
-val, !(val & GEN_CMD_FULL), 1000,
-CMD_PKT_STATUS_TIMEOUT_US);
+   ret = regmap_read_poll_timeout(dsi->regs, DSI_CMD_PKT_STATUS,
+  val, !(val & GEN_CMD_FULL), 1000,
+  CMD_PKT_STATUS_TIMEOUT_US);
if (ret) {
dev_err(dsi->dev, "failed to get available command FIFO\n");
return ret;
}
 
-   dsi_write(dsi, DSI_GEN_HDR, hdr_val);
+   regmap_write(dsi->regs, DSI_GEN_HDR, hdr_val);
 
mask = GEN_CMD_EMPTY | GEN_PLD_W_EMPTY;
-   ret = readl_poll_timeout(dsi->base + DSI_CMD_PKT_STATUS,
-val, (val & mask) == mask,
-1000, CMD_PKT_STATUS_TIMEOUT_US);
+   ret = regmap_read_poll_timeout(dsi->regs, DSI_CMD_PKT_STATUS,
+  val, (val & mask) == mask,
+  1000, CMD_PKT_STATUS_TIMEOUT_US);
if (ret) {
dev_err(dsi->dev, "failed to write command FIFO\n");
return ret;
@@ -409,18 +409,20 @@ static int dw_mipi_dsi_write(struct dw_mipi_dsi *dsi,

[PATCH v8 00/10] Genericize DW MIPI DSI bridge and add i.MX 6 driver

2020-04-27 Thread Adrian Ratiu
Hello everyone,

The dt-binding added in this series depends on [1] for
"make dt_binding_check" to pass.

The biggest change in v8 is a conversion of the imx6 host controller
driver to drm_bridge and an extension to dw_mipi_dsi.c which allows
platform drivers to daisy-chain bridges between the encoder and the
Synopsis DSI bridge.

Obviously a lot more work can be done on this front, for example to
convert the Rockchip and STM platform drivers to drm_bridge (the STM
driver doesn't even use the current dw_mipi_dsi.c bind API to attach)
or to improve the API itself.

Another kind of related work is refactoring the existng IMX drivers
to drm_bridge and move the empty encoder management to imx-drm-core.

Because this patch is already quite big, I did only the minimum
changes to get the imx6 mipi dsi driver in good shape, all the other
changes should be done in separate patch series.

I also just realized imx6qdl.dtsi was missing some properties to get
the DSI host controller working so I've added them as a new patch.

All received feedback up to this point has been addressed.

Thank you and best wishes,
Adrian

[1] 
https://lore.kernel.org/linux-devicetree/20200423100058.1734009-1-adrian.ra...@collabora.com/

Adrian Ratiu (10):
  drm: bridge: dw_mipi_dsi: add initial regmap infrastructure
  drm: bridge: dw_mipi_dsi: abstract register access using reg_fields
  drm: bridge: dw_mipi_dsi: add dsi v1.01 support
  drm: bridge: dw_mipi_dsi: allow bridge daisy chaining
  drm: imx: Add i.MX 6 MIPI DSI host platform driver
  ARM: dts: imx6qdl: add missing mipi dsi properties
  dt-bindings: display: add i.MX6 MIPI DSI host controller doc
  drm: stm: dw-mipi-dsi: let the bridge handle the HW version check
  drm: bridge: dw-mipi-dsi: split low power cfg register into fields
  drm: bridge: dw-mipi-dsi: fix bad register field offsets

 .../display/imx/fsl,mipi-dsi-imx6.yaml| 145 
 arch/arm/boot/dts/imx6qdl.dtsi|   8 +
 drivers/gpu/drm/bridge/synopsys/Kconfig   |   1 +
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 698 +-
 drivers/gpu/drm/imx/Kconfig   |   8 +
 drivers/gpu/drm/imx/Makefile  |   1 +
 drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c| 399 ++
 .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c   |   2 +-
 drivers/gpu/drm/stm/dw_mipi_dsi-stm.c |  12 +-
 include/drm/bridge/dw_mipi_dsi.h  |   5 +-
 10 files changed, 1070 insertions(+), 209 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/display/imx/fsl,mipi-dsi-imx6.yaml
 create mode 100644 drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c

-- 
2.26.0

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


[PATCH v2 02/21] drm/panel: panel-simple: add default connector_type

2020-04-27 Thread Sam Ravnborg
All panels shall report a connector type.
panel-simple has a lot of panels with no connector_type,
and for these fall back to DPI as the default.

Signed-off-by: Sam Ravnborg 
Cc: Thierry Reding 
Cc: Sam Ravnborg 
---
 drivers/gpu/drm/panel/panel-simple.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index 80388706057e..13c25ee38dbf 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -451,6 +451,7 @@ static int panel_simple_probe(struct device *dev, const 
struct panel_desc *desc)
struct panel_simple *panel;
struct display_timing dt;
struct device_node *ddc;
+   int connector_type;
int err;
 
panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
@@ -495,8 +496,13 @@ static int panel_simple_probe(struct device *dev, const 
struct panel_desc *desc)
panel_simple_parse_panel_timing_node(dev, panel, );
}
 
-   drm_panel_init(>base, dev, _simple_funcs,
-  desc->connector_type);
+   /* Default DRM_MODE_CONNECTOR_DPI if no connector_type is set */
+   if (desc->connector_type != 0)
+   connector_type = desc->connector_type;
+   else
+   connector_type = DRM_MODE_CONNECTOR_DPI;
+
+   drm_panel_init(>base, dev, _simple_funcs, connector_type);
 
err = drm_panel_of_backlight(>base);
if (err)
-- 
2.20.1

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


[PATCH v2 0/21] drm/bridge: support drm bridge connector helper + panel updates

2020-04-27 Thread Sam Ravnborg
Somehow Laurent tricked me into updating a bridge driver.
In reality, having updated a driver yourself makes for much
better understanding of what is going on.
So in order to provide proper review feedback I deciced to give
it a spin.

Second iteration of this patchset covers several drivers,
and a few panel adjustments.

The general approach for the bridge drivers:
- Introduce drm_panel_brigde
- Introduce bridge operations
- Make connector creation optional

v2:
  - Updated bus_flags for boe,hv070wsa-100
  - Collected r-b, but did not apply patches yet
  - On the panel side the panel-simple driver gained a default
connector type for all the dumb panels that do not
include so in their description.
With this change panels always provide a connector type,
and we have the potential to drop most uses of
devm_drm_panel_bridge_add_typed().
  - Added conversion of a few more bridge drivers

When bridge drivers no longer create their own connector, the
update of the connector state using drm_helper_hpd_irq_event()
is also left out.
I did not manage to convince myself if this is correct or not.
We somehow needs to trigger that the connector state is updated
but that should not be the repsonsibility of a bridge driver.

Patches can build but no run-time testing.
So both test and review feedback appreciated!


My notes on the status so far - for the bridge drives:

bridge/analogix/analogix-anx6345   todo
bridge/analogix/analogix-anx78xx   todo
bridge/analogix/analogix_dp_core   todo

bridge/sii902x todo ? how to deal with outputmode?
i2c/tda998x_drv.c  todo Needs drm_connector in helper 
fuctions. In several places.
mediatek/mtk_hdmi.ctodo Ask: Enric Balletbo i Serra 
 to do it?
omapdrm/dss/dpi.c  todo, Laurent?
omapdrm/dss/hdmi4.ctodo, Laurent?
omapdrm/dss/hdmi5.ctodo, Laurent?
omapdrm/dss/sdi.c  todo, Laurent?
omapdrm/dss/venc.c todo, Laurent?
bridge/nwl-dsi todo, Guido

bridge/adv7511 ongoing, Laurent
bridge/simple-bridge   ongoing, Laurent
bridge/synopsys/dw-hdmiongoing, Laurent
rcar-du/rcar_lvds.congoing, Laurent
bridge/megachips-stdp-ge-b850v3-fw ongoing, Sam
bridge/nxp-ptn3460 ongoing, Sam
bridge/parade-ps8622   ongoing, Sam
bridge/tc358764ongoing, Sam
bridge/tc358767ongoing, Sam
bridge/ti-sn65dsi86ongoing, Sam. How to get bpc without 
connector?
bridge/ti-tpd12s015ongoing, Sam

bridge/display-connector.c done
bridge/lvds-codec  done
bridge/cdns-dsidone
bridge/panel.c done
bridge/parade-ps8640   done
bridge/sil-sii8620 done
bridge/synopsys/dw-mipi-dsidone
bridge/tc358768done
bridge/thc63lvd1024done
bridge/ti-tfp410   done

Sam


Sam Ravnborg (21):
  drm/panel: add connector type to boe,hv070wsa-100 panel
  drm/panel: panel-simple: add default connector_type
  drm/bridge: tc358764: drop drm_connector_(un)register
  drm/bridge: tc358764: add drm_panel_bridge support
  drm/bridge: tc358764: make connector creation optional
  drm/bridge: tc358767: add drm_panel_bridge support
  drm/bridge: tc358767: add detect bridge operation
  drm/bridge: tc358767: add get_edid bride operation
  drm/bridge: tc358767: make connector creation optional
  drm/bridge: ti-tpd12s015: make connector creation optional
  drm/bridge: parade-ps8622: add drm_panel_bridge support
  drm/bridge: parade-ps8622: make connector creation optional
  drm/bridge: megachips: add helper to create connector
  drm/bridge: megachips: get drm_device from bridge
  drm/bridge: megachips: enable detect bridge operation
  drm/bridge: megachips: add get_edid bridge operation
  drm/bridge: megachips: make connector creation optional
  drm/bridge: nxp-ptn3460: add drm_panel_bridge support
  drm/bridge: nxp-ptn3460: add get_modes bridge operation
  drm/bridge: nxp-ptn3460: make connector creation optional
  drm/bridge: ti-sn65dsi86: add drm_panel_bridge support

 .../drm/bridge/megachips-stdp-ge-b850v3-fw.c   |  92 +++---
 drivers/gpu/drm/bridge/nxp-ptn3460.c   | 107 +
 drivers/gpu/drm/bridge/parade-ps8622.c |  55 ---
 drivers/gpu/drm/bridge/tc358764.c  |  68 -
 drivers/gpu/drm/bridge/tc358767.c  |  98 +++
 drivers/gpu/drm/bridge/ti-sn65dsi86.c  |  27 +++---
 drivers/gpu/drm/bridge/ti-tpd12s015.c  |   3 -
 

[PATCH v8 08/10] drm: stm: dw-mipi-dsi: let the bridge handle the HW version check

2020-04-27 Thread Adrian Ratiu
The stm mipi-dsi platform driver added a version test in
commit fa6251a747b7 ("drm/stm: dsi: check hardware version")
so that HW revisions other than v1.3x get rejected. The rockchip
driver had no such check and just assumed register layouts are
v1.3x compatible.

Having such tests was a good idea because only v130/v131 layouts
were supported at the time, however since adding multiple layout
support in the bridge, the version is automatically checked for
all drivers, compatible layouts get picked and unsupported HW is
automatically rejected by the bridge, so there's no use keeping
the test in the stm driver.

The main reason prompting this change is that the stm driver
test immediately disabled the peripheral clock after reading
the version, making the bridge read version 0x0 immediately
after in its own probe(), so we move the clock disabling after
the bridge does the version test.

Tested on STM32F769 and STM32MP1.

Cc: linux-st...@st-md-mailman.stormreply.com
Reported-by: Adrian Pop 
Tested-by: Adrian Pop 
Tested-by: Arnaud Ferraris 
Signed-off-by: Adrian Ratiu 
---
New in v6.
---
 drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c 
b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
index 2e1f2664495d0..7218e405d7e2b 100644
--- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
+++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
@@ -402,15 +402,6 @@ static int dw_mipi_dsi_stm_probe(struct platform_device 
*pdev)
goto err_dsi_probe;
}
 
-   dsi->hw_version = dsi_read(dsi, DSI_VERSION) & VERSION;
-   clk_disable_unprepare(pclk);
-
-   if (dsi->hw_version != HWVER_130 && dsi->hw_version != HWVER_131) {
-   ret = -ENODEV;
-   DRM_ERROR("bad dsi hardware version\n");
-   goto err_dsi_probe;
-   }
-
dw_mipi_dsi_stm_plat_data.base = dsi->base;
dw_mipi_dsi_stm_plat_data.priv_data = dsi;
 
@@ -423,6 +414,9 @@ static int dw_mipi_dsi_stm_probe(struct platform_device 
*pdev)
goto err_dsi_probe;
}
 
+   dsi->hw_version = dsi_read(dsi, DSI_VERSION) & VERSION;
+   clk_disable_unprepare(pclk);
+
return 0;
 
 err_dsi_probe:
-- 
2.26.0

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


[PATCH v8 02/10] drm: bridge: dw_mipi_dsi: abstract register access using reg_fields

2020-04-27 Thread Adrian Ratiu
Register existence, address/offsets, field layouts, reserved bits and
so on differ between MIPI-DSI versions and between SoC vendor boards.
Despite these differences the hw IP and protocols are mostly the same
so the generic bridge can be made to compensate these differences.

The current Rockchip and STM drivers hardcoded a lot of their common
definitions in the bridge code because they're based on DSI v1.30 and
1.31 which are relatively close, but in order to support older/future
versions with more diverging layouts like the v1.01 present on imx6,
we abstract some of the register accesses via the regmap field APIs.

The bridge detects the DSI core version and initializes the required
regmap register layout. Other DSI versions / register layouts can
easily be added in the future by only changing the bridge code.

The platform drivers don't require any changes, DSI register layout
versioning will be handled transparently by the bridge, but if in
the future the regmap or layouts needs to be exposed to the drivres,
it could easily be done via plat_data or a new API in dw_mipi_dsi.h.

Suggested-by: Boris Brezillon 
Reviewed-by: Emil Velikov 
Tested-by: Adrian Pop 
Tested-by: Arnaud Ferraris 
Signed-off-by: Adrian Ratiu 
---
Changes since v5:
  - Fix CONFIG_DEBUG_FS build (Adrian)
  - Fix DRM_MODE_FLAG_* test negation (Adrian)
  - Fixed cfg_phy_status range from [0,0] to [0,2]
  - Replace do {} while(0) with GCC extension ({}) (Andrzej)
  - Fixed payload no-op writes on STM devices (Adrian & Arnaud)

Changes since v4:
  - Move regmap infrastructure logic to a separate commit (Ezequiel)
  - Consolidate field infrastructure in this commit (Ezequiel)
  - Move the dsi v1.01 layout logic to a separate commit (Ezequiel)

Changes since v2:
  - Added const declarations to dw_mipi_dsi structs (Emil)
  - Fixed commit tags (Emil)

Changes since v1:
  - Moved register definitions & regmap initialization into bridge
  module. Platform drivers get the regmap via plat_data after calling
  the bridge probe (Emil).
---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 499 --
 1 file changed, 347 insertions(+), 152 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c 
b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index 34b8668ae24ea..f453df4eb5072 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -31,6 +31,7 @@
 #include 
 
 #define HWVER_131  0x31333100  /* IP version 1.31 */
+#define HWVER_130  0x31333000  /* IP version 1.30 */
 
 #define DSI_VERSION0x00
 #define VERSIONGENMASK(31, 8)
@@ -47,7 +48,6 @@
 #define DPI_VCID(vcid) ((vcid) & 0x3)
 
 #define DSI_DPI_COLOR_CODING   0x10
-#define LOOSELY18_EN   BIT(8)
 #define DPI_COLOR_CODING_16BIT_1   0x0
 #define DPI_COLOR_CODING_16BIT_2   0x1
 #define DPI_COLOR_CODING_16BIT_3   0x2
@@ -56,11 +56,6 @@
 #define DPI_COLOR_CODING_24BIT 0x5
 
 #define DSI_DPI_CFG_POL0x14
-#define COLORM_ACTIVE_LOW  BIT(4)
-#define SHUTD_ACTIVE_LOW   BIT(3)
-#define HSYNC_ACTIVE_LOW   BIT(2)
-#define VSYNC_ACTIVE_LOW   BIT(1)
-#define DATAEN_ACTIVE_LOW  BIT(0)
 
 #define DSI_DPI_LP_CMD_TIM 0x18
 #define OUTVACT_LPCMD_TIME(p)  (((p) & 0xff) << 16)
@@ -81,27 +76,19 @@
 #define DSI_GEN_VCID   0x30
 
 #define DSI_MODE_CFG   0x34
-#define ENABLE_VIDEO_MODE  0
-#define ENABLE_CMD_MODEBIT(0)
 
 #define DSI_VID_MODE_CFG   0x38
-#define ENABLE_LOW_POWER   (0x3f << 8)
-#define ENABLE_LOW_POWER_MASK  (0x3f << 8)
+#define ENABLE_LOW_POWER   0x3f
+
 #define VID_MODE_TYPE_NON_BURST_SYNC_PULSES0x0
 #define VID_MODE_TYPE_NON_BURST_SYNC_EVENTS0x1
 #define VID_MODE_TYPE_BURST0x2
-#define VID_MODE_TYPE_MASK 0x3
-#define VID_MODE_VPG_ENABLEBIT(16)
-#define VID_MODE_VPG_HORIZONTALBIT(24)
 
 #define DSI_VID_PKT_SIZE   0x3c
-#define VID_PKT_SIZE(p)((p) & 0x3fff)
 
 #define DSI_VID_NUM_CHUNKS 0x40
-#define VID_NUM_CHUNKS(c)  ((c) & 0x1fff)
 
 #define DSI_VID_NULL_SIZE  0x44
-#define VID_NULL_SIZE(b)   ((b) & 0x1fff)
 
 #define DSI_VID_HSA_TIME   0x48
 #define DSI_VID_HBP_TIME   0x4c
@@ -125,7 +112,6 @@
 #define GEN_SW_2P_TX_LPBIT(10)
 #define GEN_SW_1P_TX_LPBIT(9)
 #define GEN_SW_0P_TX_LPBIT(8)
-#define ACK_RQST_ENBIT(1)
 #define TEAR_FX_EN BIT(0)
 
 #define CMD_MODE_ALL_LP(MAX_RD_PKT_SIZE_LP | \
@@ -154,8 +140,6 @@
 #define GEN_CMD_EMPTY   

[PATCH v2 01/21] drm/panel: add connector type to boe, hv070wsa-100 panel

2020-04-27 Thread Sam Ravnborg
The boe,hv070wsa-100 panel is a LVDS panel.
Fix connector type to reflect this.

With this change users of this panel do not have to specify the
connector type.

v2:
  - Add .bus_format (Laurent)
  - Add .bus_flags

Signed-off-by: Sam Ravnborg 
Cc: Laurent Pinchart 
Cc: Thierry Reding 
Cc: Sam Ravnborg 
---
 drivers/gpu/drm/panel/panel-simple.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index 5e56c68fbd3e..80388706057e 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -1128,6 +1128,9 @@ static const struct panel_desc boe_hv070wsa = {
.width = 154,
.height = 90,
},
+   .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
+   .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
+   .connector_type = DRM_MODE_CONNECTOR_LVDS,
 };
 
 static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
-- 
2.20.1

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


Re: [PATCH] dt-bindings: display: anx7814.txt: convert to yaml

2020-04-27 Thread Ricardo Cañuelo
On vie 24-04-2020 16:08:10, Enric Balletbo i Serra wrote:
> Hi Ricardo,
> 
> Thank you for your patch.

Hi Enric,

Thanks for reviewing it.

> > +  "#size-cells":
> > +const: 0
> > +
> 
> I don't' think you need to specify this. You can drop it (better double check
> with Rob, though)

I think you're right. I put it just to be clear about it and because
some other yaml bindings specify them, but this is already well defined
in Documentation/devicetree/bindings/mediavideo-interfaces.txt, which is
referenced in the binding.

I agree with the rest of the comments.

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


Re: [PATCH] drm/amd/display: remove conversion to bool in dc_link_ddc.c

2020-04-27 Thread Christian König

Am 27.04.20 um 08:37 schrieb Jason Yan:

The '>' expression itself is bool, no need to convert it to bool again.
This fixes the following coccicheck warning:

drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c:602:28-33: WARNING:
conversion to bool not needed here

Signed-off-by: Jason Yan 


Reviewed-by: Christian König 


---
  drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c 
b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
index 256889eed93e..aefd29a440b5 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
@@ -599,7 +599,7 @@ bool dal_ddc_submit_aux_command(struct ddc_service *ddc,
do {
struct aux_payload current_payload;
bool is_end_of_payload = (retrieved + DEFAULT_AUX_MAX_DATA_SIZE) 
>
-   payload->length ? true : false;
+   payload->length;
  
  		current_payload.address = payload->address;

current_payload.data = >data[retrieved];


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


Re: [PATCH] drm/amd/display: remove conversion to bool in dcn20_mpc.c

2020-04-27 Thread Christian König

Am 27.04.20 um 08:37 schrieb Jason Yan:

The '==' expression itself is bool, no need to convert it to bool again.
This fixes the following coccicheck warning:

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c:455:70-75: WARNING:
conversion to bool not needed here

Signed-off-by: Jason Yan 


Reviewed-by: Christian König 


---
  drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c 
b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
index de9c857ab3e9..9d7432f3fb16 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
@@ -452,7 +452,7 @@ void mpc2_set_output_gamma(
next_mode = LUT_RAM_A;
  
  	mpc20_power_on_ogam_lut(mpc, mpcc_id, true);

-   mpc20_configure_ogam_lut(mpc, mpcc_id, next_mode == LUT_RAM_A ? 
true:false);
+   mpc20_configure_ogam_lut(mpc, mpcc_id, next_mode == LUT_RAM_A);
  
  	if (next_mode == LUT_RAM_A)

mpc2_program_luta(mpc, mpcc_id, params);


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


Re: [PATCH] drm/amdgpu: remove conversion to bool in amdgpu_device.c

2020-04-27 Thread Christian König

Am 27.04.20 um 08:36 schrieb Jason Yan:

The '>' expression itself is bool, no need to convert it to bool again.
This fixes the following coccicheck warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:3004:68-73: WARNING:
conversion to bool not needed here

Signed-off-by: Jason Yan 


Reviewed-by: Christian König 


---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 3d601d5dd5af..ad94de3632d8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3000,7 +3000,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
INIT_WORK(>xgmi_reset_work, amdgpu_device_xgmi_reset_func);
  
  	adev->gfx.gfx_off_req_count = 1;

-   adev->pm.ac_power = power_supply_is_system_supplied() > 0 ? true : 
false;
+   adev->pm.ac_power = power_supply_is_system_supplied() > 0;
  
  	/* Registers mapping */

/* TODO: block userspace mapping of io register */


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


[PATCH] gpu: host1x: Clean up debugfs in error handling path in 'host1x_probe()'

2020-04-27 Thread Christophe JAILLET
'host1x_debug_init()' must be reverted in an error handling path.

This is already fixed in the remove function since commit 44156eee91ba
("gpu: host1x: Clean up debugfs on removal")

Signed-off-by: Christophe JAILLET 
---
 drivers/gpu/host1x/dev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
index 388bcc2889aa..be46554968af 100644
--- a/drivers/gpu/host1x/dev.c
+++ b/drivers/gpu/host1x/dev.c
@@ -435,6 +435,7 @@ static int host1x_probe(struct platform_device *pdev)
return 0;
 
 deinit_intr:
+   host1x_debug_deinit(host);
host1x_intr_deinit(host);
 deinit_syncpt:
host1x_syncpt_deinit(host);
-- 
2.25.1

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


[PATCH] drm/amd/display: remove conversion to bool in dc_link_ddc.c

2020-04-27 Thread Jason Yan
The '>' expression itself is bool, no need to convert it to bool again.
This fixes the following coccicheck warning:

drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c:602:28-33: WARNING:
conversion to bool not needed here

Signed-off-by: Jason Yan 
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c 
b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
index 256889eed93e..aefd29a440b5 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
@@ -599,7 +599,7 @@ bool dal_ddc_submit_aux_command(struct ddc_service *ddc,
do {
struct aux_payload current_payload;
bool is_end_of_payload = (retrieved + 
DEFAULT_AUX_MAX_DATA_SIZE) >
-   payload->length ? true : false;
+   payload->length;
 
current_payload.address = payload->address;
current_payload.data = >data[retrieved];
-- 
2.21.1

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


[PATCH 2/8] dt-bindings: intc: Convert ingenic,intc.txt to YAML

2020-04-27 Thread Paul Cercueil
Convert the ingenic,intc.txt doc file to ingenic,intc.yaml.

Some compatible strings now require a fallback, as the controller
generally works the same across the SoCs families.

Signed-off-by: Paul Cercueil 
---
 .../interrupt-controller/ingenic,intc.txt | 28 -
 .../interrupt-controller/ingenic,intc.yaml| 63 +++
 2 files changed, 63 insertions(+), 28 deletions(-)
 delete mode 100644 
Documentation/devicetree/bindings/interrupt-controller/ingenic,intc.txt
 create mode 100644 
Documentation/devicetree/bindings/interrupt-controller/ingenic,intc.yaml

diff --git 
a/Documentation/devicetree/bindings/interrupt-controller/ingenic,intc.txt 
b/Documentation/devicetree/bindings/interrupt-controller/ingenic,intc.txt
deleted file mode 100644
index d4373d0f7121..
--- a/Documentation/devicetree/bindings/interrupt-controller/ingenic,intc.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-Ingenic SoC Interrupt Controller
-
-Required properties:
-
-- compatible : should be "ingenic,-intc". Valid strings are:
-ingenic,jz4740-intc
-ingenic,jz4725b-intc
-ingenic,jz4770-intc
-ingenic,jz4775-intc
-ingenic,jz4780-intc
-- reg : Specifies base physical address and size of the registers.
-- interrupt-controller : Identifies the node as an interrupt controller
-- #interrupt-cells : Specifies the number of cells needed to encode an
-  interrupt source. The value shall be 1.
-- interrupts : Specifies the CPU interrupt the controller is connected to.
-
-Example:
-
-intc: interrupt-controller@10001000 {
-   compatible = "ingenic,jz4740-intc";
-   reg = <0x10001000 0x14>;
-
-   interrupt-controller;
-   #interrupt-cells = <1>;
-
-   interrupt-parent = <>;
-   interrupts = <2>;
-};
diff --git 
a/Documentation/devicetree/bindings/interrupt-controller/ingenic,intc.yaml 
b/Documentation/devicetree/bindings/interrupt-controller/ingenic,intc.yaml
new file mode 100644
index ..28b27e1a6e9d
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/ingenic,intc.yaml
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/ingenic,intc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Ingenic SoCs interrupt controller devicetree bindings
+
+maintainers:
+  - Paul Cercueil 
+
+properties:
+  $nodename:
+pattern: "^interrupt-controller@[0-9a-f]+$"
+
+  compatible:
+oneOf:
+  - enum:
+- ingenic,jz4740-intc
+- ingenic,jz4760-intc
+- ingenic,jz4780-intc
+  - items:
+- enum:
+  - ingenic,jz4775-intc
+  - ingenic,jz4770-intc
+- const: ingenic,jz4760-intc
+  - items:
+- const: ingenic,x1000-intc
+- const: ingenic,jz4780-intc
+  - items:
+- const: ingenic,jz4725b-intc
+- const: ingenic,jz4740-intc
+
+  "#interrupt-cells":
+const: 1
+
+  reg:
+maxItems: 1
+
+  interrupts:
+maxItems: 1
+
+  interrupt-controller: true
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - "#interrupt-cells"
+  - interrupt-controller
+
+examples:
+  - |
+intc: interrupt-controller@10001000 {
+  compatible = "ingenic,jz4770-intc", "ingenic,jz4760-intc";
+  reg = <0x10001000 0x40>;
+
+  interrupt-controller;
+  #interrupt-cells = <1>;
+
+  interrupt-parent = <>;
+  interrupts = <2>;
+};
-- 
2.26.2

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


[PATCH 5/8] dt-bindings: mtd: Convert ingenic, jz4780-nand.txt to YAML

2020-04-27 Thread Paul Cercueil
Convert the ingenic,jz4780-nand.txt doc file to ingenic,nand.yaml.

Signed-off-by: Paul Cercueil 
---
 .../bindings/mtd/ingenic,jz4780-nand.txt  |  92 
 .../devicetree/bindings/mtd/ingenic,nand.yaml | 133 ++
 2 files changed, 133 insertions(+), 92 deletions(-)
 delete mode 100644 
Documentation/devicetree/bindings/mtd/ingenic,jz4780-nand.txt
 create mode 100644 Documentation/devicetree/bindings/mtd/ingenic,nand.yaml

diff --git a/Documentation/devicetree/bindings/mtd/ingenic,jz4780-nand.txt 
b/Documentation/devicetree/bindings/mtd/ingenic,jz4780-nand.txt
deleted file mode 100644
index c02259353327..
--- a/Documentation/devicetree/bindings/mtd/ingenic,jz4780-nand.txt
+++ /dev/null
@@ -1,92 +0,0 @@
-* Ingenic JZ4780 NAND/ECC
-
-This file documents the device tree bindings for NAND flash devices on the
-JZ4780. NAND devices are connected to the NEMC controller (described in
-memory-controllers/ingenic,jz4780-nemc.txt), and thus NAND device nodes must
-be children of the NEMC node.
-
-Required NAND controller device properties:
-- compatible: Should be one of:
-  * ingenic,jz4740-nand
-  * ingenic,jz4725b-nand
-  * ingenic,jz4780-nand
-- reg: For each bank with a NAND chip attached, should specify a bank number,
-  an offset of 0 and a size of 0x100 (i.e. the whole NEMC bank).
-
-Optional NAND controller device properties:
-- ecc-engine: To make use of the hardware ECC controller, this
-  property must contain a phandle for the ECC controller node. The required
-  properties for this node are described below. If this is not specified,
-  software ECC will be used instead.
-
-Optional children nodes:
-- Individual NAND chips are children of the NAND controller node.
-
-Required children node properties:
-- reg: An integer ranging from 1 to 6 representing the CS line to use.
-
-Optional children node properties:
-- nand-ecc-step-size: ECC block size in bytes.
-- nand-ecc-strength: ECC strength (max number of correctable bits).
-- nand-ecc-mode: String, operation mode of the NAND ecc mode. "hw" by default
-- nand-on-flash-bbt: boolean to enable on flash bbt option, if not present 
false
-- rb-gpios: GPIO specifier for the busy pin.
-- wp-gpios: GPIO specifier for the write protect pin.
-
-Optional child node of NAND chip nodes:
-- partitions: see Documentation/devicetree/bindings/mtd/partition.txt
-
-Example:
-
-nemc: nemc@1341 {
-   ...
-
-   nandc: nand-controller@1 {
-   compatible = "ingenic,jz4780-nand";
-   reg = <1 0 0x100>;  /* Bank 1 */
-
-   #address-cells = <1>;
-   #size-cells = <0>;
-
-   ecc-engine = <>;
-
-   nand@1 {
-   reg = <1>;
-
-   nand-ecc-step-size = <1024>;
-   nand-ecc-strength = <24>;
-   nand-ecc-mode = "hw";
-   nand-on-flash-bbt;
-
-   rb-gpios = < 20 GPIO_ACTIVE_LOW>;
-   wp-gpios = < 22 GPIO_ACTIVE_LOW>;
-
-   partitions {
-   #address-cells = <2>;
-   #size-cells = <2>;
-   ...
-   }
-   };
-   };
-};
-
-The ECC controller is a separate SoC component used for error correction on
-NAND devices. The following is a description of the device properties for a
-ECC controller.
-
-Required ECC properties:
-- compatible: Should be one of:
-  * ingenic,jz4740-ecc
-  * ingenic,jz4725b-bch
-  * ingenic,jz4780-bch
-- reg: Should specify the ECC controller registers location and length.
-- clocks: Clock for the ECC controller.
-
-Example:
-
-bch: bch@134d {
-   compatible = "ingenic,jz4780-bch";
-   reg = <0x134d 0x1>;
-
-   clocks = < JZ4780_CLK_BCH>;
-};
diff --git a/Documentation/devicetree/bindings/mtd/ingenic,nand.yaml 
b/Documentation/devicetree/bindings/mtd/ingenic,nand.yaml
new file mode 100644
index ..0e4cb1b55385
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/ingenic,nand.yaml
@@ -0,0 +1,133 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mtd/ingenic,nand.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Ingenic SoCs NAND controller devicetree bindings
+
+maintainers:
+  - Paul Cercueil 
+
+allOf:
+  - $ref: ../memory-controllers/ingenic,nemc-client.yaml#
+  - $ref: nand-controller.yaml#
+
+properties:
+  compatible:
+enum:
+  - ingenic,jz4740-nand
+  - ingenic,jz4725b-nand
+  - ingenic,jz4780-nand
+
+  reg:
+items:
+  - description: Bank number, offset and size of first attached NAND chip
+  - description: Bank number, offset and size of second attached NAND chip
+  - description: Bank number, offset and size of third attached NAND chip
+  - description: Bank number, offset and size of fourth attached NAND 

Re: [PATCH v7 06/12] ARM: DTS: omap4: add sgx gpu child node

2020-04-27 Thread Paul Cercueil

Hi Nikolaus,

Le ven. 24 avril 2020 à 22:34, H. Nikolaus Schaller 
 a écrit :

Add SGX GPU node with interrupt. Tested on PandaBoard ES.

Since omap4420/30/60 and omap4470 come with different SGX variants
we need to introduce a new omap4470.dtsi. If an omap4470 board
does not want to use SGX it is no problem to still include
omap4460.dtsi.

Signed-off-by: H. Nikolaus Schaller 
---
 arch/arm/boot/dts/omap4.dtsi   | 11 ++-
 arch/arm/boot/dts/omap4470.dts | 15 +++
 2 files changed, 21 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap4470.dts

diff --git a/arch/arm/boot/dts/omap4.dtsi 
b/arch/arm/boot/dts/omap4.dtsi

index 763bdea8c829..15ff3d7146af 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -389,7 +389,7 @@ abb_iva: regulator-abb-iva {
status = "disabled";
};

-   target-module@5600 {
+   sgx_module: target-module@5600 {
compatible = "ti,sysc-omap4", "ti,sysc";
reg = <0x5600fe00 0x4>,
  <0x5600fe10 0x4>;
@@ -408,10 +408,11 @@ target-module@5600 {
#size-cells = <1>;
ranges = <0 0x5600 0x200>;

-   /*
-* Closed source PowerVR driver, no child device
-* binding or driver in mainline
-*/
+   gpu: gpu@0 {
+compatible = "ti,omap4-sgx540-120", "img,sgx540-120", 
"img,sgx540";

+   reg = <0x0 0x200>;/* 32MB */
+   interrupts = ;
+   };
};

/*
diff --git a/arch/arm/boot/dts/omap4470.dts 
b/arch/arm/boot/dts/omap4470.dts

new file mode 100644
index ..f29c581300bf
--- /dev/null
+++ b/arch/arm/boot/dts/omap4470.dts
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Device Tree Source for OMAP4470 SoC
+ *
+ * Copyright (C) 2012 Texas Instruments Incorporated - 
http://www.ti.com/

+ *
+ * This file is licensed under the terms of the GNU General Public 
License
+ * version 2.  This program is licensed "as is" without any warranty 
of any

+ * kind, whether express or implied.
+ */
+#include "omap4460.dtsi"
+
+ {


Does this even compile?

The node's handle is named sgx_module, not sgx.

-Paul

+	compatible = "ti,omap4470-sgx544-112", "img,sgx544-112", 
"img,sgx544";

+};
--
2.25.1




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


[PATCH] drm/amdgpu: remove conversion to bool in amdgpu_device.c

2020-04-27 Thread Jason Yan
The '>' expression itself is bool, no need to convert it to bool again.
This fixes the following coccicheck warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:3004:68-73: WARNING:
conversion to bool not needed here

Signed-off-by: Jason Yan 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 3d601d5dd5af..ad94de3632d8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3000,7 +3000,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
INIT_WORK(>xgmi_reset_work, amdgpu_device_xgmi_reset_func);
 
adev->gfx.gfx_off_req_count = 1;
-   adev->pm.ac_power = power_supply_is_system_supplied() > 0 ? true : 
false;
+   adev->pm.ac_power = power_supply_is_system_supplied() > 0;
 
/* Registers mapping */
/* TODO: block userspace mapping of io register */
-- 
2.21.1

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


KASAN: use-after-free Read in vkms_dumb_create

2020-04-27 Thread syzbot
Hello,

syzbot found the following crash on:

HEAD commit:c578ddb3 Merge tag 'linux-kselftest-5.7-rc3' of git://git...
git tree:   upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10fbf0d810
kernel config:  https://syzkaller.appspot.com/x/.config?x=b7a70e992f2f9b68
dashboard link: https://syzkaller.appspot.com/bug?extid=e3372a2afe1e7ef04bc7
compiler:   gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=1543833010

Bisection is inconclusive: the first bad commit could be any of:

85b5bafb drm/cma-helper: Remove drm_fb_cma_fbdev_init_with_funcs()
dff1c703 drm/tinydrm: Use drm_fbdev_generic_setup()
23167fa9 drm/panel: simple: Add support for Rocktech RK070ER9427 LCD panel
9060d7f4 drm/fb-helper: Finish the generic fbdev emulation
2230ca12 dt-bindings: display: Document the EDT et* displays in one file.
e896c132 drm/debugfs: Add internal client debugfs file
894a677f drm/cma-helper: Use the generic fbdev emulation
aa7e6455 drm/panel: Add support for the EDT ETM0700G0BDH6
244007ec drm/pl111: Set .gem_prime_vmap and .gem_prime_mmap
aad34de2 drm/panel: Add support for the EDT ETM0700G0EDH6
7a6aca49 dt-bindings: Add vendor prefix for DLC Display Co., Ltd.
d536540f drm/fb-helper: Add generic fbdev emulation .fb_probe function
0ca0c827 drm/panel: simple: Add DLC DLC0700YZG-1 panel
c76f0f7c drm: Begin an API for in-kernel clients
5ba57bab drm: vkms: select DRM_KMS_HELPER
5fa8e4a2 drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of NULL
008095e0 drm/vc4: Add support for the transposer block
c59eb3cf drm/panel: Let of_drm_find_panel() return -ENODEV when the panel is 
disabled
1ebe99a7 drm/vc4: Call drm_atomic_helper_fake_vblank() in the commit path
2e64a174 drm/of: Make drm_of_find_panel_or_bridge() fail when the device is 
disabled
1b9883ea drm/vc4: Support the case where the DSI device is disabled
6fb42b66 drm/atomic: Call fake_vblank() from the generic commit_tail() helpers
b0b7aa40 dt-bindings: display: Add DT bindings for BOE HV070WSA-100 panel
b25c60af drm/crtc: Add a generic infrastructure to fake VBLANK events
184d3cf4 drm/vc4: Use wait_for_flip_done() instead of wait_for_vblanks()
ae8cf41b drm/panel: simple: Add support for BOE HV070WSA-100 panel to 
simple-panel
814bde99 drm/connector: Make ->atomic_commit() optional
955f60db drm: Add support for extracting sync signal drive edge from videomode
3b39ad7a drm/panel: simple: Add newhaven, nhd-4.3-480272ef-atxl LCD
425132fd drm/connector: Pass a drm_connector_state to ->atomic_commit()
a5d2ade6 drm/panel: simple: Add support for Innolux G070Y2-L01
b82c1f8f drm/atomic: Avoid connector to writeback_connector casts
03fa9aa3 dt-bindings: Add DataImage, Inc. vendor prefix
73915b2b drm/writeback: Fix the "overview" section of the doc
97ceb1fb drm/panel: simple: Add support for DataImage SCF0700C48GGU18
e22e9531 Merge drm-upstream/drm-next into drm-misc-next
3d5664f9 drm/panel: ili9881c: Fix missing assignment to error return ret
a0120245 drm/crc: Only report a single overflow when a CRC fd is opened
7ad4e463 drm/panel: p079zca: Refactor panel driver to support multiple panels
8adbbb2e drm/stm: ltdc: rework reset sequence
48bd379a drm/panel: p079zca: Add variable unprepare_delay properties
7868e507 drm/stm: ltdc: filter mode pixel clock vs pad constraint
731edd4c dt-bindings: Add Innolux P097PFG panel bindings
f8878bb2 drm: print plane state normalized zpos value
ca52bea9 drm/atomic-helper: Use bitwise or for filling a bitmask
de04a462 drm/panel: p079zca: Support Innolux P097PFG panel
2bb7a39c dt-bindings: Add vendor prefix for kingdisplay
a65020d0 drm/v3d: Fix a grammar nit in the scheduler docs.
2dd4f211 drm/v3d: Add missing v3d documentation structure.
ebc950fd dt-bindings: Add KINGDISPLAY KD097D04 panel bindings
cd0e0ca6 drm/panel: type promotion bug in s6e8aa0_read_mtp_id()
e0d01811 drm/v3d: Remove unnecessary dma_fence_ops.
624bb0c0 drm/v3d: Delay the scheduler timeout if we're still making progress.
b6d83fcc drm/panel: p079zca: Use of_device_get_match_data()
408633d2 drm/v3d: use new return type vm_fault_t in v3d_gem_fault
decac6b0 dt-bindings: display: sun4i-drm: Add R40 display engine compatible
0b7510d1 drm/tilcdc: Use drm_connector_has_possible_encoder()
d978a94b drm/sun4i: Add R40 display engine compatible
af11942e drm/sun4i: tcon-top: Cleanup clock handling
f8222409 drm/msm: Use drm_connector_has_possible_encoder()
38cb8d96 drm: Add drm_connector_has_possible_encoder()
da82107e drm/sun4i: tcon: Release node when traversing of graph
7a667775 dt-bindings: display: sun4i-drm: Add R40 TV TCON description
7b71ca24 drm/radeon: Use drm_connector_for_each_possible_encoder()
4a068c5c drm/sun4i: DW HDMI: Release nodes if error happens during CRTC search
ddba766d drm/nouveau: Use drm_connector_for_each_possible_encoder()
98c0e348 drm/amdgpu: Use drm_connector_for_each_possible_encoder()
e0f56782 drm/sun4i: mixer: Order includes alphabetically
05db311a drm/sun4i: 

  1   2   >