mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 22:57:21 -04:00
Merge tag 'drm-misc-fixes-2024-07-11' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
drm-misc-fixes for v6.10: - EDID irq fix for bridge/adv7511. - gma500 null mode fixes. - Cleanup meson binding. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/8abff46f-eae6-4521-8434-7c6240f9091c@linux.intel.com
This commit is contained in:
@@ -401,7 +401,7 @@ struct adv7511 {
|
||||
|
||||
#ifdef CONFIG_DRM_I2C_ADV7511_CEC
|
||||
int adv7511_cec_init(struct device *dev, struct adv7511 *adv7511);
|
||||
void adv7511_cec_irq_process(struct adv7511 *adv7511, unsigned int irq1);
|
||||
int adv7511_cec_irq_process(struct adv7511 *adv7511, unsigned int irq1);
|
||||
#else
|
||||
static inline int adv7511_cec_init(struct device *dev, struct adv7511 *adv7511)
|
||||
{
|
||||
|
||||
@@ -119,7 +119,7 @@ static void adv7511_cec_rx(struct adv7511 *adv7511, int rx_buf)
|
||||
cec_received_msg(adv7511->cec_adap, &msg);
|
||||
}
|
||||
|
||||
void adv7511_cec_irq_process(struct adv7511 *adv7511, unsigned int irq1)
|
||||
int adv7511_cec_irq_process(struct adv7511 *adv7511, unsigned int irq1)
|
||||
{
|
||||
unsigned int offset = adv7511->info->reg_cec_offset;
|
||||
const u32 irq_tx_mask = ADV7511_INT1_CEC_TX_READY |
|
||||
@@ -131,16 +131,19 @@ void adv7511_cec_irq_process(struct adv7511 *adv7511, unsigned int irq1)
|
||||
unsigned int rx_status;
|
||||
int rx_order[3] = { -1, -1, -1 };
|
||||
int i;
|
||||
int irq_status = IRQ_NONE;
|
||||
|
||||
if (irq1 & irq_tx_mask)
|
||||
if (irq1 & irq_tx_mask) {
|
||||
adv_cec_tx_raw_status(adv7511, irq1);
|
||||
irq_status = IRQ_HANDLED;
|
||||
}
|
||||
|
||||
if (!(irq1 & irq_rx_mask))
|
||||
return;
|
||||
return irq_status;
|
||||
|
||||
if (regmap_read(adv7511->regmap_cec,
|
||||
ADV7511_REG_CEC_RX_STATUS + offset, &rx_status))
|
||||
return;
|
||||
return irq_status;
|
||||
|
||||
/*
|
||||
* ADV7511_REG_CEC_RX_STATUS[5:0] contains the reception order of RX
|
||||
@@ -172,6 +175,8 @@ void adv7511_cec_irq_process(struct adv7511 *adv7511, unsigned int irq1)
|
||||
|
||||
adv7511_cec_rx(adv7511, rx_buf);
|
||||
}
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static int adv7511_cec_adap_enable(struct cec_adapter *adap, bool enable)
|
||||
|
||||
@@ -469,6 +469,8 @@ static int adv7511_irq_process(struct adv7511 *adv7511, bool process_hpd)
|
||||
{
|
||||
unsigned int irq0, irq1;
|
||||
int ret;
|
||||
int cec_status = IRQ_NONE;
|
||||
int irq_status = IRQ_NONE;
|
||||
|
||||
ret = regmap_read(adv7511->regmap, ADV7511_REG_INT(0), &irq0);
|
||||
if (ret < 0)
|
||||
@@ -478,29 +480,31 @@ static int adv7511_irq_process(struct adv7511 *adv7511, bool process_hpd)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* If there is no IRQ to handle, exit indicating no IRQ data */
|
||||
if (!(irq0 & (ADV7511_INT0_HPD | ADV7511_INT0_EDID_READY)) &&
|
||||
!(irq1 & ADV7511_INT1_DDC_ERROR))
|
||||
return -ENODATA;
|
||||
|
||||
regmap_write(adv7511->regmap, ADV7511_REG_INT(0), irq0);
|
||||
regmap_write(adv7511->regmap, ADV7511_REG_INT(1), irq1);
|
||||
|
||||
if (process_hpd && irq0 & ADV7511_INT0_HPD && adv7511->bridge.encoder)
|
||||
if (process_hpd && irq0 & ADV7511_INT0_HPD && adv7511->bridge.encoder) {
|
||||
schedule_work(&adv7511->hpd_work);
|
||||
irq_status = IRQ_HANDLED;
|
||||
}
|
||||
|
||||
if (irq0 & ADV7511_INT0_EDID_READY || irq1 & ADV7511_INT1_DDC_ERROR) {
|
||||
adv7511->edid_read = true;
|
||||
|
||||
if (adv7511->i2c_main->irq)
|
||||
wake_up_all(&adv7511->wq);
|
||||
irq_status = IRQ_HANDLED;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DRM_I2C_ADV7511_CEC
|
||||
adv7511_cec_irq_process(adv7511, irq1);
|
||||
cec_status = adv7511_cec_irq_process(adv7511, irq1);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
/* If there is no IRQ to handle, exit indicating no IRQ data */
|
||||
if (irq_status == IRQ_HANDLED || cec_status == IRQ_HANDLED)
|
||||
return IRQ_HANDLED;
|
||||
|
||||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
static irqreturn_t adv7511_irq_handler(int irq, void *devid)
|
||||
@@ -509,7 +513,7 @@ static irqreturn_t adv7511_irq_handler(int irq, void *devid)
|
||||
int ret;
|
||||
|
||||
ret = adv7511_irq_process(adv7511, true);
|
||||
return ret < 0 ? IRQ_NONE : IRQ_HANDLED;
|
||||
return ret < 0 ? IRQ_NONE : ret;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
||||
@@ -311,6 +311,9 @@ static int cdv_intel_lvds_get_modes(struct drm_connector *connector)
|
||||
if (mode_dev->panel_fixed_mode != NULL) {
|
||||
struct drm_display_mode *mode =
|
||||
drm_mode_duplicate(dev, mode_dev->panel_fixed_mode);
|
||||
if (!mode)
|
||||
return 0;
|
||||
|
||||
drm_mode_probed_add(connector, mode);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -504,6 +504,9 @@ static int psb_intel_lvds_get_modes(struct drm_connector *connector)
|
||||
if (mode_dev->panel_fixed_mode != NULL) {
|
||||
struct drm_display_mode *mode =
|
||||
drm_mode_duplicate(dev, mode_dev->panel_fixed_mode);
|
||||
if (!mode)
|
||||
return 0;
|
||||
|
||||
drm_mode_probed_add(connector, mode);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -250,29 +250,20 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
|
||||
if (ret)
|
||||
goto free_drm;
|
||||
ret = meson_canvas_alloc(priv->canvas, &priv->canvas_id_vd1_0);
|
||||
if (ret) {
|
||||
meson_canvas_free(priv->canvas, priv->canvas_id_osd1);
|
||||
goto free_drm;
|
||||
}
|
||||
if (ret)
|
||||
goto free_canvas_osd1;
|
||||
ret = meson_canvas_alloc(priv->canvas, &priv->canvas_id_vd1_1);
|
||||
if (ret) {
|
||||
meson_canvas_free(priv->canvas, priv->canvas_id_osd1);
|
||||
meson_canvas_free(priv->canvas, priv->canvas_id_vd1_0);
|
||||
goto free_drm;
|
||||
}
|
||||
if (ret)
|
||||
goto free_canvas_vd1_0;
|
||||
ret = meson_canvas_alloc(priv->canvas, &priv->canvas_id_vd1_2);
|
||||
if (ret) {
|
||||
meson_canvas_free(priv->canvas, priv->canvas_id_osd1);
|
||||
meson_canvas_free(priv->canvas, priv->canvas_id_vd1_0);
|
||||
meson_canvas_free(priv->canvas, priv->canvas_id_vd1_1);
|
||||
goto free_drm;
|
||||
}
|
||||
if (ret)
|
||||
goto free_canvas_vd1_1;
|
||||
|
||||
priv->vsync_irq = platform_get_irq(pdev, 0);
|
||||
|
||||
ret = drm_vblank_init(drm, 1);
|
||||
if (ret)
|
||||
goto free_drm;
|
||||
goto free_canvas_vd1_2;
|
||||
|
||||
/* Assign limits per soc revision/package */
|
||||
for (i = 0 ; i < ARRAY_SIZE(meson_drm_soc_attrs) ; ++i) {
|
||||
@@ -288,11 +279,11 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
|
||||
*/
|
||||
ret = drm_aperture_remove_framebuffers(&meson_driver);
|
||||
if (ret)
|
||||
goto free_drm;
|
||||
goto free_canvas_vd1_2;
|
||||
|
||||
ret = drmm_mode_config_init(drm);
|
||||
if (ret)
|
||||
goto free_drm;
|
||||
goto free_canvas_vd1_2;
|
||||
drm->mode_config.max_width = 3840;
|
||||
drm->mode_config.max_height = 2160;
|
||||
drm->mode_config.funcs = &meson_mode_config_funcs;
|
||||
@@ -307,7 +298,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
|
||||
if (priv->afbcd.ops) {
|
||||
ret = priv->afbcd.ops->init(priv);
|
||||
if (ret)
|
||||
goto free_drm;
|
||||
goto free_canvas_vd1_2;
|
||||
}
|
||||
|
||||
/* Encoder Initialization */
|
||||
@@ -371,6 +362,14 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
|
||||
exit_afbcd:
|
||||
if (priv->afbcd.ops)
|
||||
priv->afbcd.ops->exit(priv);
|
||||
free_canvas_vd1_2:
|
||||
meson_canvas_free(priv->canvas, priv->canvas_id_vd1_2);
|
||||
free_canvas_vd1_1:
|
||||
meson_canvas_free(priv->canvas, priv->canvas_id_vd1_1);
|
||||
free_canvas_vd1_0:
|
||||
meson_canvas_free(priv->canvas, priv->canvas_id_vd1_0);
|
||||
free_canvas_osd1:
|
||||
meson_canvas_free(priv->canvas, priv->canvas_id_osd1);
|
||||
free_drm:
|
||||
drm_dev_put(drm);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user