Commit e32b2484 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-misc-fixes-2020-04-23' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

A few resources-related fixes (tidss, dp_mst, scheduler), probe fixes and
DT bindings adjustments.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200423103224.7hvyr3v7dmuny2bz@gilmour.lan
parents 11c5ec78 9da67433
...@@ -37,7 +37,6 @@ examples: ...@@ -37,7 +37,6 @@ examples:
dsi { dsi {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
reg = <0xff450000 0x1000>;
panel@0 { panel@0 {
compatible = "leadtek,ltk500hd1829"; compatible = "leadtek,ltk500hd1829";
......
...@@ -96,12 +96,20 @@ properties: ...@@ -96,12 +96,20 @@ properties:
If set, reverse the bit order described in the data mappings below on all If set, reverse the bit order described in the data mappings below on all
data lanes, transmitting bits for slots 6 to 0 instead of 0 to 6. data lanes, transmitting bits for slots 6 to 0 instead of 0 to 6.
port: true
ports: true
required: required:
- compatible - compatible
- data-mapping - data-mapping
- width-mm - width-mm
- height-mm - height-mm
- panel-timing - panel-timing
oneOf:
- required:
- port - port
- required:
- ports
... ...
...@@ -37,7 +37,6 @@ examples: ...@@ -37,7 +37,6 @@ examples:
dsi { dsi {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
reg = <0xff450000 0x1000>;
panel@0 { panel@0 {
compatible = "xinpeng,xpp055c272"; compatible = "xinpeng,xpp055c272";
......
...@@ -485,6 +485,9 @@ static int anx6345_get_modes(struct drm_connector *connector) ...@@ -485,6 +485,9 @@ static int anx6345_get_modes(struct drm_connector *connector)
num_modes += drm_add_edid_modes(connector, anx6345->edid); num_modes += drm_add_edid_modes(connector, anx6345->edid);
/* Driver currently supports only 6bpc */
connector->display_info.bpc = 6;
unlock: unlock:
if (power_off) if (power_off)
anx6345_poweroff(anx6345); anx6345_poweroff(anx6345);
......
...@@ -4295,6 +4295,7 @@ int drm_dp_atomic_release_vcpi_slots(struct drm_atomic_state *state, ...@@ -4295,6 +4295,7 @@ int drm_dp_atomic_release_vcpi_slots(struct drm_atomic_state *state,
if (pos->vcpi) { if (pos->vcpi) {
drm_dp_mst_put_port_malloc(port); drm_dp_mst_put_port_malloc(port);
pos->vcpi = 0; pos->vcpi = 0;
pos->pbn = 0;
} }
return 0; return 0;
......
...@@ -1034,10 +1034,8 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master, ...@@ -1034,10 +1034,8 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
return PTR_ERR(dw_plat_data->regm); return PTR_ERR(dw_plat_data->regm);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(dev, "Failed to get hdmi top irq\n");
return irq; return irq;
}
ret = devm_request_threaded_irq(dev, irq, dw_hdmi_top_irq, ret = devm_request_threaded_irq(dev, irq, dw_hdmi_top_irq,
dw_hdmi_top_thread_irq, IRQF_SHARED, dw_hdmi_top_thread_irq, IRQF_SHARED,
......
...@@ -676,7 +676,7 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched) ...@@ -676,7 +676,7 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
*/ */
if ((sched->timeout != MAX_SCHEDULE_TIMEOUT && if ((sched->timeout != MAX_SCHEDULE_TIMEOUT &&
!cancel_delayed_work(&sched->work_tdr)) || !cancel_delayed_work(&sched->work_tdr)) ||
__kthread_should_park(sched->thread)) kthread_should_park())
return NULL; return NULL;
spin_lock(&sched->job_list_lock); spin_lock(&sched->job_list_lock);
......
...@@ -379,9 +379,17 @@ static struct drm_crtc_state *tidss_crtc_duplicate_state(struct drm_crtc *crtc) ...@@ -379,9 +379,17 @@ static struct drm_crtc_state *tidss_crtc_duplicate_state(struct drm_crtc *crtc)
return &state->base; return &state->base;
} }
static void tidss_crtc_destroy(struct drm_crtc *crtc)
{
struct tidss_crtc *tcrtc = to_tidss_crtc(crtc);
drm_crtc_cleanup(crtc);
kfree(tcrtc);
}
static const struct drm_crtc_funcs tidss_crtc_funcs = { static const struct drm_crtc_funcs tidss_crtc_funcs = {
.reset = tidss_crtc_reset, .reset = tidss_crtc_reset,
.destroy = drm_crtc_cleanup, .destroy = tidss_crtc_destroy,
.set_config = drm_atomic_helper_set_config, .set_config = drm_atomic_helper_set_config,
.page_flip = drm_atomic_helper_page_flip, .page_flip = drm_atomic_helper_page_flip,
.atomic_duplicate_state = tidss_crtc_duplicate_state, .atomic_duplicate_state = tidss_crtc_duplicate_state,
...@@ -400,7 +408,7 @@ struct tidss_crtc *tidss_crtc_create(struct tidss_device *tidss, ...@@ -400,7 +408,7 @@ struct tidss_crtc *tidss_crtc_create(struct tidss_device *tidss,
bool has_ctm = tidss->feat->vp_feat.color.has_ctm; bool has_ctm = tidss->feat->vp_feat.color.has_ctm;
int ret; int ret;
tcrtc = devm_kzalloc(tidss->dev, sizeof(*tcrtc), GFP_KERNEL); tcrtc = kzalloc(sizeof(*tcrtc), GFP_KERNEL);
if (!tcrtc) if (!tcrtc)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
...@@ -411,8 +419,10 @@ struct tidss_crtc *tidss_crtc_create(struct tidss_device *tidss, ...@@ -411,8 +419,10 @@ struct tidss_crtc *tidss_crtc_create(struct tidss_device *tidss,
ret = drm_crtc_init_with_planes(&tidss->ddev, crtc, primary, ret = drm_crtc_init_with_planes(&tidss->ddev, crtc, primary,
NULL, &tidss_crtc_funcs, NULL); NULL, &tidss_crtc_funcs, NULL);
if (ret < 0) if (ret < 0) {
kfree(tcrtc);
return ERR_PTR(ret); return ERR_PTR(ret);
}
drm_crtc_helper_add(crtc, &tidss_crtc_helper_funcs); drm_crtc_helper_add(crtc, &tidss_crtc_helper_funcs);
......
...@@ -55,12 +55,18 @@ static int tidss_encoder_atomic_check(struct drm_encoder *encoder, ...@@ -55,12 +55,18 @@ static int tidss_encoder_atomic_check(struct drm_encoder *encoder,
return 0; return 0;
} }
static void tidss_encoder_destroy(struct drm_encoder *encoder)
{
drm_encoder_cleanup(encoder);
kfree(encoder);
}
static const struct drm_encoder_helper_funcs encoder_helper_funcs = { static const struct drm_encoder_helper_funcs encoder_helper_funcs = {
.atomic_check = tidss_encoder_atomic_check, .atomic_check = tidss_encoder_atomic_check,
}; };
static const struct drm_encoder_funcs encoder_funcs = { static const struct drm_encoder_funcs encoder_funcs = {
.destroy = drm_encoder_cleanup, .destroy = tidss_encoder_destroy,
}; };
struct drm_encoder *tidss_encoder_create(struct tidss_device *tidss, struct drm_encoder *tidss_encoder_create(struct tidss_device *tidss,
...@@ -69,7 +75,7 @@ struct drm_encoder *tidss_encoder_create(struct tidss_device *tidss, ...@@ -69,7 +75,7 @@ struct drm_encoder *tidss_encoder_create(struct tidss_device *tidss,
struct drm_encoder *enc; struct drm_encoder *enc;
int ret; int ret;
enc = devm_kzalloc(tidss->dev, sizeof(*enc), GFP_KERNEL); enc = kzalloc(sizeof(*enc), GFP_KERNEL);
if (!enc) if (!enc)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
...@@ -77,8 +83,10 @@ struct drm_encoder *tidss_encoder_create(struct tidss_device *tidss, ...@@ -77,8 +83,10 @@ struct drm_encoder *tidss_encoder_create(struct tidss_device *tidss,
ret = drm_encoder_init(&tidss->ddev, enc, &encoder_funcs, ret = drm_encoder_init(&tidss->ddev, enc, &encoder_funcs,
encoder_type, NULL); encoder_type, NULL);
if (ret < 0) if (ret < 0) {
kfree(enc);
return ERR_PTR(ret); return ERR_PTR(ret);
}
drm_encoder_helper_add(enc, &encoder_helper_funcs); drm_encoder_helper_add(enc, &encoder_helper_funcs);
......
...@@ -141,6 +141,14 @@ static void tidss_plane_atomic_disable(struct drm_plane *plane, ...@@ -141,6 +141,14 @@ static void tidss_plane_atomic_disable(struct drm_plane *plane,
dispc_plane_enable(tidss->dispc, tplane->hw_plane_id, false); dispc_plane_enable(tidss->dispc, tplane->hw_plane_id, false);
} }
static void drm_plane_destroy(struct drm_plane *plane)
{
struct tidss_plane *tplane = to_tidss_plane(plane);
drm_plane_cleanup(plane);
kfree(tplane);
}
static const struct drm_plane_helper_funcs tidss_plane_helper_funcs = { static const struct drm_plane_helper_funcs tidss_plane_helper_funcs = {
.atomic_check = tidss_plane_atomic_check, .atomic_check = tidss_plane_atomic_check,
.atomic_update = tidss_plane_atomic_update, .atomic_update = tidss_plane_atomic_update,
...@@ -151,7 +159,7 @@ static const struct drm_plane_funcs tidss_plane_funcs = { ...@@ -151,7 +159,7 @@ static const struct drm_plane_funcs tidss_plane_funcs = {
.update_plane = drm_atomic_helper_update_plane, .update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane, .disable_plane = drm_atomic_helper_disable_plane,
.reset = drm_atomic_helper_plane_reset, .reset = drm_atomic_helper_plane_reset,
.destroy = drm_plane_cleanup, .destroy = drm_plane_destroy,
.atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_plane_destroy_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
}; };
...@@ -175,7 +183,7 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss, ...@@ -175,7 +183,7 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss,
BIT(DRM_MODE_BLEND_COVERAGE)); BIT(DRM_MODE_BLEND_COVERAGE));
int ret; int ret;
tplane = devm_kzalloc(tidss->dev, sizeof(*tplane), GFP_KERNEL); tplane = kzalloc(sizeof(*tplane), GFP_KERNEL);
if (!tplane) if (!tplane)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
...@@ -190,7 +198,7 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss, ...@@ -190,7 +198,7 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss,
formats, num_formats, formats, num_formats,
NULL, type, NULL); NULL, type, NULL);
if (ret < 0) if (ret < 0)
return ERR_PTR(ret); goto err;
drm_plane_helper_add(&tplane->plane, &tidss_plane_helper_funcs); drm_plane_helper_add(&tplane->plane, &tidss_plane_helper_funcs);
...@@ -203,15 +211,19 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss, ...@@ -203,15 +211,19 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss,
default_encoding, default_encoding,
default_range); default_range);
if (ret) if (ret)
return ERR_PTR(ret); goto err;
ret = drm_plane_create_alpha_property(&tplane->plane); ret = drm_plane_create_alpha_property(&tplane->plane);
if (ret) if (ret)
return ERR_PTR(ret); goto err;
ret = drm_plane_create_blend_mode_property(&tplane->plane, blend_modes); ret = drm_plane_create_blend_mode_property(&tplane->plane, blend_modes);
if (ret) if (ret)
return ERR_PTR(ret); goto err;
return tplane; return tplane;
err:
kfree(tplane);
return ERR_PTR(ret);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment