Commit 6f784a31 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 9d588f63 d171c45d
...@@ -639,9 +639,9 @@ int media_get_pad_index(struct media_entity *entity, bool is_sink, ...@@ -639,9 +639,9 @@ int media_get_pad_index(struct media_entity *entity, bool is_sink,
return -EINVAL; return -EINVAL;
for (i = 0; i < entity->num_pads; i++) { 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; 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; pad_is_sink = false;
else else
continue; /* This is an error! */ continue; /* This is an error! */
......
...@@ -27,17 +27,17 @@ static const struct v4l2_fwht_pixfmt_info v4l2_fwht_pixfmts[] = { ...@@ -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_BGR24, 3, 3, 1, 3, 3, 1, 1, 3, 1, FWHT_FL_PIXENC_RGB},
{ V4L2_PIX_FMT_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HT_FL_PIXENC_RGB},
{ V4L2_PIX_FMT_BGRX32, 4, 4, 1, 4, 4, 1, 1, 3, 1, FWHT_FL_PIXENC_RGB}, { V4L2_PIX_FMT_BGRX32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
{ V4L2_PIX_FMT_BGRA32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB}, { V4L2_PIX_FMT_BGRA32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
{ V4L2_PIX_FMT_RGBX32, 4, 4, 1, 4, 4, 1, 1, 3, 1, FWHT_FL_PIXENC_RGB}, { V4L2_PIX_FMT_RGBX32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
{ V4L2_PIX_FMT_RGBA32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB}, { V4L2_PIX_FMT_RGBA32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_RGB},
{ V4L2_PIX_FMT_HSV32, 4, 4, 1, 4, 4, 1, 1, 3, 1, FWHT_FL_PIXENC_HSV}, { V4L2_PIX_FMT_HSV32, 4, 4, 1, 4, 4, 1, 1, 4, 1, FWHT_FL_PIXENC_HSV},
{ V4L2_PIX_FMT_GREY, 1, 1, 1, 1, 0, 1, 1, 1, 1, FWHT_FL_PIXENC_RGB}, { V4L2_PIX_FMT_GREY, 1, 1, 1, 1, 0, 1, 1, 1, 1, FWHT_FL_PIXENC_RGB},
}; };
...@@ -175,22 +175,14 @@ static int prepare_raw_frame(struct fwht_raw_frame *rf, ...@@ -175,22 +175,14 @@ static int prepare_raw_frame(struct fwht_raw_frame *rf,
case V4L2_PIX_FMT_RGB32: case V4L2_PIX_FMT_RGB32:
case V4L2_PIX_FMT_XRGB32: case V4L2_PIX_FMT_XRGB32:
case V4L2_PIX_FMT_HSV32: 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: case V4L2_PIX_FMT_ARGB32:
rf->alpha = rf->luma; rf->alpha = rf->luma;
rf->cr = rf->luma + 1; rf->cr = rf->luma + 1;
rf->cb = rf->cr + 2; rf->cb = rf->cr + 2;
rf->luma += 2; rf->luma += 2;
break; break;
case V4L2_PIX_FMT_BGR32:
case V4L2_PIX_FMT_XBGR32:
case V4L2_PIX_FMT_ABGR32: case V4L2_PIX_FMT_ABGR32:
rf->cb = rf->luma; rf->cb = rf->luma;
rf->cr = rf->cb + 2; rf->cr = rf->cb + 2;
...@@ -198,10 +190,6 @@ static int prepare_raw_frame(struct fwht_raw_frame *rf, ...@@ -198,10 +190,6 @@ static int prepare_raw_frame(struct fwht_raw_frame *rf,
rf->alpha = rf->cr + 1; rf->alpha = rf->cr + 1;
break; break;
case V4L2_PIX_FMT_BGRX32: case V4L2_PIX_FMT_BGRX32:
rf->cb = rf->luma + 1;
rf->cr = rf->cb + 2;
rf->luma += 2;
break;
case V4L2_PIX_FMT_BGRA32: case V4L2_PIX_FMT_BGRA32:
rf->alpha = rf->luma; rf->alpha = rf->luma;
rf->cb = rf->luma + 1; rf->cb = rf->luma + 1;
...@@ -209,10 +197,6 @@ static int prepare_raw_frame(struct fwht_raw_frame *rf, ...@@ -209,10 +197,6 @@ static int prepare_raw_frame(struct fwht_raw_frame *rf,
rf->luma += 2; rf->luma += 2;
break; break;
case V4L2_PIX_FMT_RGBX32: case V4L2_PIX_FMT_RGBX32:
rf->cr = rf->luma;
rf->cb = rf->cr + 2;
rf->luma++;
break;
case V4L2_PIX_FMT_RGBA32: case V4L2_PIX_FMT_RGBA32:
rf->alpha = rf->luma + 3; rf->alpha = rf->luma + 3;
rf->cr = rf->luma; rf->cr = rf->luma;
......
...@@ -635,8 +635,6 @@ static void pulse8_cec_adap_free(struct cec_adapter *adap) ...@@ -635,8 +635,6 @@ static void pulse8_cec_adap_free(struct cec_adapter *adap)
cancel_delayed_work_sync(&pulse8->ping_eeprom_work); cancel_delayed_work_sync(&pulse8->ping_eeprom_work);
cancel_work_sync(&pulse8->irq_work); cancel_work_sync(&pulse8->irq_work);
cancel_work_sync(&pulse8->tx_work); cancel_work_sync(&pulse8->tx_work);
serio_close(pulse8->serio);
serio_set_drvdata(pulse8->serio, NULL);
kfree(pulse8); kfree(pulse8);
} }
...@@ -652,6 +650,9 @@ static void pulse8_disconnect(struct serio *serio) ...@@ -652,6 +650,9 @@ static void pulse8_disconnect(struct serio *serio)
struct pulse8 *pulse8 = serio_get_drvdata(serio); struct pulse8 *pulse8 = serio_get_drvdata(serio);
cec_unregister_adapter(pulse8->adap); 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, 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) ...@@ -840,6 +841,8 @@ static int pulse8_connect(struct serio *serio, struct serio_driver *drv)
serio_set_drvdata(serio, pulse8); serio_set_drvdata(serio, pulse8);
INIT_WORK(&pulse8->irq_work, pulse8_irq_work_handler); INIT_WORK(&pulse8->irq_work, pulse8_irq_work_handler);
INIT_WORK(&pulse8->tx_work, pulse8_tx_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); mutex_init(&pulse8->lock);
spin_lock_init(&pulse8->msg_lock); spin_lock_init(&pulse8->msg_lock);
pulse8->config_pending = false; pulse8->config_pending = false;
...@@ -865,17 +868,16 @@ static int pulse8_connect(struct serio *serio, struct serio_driver *drv) ...@@ -865,17 +868,16 @@ static int pulse8_connect(struct serio *serio, struct serio_driver *drv)
pulse8->restoring_config = true; 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); schedule_delayed_work(&pulse8->ping_eeprom_work, PING_PERIOD);
return 0; return 0;
close_serio: close_serio:
pulse8->serio = NULL;
serio_set_drvdata(serio, NULL);
serio_close(serio); serio_close(serio);
delete_adap: delete_adap:
cec_delete_adapter(pulse8->adap); cec_delete_adapter(pulse8->adap);
serio_set_drvdata(serio, NULL);
free_device: free_device:
kfree(pulse8); kfree(pulse8);
return err; return err;
......
...@@ -880,12 +880,12 @@ int v4l2_m2m_register_media_controller(struct v4l2_m2m_dev *m2m_dev, ...@@ -880,12 +880,12 @@ int v4l2_m2m_register_media_controller(struct v4l2_m2m_dev *m2m_dev,
goto err_rel_entity1; goto err_rel_entity1;
/* Connect the three entities */ /* 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); MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED);
if (ret) if (ret)
goto err_rel_entity2; 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); MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED);
if (ret) if (ret)
goto err_rm_links0; goto err_rm_links0;
......
...@@ -558,13 +558,13 @@ static int hantro_attach_func(struct hantro_dev *vpu, ...@@ -558,13 +558,13 @@ static int hantro_attach_func(struct hantro_dev *vpu,
goto err_rel_entity1; goto err_rel_entity1;
/* Connect the three entities */ /* 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_IMMUTABLE |
MEDIA_LNK_FL_ENABLED); MEDIA_LNK_FL_ENABLED);
if (ret) if (ret)
goto err_rel_entity2; 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_IMMUTABLE |
MEDIA_LNK_FL_ENABLED); MEDIA_LNK_FL_ENABLED);
if (ret) if (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