Skip to content

Commit

Permalink
Merge tag 'drm-misc-next-2018-03-09-3' of git://anongit.freedesktop.o…
Browse files Browse the repository at this point in the history
…rg/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 <[email protected]>
Cc: Jyri Sarha <[email protected]>
Cc: Ville Syrjälä <[email protected]>
Cc: Linus Walleij <[email protected]>

* 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
  ...
  • Loading branch information
airlied committed Mar 14, 2018
2 parents 62ccb65 + 60beecc commit 0b8eeac
Show file tree
Hide file tree
Showing 96 changed files with 1,800 additions and 678 deletions.
6 changes: 6 additions & 0 deletions Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
----------

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 1 addition & 6 deletions drivers/gpu/drm/arm/hdlcd_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down
7 changes: 1 addition & 6 deletions drivers/gpu/drm/arm/malidp_planes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 5 additions & 4 deletions drivers/gpu/drm/armada/armada_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 5 additions & 4 deletions drivers/gpu/drm/armada/armada_overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,18 @@ 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;

trace_armada_ovl_plane_update(plane, crtc, fb,
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;
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/bridge/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
97 changes: 39 additions & 58 deletions drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;

Expand Down Expand Up @@ -1015,27 +1012,30 @@ 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
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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)) {
Expand All @@ -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);
Expand All @@ -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");

Expand All @@ -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;
Expand All @@ -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,
Expand All @@ -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))
Expand All @@ -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) {
Expand All @@ -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);
Expand Down
Loading

0 comments on commit 0b8eeac

Please sign in to comment.