Commit 63c4cec7 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-misc-fixes-2019-10-03' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

 - One include fix for tilcdc
 - A clock fix for OMAP
 - A memory leak fix for Komeda
 - Some fixes for resources cleanups with writeback
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20191003081031.oykms5fg4tijvdri@gilmour
parents 0f83eb88 b6559bf3
...@@ -43,9 +43,8 @@ komeda_wb_encoder_atomic_check(struct drm_encoder *encoder, ...@@ -43,9 +43,8 @@ komeda_wb_encoder_atomic_check(struct drm_encoder *encoder,
struct komeda_data_flow_cfg dflow; struct komeda_data_flow_cfg dflow;
int err; int err;
if (!writeback_job || !writeback_job->fb) { if (!writeback_job)
return 0; return 0;
}
if (!crtc_st->active) { if (!crtc_st->active) {
DRM_DEBUG_ATOMIC("Cannot write the composition result out on a inactive CRTC.\n"); DRM_DEBUG_ATOMIC("Cannot write the composition result out on a inactive CRTC.\n");
...@@ -166,8 +165,10 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms, ...@@ -166,8 +165,10 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms,
&komeda_wb_encoder_helper_funcs, &komeda_wb_encoder_helper_funcs,
formats, n_formats); formats, n_formats);
komeda_put_fourcc_list(formats); komeda_put_fourcc_list(formats);
if (err) if (err) {
kfree(kwb_conn);
return err; return err;
}
drm_connector_helper_add(&wb_conn->base, &komeda_wb_conn_helper_funcs); drm_connector_helper_add(&wb_conn->base, &komeda_wb_conn_helper_funcs);
......
...@@ -131,7 +131,7 @@ malidp_mw_encoder_atomic_check(struct drm_encoder *encoder, ...@@ -131,7 +131,7 @@ malidp_mw_encoder_atomic_check(struct drm_encoder *encoder,
struct drm_framebuffer *fb; struct drm_framebuffer *fb;
int i, n_planes; int i, n_planes;
if (!conn_state->writeback_job || !conn_state->writeback_job->fb) if (!conn_state->writeback_job)
return 0; return 0;
fb = conn_state->writeback_job->fb; fb = conn_state->writeback_job->fb;
...@@ -248,7 +248,7 @@ void malidp_mw_atomic_commit(struct drm_device *drm, ...@@ -248,7 +248,7 @@ void malidp_mw_atomic_commit(struct drm_device *drm,
mw_state = to_mw_state(conn_state); mw_state = to_mw_state(conn_state);
if (conn_state->writeback_job && conn_state->writeback_job->fb) { if (conn_state->writeback_job) {
struct drm_framebuffer *fb = conn_state->writeback_job->fb; struct drm_framebuffer *fb = conn_state->writeback_job->fb;
DRM_DEV_DEBUG_DRIVER(drm->dev, DRM_DEV_DEBUG_DRIVER(drm->dev,
......
...@@ -430,12 +430,17 @@ static int drm_atomic_connector_check(struct drm_connector *connector, ...@@ -430,12 +430,17 @@ static int drm_atomic_connector_check(struct drm_connector *connector,
return -EINVAL; return -EINVAL;
} }
if (writeback_job->out_fence && !writeback_job->fb) { if (!writeback_job->fb) {
if (writeback_job->out_fence) {
DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] requesting out-fence without framebuffer\n", DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] requesting out-fence without framebuffer\n",
connector->base.id, connector->name); connector->base.id, connector->name);
return -EINVAL; return -EINVAL;
} }
drm_writeback_cleanup_job(writeback_job);
state->writeback_job = NULL;
}
return 0; return 0;
} }
......
...@@ -324,6 +324,9 @@ void drm_writeback_cleanup_job(struct drm_writeback_job *job) ...@@ -324,6 +324,9 @@ void drm_writeback_cleanup_job(struct drm_writeback_job *job)
if (job->fb) if (job->fb)
drm_framebuffer_put(job->fb); drm_framebuffer_put(job->fb);
if (job->out_fence)
dma_fence_put(job->out_fence);
kfree(job); kfree(job);
} }
EXPORT_SYMBOL(drm_writeback_cleanup_job); EXPORT_SYMBOL(drm_writeback_cleanup_job);
...@@ -366,25 +369,29 @@ drm_writeback_signal_completion(struct drm_writeback_connector *wb_connector, ...@@ -366,25 +369,29 @@ drm_writeback_signal_completion(struct drm_writeback_connector *wb_connector,
{ {
unsigned long flags; unsigned long flags;
struct drm_writeback_job *job; struct drm_writeback_job *job;
struct dma_fence *out_fence;
spin_lock_irqsave(&wb_connector->job_lock, flags); spin_lock_irqsave(&wb_connector->job_lock, flags);
job = list_first_entry_or_null(&wb_connector->job_queue, job = list_first_entry_or_null(&wb_connector->job_queue,
struct drm_writeback_job, struct drm_writeback_job,
list_entry); list_entry);
if (job) { if (job)
list_del(&job->list_entry); list_del(&job->list_entry);
if (job->out_fence) {
if (status)
dma_fence_set_error(job->out_fence, status);
dma_fence_signal(job->out_fence);
dma_fence_put(job->out_fence);
}
}
spin_unlock_irqrestore(&wb_connector->job_lock, flags); spin_unlock_irqrestore(&wb_connector->job_lock, flags);
if (WARN_ON(!job)) if (WARN_ON(!job))
return; return;
out_fence = job->out_fence;
if (out_fence) {
if (status)
dma_fence_set_error(out_fence, status);
dma_fence_signal(out_fence);
dma_fence_put(out_fence);
job->out_fence = NULL;
}
INIT_WORK(&job->cleanup_work, cleanup_work); INIT_WORK(&job->cleanup_work, cleanup_work);
queue_work(system_long_wq, &job->cleanup_work); queue_work(system_long_wq, &job->cleanup_work);
} }
......
...@@ -1083,7 +1083,7 @@ static const struct dss_features omap34xx_dss_feats = { ...@@ -1083,7 +1083,7 @@ static const struct dss_features omap34xx_dss_feats = {
static const struct dss_features omap3630_dss_feats = { static const struct dss_features omap3630_dss_feats = {
.model = DSS_MODEL_OMAP3, .model = DSS_MODEL_OMAP3,
.fck_div_max = 32, .fck_div_max = 31,
.fck_freq_max = 173000000, .fck_freq_max = 173000000,
.dss_fck_multiplier = 1, .dss_fck_multiplier = 1,
.parent_clk_name = "dpll4_ck", .parent_clk_name = "dpll4_ck",
......
...@@ -147,7 +147,7 @@ static int rcar_du_wb_enc_atomic_check(struct drm_encoder *encoder, ...@@ -147,7 +147,7 @@ static int rcar_du_wb_enc_atomic_check(struct drm_encoder *encoder,
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct drm_framebuffer *fb; struct drm_framebuffer *fb;
if (!conn_state->writeback_job || !conn_state->writeback_job->fb) if (!conn_state->writeback_job)
return 0; return 0;
fb = conn_state->writeback_job->fb; fb = conn_state->writeback_job->fb;
...@@ -221,7 +221,7 @@ void rcar_du_writeback_setup(struct rcar_du_crtc *rcrtc, ...@@ -221,7 +221,7 @@ void rcar_du_writeback_setup(struct rcar_du_crtc *rcrtc,
unsigned int i; unsigned int i;
state = rcrtc->writeback.base.state; state = rcrtc->writeback.base.state;
if (!state || !state->writeback_job || !state->writeback_job->fb) if (!state || !state->writeback_job)
return; return;
fb = state->writeback_job->fb; fb = state->writeback_job->fb;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/mod_devicetable.h> #include <linux/mod_devicetable.h>
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_helper.h>
......
...@@ -231,7 +231,7 @@ static int vc4_txp_connector_atomic_check(struct drm_connector *conn, ...@@ -231,7 +231,7 @@ static int vc4_txp_connector_atomic_check(struct drm_connector *conn,
int i; int i;
conn_state = drm_atomic_get_new_connector_state(state, conn); conn_state = drm_atomic_get_new_connector_state(state, conn);
if (!conn_state->writeback_job || !conn_state->writeback_job->fb) if (!conn_state->writeback_job)
return 0; return 0;
crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc); crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc);
...@@ -271,8 +271,7 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, ...@@ -271,8 +271,7 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn,
u32 ctrl; u32 ctrl;
int i; int i;
if (WARN_ON(!conn_state->writeback_job || if (WARN_ON(!conn_state->writeback_job))
!conn_state->writeback_job->fb))
return; return;
mode = &conn_state->crtc->state->adjusted_mode; mode = &conn_state->crtc->state->adjusted_mode;
......
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