Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1594468 > unrolled thread
| Started by | Neil Armstrong <narmstrong@baylibre.com> |
|---|---|
| First post | 2017-03-07 18:50 +0100 |
| Last post | 2017-03-07 21:50 +0100 |
| Articles | 4 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH v3 0/6] drm: bridge: dw-hdmi: Add support for Custom PHYs Neil Armstrong <narmstrong@baylibre.com> - 2017-03-07 18:50 +0100
[PATCH v3 1/6] drm: bridge: dw-hdmi: Extract PHY interrupt setup to a function Neil Armstrong <narmstrong@baylibre.com> - 2017-03-07 20:30 +0100
[PATCH v3 2/6] media: uapi: Add RGB and YUV bus formats for Synopsys HDMI TX Controller Neil Armstrong <narmstrong@baylibre.com> - 2017-03-07 20:40 +0100
[PATCH v3 5/6] drm: bridge: dw-hdmi: Add Documentation on supported input formats Neil Armstrong <narmstrong@baylibre.com> - 2017-03-07 21:50 +0100
| From | Neil Armstrong <narmstrong@baylibre.com> |
|---|---|
| Date | 2017-03-07 18:50 +0100 |
| Subject | [PATCH v3 0/6] drm: bridge: dw-hdmi: Add support for Custom PHYs |
| Message-ID | <tiqWd-2hL-11@gated-at.bofh.it> |
The Amlogic GX SoCs implements a Synopsys DesignWare HDMI TX Controller
in combination with a very custom PHY.
Thanks to Laurent Pinchart's changes, the HW report the following :
Detected HDMI TX controller v2.01a with HDCP (Vendor PHY)
The following differs from common PHY integration as managed in the current
driver :
- Amlogic PHY is not configured through the internal I2C link
- Amlogic PHY do not use the ENTMDS, SVSRET, PDDQ, ... signals from the controller
- Amlogic PHY do not export HPD ands RxSense signals to the controller
And finally, concerning the controller integration :
- the Controller registers are not flat memory-mapped, and uses an
addr+read/write register pair to write all registers.
- Inputs only YUV444 pixel data
Most of these uses case are implemented in Laurent Pinchart v5.1 patchset at [3] :
- Conversion to regmap for register access
- Add more callbacks ops to handle Custom PHYs
- Fixes a bug that considers the input to be always RBG and sends bad pixel
format to a DVI sink by disabling CSC
This is why the following patchset implements :
- Configure the Input format from the plat_data
- Add PHY callback to handle HPD and RxSense out of the dw-hdmi driver
To implement the input format handling, the Synopsys HDMIT TX Controller input
V4L bus formats are used and missing formats + documentation are added.
This patchset makes the Amlogic GX SoCs HDMI output successfully work, and is
also tested on the RK3288 ACT8846 EVB Board.
Changes since v2 at [4] :
- Rebase on laurent patch "Extract PHY interrupt setup to a function"
- Reduce phy operations
- Switch the V4L bus formats and encodings instead of custom enum
Changes since v1 at [2] :
- Drop patches submitted by laurent
Changes since RFC at [1] :
- Regmap fixup for 4bytes register access, tested on RK3288 SoC
- Move phy callbacks to phy_ops and move Synopsys PHY calls into default ops
- Move HDMI link data into shared header
- Move Pixel Encoding enum to shared header
[1] http://lkml.kernel.org/r/1484656294-6140-1-git-send-email-narmstrong@baylibre.com
[2] http://lkml.kernel.org/r/1485774318-21916-1-git-send-email-narmstrong@baylibre.com
[3] http://lkml.kernel.org/r/20170303172007.26541-1-laurent.pinchart+renesas@ideasonboard.com
[4] http://lkml.kernel.org/r/1488468572-31971-1-git-send-email-narmstrong@baylibre.com
Laurent Pinchart (1):
drm: bridge: dw-hdmi: Extract PHY interrupt setup to a function
Neil Armstrong (5):
media: uapi: Add RGB and YUV bus formats for Synopsys HDMI TX
Controller
documentation: media: Add documentation for new RGB and YUV bus
formats
drm: bridge: dw-hdmi: Switch to V4L bus format and encodings
drm: bridge: dw-hdmi: Add Documentation on supported input formats
drm: bridge: dw-hdmi: Move HPD handling to PHY operations
Documentation/gpu/dw-hdmi.rst | 15 +
Documentation/gpu/index.rst | 1 +
Documentation/media/uapi/v4l/subdev-formats.rst | 4992 ++++++++++++++++++-----
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 465 ++-
include/drm/bridge/dw_hdmi.h | 68 +
include/uapi/linux/media-bus-format.h | 13 +-
6 files changed, 4368 insertions(+), 1186 deletions(-)
create mode 100644 Documentation/gpu/dw-hdmi.rst
--
1.9.1
[toc] | [next] | [standalone]
| From | Neil Armstrong <narmstrong@baylibre.com> |
|---|---|
| Date | 2017-03-07 20:30 +0100 |
| Subject | [PATCH v3 1/6] drm: bridge: dw-hdmi: Extract PHY interrupt setup to a function |
| Message-ID | <tiqWd-2hL-13@gated-at.bofh.it> |
| In reply to | #1594468 |
From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
In preparation for adding PHY operations to handle RX SENSE and HPD,
group all the PHY interrupt setup code in a single location and extract
it to a separate function.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 50 ++++++++++++++-----------------
1 file changed, 23 insertions(+), 27 deletions(-)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 026a0dc..1ed8bc1 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -1496,7 +1496,7 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
}
/* Wait until we are registered to enable interrupts */
-static int dw_hdmi_fb_registered(struct dw_hdmi *hdmi)
+static void dw_hdmi_fb_registered(struct dw_hdmi *hdmi)
{
hdmi_writeb(hdmi, HDMI_PHY_I2CM_INT_ADDR_DONE_POL,
HDMI_PHY_I2CM_INT_ADDR);
@@ -1504,15 +1504,6 @@ static int dw_hdmi_fb_registered(struct dw_hdmi *hdmi)
hdmi_writeb(hdmi, HDMI_PHY_I2CM_CTLINT_ADDR_NAC_POL |
HDMI_PHY_I2CM_CTLINT_ADDR_ARBITRATION_POL,
HDMI_PHY_I2CM_CTLINT_ADDR);
-
- /* enable cable hot plug irq */
- hdmi_writeb(hdmi, hdmi->phy_mask, HDMI_PHY_MASK0);
-
- /* Clear Hotplug interrupts */
- hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE,
- HDMI_IH_PHY_STAT0);
-
- return 0;
}
static void initialize_hdmi_ih_mutes(struct dw_hdmi *hdmi)
@@ -1630,6 +1621,26 @@ static void dw_hdmi_update_phy_mask(struct dw_hdmi *hdmi)
hdmi_writeb(hdmi, hdmi->phy_mask, HDMI_PHY_MASK0);
}
+static void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi)
+{
+ /*
+ * Configure the PHY RX SENSE and HPD interrupts polarities and clear
+ * any pending interrupt.
+ */
+ hdmi_writeb(hdmi, HDMI_PHY_HPD | HDMI_PHY_RX_SENSE, HDMI_PHY_POL0);
+ hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE,
+ HDMI_IH_PHY_STAT0);
+
+ /* Enable cable hot plug irq. */
+ hdmi_writeb(hdmi, hdmi->phy_mask, HDMI_PHY_MASK0);
+
+ /* Clear and unmute interrupts. */
+ hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE,
+ HDMI_IH_PHY_STAT0);
+ hdmi_writeb(hdmi, ~(HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE),
+ HDMI_IH_MUTE_PHY_STAT0);
+}
+
static enum drm_connector_status
dw_hdmi_connector_detect(struct drm_connector *connector, bool force)
{
@@ -2141,29 +2152,14 @@ static int dw_hdmi_detect_phy(struct dw_hdmi *hdmi)
hdmi->ddc = NULL;
}
- /*
- * Configure registers related to HDMI interrupt
- * generation before registering IRQ.
- */
- hdmi_writeb(hdmi, HDMI_PHY_HPD | HDMI_PHY_RX_SENSE, HDMI_PHY_POL0);
-
- /* Clear Hotplug interrupts */
- hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE,
- HDMI_IH_PHY_STAT0);
-
hdmi->bridge.driver_private = hdmi;
hdmi->bridge.funcs = &dw_hdmi_bridge_funcs;
#ifdef CONFIG_OF
hdmi->bridge.of_node = pdev->dev.of_node;
#endif
- ret = dw_hdmi_fb_registered(hdmi);
- if (ret)
- goto err_iahb;
-
- /* Unmute interrupts */
- hdmi_writeb(hdmi, ~(HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE),
- HDMI_IH_MUTE_PHY_STAT0);
+ dw_hdmi_fb_registered(hdmi);
+ dw_hdmi_phy_setup_hpd(hdmi);
memset(&pdevinfo, 0, sizeof(pdevinfo));
pdevinfo.parent = dev;
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Neil Armstrong <narmstrong@baylibre.com> |
|---|---|
| Date | 2017-03-07 20:40 +0100 |
| Subject | [PATCH v3 2/6] media: uapi: Add RGB and YUV bus formats for Synopsys HDMI TX Controller |
| Message-ID | <tit7I-3FT-17@gated-at.bofh.it> |
| In reply to | #1594468 |
In order to describe the RGB and YUB bus formats used to feed the Synopsys DesignWare HDMI TX Controller, add missing formats to the list of Bus Formats. Documentation for these formats is added in a separate patch. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> --- include/uapi/linux/media-bus-format.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h index 2168759..7cc820b 100644 --- a/include/uapi/linux/media-bus-format.h +++ b/include/uapi/linux/media-bus-format.h @@ -33,7 +33,7 @@ #define MEDIA_BUS_FMT_FIXED 0x0001 -/* RGB - next is 0x1018 */ +/* RGB - next is 0x101b */ #define MEDIA_BUS_FMT_RGB444_1X12 0x1016 #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001 #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002 @@ -57,8 +57,11 @@ #define MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA 0x1012 #define MEDIA_BUS_FMT_ARGB8888_1X32 0x100d #define MEDIA_BUS_FMT_RGB888_1X32_PADHI 0x100f +#define MEDIA_BUS_FMT_RGB101010_1X30 0x1018 +#define MEDIA_BUS_FMT_RGB121212_1X36 0x1019 +#define MEDIA_BUS_FMT_RGB161616_1X48 0x101a -/* YUV (including grey) - next is 0x2026 */ +/* YUV (including grey) - next is 0x202c */ #define MEDIA_BUS_FMT_Y8_1X8 0x2001 #define MEDIA_BUS_FMT_UV8_1X8 0x2015 #define MEDIA_BUS_FMT_UYVY8_1_5X8 0x2002 @@ -90,12 +93,18 @@ #define MEDIA_BUS_FMT_YVYU10_1X20 0x200e #define MEDIA_BUS_FMT_VUY8_1X24 0x2024 #define MEDIA_BUS_FMT_YUV8_1X24 0x2025 +#define MEDIA_BUS_FMT_UYVY8_1_1X24 0x2026 #define MEDIA_BUS_FMT_UYVY12_1X24 0x2020 #define MEDIA_BUS_FMT_VYUY12_1X24 0x2021 #define MEDIA_BUS_FMT_YUYV12_1X24 0x2022 #define MEDIA_BUS_FMT_YVYU12_1X24 0x2023 #define MEDIA_BUS_FMT_YUV10_1X30 0x2016 +#define MEDIA_BUS_FMT_UYVY10_1_1X30 0x2027 #define MEDIA_BUS_FMT_AYUV8_1X32 0x2017 +#define MEDIA_BUS_FMT_UYVY12_1_1X36 0x2028 +#define MEDIA_BUS_FMT_YUV12_1X36 0x2029 +#define MEDIA_BUS_FMT_YUV16_1X48 0x202a +#define MEDIA_BUS_FMT_UYVY16_1_1X48 0x202b /* Bayer - next is 0x3021 */ #define MEDIA_BUS_FMT_SBGGR8_1X8 0x3001 -- 1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Neil Armstrong <narmstrong@baylibre.com> |
|---|---|
| Date | 2017-03-07 21:50 +0100 |
| Subject | [PATCH v3 5/6] drm: bridge: dw-hdmi: Add Documentation on supported input formats |
| Message-ID | <tiuds-4ru-11@gated-at.bofh.it> |
| In reply to | #1594468 |
This patch adds a new DRM documentation entry and links to the input
format table added in the dw_hdmi header.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
Documentation/gpu/dw-hdmi.rst | 15 +++++++++++++++
Documentation/gpu/index.rst | 1 +
2 files changed, 16 insertions(+)
create mode 100644 Documentation/gpu/dw-hdmi.rst
diff --git a/Documentation/gpu/dw-hdmi.rst b/Documentation/gpu/dw-hdmi.rst
new file mode 100644
index 0000000..486faad
--- /dev/null
+++ b/Documentation/gpu/dw-hdmi.rst
@@ -0,0 +1,15 @@
+=======================================================
+ drm/bridge/dw-hdmi Synopsys DesignWare HDMI Controller
+=======================================================
+
+Synopsys DesignWare HDMI Controller
+===================================
+
+This section covers everything related to the Synopsys DesignWare HDMI
+Controller implemented as a DRM bridge.
+
+Supported Input Formats and Encodings
+-------------------------------------
+
+.. kernel-doc:: include/drm/bridge/dw_hdmi.h
+ :doc: Supported input formats and encodings
diff --git a/Documentation/gpu/index.rst b/Documentation/gpu/index.rst
index e998ee0..0725449 100644
--- a/Documentation/gpu/index.rst
+++ b/Documentation/gpu/index.rst
@@ -10,6 +10,7 @@ Linux GPU Driver Developer's Guide
drm-kms
drm-kms-helpers
drm-uapi
+ dw-hdmi
i915
tinydrm
vc4
--
1.9.1
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web