mirror of
https://github.com/a52xq-dev/kernel.git
synced 2026-10-18 21:58:11 +07:00
drm-misc-next for 4.17:
UAPI Changes: plane: Add color encoding/range properties (Jyri) nouveau: Replace iturbt_709 property with color_encoding property (Ville) Core Changes: atomic: Move plane clipping into plane check helper (Ville) property: Multiple new property checks/verification (Ville) Driver Changes: rockchip: Fixes & improvements for rk3399/chromebook plus (various) sun4i: Add H3/H5 HDMI support (Jernej) i915: Add support for limited/full-range ycbcr toggling (Ville) pl111: Add bandwidth checking/limiting (Linus) Cc: Jernej Skrabec <jernej.skrabec@siol.net> Cc: Jyri Sarha <jsarha@ti.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Linus Walleij <linus.walleij@linaro.org> -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfxcpfMSgdnQMs+QqlvcN/ahKBwoFAlqiy/cACgkQlvcN/ahK BwpkyQgAjqswNsnUP62lEow2MXoxDYAhyIh4PGR/fIp1/+pVm+UOOSMKJyQCVkPb 6M4svzPXdawcPrIBFzfb17N73PqRw4S768N2NgiSbDEDdIW6VtzE+qX8z/tu0nFy WVlm3ilqy8YSHy9f4Wx8a4bDh8OWX4ElsUbxrADuun/+7zYFsbiIL2/NQk3nexVF ZgWyoyJ2XlSkUn07ghjoBkNTvJ2GCh/G9QFaFQu8LfAXhj60XAcWOH0/lI0hPdCP 4JhAGZh1SDHoNxSFwriIw2k4GINLaHjGfDIQVvEtPwGOLJe9jH2KuuAdxahuT+yz tOn91ufpapxW9BUQoJHr/e6d0/CNqw== =gTcX -----END PGP SIGNATURE----- Merge tag 'drm-misc-next-2018-03-09-3' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 4.17: UAPI Changes: plane: Add color encoding/range properties (Jyri) nouveau: Replace iturbt_709 property with color_encoding property (Ville) Core Changes: atomic: Move plane clipping into plane check helper (Ville) property: Multiple new property checks/verification (Ville) Driver Changes: rockchip: Fixes & improvements for rk3399/chromebook plus (various) sun4i: Add H3/H5 HDMI support (Jernej) i915: Add support for limited/full-range ycbcr toggling (Ville) pl111: Add bandwidth checking/limiting (Linus) Cc: Jernej Skrabec <jernej.skrabec@siol.net> Cc: Jyri Sarha <jsarha@ti.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Linus Walleij <linus.walleij@linaro.org> * tag 'drm-misc-next-2018-03-09-3' of git://anongit.freedesktop.org/drm/drm-misc: (85 commits) drm/rockchip: Don't use atomic constructs for psr drm/rockchip: analogix_dp: set psr activate/deactivate when enable/disable bridge drm/rockchip: dw_hdmi: Move HDMI vpll clock enable to bind() drm/rockchip: inno_hdmi: reorder clk_disable_unprepare call in unbind drm/rockchip: inno_hdmi: Fix error handling path. drm/rockchip: dw-mipi-dsi: Fix connector and encoder cleanup. drm/nouveau: Replace the iturbt_709 prop with the standard COLOR_ENCODING prop drm/pl111: Use max memory bandwidth for resolution drm/bridge: sii902x: Retry status read after DDI I2C drm/pl111: Handle the RealView variant separately drm/pl111: Make the default BPP a per-variant variable drm: simple_kms_helper: Fix .mode_valid() documentation bridge: Elaborate a bit on dumb VGA bridges in Kconfig drm/atomic: Add new reverse iterator over all plane state (V2) drm: Reject bad property flag combinations drm: Make property flags u32 drm/uapi: Deprecate DRM_MODE_PROP_PENDING drm: WARN when trying to add enum value > 63 to a bitmask property drm: WARN when trying add enum values to non-enum/bitmask properties drm: Reject replacing property enum values ...
This commit is contained in:
commit
0b8eeac5c6
96 changed files with 1800 additions and 678 deletions
|
|
@ -102,6 +102,7 @@ DWC HDMI PHY
|
|||
Required properties:
|
||||
- compatible: value must be one of:
|
||||
* allwinner,sun8i-a83t-hdmi-phy
|
||||
* allwinner,sun8i-h3-hdmi-phy
|
||||
- reg: base address and size of memory-mapped region
|
||||
- clocks: phandles to the clocks feeding the HDMI PHY
|
||||
* bus: the HDMI PHY interface clock
|
||||
|
|
@ -110,6 +111,9 @@ Required properties:
|
|||
- resets: phandle to the reset controller driving the PHY
|
||||
- reset-names: must be "phy"
|
||||
|
||||
H3 HDMI PHY requires additional clock:
|
||||
- pll-0: parent of phy clock
|
||||
|
||||
TV Encoder
|
||||
----------
|
||||
|
||||
|
|
@ -275,6 +279,7 @@ Required properties:
|
|||
- compatible: value must be one of:
|
||||
* allwinner,sun8i-a83t-de2-mixer-0
|
||||
* allwinner,sun8i-a83t-de2-mixer-1
|
||||
* allwinner,sun8i-h3-de2-mixer-0
|
||||
* allwinner,sun8i-v3s-de2-mixer
|
||||
- reg: base address and size of the memory-mapped region.
|
||||
- clocks: phandles to the clocks feeding the mixer
|
||||
|
|
@ -305,6 +310,7 @@ Required properties:
|
|||
* allwinner,sun7i-a20-display-engine
|
||||
* allwinner,sun8i-a33-display-engine
|
||||
* allwinner,sun8i-a83t-display-engine
|
||||
* allwinner,sun8i-h3-display-engine
|
||||
* allwinner,sun8i-v3s-display-engine
|
||||
|
||||
- allwinner,pipelines: list of phandle to the display engine
|
||||
|
|
|
|||
|
|
@ -229,7 +229,6 @@ static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = {
|
|||
static int hdlcd_plane_atomic_check(struct drm_plane *plane,
|
||||
struct drm_plane_state *state)
|
||||
{
|
||||
struct drm_rect clip = { 0 };
|
||||
struct drm_crtc_state *crtc_state;
|
||||
u32 src_h = state->src_h >> 16;
|
||||
|
||||
|
|
@ -249,11 +248,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (crtc_state->enable)
|
||||
drm_mode_get_hv_timing(&crtc_state->mode,
|
||||
&clip.x2, &clip.y2);
|
||||
|
||||
return drm_atomic_helper_check_plane_state(state, crtc_state, &clip,
|
||||
return drm_atomic_helper_check_plane_state(state, crtc_state,
|
||||
DRM_PLANE_HELPER_NO_SCALING,
|
||||
DRM_PLANE_HELPER_NO_SCALING,
|
||||
false, true);
|
||||
|
|
|
|||
|
|
@ -141,18 +141,13 @@ static int malidp_se_check_scaling(struct malidp_plane *mp,
|
|||
struct drm_crtc_state *crtc_state =
|
||||
drm_atomic_get_existing_crtc_state(state->state, state->crtc);
|
||||
struct malidp_crtc_state *mc;
|
||||
struct drm_rect clip = { 0 };
|
||||
u32 src_w, src_h;
|
||||
int ret;
|
||||
|
||||
if (!crtc_state)
|
||||
return -EINVAL;
|
||||
|
||||
if (crtc_state->enable)
|
||||
drm_mode_get_hv_timing(&crtc_state->mode,
|
||||
&clip.x2, &clip.y2);
|
||||
|
||||
ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip,
|
||||
ret = drm_atomic_helper_check_plane_state(state, crtc_state,
|
||||
0, INT_MAX, true, true);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -1200,13 +1200,14 @@ static int armada_drm_primary_update(struct drm_plane *plane,
|
|||
.crtc_h = crtc_h,
|
||||
.rotation = DRM_MODE_ROTATE_0,
|
||||
};
|
||||
const struct drm_rect clip = {
|
||||
.x2 = crtc->mode.hdisplay,
|
||||
.y2 = crtc->mode.vdisplay,
|
||||
struct drm_crtc_state crtc_state = {
|
||||
.crtc = crtc,
|
||||
.enable = crtc->enabled,
|
||||
.mode = crtc->mode,
|
||||
};
|
||||
int ret;
|
||||
|
||||
ret = drm_atomic_helper_check_plane_state(&state, crtc->state, &clip, 0,
|
||||
ret = drm_atomic_helper_check_plane_state(&state, &crtc_state, 0,
|
||||
INT_MAX, true, false);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -205,9 +205,10 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
|
|||
.crtc_h = crtc_h,
|
||||
.rotation = DRM_MODE_ROTATE_0,
|
||||
};
|
||||
const struct drm_rect clip = {
|
||||
.x2 = crtc->mode.hdisplay,
|
||||
.y2 = crtc->mode.vdisplay,
|
||||
struct drm_crtc_state crtc_state = {
|
||||
.crtc = crtc,
|
||||
.enable = crtc->enabled,
|
||||
.mode = crtc->mode,
|
||||
};
|
||||
int ret;
|
||||
|
||||
|
|
@ -215,7 +216,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
|
|||
crtc_x, crtc_y, crtc_w, crtc_h,
|
||||
src_x, src_y, src_w, src_h);
|
||||
|
||||
ret = drm_atomic_helper_check_plane_state(&state, crtc->state, &clip, 0,
|
||||
ret = drm_atomic_helper_check_plane_state(&state, &crtc_state, 0,
|
||||
INT_MAX, true, false);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ config DRM_DUMB_VGA_DAC
|
|||
depends on OF
|
||||
select DRM_KMS_HELPER
|
||||
help
|
||||
Support for RGB to VGA DAC based bridges
|
||||
Support for non-programmable RGB to VGA DAC bridges, such as ADI
|
||||
ADV7123, TI THS8134 and THS8135 or passive resistor ladder DACs.
|
||||
|
||||
config DRM_LVDS_ENCODER
|
||||
tristate "Transparent parallel to LVDS encoder support"
|
||||
|
|
|
|||
|
|
@ -98,17 +98,15 @@ static int analogix_dp_detect_hpd(struct analogix_dp_device *dp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int analogix_dp_psr_supported(struct device *dev)
|
||||
int analogix_dp_psr_supported(struct analogix_dp_device *dp)
|
||||
{
|
||||
struct analogix_dp_device *dp = dev_get_drvdata(dev);
|
||||
|
||||
return dp->psr_support;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(analogix_dp_psr_supported);
|
||||
|
||||
int analogix_dp_enable_psr(struct device *dev)
|
||||
int analogix_dp_enable_psr(struct analogix_dp_device *dp)
|
||||
{
|
||||
struct analogix_dp_device *dp = dev_get_drvdata(dev);
|
||||
struct edp_vsc_psr psr_vsc;
|
||||
|
||||
if (!dp->psr_support)
|
||||
|
|
@ -129,9 +127,8 @@ int analogix_dp_enable_psr(struct device *dev)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(analogix_dp_enable_psr);
|
||||
|
||||
int analogix_dp_disable_psr(struct device *dev)
|
||||
int analogix_dp_disable_psr(struct analogix_dp_device *dp)
|
||||
{
|
||||
struct analogix_dp_device *dp = dev_get_drvdata(dev);
|
||||
struct edp_vsc_psr psr_vsc;
|
||||
int ret;
|
||||
|
||||
|
|
@ -1015,28 +1012,31 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge)
|
|||
{
|
||||
struct analogix_dp_device *dp = bridge->driver_private;
|
||||
struct drm_encoder *encoder = dp->encoder;
|
||||
struct drm_connector *connector = &dp->connector;
|
||||
int ret;
|
||||
struct drm_connector *connector = NULL;
|
||||
int ret = 0;
|
||||
|
||||
if (!bridge->encoder) {
|
||||
DRM_ERROR("Parent encoder object not found");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
connector->polled = DRM_CONNECTOR_POLL_HPD;
|
||||
if (!dp->plat_data->skip_connector) {
|
||||
connector = &dp->connector;
|
||||
connector->polled = DRM_CONNECTOR_POLL_HPD;
|
||||
|
||||
ret = drm_connector_init(dp->drm_dev, connector,
|
||||
&analogix_dp_connector_funcs,
|
||||
DRM_MODE_CONNECTOR_eDP);
|
||||
if (ret) {
|
||||
DRM_ERROR("Failed to initialize connector with drm\n");
|
||||
return ret;
|
||||
ret = drm_connector_init(dp->drm_dev, connector,
|
||||
&analogix_dp_connector_funcs,
|
||||
DRM_MODE_CONNECTOR_eDP);
|
||||
if (ret) {
|
||||
DRM_ERROR("Failed to initialize connector with drm\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
drm_connector_helper_add(connector,
|
||||
&analogix_dp_connector_helper_funcs);
|
||||
drm_mode_connector_attach_encoder(connector, encoder);
|
||||
}
|
||||
|
||||
drm_connector_helper_add(connector,
|
||||
&analogix_dp_connector_helper_funcs);
|
||||
drm_mode_connector_attach_encoder(connector, encoder);
|
||||
|
||||
/*
|
||||
* NOTE: the connector registration is implemented in analogix
|
||||
* platform driver, that to say connector would be exist after
|
||||
|
|
@ -1279,8 +1279,9 @@ static ssize_t analogix_dpaux_transfer(struct drm_dp_aux *aux,
|
|||
return analogix_dp_transfer(dp, msg);
|
||||
}
|
||||
|
||||
int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
|
||||
struct analogix_dp_plat_data *plat_data)
|
||||
struct analogix_dp_device *
|
||||
analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
|
||||
struct analogix_dp_plat_data *plat_data)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct analogix_dp_device *dp;
|
||||
|
|
@ -1290,14 +1291,12 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
|
|||
|
||||
if (!plat_data) {
|
||||
dev_err(dev, "Invalided input plat_data\n");
|
||||
return -EINVAL;
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
dp = devm_kzalloc(dev, sizeof(struct analogix_dp_device), GFP_KERNEL);
|
||||
if (!dp)
|
||||
return -ENOMEM;
|
||||
|
||||
dev_set_drvdata(dev, dp);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
dp->dev = &pdev->dev;
|
||||
dp->dpms_mode = DRM_MODE_DPMS_OFF;
|
||||
|
|
@ -1314,7 +1313,7 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
|
|||
|
||||
ret = analogix_dp_dt_parse_pdata(dp);
|
||||
if (ret)
|
||||
return ret;
|
||||
return ERR_PTR(ret);
|
||||
|
||||
dp->phy = devm_phy_get(dp->dev, "dp");
|
||||
if (IS_ERR(dp->phy)) {
|
||||
|
|
@ -1328,14 +1327,14 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
|
|||
if (ret == -ENOSYS || ret == -ENODEV)
|
||||
dp->phy = NULL;
|
||||
else
|
||||
return ret;
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
}
|
||||
|
||||
dp->clock = devm_clk_get(&pdev->dev, "dp");
|
||||
if (IS_ERR(dp->clock)) {
|
||||
dev_err(&pdev->dev, "failed to get clock\n");
|
||||
return PTR_ERR(dp->clock);
|
||||
return ERR_CAST(dp->clock);
|
||||
}
|
||||
|
||||
clk_prepare_enable(dp->clock);
|
||||
|
|
@ -1344,7 +1343,7 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
|
|||
|
||||
dp->reg_base = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(dp->reg_base))
|
||||
return PTR_ERR(dp->reg_base);
|
||||
return ERR_CAST(dp->reg_base);
|
||||
|
||||
dp->force_hpd = of_property_read_bool(dev->of_node, "force-hpd");
|
||||
|
||||
|
|
@ -1365,7 +1364,7 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
|
|||
"hpd_gpio");
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to get hpd gpio\n");
|
||||
return ret;
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
dp->irq = gpio_to_irq(dp->hpd_gpio);
|
||||
irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
|
||||
|
|
@ -1377,16 +1376,9 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
|
|||
|
||||
if (dp->irq == -ENXIO) {
|
||||
dev_err(&pdev->dev, "failed to get irq\n");
|
||||
return -ENODEV;
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
pm_runtime_enable(dev);
|
||||
|
||||
pm_runtime_get_sync(dev);
|
||||
phy_power_on(dp->phy);
|
||||
|
||||
analogix_dp_init_dp(dp);
|
||||
|
||||
ret = devm_request_threaded_irq(&pdev->dev, dp->irq,
|
||||
analogix_dp_hardirq,
|
||||
analogix_dp_irq_thread,
|
||||
|
|
@ -1406,38 +1398,30 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
|
|||
|
||||
ret = drm_dp_aux_register(&dp->aux);
|
||||
if (ret)
|
||||
goto err_disable_pm_runtime;
|
||||
return ERR_PTR(ret);
|
||||
|
||||
pm_runtime_enable(dev);
|
||||
|
||||
ret = analogix_dp_create_bridge(drm_dev, dp);
|
||||
if (ret) {
|
||||
DRM_ERROR("failed to create bridge (%d)\n", ret);
|
||||
drm_encoder_cleanup(dp->encoder);
|
||||
goto err_disable_pm_runtime;
|
||||
}
|
||||
|
||||
phy_power_off(dp->phy);
|
||||
pm_runtime_put(dev);
|
||||
|
||||
return 0;
|
||||
return dp;
|
||||
|
||||
err_disable_pm_runtime:
|
||||
|
||||
phy_power_off(dp->phy);
|
||||
pm_runtime_put(dev);
|
||||
pm_runtime_disable(dev);
|
||||
|
||||
return ret;
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(analogix_dp_bind);
|
||||
|
||||
void analogix_dp_unbind(struct device *dev, struct device *master,
|
||||
void *data)
|
||||
void analogix_dp_unbind(struct analogix_dp_device *dp)
|
||||
{
|
||||
struct analogix_dp_device *dp = dev_get_drvdata(dev);
|
||||
|
||||
analogix_dp_bridge_disable(dp->bridge);
|
||||
dp->connector.funcs->destroy(&dp->connector);
|
||||
dp->encoder->funcs->destroy(dp->encoder);
|
||||
|
||||
if (dp->plat_data->panel) {
|
||||
if (drm_panel_unprepare(dp->plat_data->panel))
|
||||
|
|
@ -1447,16 +1431,14 @@ void analogix_dp_unbind(struct device *dev, struct device *master,
|
|||
}
|
||||
|
||||
drm_dp_aux_unregister(&dp->aux);
|
||||
pm_runtime_disable(dev);
|
||||
pm_runtime_disable(dp->dev);
|
||||
clk_disable_unprepare(dp->clock);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(analogix_dp_unbind);
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
int analogix_dp_suspend(struct device *dev)
|
||||
int analogix_dp_suspend(struct analogix_dp_device *dp)
|
||||
{
|
||||
struct analogix_dp_device *dp = dev_get_drvdata(dev);
|
||||
|
||||
clk_disable_unprepare(dp->clock);
|
||||
|
||||
if (dp->plat_data->panel) {
|
||||
|
|
@ -1468,9 +1450,8 @@ int analogix_dp_suspend(struct device *dev)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(analogix_dp_suspend);
|
||||
|
||||
int analogix_dp_resume(struct device *dev)
|
||||
int analogix_dp_resume(struct analogix_dp_device *dp)
|
||||
{
|
||||
struct analogix_dp_device *dp = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
|
||||
ret = clk_prepare_enable(dp->clock);
|
||||
|
|
|
|||
|
|
@ -137,7 +137,9 @@ static int sii902x_get_modes(struct drm_connector *connector)
|
|||
struct sii902x *sii902x = connector_to_sii902x(connector);
|
||||
struct regmap *regmap = sii902x->regmap;
|
||||
u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
|
||||
struct device *dev = &sii902x->i2c->dev;
|
||||
unsigned long timeout;
|
||||
unsigned int retries;
|
||||
unsigned int status;
|
||||
struct edid *edid;
|
||||
int num = 0;
|
||||
|
|
@ -159,7 +161,7 @@ static int sii902x_get_modes(struct drm_connector *connector)
|
|||
time_before(jiffies, timeout));
|
||||
|
||||
if (!(status & SII902X_SYS_CTRL_DDC_BUS_GRTD)) {
|
||||
dev_err(&sii902x->i2c->dev, "failed to acquire the i2c bus\n");
|
||||
dev_err(dev, "failed to acquire the i2c bus\n");
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
|
|
@ -179,9 +181,19 @@ static int sii902x_get_modes(struct drm_connector *connector)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = regmap_read(regmap, SII902X_SYS_CTRL_DATA, &status);
|
||||
/*
|
||||
* Sometimes the I2C bus can stall after failure to use the
|
||||
* EDID channel. Retry a few times to see if things clear
|
||||
* up, else continue anyway.
|
||||
*/
|
||||
retries = 5;
|
||||
do {
|
||||
ret = regmap_read(regmap, SII902X_SYS_CTRL_DATA,
|
||||
&status);
|
||||
retries--;
|
||||
} while (ret && retries);
|
||||
if (ret)
|
||||
return ret;
|
||||
dev_err(dev, "failed to read status (%d)\n", ret);
|
||||
|
||||
ret = regmap_update_bits(regmap, SII902X_SYS_CTRL_DATA,
|
||||
SII902X_SYS_CTRL_DDC_BUS_REQ |
|
||||
|
|
@ -201,7 +213,7 @@ static int sii902x_get_modes(struct drm_connector *connector)
|
|||
|
||||
if (status & (SII902X_SYS_CTRL_DDC_BUS_REQ |
|
||||
SII902X_SYS_CTRL_DDC_BUS_GRTD)) {
|
||||
dev_err(&sii902x->i2c->dev, "failed to release the i2c bus\n");
|
||||
dev_err(dev, "failed to release the i2c bus\n");
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1654,6 +1654,8 @@ static void dw_hdmi_clear_overflow(struct dw_hdmi *hdmi)
|
|||
* (v1.31a) and multiple Allwinner SoCs (v1.32a) have been identified
|
||||
* as needing the workaround, with 4 iterations for v1.30a and 1
|
||||
* iteration for others.
|
||||
* The Amlogic Meson GX SoCs (v2.01a) have been identified as needing
|
||||
* the workaround with a single iteration.
|
||||
*/
|
||||
|
||||
switch (hdmi->version) {
|
||||
|
|
@ -1662,6 +1664,7 @@ static void dw_hdmi_clear_overflow(struct dw_hdmi *hdmi)
|
|||
break;
|
||||
case 0x131a:
|
||||
case 0x132a:
|
||||
case 0x201a:
|
||||
count = 1;
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ static int dw_mipi_dsi_gen_pkt_hdr_write(struct dw_mipi_dsi *dsi, u32 hdr_val)
|
|||
ret = readl_poll_timeout(dsi->base + DSI_CMD_PKT_STATUS,
|
||||
val, !(val & GEN_CMD_FULL), 1000,
|
||||
CMD_PKT_STATUS_TIMEOUT_US);
|
||||
if (ret < 0) {
|
||||
if (ret) {
|
||||
dev_err(dsi->dev, "failed to get available command FIFO\n");
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -353,7 +353,7 @@ static int dw_mipi_dsi_gen_pkt_hdr_write(struct dw_mipi_dsi *dsi, u32 hdr_val)
|
|||
ret = readl_poll_timeout(dsi->base + DSI_CMD_PKT_STATUS,
|
||||
val, (val & mask) == mask,
|
||||
1000, CMD_PKT_STATUS_TIMEOUT_US);
|
||||
if (ret < 0) {
|
||||
if (ret) {
|
||||
dev_err(dsi->dev, "failed to write command FIFO\n");
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -385,7 +385,7 @@ static int dw_mipi_dsi_write(struct dw_mipi_dsi *dsi,
|
|||
ret = readl_poll_timeout(dsi->base + DSI_CMD_PKT_STATUS,
|
||||
val, !(val & GEN_PLD_W_FULL), 1000,
|
||||
CMD_PKT_STATUS_TIMEOUT_US);
|
||||
if (ret < 0) {
|
||||
if (ret) {
|
||||
dev_err(dsi->dev,
|
||||
"failed to get available write payload FIFO\n");
|
||||
return ret;
|
||||
|
|
@ -721,13 +721,13 @@ static void dw_mipi_dsi_dphy_enable(struct dw_mipi_dsi *dsi)
|
|||
|
||||
ret = readl_poll_timeout(dsi->base + DSI_PHY_STATUS, val,
|
||||
val & PHY_LOCK, 1000, PHY_STATUS_TIMEOUT_US);
|
||||
if (ret < 0)
|
||||
if (ret)
|
||||
DRM_DEBUG_DRIVER("failed to wait phy lock state\n");
|
||||
|
||||
ret = readl_poll_timeout(dsi->base + DSI_PHY_STATUS,
|
||||
val, val & PHY_STOP_STATE_CLK_LANE, 1000,
|
||||
PHY_STATUS_TIMEOUT_US);
|
||||
if (ret < 0)
|
||||
if (ret)
|
||||
DRM_DEBUG_DRIVER("failed to wait phy clk lane stop state\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -759,6 +759,10 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane,
|
|||
state->rotation = val;
|
||||
} else if (property == plane->zpos_property) {
|
||||
state->zpos = val;
|
||||
} else if (property == plane->color_encoding_property) {
|
||||
state->color_encoding = val;
|
||||
} else if (property == plane->color_range_property) {
|
||||
state->color_range = val;
|
||||
} else if (plane->funcs->atomic_set_property) {
|
||||
return plane->funcs->atomic_set_property(plane, state,
|
||||
property, val);
|
||||
|
|
@ -818,6 +822,10 @@ drm_atomic_plane_get_property(struct drm_plane *plane,
|
|||
*val = state->rotation;
|
||||
} else if (property == plane->zpos_property) {
|
||||
*val = state->zpos;
|
||||
} else if (property == plane->color_encoding_property) {
|
||||
*val = state->color_encoding;
|
||||
} else if (property == plane->color_range_property) {
|
||||
*val = state->color_range;
|
||||
} else if (plane->funcs->atomic_get_property) {
|
||||
return plane->funcs->atomic_get_property(plane, state, property, val);
|
||||
} else {
|
||||
|
|
@ -882,12 +890,14 @@ static int drm_atomic_plane_check(struct drm_plane *plane,
|
|||
}
|
||||
|
||||
/* Check whether this plane supports the fb pixel format. */
|
||||
ret = drm_plane_check_pixel_format(plane, state->fb->format->format);
|
||||
ret = drm_plane_check_pixel_format(plane, state->fb->format->format,
|
||||
state->fb->modifier);
|
||||
if (ret) {
|
||||
struct drm_format_name_buf format_name;
|
||||
DRM_DEBUG_ATOMIC("Invalid pixel format %s\n",
|
||||
drm_get_format_name(state->fb->format->format,
|
||||
&format_name));
|
||||
DRM_DEBUG_ATOMIC("Invalid pixel format %s, modifier 0x%llx\n",
|
||||
drm_get_format_name(state->fb->format->format,
|
||||
&format_name),
|
||||
state->fb->modifier);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -944,6 +954,10 @@ static void drm_atomic_plane_print_state(struct drm_printer *p,
|
|||
drm_printf(p, "\tcrtc-pos=" DRM_RECT_FMT "\n", DRM_RECT_ARG(&dest));
|
||||
drm_printf(p, "\tsrc-pos=" DRM_RECT_FP_FMT "\n", DRM_RECT_FP_ARG(&src));
|
||||
drm_printf(p, "\trotation=%x\n", state->rotation);
|
||||
drm_printf(p, "\tcolor-encoding=%s\n",
|
||||
drm_get_color_encoding_name(state->color_encoding));
|
||||
drm_printf(p, "\tcolor-range=%s\n",
|
||||
drm_get_color_range_name(state->color_range));
|
||||
|
||||
if (plane->funcs->atomic_print_state)
|
||||
plane->funcs->atomic_print_state(p, state);
|
||||
|
|
|
|||
|
|
@ -699,7 +699,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset);
|
|||
* drm_atomic_helper_check_plane_state() - Check plane state for validity
|
||||
* @plane_state: plane state to check
|
||||
* @crtc_state: crtc state to check
|
||||
* @clip: integer clipping coordinates
|
||||
* @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point
|
||||
* @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point
|
||||
* @can_position: is it legal to position the plane such that it
|
||||
|
|
@ -719,7 +718,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset);
|
|||
*/
|
||||
int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
|
||||
const struct drm_crtc_state *crtc_state,
|
||||
const struct drm_rect *clip,
|
||||
int min_scale,
|
||||
int max_scale,
|
||||
bool can_position,
|
||||
|
|
@ -729,6 +727,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
|
|||
struct drm_rect *src = &plane_state->src;
|
||||
struct drm_rect *dst = &plane_state->dst;
|
||||
unsigned int rotation = plane_state->rotation;
|
||||
struct drm_rect clip = {};
|
||||
int hscale, vscale;
|
||||
|
||||
WARN_ON(plane_state->crtc && plane_state->crtc != crtc_state->crtc);
|
||||
|
|
@ -764,7 +763,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
|
|||
return -ERANGE;
|
||||
}
|
||||
|
||||
plane_state->visible = drm_rect_clip_scaled(src, dst, clip, hscale, vscale);
|
||||
if (crtc_state->enable)
|
||||
drm_mode_get_hv_timing(&crtc_state->mode, &clip.x2, &clip.y2);
|
||||
|
||||
plane_state->visible = drm_rect_clip_scaled(src, dst, &clip, hscale, vscale);
|
||||
|
||||
drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16, rotation);
|
||||
|
||||
|
|
@ -778,10 +780,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
|
|||
*/
|
||||
return 0;
|
||||
|
||||
if (!can_position && !drm_rect_equals(dst, clip)) {
|
||||
if (!can_position && !drm_rect_equals(dst, &clip)) {
|
||||
DRM_DEBUG_KMS("Plane must cover entire CRTC\n");
|
||||
drm_rect_debug_print("dst: ", dst, false);
|
||||
drm_rect_debug_print("clip: ", clip, false);
|
||||
drm_rect_debug_print("clip: ", &clip, false);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,20 @@
|
|||
* drm_mode_crtc_set_gamma_size(). Drivers which support both should use
|
||||
* drm_atomic_helper_legacy_gamma_set() to alias the legacy gamma ramp with the
|
||||
* "GAMMA_LUT" property above.
|
||||
*
|
||||
* Support for different non RGB color encodings is controlled through
|
||||
* &drm_plane specific COLOR_ENCODING and COLOR_RANGE properties. They
|
||||
* are set up by calling drm_plane_create_color_properties().
|
||||
*
|
||||
* "COLOR_ENCODING"
|
||||
* Optional plane enum property to support different non RGB
|
||||
* color encodings. The driver can provide a subset of standard
|
||||
* enum values supported by the DRM plane.
|
||||
*
|
||||
* "COLOR_RANGE"
|
||||
* Optional plane enum property to support different non RGB
|
||||
* color parameter ranges. The driver can provide a subset of
|
||||
* standard enum values supported by the DRM plane.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
@ -339,3 +353,122 @@ out:
|
|||
drm_modeset_unlock(&crtc->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const char * const color_encoding_name[] = {
|
||||
[DRM_COLOR_YCBCR_BT601] = "ITU-R BT.601 YCbCr",
|
||||
[DRM_COLOR_YCBCR_BT709] = "ITU-R BT.709 YCbCr",
|
||||
[DRM_COLOR_YCBCR_BT2020] = "ITU-R BT.2020 YCbCr",
|
||||
};
|
||||
|
||||
static const char * const color_range_name[] = {
|
||||
[DRM_COLOR_YCBCR_FULL_RANGE] = "YCbCr full range",
|
||||
[DRM_COLOR_YCBCR_LIMITED_RANGE] = "YCbCr limited range",
|
||||
};
|
||||
|
||||
/**
|
||||
* drm_get_color_encoding_name - return a string for color encoding
|
||||
* @encoding: color encoding to compute name of
|
||||
*
|
||||
* In contrast to the other drm_get_*_name functions this one here returns a
|
||||
* const pointer and hence is threadsafe.
|
||||
*/
|
||||
const char *drm_get_color_encoding_name(enum drm_color_encoding encoding)
|
||||
{
|
||||
if (WARN_ON(encoding >= ARRAY_SIZE(color_encoding_name)))
|
||||
return "unknown";
|
||||
|
||||
return color_encoding_name[encoding];
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_get_color_range_name - return a string for color range
|
||||
* @range: color range to compute name of
|
||||
*
|
||||
* In contrast to the other drm_get_*_name functions this one here returns a
|
||||
* const pointer and hence is threadsafe.
|
||||
*/
|
||||
const char *drm_get_color_range_name(enum drm_color_range range)
|
||||
{
|
||||
if (WARN_ON(range >= ARRAY_SIZE(color_range_name)))
|
||||
return "unknown";
|
||||
|
||||
return color_range_name[range];
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_plane_create_color_properties - color encoding related plane properties
|
||||
* @plane: plane object
|
||||
* @supported_encodings: bitfield indicating supported color encodings
|
||||
* @supported_ranges: bitfileld indicating supported color ranges
|
||||
* @default_encoding: default color encoding
|
||||
* @default_range: default color range
|
||||
*
|
||||
* Create and attach plane specific COLOR_ENCODING and COLOR_RANGE
|
||||
* properties to @plane. The supported encodings and ranges should
|
||||
* be provided in supported_encodings and supported_ranges bitmasks.
|
||||
* Each bit set in the bitmask indicates that its number as enum
|
||||
* value is supported.
|
||||
*/
|
||||
int drm_plane_create_color_properties(struct drm_plane *plane,
|
||||
u32 supported_encodings,
|
||||
u32 supported_ranges,
|
||||
enum drm_color_encoding default_encoding,
|
||||
enum drm_color_range default_range)
|
||||
{
|
||||
struct drm_device *dev = plane->dev;
|
||||
struct drm_property *prop;
|
||||
struct drm_prop_enum_list enum_list[max(DRM_COLOR_ENCODING_MAX,
|
||||
DRM_COLOR_RANGE_MAX)];
|
||||
int i, len;
|
||||
|
||||
if (WARN_ON(supported_encodings == 0 ||
|
||||
(supported_encodings & -BIT(DRM_COLOR_ENCODING_MAX)) != 0 ||
|
||||
(supported_encodings & BIT(default_encoding)) == 0))
|
||||
return -EINVAL;
|
||||
|
||||
if (WARN_ON(supported_ranges == 0 ||
|
||||
(supported_ranges & -BIT(DRM_COLOR_RANGE_MAX)) != 0 ||
|
||||
(supported_ranges & BIT(default_range)) == 0))
|
||||
return -EINVAL;
|
||||
|
||||
len = 0;
|
||||
for (i = 0; i < DRM_COLOR_ENCODING_MAX; i++) {
|
||||
if ((supported_encodings & BIT(i)) == 0)
|
||||
continue;
|
||||
|
||||
enum_list[len].type = i;
|
||||
enum_list[len].name = color_encoding_name[i];
|
||||
len++;
|
||||
}
|
||||
|
||||
prop = drm_property_create_enum(dev, 0, "COLOR_ENCODING",
|
||||
enum_list, len);
|
||||
if (!prop)
|
||||
return -ENOMEM;
|
||||
plane->color_encoding_property = prop;
|
||||
drm_object_attach_property(&plane->base, prop, default_encoding);
|
||||
if (plane->state)
|
||||
plane->state->color_encoding = default_encoding;
|
||||
|
||||
len = 0;
|
||||
for (i = 0; i < DRM_COLOR_RANGE_MAX; i++) {
|
||||
if ((supported_ranges & BIT(i)) == 0)
|
||||
continue;
|
||||
|
||||
enum_list[len].type = i;
|
||||
enum_list[len].name = color_range_name[i];
|
||||
len++;
|
||||
}
|
||||
|
||||
prop = drm_property_create_enum(dev, 0, "COLOR_RANGE",
|
||||
enum_list, len);
|
||||
if (!prop)
|
||||
return -ENOMEM;
|
||||
plane->color_range_property = prop;
|
||||
drm_object_attach_property(&plane->base, prop, default_range);
|
||||
if (plane->state)
|
||||
plane->state->color_range = default_range;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(drm_plane_create_color_properties);
|
||||
|
|
|
|||
|
|
@ -629,12 +629,14 @@ retry:
|
|||
*/
|
||||
if (!crtc->primary->format_default) {
|
||||
ret = drm_plane_check_pixel_format(crtc->primary,
|
||||
fb->format->format);
|
||||
fb->format->format,
|
||||
fb->modifier);
|
||||
if (ret) {
|
||||
struct drm_format_name_buf format_name;
|
||||
DRM_DEBUG_KMS("Invalid pixel format %s\n",
|
||||
drm_get_format_name(fb->format->format,
|
||||
&format_name));
|
||||
DRM_DEBUG_KMS("Invalid pixel format %s, modifier 0x%llx\n",
|
||||
drm_get_format_name(fb->format->format,
|
||||
&format_name),
|
||||
fb->modifier);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
|
|||
void *data, struct drm_file *file_priv);
|
||||
|
||||
/* drm_color_mgmt.c */
|
||||
const char *drm_get_color_encoding_name(enum drm_color_encoding encoding);
|
||||
const char *drm_get_color_range_name(enum drm_color_range range);
|
||||
|
||||
/* IOCTLs */
|
||||
int drm_mode_gamma_get_ioctl(struct drm_device *dev,
|
||||
|
|
@ -196,8 +198,8 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
|
|||
/* drm_plane.c */
|
||||
int drm_plane_register_all(struct drm_device *dev);
|
||||
void drm_plane_unregister_all(struct drm_device *dev);
|
||||
int drm_plane_check_pixel_format(const struct drm_plane *plane,
|
||||
u32 format);
|
||||
int drm_plane_check_pixel_format(struct drm_plane *plane,
|
||||
u32 format, u64 modifier);
|
||||
|
||||
/* drm_bridge.c */
|
||||
void drm_bridge_detach(struct drm_bridge *bridge);
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ static struct drm_minor **drm_minor_get_slot(struct drm_device *dev,
|
|||
case DRM_MINOR_CONTROL:
|
||||
return &dev->control;
|
||||
default:
|
||||
return NULL;
|
||||
BUG();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ EXPORT_SYMBOL(drm_legacy_ioremapfree);
|
|||
u64 drm_get_max_iomem(void)
|
||||
{
|
||||
struct resource *tmp;
|
||||
u64 max_iomem = 0;
|
||||
resource_size_t max_iomem = 0;
|
||||
|
||||
for (tmp = iomem_resource.child; tmp; tmp = tmp->sibling) {
|
||||
max_iomem = max(max_iomem, tmp->end);
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ static void drm_mm_interval_tree_add_node(struct drm_mm_node *hole_node,
|
|||
struct drm_mm *mm = hole_node->mm;
|
||||
struct rb_node **link, *rb;
|
||||
struct drm_mm_node *parent;
|
||||
bool leftmost = true;
|
||||
bool leftmost;
|
||||
|
||||
node->__subtree_last = LAST(node);
|
||||
|
||||
|
|
@ -201,6 +201,7 @@ static void drm_mm_interval_tree_add_node(struct drm_mm_node *hole_node,
|
|||
} else {
|
||||
rb = NULL;
|
||||
link = &mm->interval_tree.rb_root.rb_node;
|
||||
leftmost = true;
|
||||
}
|
||||
|
||||
while (*link) {
|
||||
|
|
@ -208,11 +209,11 @@ static void drm_mm_interval_tree_add_node(struct drm_mm_node *hole_node,
|
|||
parent = rb_entry(rb, struct drm_mm_node, rb);
|
||||
if (parent->__subtree_last < node->__subtree_last)
|
||||
parent->__subtree_last = node->__subtree_last;
|
||||
if (node->start < parent->start)
|
||||
if (node->start < parent->start) {
|
||||
link = &parent->rb.rb_left;
|
||||
else {
|
||||
} else {
|
||||
link = &parent->rb.rb_right;
|
||||
leftmost = true;
|
||||
leftmost = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ retry:
|
|||
kfree(ctx);
|
||||
return;
|
||||
}
|
||||
ww_acquire_done(&ctx->ww_ctx);
|
||||
|
||||
WARN_ON(config->acquire_ctx);
|
||||
|
||||
|
|
|
|||
|
|
@ -122,12 +122,10 @@ int drm_of_component_probe(struct device *dev,
|
|||
if (!port)
|
||||
break;
|
||||
|
||||
if (!of_device_is_available(port->parent)) {
|
||||
of_node_put(port);
|
||||
continue;
|
||||
}
|
||||
if (of_device_is_available(port->parent))
|
||||
drm_of_component_match_add(dev, &match, compare_of,
|
||||
port);
|
||||
|
||||
drm_of_component_match_add(dev, &match, compare_of, port);
|
||||
of_node_put(port);
|
||||
}
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue