media fixes for v5.6-rc5
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE+QmuaPwR3wnBdVwACF8+vY7k4RUFAl5jnhoACgkQCF8+vY7k 4RX6Hw/8DRlnp6D+nTBk1Tb0LyGAo/FP8XgA+EUtiJ+FZpt2op/6tnC0dS3Czj1W g6jt/94bV+38htb+xR0MxKQz25fQywh7iyxgLH3xLjjHnmQoZrDbWrjGjQqt5MIF rOskkvBBVwmA2auuyKCDZ3YIWxV4HT1wz0ptsGYu3zK1PY2NR980zvTnlUkWBJES IZ7Y58MV/wI4kLSWW8HcK2WAKD5NW613spae1szZ44OoKUw/tULY31+TAeMCd+uA Hi0ApS2PdSr/RBG9glHrguueWJp34oW9xUnbXRYZUJng8jiJtkoa4BDLxDXgBTZm TCi9XGjm4oh5RLS6C+lWwFrRW4ifvc0Hc2Uo1z5boxwiEoJV7YTn7+Lz9U3/Aeie J37LgEHyTdK8+yvqt+fi0CwLfaQ6OSyCO0euQ+gXOTNnhHMcskwjqWsXAW5/QPqV H6njqOi2yCEaotDKYbXXfBUfBJQveYeC15Lj529Zs6h0lGLHNRms3/kMrv8H9Nec VLu/NX6m0JyAhBdQJKKOO+j1PqGTBiAfga0Pf0lWn8lPWfGxjv5WNnh+Zx4pyL8M nJn4v7agbAwiSaL9Sv2FQSj0LhfBWBBpWu5LPQ/WjG5cIf83ZOYfsYagFUbvdd9a LG4qSins/hXT91vhyPGx54/BhrkCx2NAmtwtwRQiWO2HgL96ff4= =ch+J -----END PGP SIGNATURE----- Merge tag 'media/v5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fixes from Mauro Carvalho Chehab: - a fix for the media controller links in both hantro driver and in v4l2-mem2mem core - some fixes for the pulse8-cec driver - vicodec: handle alpha channel for RGB32 formats, as it may be used - mc-entity.c: fix handling of pad flags * tag 'media/v5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: hantro: Fix broken media controller links media: mc-entity.c: use & to check pad flags, not == media: v4l2-mem2mem.c: fix broken links media: vicodec: process all 4 components for RGB32 formats media: pulse8-cec: close serio in disconnect, not adap_free media: pulse8-cec: INIT_DELAYED_WORK was called too late
This commit is contained in:
commit
6f784a3179
|
@ -639,9 +639,9 @@ int media_get_pad_index(struct media_entity *entity, bool is_sink,
|
|||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < entity->num_pads; i++) {
|
||||
if (entity->pads[i].flags == MEDIA_PAD_FL_SINK)
|
||||
if (entity->pads[i].flags & MEDIA_PAD_FL_SINK)
|
||||
pad_is_sink = true;
|
||||
else if (entity->pads[i].flags == MEDIA_PAD_FL_SOURCE)
|
||||
else if (entity->pads[i].flags & MEDIA_PAD_FL_SOURCE)
|
||||
pad_is_sink = false;
|
||||
else
|
||||
continue; /* This is an error! */
|
||||
|
|
|
@ -27,17 +27,17 @@ static const struct v4l2_fwht_pixfmt_info v4l2_fwht_pixfmts[] = {
|
|||
{ V4L2_PIX_FMT_BGR24, 3, 3, 1, 3, 3, 1, 1, 3, 1, FWHT_FL_PIXENC_RGB},
|
||||
{ V4L2_PIX_FMT_RGB24, 3, 3, 1, 3, 3, 1, 1, 3, 1, FWHT_FL_PIXENC_RGB},
|
||||
{ V4L2_PIX_FMT_HSV24, 3, 3, 1, 3, 3, 1, 1, 3, 1, FWHT_FL_PIXENC_HSV},
|
||||
{ V4L2_PIX_FMT_BGR32, 4, 4, 1, 4, 4, 1, 1, 3, 1, FWHT_FL_PIXENC_RGB},
|
||||
{ V4L2_PIX_FMT_XBGR32, 4, 4, 1, 4, 4, 1, 1, 3, 1, FWHT_FL_PIXENC_RGB},
|
||||
{ V4L2_PIX_FMT_BGR32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
|
||||
{ V4L2_PIX_FMT_XBGR32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
|
||||
{ V4L2_PIX_FMT_ABGR32, 4, 4, 1, 4, 4, 1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C_RGB},
|
||||
};
|
||||
|
||||
|
@ -175,22 +175,14 @@ static int prepare_raw_frame(struct fwht_raw_frame *rf,
|
|||
case V4L2_PIX_FMT_RGB32:
|
||||
case V4L2_PIX_FMT_XRGB32:
|
||||
case V4L2_PIX_FMT_HSV32:
|
||||
rf->cr = rf->luma + 1;
|
||||
rf->cb = rf->cr + 2;
|
||||
rf->luma += 2;
|
||||
break;
|
||||
case V4L2_PIX_FMT_BGR32:
|
||||
case V4L2_PIX_FMT_XBGR32:
|
||||
rf->cb = rf->luma;
|
||||
rf->cr = rf->cb + 2;
|
||||
rf->luma++;
|
||||
break;
|
||||
case V4L2_PIX_FMT_ARGB32:
|
||||
rf->alpha = rf->luma;
|
||||
rf->cr = rf->luma + 1;
|
||||
rf->cb = rf->cr + 2;
|
||||
rf->luma += 2;
|
||||
break;
|
||||
case V4L2_PIX_FMT_BGR32:
|
||||
case V4L2_PIX_FMT_XBGR32:
|
||||
case V4L2_PIX_FMT_ABGR32:
|
||||
rf->cb = rf->luma;
|
||||
rf->cr = rf->cb + 2;
|
||||
|
@ -198,10 +190,6 @@ static int prepare_raw_frame(struct fwht_raw_frame *rf,
|
|||
rf->alpha = rf->cr + 1;
|
||||
break;
|
||||
case V4L2_PIX_FMT_BGRX32:
|
||||
rf->cb = rf->luma + 1;
|
||||
rf->cr = rf->cb + 2;
|
||||
rf->luma += 2;
|
||||
break;
|
||||
case V4L2_PIX_FMT_BGRA32:
|
||||
rf->alpha = rf->luma;
|
||||
rf->cb = rf->luma + 1;
|
||||
|
@ -209,10 +197,6 @@ static int prepare_raw_frame(struct fwht_raw_frame *rf,
|
|||
rf->luma += 2;
|
||||
break;
|
||||
case V4L2_PIX_FMT_RGBX32:
|
||||
rf->cr = rf->luma;
|
||||
rf->cb = rf->cr + 2;
|
||||
rf->luma++;
|
||||
break;
|
||||
case V4L2_PIX_FMT_RGBA32:
|
||||
rf->alpha = rf->luma + 3;
|
||||
rf->cr = rf->luma;
|
||||
|
|
|
@ -635,8 +635,6 @@ static void pulse8_cec_adap_free(struct cec_adapter *adap)
|
|||
cancel_delayed_work_sync(&pulse8->ping_eeprom_work);
|
||||
cancel_work_sync(&pulse8->irq_work);
|
||||
cancel_work_sync(&pulse8->tx_work);
|
||||
serio_close(pulse8->serio);
|
||||
serio_set_drvdata(pulse8->serio, NULL);
|
||||
kfree(pulse8);
|
||||
}
|
||||
|
||||
|
@ -652,6 +650,9 @@ static void pulse8_disconnect(struct serio *serio)
|
|||
struct pulse8 *pulse8 = serio_get_drvdata(serio);
|
||||
|
||||
cec_unregister_adapter(pulse8->adap);
|
||||
pulse8->serio = NULL;
|
||||
serio_set_drvdata(serio, NULL);
|
||||
serio_close(serio);
|
||||
}
|
||||
|
||||
static int pulse8_setup(struct pulse8 *pulse8, struct serio *serio,
|
||||
|
@ -840,6 +841,8 @@ static int pulse8_connect(struct serio *serio, struct serio_driver *drv)
|
|||
serio_set_drvdata(serio, pulse8);
|
||||
INIT_WORK(&pulse8->irq_work, pulse8_irq_work_handler);
|
||||
INIT_WORK(&pulse8->tx_work, pulse8_tx_work_handler);
|
||||
INIT_DELAYED_WORK(&pulse8->ping_eeprom_work,
|
||||
pulse8_ping_eeprom_work_handler);
|
||||
mutex_init(&pulse8->lock);
|
||||
spin_lock_init(&pulse8->msg_lock);
|
||||
pulse8->config_pending = false;
|
||||
|
@ -865,17 +868,16 @@ static int pulse8_connect(struct serio *serio, struct serio_driver *drv)
|
|||
pulse8->restoring_config = true;
|
||||
}
|
||||
|
||||
INIT_DELAYED_WORK(&pulse8->ping_eeprom_work,
|
||||
pulse8_ping_eeprom_work_handler);
|
||||
schedule_delayed_work(&pulse8->ping_eeprom_work, PING_PERIOD);
|
||||
|
||||
return 0;
|
||||
|
||||
close_serio:
|
||||
pulse8->serio = NULL;
|
||||
serio_set_drvdata(serio, NULL);
|
||||
serio_close(serio);
|
||||
delete_adap:
|
||||
cec_delete_adapter(pulse8->adap);
|
||||
serio_set_drvdata(serio, NULL);
|
||||
free_device:
|
||||
kfree(pulse8);
|
||||
return err;
|
||||
|
|
|
@ -880,12 +880,12 @@ int v4l2_m2m_register_media_controller(struct v4l2_m2m_dev *m2m_dev,
|
|||
goto err_rel_entity1;
|
||||
|
||||
/* Connect the three entities */
|
||||
ret = media_create_pad_link(m2m_dev->source, 0, &m2m_dev->proc, 1,
|
||||
ret = media_create_pad_link(m2m_dev->source, 0, &m2m_dev->proc, 0,
|
||||
MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED);
|
||||
if (ret)
|
||||
goto err_rel_entity2;
|
||||
|
||||
ret = media_create_pad_link(&m2m_dev->proc, 0, &m2m_dev->sink, 0,
|
||||
ret = media_create_pad_link(&m2m_dev->proc, 1, &m2m_dev->sink, 0,
|
||||
MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED);
|
||||
if (ret)
|
||||
goto err_rm_links0;
|
||||
|
|
|
@ -558,13 +558,13 @@ static int hantro_attach_func(struct hantro_dev *vpu,
|
|||
goto err_rel_entity1;
|
||||
|
||||
/* Connect the three entities */
|
||||
ret = media_create_pad_link(&func->vdev.entity, 0, &func->proc, 1,
|
||||
ret = media_create_pad_link(&func->vdev.entity, 0, &func->proc, 0,
|
||||
MEDIA_LNK_FL_IMMUTABLE |
|
||||
MEDIA_LNK_FL_ENABLED);
|
||||
if (ret)
|
||||
goto err_rel_entity2;
|
||||
|
||||
ret = media_create_pad_link(&func->proc, 0, &func->sink, 0,
|
||||
ret = media_create_pad_link(&func->proc, 1, &func->sink, 0,
|
||||
MEDIA_LNK_FL_IMMUTABLE |
|
||||
MEDIA_LNK_FL_ENABLED);
|
||||
if (ret)
|
||||
|
|
Loading…
Reference in a new issue