Re: [Linux-kernel-mentees] [PATCH v2 2/2] vivid: Add metadata output support

2019-10-03 Thread Shuah Khan
VID_META_OUT_H_ + +struct vivid_meta_out_buf { + u16 brightness; + u16 contrast; + u16 saturation; + s16 hue; +}; + +void vivid_meta_out_process(struct vivid_dev *dev, struct vivid_buffer *buf); +int vidioc_enum_fmt_meta_out(struct file *file, void *priv, +struct v4l2_fmtdesc *f); +int vidioc_g_fmt_meta_out(struct file *file, void *priv, + struct v4l2_format *f); +int vidioc_s_fmt_meta_out(struct file *file, void *priv, + struct v4l2_format *f); + +extern const struct vb2_ops vivid_meta_out_qops; + +#endif diff --git a/drivers/media/platform/vivid/vivid-vid-out.c b/drivers/media/platform/vivid/vivid-vid-out.c index a0364ac497f9..ee3446e3217c 100644 --- a/drivers/media/platform/vivid/vivid-vid-out.c +++ b/drivers/media/platform/vivid/vivid-vid-out.c @@ -1079,7 +1079,9 @@ int vidioc_s_output(struct file *file, void *priv, unsigned o) if (o == dev->output) return 0; - if (vb2_is_busy(&dev->vb_vid_out_q) || vb2_is_busy(&dev->vb_vbi_out_q)) + if (vb2_is_busy(&dev->vb_vid_out_q) || + vb2_is_busy(&dev->vb_vbi_out_q) || + vb2_is_busy(&dev->vb_meta_out_q)) return -EBUSY; dev->output = o; @@ -1090,6 +1092,7 @@ int vidioc_s_output(struct file *file, void *priv, unsigned o) dev->vid_out_dev.tvnorms = 0; dev->vbi_out_dev.tvnorms = dev->vid_out_dev.tvnorms; + dev->meta_out_dev.tvnorms = dev->vid_out_dev.tvnorms; vivid_update_format_out(dev); v4l2_ctrl_activate(dev->ctrl_display_present, vivid_is_hdmi_out(dev)); thanks, -- Shuah

Re: [Linux-kernel-mentees] [PATCH v2 1/2] v4l2-core: Add new metadata format

2019-10-03 Thread Shuah Khan
On 10/3/19 5:08 AM, Vandana BN wrote: Add new metadata format to support metadata output in vivid. Signed-off-by: Vandana BN --- drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/media/v4l2-core/v4l

Re: [PATCH 4/5] media: vimc: use configfs instead of having hardcoded configuration

2019-09-26 Thread Shuah Khan
/platform/vimc/vimc-sensor.c @@ -300,12 +300,12 @@ static const struct v4l2_subdev_internal_ops vimc_sen_int_ops = { .release = vimc_sen_release, }; -void vimc_sen_rm(struct vimc_device *vimc, struct vimc_ent_device *ved) +void vimc_sen_rm(struct vimc_ent_device *ent) { struct vimc_sen_device *vsen; - vsen = container_of(ved, struct vimc_sen_device, ved); - vimc_ent_sd_unregister(ved, &vsen->sd); + vsen = container_of(ent, struct vimc_sen_device, ved); + vimc_ent_sd_unregister(ent, &vsen->sd); } /* Image Processing Controls */ @@ -335,7 +335,7 @@ struct vimc_ent_device *vimc_sen_add(struct vimc_device *vimc, /* Allocate the vsen struct */ vsen = kzalloc(sizeof(*vsen), GFP_KERNEL); if (!vsen) - return NULL; + return ERR_PTR(-ENOMEM); v4l2_ctrl_handler_init(&vsen->hdl, 4); @@ -369,7 +369,7 @@ struct vimc_ent_device *vimc_sen_add(struct vimc_device *vimc, goto err_free_hdl; vsen->ved.process_frame = vimc_sen_process_frame; - vsen->dev = &vimc->pdev.dev; + vsen->dev = vimc->mdev.dev; /* Initialize the frame format */ vsen->mbus_format = fmt_default; @@ -390,7 +390,7 @@ struct vimc_ent_device *vimc_sen_add(struct vimc_device *vimc, err_free_vsen: kfree(vsen); - return NULL; + return ERR_PTR(ret); } static void vimc_sen_create_cfs_pads(struct config_group *ent_group) thanks, -- Shuah

Re: [PATCH 3/5] media: vimc: Add the implementation for the configfs api

2019-09-26 Thread Shuah Khan
On 9/19/19 2:32 PM, Dafna Hirschfeld wrote: Add the code that implements the usage of configfs in order to create and configure a device topology from userspace. The code is only added in this patch but is not used. It will be used in next patch in the series. This somehow doesn't read right.

Re: [PATCH 2/5] docs: media: vimc: Documenting vimc topology configuration using configfs

2019-09-26 Thread Shuah Khan
Pad source vimc-scaler: - Scale up the image by a factor of 3. E.g.: a 640x480 image becomes a -1920x1440 image. (this value can be configured, see at + Scales up the image by a factor of 3. E.g.: a 640x480 image becomes a +1920x1440 image. (this value can be configured, see `Module options`_). Exposes: @@ -77,12 +257,10 @@ vimc-capture: * 1 Pad source -Module options - -Vimc has a few module parameters to configure the driver. +Module options +== -param=value +Vimc has 2 module parameters to configure the driver. * ``sca_mult=`` @@ -98,10 +276,10 @@ Vimc has a few module parameters to configure the driver. otherwise the next odd number is considered (the default value is 3). Keep this close to the top of the file and then add the configfs stuff. Source code documentation -- += vimc-streamer -~ +- .. kernel-doc:: drivers/media/platform/vimc/vimc-streamer.h :internal: thanks, -- Shuah

Re: [PATCH 1/5] media: vimc: upon streaming, check that the pipeline starts with a source entity

2019-09-26 Thread Shuah Khan
video_get_drvdata(vdev); } } - vimc_streamer_pipeline_terminate(stream); - return -EINVAL; + return ret; } /** thanks, -- Shuah

Re: [Linux-kernel-mentees] [PATCH v2 2/2] cec-compliance: add/refactor tuner control tests

2019-09-24 Thread Shuah Khan
}, { "Tuner Device Status", CEC_LOG_ADDR_MASK_ALL, tuner_ctl_tuner_dev_status }, - { "Tuner Step Decrement", CEC_LOG_ADDR_MASK_TUNER, tuner_ctl_step_dec }, - { "Tuner Step Increment", CEC_LOG_ADDR_MASK_TUNER, tuner_ctl_step_inc }, + { "Tuner Analog Step Decrement", CEC_LOG_ADDR_MASK_TUNER | CEC_LOG_ADDR_MASK_TV, tuner_ctl_analog_step_dec }, + { "Tuner Analog Step Increment", CEC_LOG_ADDR_MASK_TUNER | CEC_LOG_ADDR_MASK_TV, tuner_ctl_analog_step_inc }, }; thanks, -- Shuah

Re: [Linux-kernel-mentees] [PATCH v2 1/2] cec-follower: add tuner step increment/decrement

2019-09-24 Thread Shuah Khan
[++idx]; + Do you need this extra line. + info->analog.ana_freq = (freq * 10) / 625; + } + return; + } /* One Touch Record thanks, -- Shuah

Re: [Linux-kernel-mentees] [PATCH v8] cec-follower: add tuner analog service emulation

2019-09-24 Thread Shuah Khan
node, &msg, CEC_OP_ABORT_REFUSED); + return; + } + if (!analog_set_tuner_dev_info(node, &msg)) { + reply_feature_abort(node, &msg, CEC_OP_ABORT_INVALID_OP); + return; + } + return; + case CEC_MSG_SELECT_DIGITAL_SERVICE: case CEC_MSG_TUNER_STEP_DECREMENT: case CEC_MSG_TUNER_STEP_INCREMENT: thanks, -- Shuah

Re: [Linux-kernel-mentees] [PATCH v8] v4l2-ctl: Print UVC meta info

2019-09-24 Thread Shuah Khan
On 9/24/19 5:04 AM, Vandana BN wrote: Print UVC Metadata information in verbose mode. Cam you add more information on what this Metadata is and how it is used. Signed-off-by: Vandana BN --- Changes since v7: Not to call print_meta_buffer, if V4L2_BUF_FLAG_ERROR is set or bytesused i

Re: [ANN] Media sessions in Lyon in October: libcamera

2019-09-23 Thread Shuah Khan
Hristev Shuah Khan Helen Koike Jacopo Mondi Laurent Pinchart Niklas Söderlund Hans Verkuil If I missed someone, or you are on the list but won't attend after all, then please let me know. I would like to join this one to, as after ELCE I should have some time to spend on this. I under

Re: [Linux-kernel-mentees] [PATCH v6] cec-follower: add tuner analog service emulation

2019-09-20 Thread Shuah Khan
On 9/20/19 1:32 PM, Jiunn Chang wrote: Implement the following tuner control features: - - and reply More information is needed on what this feature does. This commit log to terse. Signed-off-by: Jiunn Chang --- Changes made since v1: - Fix typos/bugs - Import reply_feature_

Re: [Linux-kernel-mentees] [PATCH v2] cec-compliance: system audio control tests

2019-09-03 Thread Shuah Khan
node->state.mute = false; + break; case 0x6B: if (!enter_standby(node)) exit_standby(node); thanks, -- Shuah

Re: [PATCH 3/3] selftests: ir: fix ir_loopback test failure

2019-08-12 Thread shuah
On 8/10/19 5:44 AM, Sean Young wrote: The decoder is called rc-mm, not rcmm. This was renamed late in the cycle so this bug crept in. Cc: Shuah Khan Signed-off-by: Sean Young --- tools/testing/selftests/ir/ir_loopback.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

Re: [PATCH 0/2] Use Media Dev Allocator to fix vimc dev lifetime bugs

2019-07-03 Thread Shuah Khan
Hi Niklas, Laurent, On 7/3/19 10:17 AM, Niklas Söderlund wrote: Hi Shauah, Laurent, On 2019-06-30 14:41:02 +0300, Laurent Pinchart wrote: Hi Shuah, On Fri, Jun 28, 2019 at 10:41:07AM -0600, Shuah Khan wrote: On 6/16/19 12:45 PM, Laurent Pinchart wrote: On Fri, Jun 14, 2019 at 05:26:46PM

Re: Linux 5.2 - vimc streaming fails with format error

2019-07-02 Thread shuah
On 5/23/19 9:07 AM, shuah wrote: Hi Hans and Helen, vimc streaming fails on Linux 5.2-rc1 vimc: format doesn't match in link Scaler->RGB/YUV Capture You can reproduce this easily with v4l2-ctl Streaming works fine on Linux 5.1 I narrowed it to the following commit

[PATCH] media: media.h: Fix shifting signed 32-bit value by 31 bits problem

2019-06-13 Thread Shuah Khan
andle this condition safely resulting in undefined behavior. Signed-off-by: Shuah Khan --- include/uapi/linux/media.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h index 9aedb187bc48..383ac7b7d8f0 100644 --- a/includ

Linux 5.2-rc1 rmmod on vimc_capture panics

2019-05-23 Thread shuah
] CS: 0010 DS: ES: CR0: 80050033 [ 302.974737] CR2: 55f43e465ec8 CR3: 0001ac95 CR4: 000606e0 thanks, -- Shuah

Linux 5.2 - vimc streaming fails with format error

2019-05-23 Thread shuah
9 Author: Helen Fornazier Date: Wed Mar 13 14:29:37 2019 -0400 media: vimc: propagate pixel format in the stream Please take a look. thanks, -- Shuah

Re: [GIT PULL FOR v5.2] Media Device Allocator API

2019-04-03 Thread shuah
On 4/3/19 1:32 AM, Hans Verkuil wrote: Hi Mauro, After five (!) years of work, this is finally ready to go in. Thank you Shuah for your perseverance! Awesome. I am glad that this work is finally getting in. thanks, -- Shuah

Re: [PATCH v2] au0828: stop video streaming only when last user stops

2019-04-02 Thread shuah
t for vbi. This is obviously wrong when starting vbi first, but also caused weird behavior since attempting to start a second vbi capture would stop the first. --- Looks good. Attempting to start the second VBI stream capture doesn't stop the active VBI stream. Tested-by: Shuah Khan thanks, -- Shuah

Re: [PATCH] au0828: stop video streaming only when last user stops

2019-04-01 Thread shuah
Hi Hans, On 4/1/19 8:54 AM, shuah wrote: On 4/1/19 5:18 AM, Hans Verkuil wrote: If the application was streaming from both videoX and vbiX, and streaming from videoX was stopped, then the vbi streaming also stopped. The cause being that stop_streaming for video stopped the subdevs as well

Re: [PATCH] au0828: stop video streaming only when last user stops

2019-04-01 Thread shuah
ev->streaming_users-- == 1) + if (dev->streaming_users-- == 1) { au0828_uninit_isoc(dev); + v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_stream, 0); + } spin_lock_irqsave(&dev->slock, flags); if (dev->isoc_ctl.vbi_buf != NULL) { Thanks. I will test the series with this patch and send v15 thanks again, -- Shuah

[PATCH v2] au0828: minor fix to a misleading comment in _close()

2019-02-25 Thread Shuah Khan
Fix a misleading comment in _close() and a spelling error. Reviewed-by: Niklas Söderlund Signed-off-by: Shuah Khan --- drivers/media/usb/au0828/au0828-video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb

Re: [PATCH] au0828: minor fix to a misleading comment in _close()

2019-02-25 Thread shuah
On 2/22/19 6:44 PM, Niklas Söderlund wrote: Hi Shuah, Thanks for your patch. On 2019-02-22 10:45:59 -0700, Shuah Khan wrote: Fix misleading comment in _close() Signed-off-by: Shuah Khan --- drivers/media/usb/au0828/au0828-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] media: replace WARN_ON in __media_pipeline_start()

2019-02-22 Thread Shuah Khan
__media_pipeline_start() does WARN_ON() when active pipe doesn't match the input arg entity's pipe. Replace WARN_ON with a conditional and error message that includes names of both entities. Signed-off-by: Shuah Khan --- drivers/media/media-entity.c | 5 - 1 file changed, 4

[PATCH] au0828: minor fix to a misleading comment in _close()

2019-02-22 Thread Shuah Khan
Fix misleading comment in _close() Signed-off-by: Shuah Khan --- drivers/media/usb/au0828/au0828-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c index 7876c897cc1d..08f566006a1f 100644

[PATCH v11 1/5] media: Media Device Allocator API

2019-02-22 Thread Shuah Khan
can get a reference to it. The media device is released when all the references are released. Signed-off-by: Shuah Khan --- Documentation/media/kapi/mc-core.rst | 41 drivers/media/Makefile | 4 + drivers/media/media-dev-allocator.c | 142

[PATCH v11 2/5] media: change au0828 to use Media Device Allocator API

2019-02-22 Thread Shuah Khan
can get a reference to it. The media device is released when all the references are released. Change au0828 to use Media Device Allocator API to allocate media device with the parent usb struct device as the key, so it can be shared with the snd_usb_audio driver. Signed-off-by: Shuah Khan

[PATCH v11 4/5] sound/usb: Use Media Controller API to share media resources

2019-02-22 Thread Shuah Khan
snd_usb_hw_free(). If resource is busy, -EBUSY is returned. Media specific cleanup is done in usb_audio_disconnect(). Reviewed-by: Takashi Iwai Signed-off-by: Shuah Khan --- sound/usb/Kconfig| 4 + sound/usb/Makefile | 2 + sound/usb/card.c | 14 ++ sound/usb/card.h

[PATCH v11 3/5] media: media.h: Enable ALSA MEDIA_INTF_T* interface types

2019-02-22 Thread Shuah Khan
Move PCM_CAPTURE, PCM_PLAYBACK, and CONTROL ALSA MEDIA_INTF_T* interface types back into __KERNEL__ scope to get ready for adding ALSA support for these to the media controller. Signed-off-by: Shuah Khan --- include/uapi/linux/media.h | 25 +++-- 1 file changed, 15

[PATCH v11 5/5] au0828: fix enable and disable source audio and video inconsistencies

2019-02-22 Thread Shuah Khan
ation disables it. Signed-off-by: Shuah Khan --- drivers/media/usb/au0828/au0828-core.c | 178 +++-- drivers/media/usb/au0828/au0828.h | 5 +- 2 files changed, 144 insertions(+), 39 deletions(-) diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/a

[PATCH v11 0/5] Media Device Allocator API

2019-02-22 Thread Shuah Khan
registering the device based on comments from Hans Verkuil - Carried Reviewed-by tag from Takashi Iwai for the sound from v9. - No changes to Patches 2 and 3. References: https://lkml.org/lkml/2018/11/2/169 https://www.mail-archive.com/linux-media@vger.kernel.org/msg105854.html Shuah Khan (5): medi

Re: [PATCH v10 0/4] Media Device Allocator API

2019-02-05 Thread shuah
On 2/1/19 2:21 AM, Hans Verkuil wrote: On 2/1/19 1:46 AM, shuah wrote: Hi Hans, On 1/30/19 12:42 AM, Hans Verkuil wrote: On 1/30/19 2:50 AM, shuah wrote: On 1/29/19 2:43 AM, Hans Verkuil wrote: On 1/29/19 12:48 AM, shuah wrote: Hi Hans, On 1/28/19 5:03 AM, Hans Verkuil wrote: Hi Shuah

Re: [PATCH v10 0/4] Media Device Allocator API

2019-01-31 Thread shuah
Hi Hans, On 1/30/19 12:42 AM, Hans Verkuil wrote: On 1/30/19 2:50 AM, shuah wrote: On 1/29/19 2:43 AM, Hans Verkuil wrote: On 1/29/19 12:48 AM, shuah wrote: Hi Hans, On 1/28/19 5:03 AM, Hans Verkuil wrote: Hi Shuah, On 1/24/19 9:32 PM, Shuah Khan wrote: Media Device Allocator API to

Re: [PATCH v10 0/4] Media Device Allocator API

2019-01-29 Thread shuah
On 1/29/19 2:43 AM, Hans Verkuil wrote: On 1/29/19 12:48 AM, shuah wrote: Hi Hans, On 1/28/19 5:03 AM, Hans Verkuil wrote: Hi Shuah, On 1/24/19 9:32 PM, Shuah Khan wrote: Media Device Allocator API to allows multiple drivers share a media device. This API solves a very common use-case for

Re: [PATCH v10 0/4] Media Device Allocator API

2019-01-28 Thread shuah
Hi Hans, On 1/28/19 5:03 AM, Hans Verkuil wrote: Hi Shuah, On 1/24/19 9:32 PM, Shuah Khan wrote: Media Device Allocator API to allows multiple drivers share a media device. This API solves a very common use-case for media devices where one physical device (an USB stick) provides both audio

Re: [PATCH v10 1/4] media: Media Device Allocator API

2019-01-25 Thread shuah
Hi Sakari, On 1/25/19 8:38 AM, Sakari Ailus wrote: Hi Shuah, On Thu, Jan 24, 2019 at 01:32:38PM -0700, Shuah Khan wrote: Media Device Allocator API to allows multiple drivers share a media device. This API solves a very common use-case for media devices where one physical device (an USB stick

[PATCH v10 1/4] media: Media Device Allocator API

2019-01-24 Thread Shuah Khan
can get a reference to it. The media device is released when all the references are released. Signed-off-by: Shuah Khan --- Documentation/media/kapi/mc-core.rst | 41 drivers/media/Makefile | 4 + drivers/media/media-dev-allocator.c | 144

[PATCH v10 2/4] media: change au0828 to use Media Device Allocator API

2019-01-24 Thread Shuah Khan
can get a reference to it. The media device is released when all the references are released. Change au0828 to use Media Device Allocator API to allocate media device with the parent usb struct device as the key, so it can be shared with the snd_usb_audio driver. Signed-off-by: Shuah Khan

[PATCH v10 4/4] sound/usb: Use Media Controller API to share media resources

2019-01-24 Thread Shuah Khan
snd_usb_hw_free(). If resource is busy, -EBUSY is returned. Media specific cleanup is done in usb_audio_disconnect(). Reviewed-by: Takashi Iwai Signed-off-by: Shuah Khan --- sound/usb/Kconfig| 4 + sound/usb/Makefile | 2 + sound/usb/card.c | 14 ++ sound/usb/card.h

[PATCH v10 3/4] media: media.h: Enable ALSA MEDIA_INTF_T* interface types

2019-01-24 Thread Shuah Khan
Move PCM_CAPTURE, PCM_PLAYBACK, and CONTROL ALSA MEDIA_INTF_T* interface types back into __KERNEL__ scope to get ready for adding ALSA support for these to the media controller. Signed-off-by: Shuah Khan --- include/uapi/linux/media.h | 25 +++-- 1 file changed, 15

[PATCH v10 0/4] Media Device Allocator API

2019-01-24 Thread Shuah Khan
device based on comments from Hans Verkuil - Carried Reviewed-by tag from Takashi Iwai for the sound from v9. - No changes to Patches 2 and 3. References: https://lkml.org/lkml/2018/11/2/169 https://www.mail-archive.com/linux-media@vger.kernel.org/msg105854.html Shuah Khan (4): media: Media Device

Re: [PATCH v9 0/4] Media Device Allocator API

2019-01-23 Thread shuah
On 1/21/19 7:46 AM, Hans Verkuil wrote: Hi Shuah, On 12/18/2018 06:59 PM, sh...@kernel.org wrote: From: Shuah Khan Media Device Allocator API to allows multiple drivers share a media device. This API solves a very common use-case for media devices where one physical device (an USB stick

Re: [PATCH 1/2] selftests: Use lirc.h from kernel tree, not from system

2019-01-22 Thread shuah
On 1/17/19 8:29 AM, Sean Young wrote: When the system lirc.h is older than v4.16, you will get errors like: ir_loopback.c:32:16: error: field ‘proto’ has incomplete type enum rc_proto proto; Cc: Shuah Khan Signed-off-by: Sean Young --- tools/testing/selftests/ir/Makefile | 2 ++ 1 file

Re: [PATCH v9 4/4] sound/usb: Use Media Controller API to share media resources

2019-01-20 Thread shuah
On 1/19/19 3:30 AM, Hans Verkuil wrote: On 01/19/2019 02:03 AM, shuah wrote: On 1/18/19 2:54 PM, shuah wrote: On 1/18/19 1:36 AM, Hans Verkuil wrote: On 12/18/18 6:59 PM, sh...@kernel.org wrote: From: Shuah Khan Media Device Allocator API to allows multiple drivers share a media device

Re: [PATCH v9 4/4] sound/usb: Use Media Controller API to share media resources

2019-01-18 Thread shuah
On 1/18/19 2:54 PM, shuah wrote: On 1/18/19 1:36 AM, Hans Verkuil wrote: On 12/18/18 6:59 PM, sh...@kernel.org wrote: From: Shuah Khan Media Device Allocator API to allows multiple drivers share a media device. This API solves a very common use-case for media devices where one physical

Re: [PATCH v9 4/4] sound/usb: Use Media Controller API to share media resources

2019-01-18 Thread shuah
On 1/18/19 1:36 AM, Hans Verkuil wrote: On 12/18/18 6:59 PM, sh...@kernel.org wrote: From: Shuah Khan Media Device Allocator API to allows multiple drivers share a media device. This API solves a very common use-case for media devices where one physical device (an USB stick) provides both

Re: [alsa-devel] [PATCH v9 4/4] sound/usb: Use Media Controller API to share media resources

2019-01-11 Thread shuah
On 1/11/19 7:59 AM, Hans Verkuil wrote: On 1/11/19 3:57 PM, shuah wrote: On 12/19/18 6:51 AM, Takashi Iwai wrote: On Tue, 18 Dec 2018 18:59:39 +0100, sh...@kernel.org wrote: From: Shuah Khan Media Device Allocator API to allows multiple drivers share a media device. This API solves a very

Re: [alsa-devel] [PATCH v9 4/4] sound/usb: Use Media Controller API to share media resources

2019-01-11 Thread shuah
On 12/19/18 6:51 AM, Takashi Iwai wrote: On Tue, 18 Dec 2018 18:59:39 +0100, sh...@kernel.org wrote: From: Shuah Khan Media Device Allocator API to allows multiple drivers share a media device. This API solves a very common use-case for media devices where one physical device (an USB stick

[PATCH v9 0/4] Media Device Allocator API

2018-12-18 Thread shuah
From: Shuah Khan Media Device Allocator API to allows multiple drivers share a media device. This API solves a very common use-case for media devices where one physical device (an USB stick) provides both audio and video. When such media device exposes a standard USB Audio class, a proprietary

[PATCH v9 2/4] media: change au0828 to use Media Device Allocator API

2018-12-18 Thread shuah
From: Shuah Khan Media Device Allocator API to allows multiple drivers share a media device. This API solves a very common use-case for media devices where one physical device (an USB stick) provides both audio and video. When such media device exposes a standard USB Audio class, a proprietary

[PATCH v9 1/4] media: Media Device Allocator API

2018-12-18 Thread shuah
From: Shuah Khan Media Device Allocator API to allows multiple drivers share a media device. This API solves a very common use-case for media devices where one physical device (an USB stick) provides both audio and video. When such media device exposes a standard USB Audio class, a proprietary

[PATCH v9 4/4] sound/usb: Use Media Controller API to share media resources

2018-12-18 Thread shuah
From: Shuah Khan Media Device Allocator API to allows multiple drivers share a media device. This API solves a very common use-case for media devices where one physical device (an USB stick) provides both audio and video. When such media device exposes a standard USB Audio class, a proprietary

[PATCH v9 3/4] media: media.h: Enable ALSA MEDIA_INTF_T* interface types

2018-12-18 Thread shuah
From: Shuah Khan Move PCM_CAPTURE, PCM_PLAYBACK, and CONTROL ALSA MEDIA_INTF_T* interface types back into __KERNEL__ scope to get ready for adding ALSA support for these to the media controller. Signed-off-by: Shuah Khan --- include/uapi/linux/media.h | 25 +++-- 1 file

Re: [RFC PATCH v8 4/4] sound/usb: Use Media Controller API to share media resources

2018-12-06 Thread shuah
Hi Hans, On 11/20/18 4:54 AM, Hans Verkuil wrote: On 11/02/2018 01:31 AM, sh...@kernel.org wrote: From: Shuah Khan Change ALSA driver to use Media Controller API to share media resources with DVB, and V4L2 drivers on a AU0828 media device. Media Controller specific initialization is done

Re: [RFC PATCH v8 1/4] media: Media Device Allocator API

2018-12-06 Thread shuah
On 11/19/18 1:59 AM, Pavel Machek wrote: On Thu 2018-11-01 18:31:30, sh...@kernel.org wrote: From: Shuah Khan Media Device Allocator API to allows multiple drivers share a media device. Using this API, drivers can allocate a media device with the shared struct device as the key. Once the

Re: [RFC PATCH v8 3/4] media: media.h: Enable ALSA MEDIA_INTF_T* interface types

2018-12-06 Thread shuah
Hi Hans, On 11/20/18 4:22 AM, Hans Verkuil wrote: On 11/02/2018 01:31 AM, sh...@kernel.org wrote: From: Shuah Khan Move ALSA MEDIA_INTF_T* interface types back into __KERNEL__ scope to get ready for adding ALSA support to the media controller. Signed-off-by: Shuah Khan --- include/uapi

Re: [RFC PATCH v8 1/4] media: Media Device Allocator API

2018-12-06 Thread shuah
Hi Hans, On 11/20/18 4:20 AM, Hans Verkuil wrote: On 11/02/2018 01:31 AM, sh...@kernel.org wrote: From: Shuah Khan Media Device Allocator API to allows multiple drivers share a media device. Using this API, drivers can allocate a media device with the shared struct device as the key. Once

Re: [RFC] Create test script(s?) for regression testing

2018-11-07 Thread Shuah Khan
streaming >>>>> test). >>>>> >>>>> There are more extensive (and longer running) tests that can be done, but >>>>> that's something to look at later. >>>>> >>>>>>>> We have four virtual drivers: vivi

[RFC PATCH v8 4/4] sound/usb: Use Media Controller API to share media resources

2018-11-01 Thread shuah
From: Shuah Khan Change ALSA driver to use Media Controller API to share media resources with DVB, and V4L2 drivers on a AU0828 media device. Media Controller specific initialization is done after sound card is registered. ALSA creates Media interface and entity function graph nodes for Control

[RFC PATCH v8 3/4] media: media.h: Enable ALSA MEDIA_INTF_T* interface types

2018-11-01 Thread shuah
From: Shuah Khan Move ALSA MEDIA_INTF_T* interface types back into __KERNEL__ scope to get ready for adding ALSA support to the media controller. Signed-off-by: Shuah Khan --- include/uapi/linux/media.h | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff

[RFC PATCH v8 1/4] media: Media Device Allocator API

2018-11-01 Thread shuah
From: Shuah Khan Media Device Allocator API to allows multiple drivers share a media device. Using this API, drivers can allocate a media device with the shared struct device as the key. Once the media device is allocated by a driver, other drivers can get a reference to it. The media device is

[RFC PATCH v8 0/4] Media Device Allocator API

2018-11-01 Thread shuah
From: Shuah Khan This patch series has been on the ice for the last couple of years. Mauro asked me to restart the discussion on this and see if we can make progress. I rebased the series to Linux 4.19. It has been surprisingly well preserved with one small merge conflict resolved in 0004

[RFC PATCH v8 2/4] media: change au0828 to use Media Device Allocator API

2018-11-01 Thread shuah
From: Shuah Khan Change au0828 to use Media Device Allocator API to allocate media device with the parent usb struct device as the key, so it can be shared with the snd_usb_audio driver. Signed-off-by: Shuah Khan --- drivers/media/usb/au0828/au0828-core.c | 12 drivers/media/usb

Re: [PATCH] media: rc: self test for IR encoders and decoders

2018-11-01 Thread Shuah Khan
IR encoders and decoders themselves. > > No hardware is required for this test. > > Signed-off-by: Sean Young > Cc: Shuah Khan Hi Sean, This looks good. I will get this into the next release. It will show up in linux-kselftest next after 4.20-rc1 comes out. thanks, -- Shuah

Re: [PATCH 2/2] media: rc: self test for IR encoders and decoders

2018-10-04 Thread Shuah Khan
.scancode) { > + printf("decoded scancode is different: %llx\n", > lsc2.scancode); > + errors++; > + } > + } > + > + printf("OK\n"); > + } > + > + close(rlircfd); > + close(wlircfd); > + close(protocolfd); > + > + return errors > 0; > +} > diff --git a/tools/testing/selftests/ir/ir-loopback.sh > b/tools/testing/selftests/ir/ir-loopback.sh > new file mode 100755 > index ..72be64a45cc5 > --- /dev/null > +++ b/tools/testing/selftests/ir/ir-loopback.sh > @@ -0,0 +1,28 @@ > +#!/bin/bash > +# SPDX-License-Identifier: GPL-2.0 > + > +GREEN='\033[0;92m' > +RED='\033[0;31m' > +NC='\033[0m' # No Color > + > +modprobe rc-loopback Please check rc-loopback exists or not and handle modprobe failures. If module doesn't exit, the test should exit with skip code. > + > +for i in /sys/class/rc/rc* > +do > + if grep -q DRV_NAME=rc-loopback $i/uevent > + then > + RCDEV=$(echo $i | sed sQ/sys/class/rc/QQ) > + fi > +done > + > +if [ -n $RCDEV ]; > +then > + TYPE=ir-loopback > + ./ir-loopback $RCDEV $RCDEV > + ret=$? > + if [ $ret -ne 0 ]; then > + echo -e ${RED}"FAIL: $TYPE"${NC} > + else > + echo -e ${GREEN}"PASS: $TYPE"${NC} > + fi > +fi > Please check tools/testing/selftests/lib/*.sh for examples on how to handle loading test modules and error/skip conditions. Please refer to the following or other tests that call ksft_* interfaces. tools/testing/selftests/membarrier tools/testing/selftests/breakpoints thanks, -- Shuah

Re: [RFC] Make entity to interface links immutable

2018-07-09 Thread Shuah Khan
e tests with real case scenarios before changing it. > I have been sidetracked by USB over IP security vulnerability reports and fixing them since last November. Sorry for not picking this work back up. I am back from a week of vacation and I will dig my patches and respond with details in a couple of days. thanks for your patience, -- Shuah

[PATCH v2] media: v4l2-core: v4l2-mc: Add SPDX license identifier

2018-01-11 Thread Shuah Khan
Replace GPL license statement with SPDX GPL-2.0 license identifier. Signed-off-by: Shuah Khan --- Changes since v1: - Fixed SPDX comment format - Fixed SPDX license text to eliminate change in license. It now reads GPL-2.0-or-later to maintain the original. drivers/media/v4l2-core/v4l2-mc.c

Re: [PATCH] media: v4l2-core: v4l2-mc: Add SPDX license identifier

2018-01-11 Thread Shuah Khan
On 01/11/2018 02:33 PM, Laurent Pinchart wrote: > Hi Shuah, > > On Thursday, 11 January 2018 22:44:08 EET Shuah Khan wrote: >> On 01/11/2018 11:42 AM, Laurent Pinchart wrote: >>> On Thursday, 11 January 2018 17:45:15 EET Shuah Khan wrote: >>>> On 01/11/2

Re: [PATCH] media: v4l2-core: v4l2-mc: Add SPDX license identifier

2018-01-11 Thread Shuah Khan
On 01/11/2018 11:42 AM, Laurent Pinchart wrote: > Hi Shuah, > > On Thursday, 11 January 2018 17:45:15 EET Shuah Khan wrote: >> On 01/11/2018 05:55 AM, Laurent Pinchart wrote: >>> On Wednesday, 10 January 2018 18:35:36 EET Shuah Khan wrote: >>>> Replace GPL

Re: [PATCH] media: v4l2-core: v4l2-mc: Add SPDX license identifier

2018-01-11 Thread Shuah Khan
On 01/11/2018 05:55 AM, Laurent Pinchart wrote: > Hi Shuah, > > Thank you for the patch. > > On Wednesday, 10 January 2018 18:35:36 EET Shuah Khan wrote: >> Replace GPL license statement with SPDX GPL-2.0 license identifier. >> >> Signed-off-by: Shuah Khan &

[PATCH] media: v4l2-core: v4l2-mc: Add SPDX license identifier

2018-01-10 Thread Shuah Khan
Replace GPL license statement with SPDX GPL-2.0 license identifier. Signed-off-by: Shuah Khan --- drivers/media/v4l2-core/v4l2-mc.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-mc.c b/drivers/media/v4l2-core/v4l2-mc.c index

Re: [PATCH v2 1/2] media: exynos-gsc: fix lockdep warning

2017-12-08 Thread Shuah Khan
On 11/07/2017 09:53 AM, Shuah Khan wrote: > On 10/16/2017 09:18 AM, Hans Verkuil wrote: >> On 10/16/2017 05:16 PM, Shuah Khan wrote: >>> The driver mmap functions shouldn't take lock when calling vb2_mmap(). >>> Fix it to not take the lock. &

Re: [PATCH v2 1/2] media: exynos-gsc: fix lockdep warning

2017-11-07 Thread Shuah Khan
On 10/16/2017 09:18 AM, Hans Verkuil wrote: > On 10/16/2017 05:16 PM, Shuah Khan wrote: >> The driver mmap functions shouldn't take lock when calling vb2_mmap(). >> Fix it to not take the lock. >> >> Reference: commit log for f035eb4e976ef5a

[PATCH v2 2/2] media: s5p-mfc: fix lock confection - request_firmware() once and keep state

2017-11-03 Thread Shuah Khan
[ 552.446104] lock(&mm->mmap_sem); [ 552.449484]lock(&type->i_mutex_dir_key#2); [ 552.456329]lock(&mm->mmap_sem); [ 552.46] lock(&dev->mfc_mutex); [ 552.465775] *** DEAD

[PATCH v2 1/2] media: s5p-mfc: remove firmware buf null check in s5p_mfc_load_firmware()

2017-11-03 Thread Shuah Khan
s5p_mfc_load_firmware() will not get called if fw_buf.virt allocation fails. The allocation happens very early on in the probe routine and probe fails if allocation fails. There is no need to check if it is null in s5p_mfc_load_firmware(). Remove the check. Signed-off-by: Shuah Khan

[PATCH v2 0/2] Fix s5p-mfc lock contention in request firmware paths

2017-11-03 Thread Shuah Khan
case it works. Shuah Khan (2): media: s5p-mfc: remove firmware buf null check in s5p_mfc_load_firmware() media: s5p-mfc: fix lock confection - request_firmware() once and keep state drivers/media/platform/s5p-mfc/s5p_mfc.c| 6 ++ drivers/media/platform/s5p-mfc/s5p_mfc_commo

Re: [PATCH 2/2] media: s5p-mfc: fix lock confection - request_firmware() once and keep state

2017-11-03 Thread Shuah Khan
e norm. thanks, -- Shuah

Re: [PATCH 2/2] media: s5p-mfc: fix lock confection - request_firmware() once and keep state

2017-11-02 Thread Shuah Khan
On 11/02/2017 02:31 AM, Andrzej Hajda wrote: > On 06.10.2017 23:30, Shuah Khan wrote: >> Driver calls request_firmware() whenever the device is opened for the >> first time. As the device gets opened and closed, dev->num_inst == 1 >> is true several times. This is not nece

Re: [PATCH 1/2] media: s5p-mfc: check for firmware allocation before requesting firmware

2017-11-02 Thread Shuah Khan
On 11/02/2017 02:12 AM, Andrzej Hajda wrote: > Hi Shuah, > > On 06.10.2017 23:30, Shuah Khan wrote: >> Check if firmware is allocated before requesting firmware instead of >> requesting firmware only to release it if firmware is not allocated. >> >> Signed-off-b

Re: [PATCH 0/2] Fix s5p-mfc lock contention in request firmware paths

2017-10-30 Thread Shuah Khan
On 10/25/2017 04:28 PM, Marian Mihailescu wrote: > Hi Shuah, > > For MFC patch, you can delete the "dev" variable since it's not being > used anymore and results in a compile warning. > > - struct s5p_mfc_dev *dev = ctx->dev; > Hi Marian, This series

[PATCH v2] media: s5p-mfc: fix lockdep warning

2017-10-30 Thread Shuah Khan
ap_region) from [] (do_mmap+0x330/0x3a4) [ 2106.505068] [] (do_mmap) from [] (vm_mmap_pgoff+0x90/0xb8) [ 2106.512260] [] (vm_mmap_pgoff) from [] (SyS_mmap_pgoff+0x90/0xc0) [ 2106.520059] [] (SyS_mmap_pgoff) from [] (ret_fast_syscall+0x0/0x28) Signed-off-by: Shuah Khan Suggested-by: Hans Verkuil

Re: [PATCH 0/2] Fix s5p-mfc lock contention in request firmware paths

2017-10-25 Thread Shuah Khan
On 10/25/2017 04:28 PM, Marian Mihailescu wrote: > Hi Shuah, > > For MFC patch, you can delete the "dev" variable since it's not being > used anymore and results in a compile warning. > > - struct s5p_mfc_dev *dev = ctx->dev; > > Cheers, > Marian Oo

Re: [PATCH 0/2] Fix s5p-mfc lock contention in request firmware paths

2017-10-25 Thread Shuah Khan
On 10/06/2017 03:30 PM, Shuah Khan wrote: > This patch series fixes inefficiencies and lock contention in the request > firmware paths. > > Shuah Khan (2): > media: s5p-mfc: check for firmware allocation before requesting > firmware > media: s5p-mfc: fix lock confecti

Re: Exynos MFC issues on 4.14-rc4

2017-10-16 Thread Shuah Khan
(1)" >> message either > > > I will check it and let you know if this is something we should worry about. I am seeing this messages. It appears to be harmless. However, it would be good to look into this. It doesn't appear to cause any problems for capture/output. thanks, -- Shuah

Re: [PATCH 0/2] fix lockdep warnings in s5p_mfc and exynos-gsc vb2 drivers

2017-10-16 Thread Shuah Khan
Hi Marek, On 10/16/2017 06:48 AM, Marek Szyprowski wrote: > Hi Shuah, > > On 2017-10-14 01:13, Shuah Khan wrote: >> Driver mmap functions shouldn't hold lock when calling vb2_mmap(). The >> vb2_mmap() function has its own lock that it uses to protect the critical &

[PATCH 0/2] fix lockdep warnings in s5p_mfc and exynos-gsc vb2 drivers

2017-10-13 Thread Shuah Khan
Driver mmap functions shouldn't hold lock when calling vb2_mmap(). The vb2_mmap() function has its own lock that it uses to protect the critical section. Reference: commit log for f035eb4e976ef5a059e30bc91cfd310ff030a7d3 Shuah Khan (2): media: exynos-gsc: fix lockdep warning media: s5

[PATCH 1/2] media: exynos-gsc: fix lockdep warning

2017-10-13 Thread Shuah Khan
from [] (vm_mmap_pgoff+0x90/0xb8) [ 1991.302178] [] (vm_mmap_pgoff) from [] (SyS_mmap_pgoff+0x90/0xc0) [ 1991.309977] [] (SyS_mmap_pgoff) from [] (ret_fast_syscall+0x0/0x28) Signed-off-by: Shuah Khan Suggested-by: Hans Verkuil --- drivers/media/platform/exynos-gsc/gsc-m2m.c | 5 - 1 fi

[PATCH 2/2] media: s5p-mfc: fix lockdep warning

2017-10-13 Thread Shuah Khan
ap_region) from [] (do_mmap+0x330/0x3a4) [ 2106.505068] [] (do_mmap) from [] (vm_mmap_pgoff+0x90/0xb8) [ 2106.512260] [] (vm_mmap_pgoff) from [] (SyS_mmap_pgoff+0x90/0xc0) [ 2106.520059] [] (SyS_mmap_pgoff) from [] (ret_fast_syscall+0x0/0x28) Signed-off-by: Shuah Khan Suggested-by: Hans Verkuil

Re: [ANN] Call for topics for the media mini-summit on Friday Oct 27 in Prague

2017-10-13 Thread Shuah Khan
On 10/13/2017 09:05 AM, Hans Verkuil wrote: > On 10/13/17 16:43, Shuah Khan wrote: >> Hi Hans, >> >> On 10/13/2017 01:36 AM, Hans Verkuil wrote: >>> Hi Shuah, >>> >>> On 10/05/2017 03:53 PM, Shuah Khan wrote: >>>> Hi Hans/Gustav

Re: [ANN] Call for topics for the media mini-summit on Friday Oct 27 in Prague

2017-10-13 Thread Shuah Khan
Hi Hans, On 10/13/2017 01:36 AM, Hans Verkuil wrote: > Hi Shuah, > > On 10/05/2017 03:53 PM, Shuah Khan wrote: >> Hi Hans/Gustavo. >> >> On Wed, Oct 4, 2017 at 1:34 PM, Gustavo Padovan wrote: >>> Hi Hans, >>> >>> >>> >&

[PATCH 1/2] media: s5p-mfc: check for firmware allocation before requesting firmware

2017-10-06 Thread Shuah Khan
Check if firmware is allocated before requesting firmware instead of requesting firmware only to release it if firmware is not allocated. Signed-off-by: Shuah Khan --- drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a

[PATCH 0/2] Fix s5p-mfc lock contention in request firmware paths

2017-10-06 Thread Shuah Khan
This patch series fixes inefficiencies and lock contention in the request firmware paths. Shuah Khan (2): media: s5p-mfc: check for firmware allocation before requesting firmware media: s5p-mfc: fix lock confection - request_firmware() once and keep state drivers/media/platform/s5p

[PATCH 2/2] media: s5p-mfc: fix lock confection - request_firmware() once and keep state

2017-10-06 Thread Shuah Khan
[ 552.446104] lock(&mm->mmap_sem); [ 552.449484]lock(&type->i_mutex_dir_key#2); [ 552.456329]lock(&mm->mmap_sem); [ 552.46] lock(&dev->mfc_mutex); [ 552.465775] *** DE

Re: [ANN] Call for topics for the media mini-summit on Friday Oct 27 in Prague

2017-10-05 Thread Shuah Khan
-30min I would have loved to attend the Media mini-summit. Unfortunately I already made plans to leave Friday. In addition participating in the V4L2 Explicit Syncronization discussion, it would have been good to discuss: the my pending Media/Audio resource sharing patch series that is dependent on Sakari's lifetime managemnet patch series. I have been unable to get any discussion going on this topic on the mailing list. thanks, -- Shuah

Re: [RFC 5/5] pm: remove kernel thread freezing

2017-10-03 Thread Shuah Khan
for a review of which one of these usages could be removed. cc'ing Mauro and linux-media thanks, -- Shuah

Re: s5p-mfc - WARNING: possible circular locking dependency detected,[ 4.14.0-rc2

2017-09-26 Thread Shuah Khan
On 09/26/2017 02:10 PM, Shuah Khan wrote: > When running gstreamer pipeline with s5p-mfc → exynos-gsc→ exynos-drm, > I am seeing circular locking dependency detected warning in 4.14-rc2. > This is a regression from 4.13. The pipeline does run to completion > video streaming works. Are

s5p-mfc - WARNING: possible circular locking dependency detected,[ 4.14.0-rc2

2017-09-26 Thread Shuah Khan
rom [] (do_mmap+0x330/0x3a4) [ 2135.422063] [] (do_mmap) from [] (vm_mmap_pgoff+0x90/0xb8) [ 2135.429255] [] (vm_mmap_pgoff) from [] (SyS_mmap_pgoff+0x90/0xc0) [ 2135.437054] [] (SyS_mmap_pgoff) from [] (ret_fast_syscall+0x0/0x28) thanks, -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America (Silicon Valley) shua...@osg.samsung.com

Re: [PATCH 18/25] media: dvb_frontend: get rid of dtv_get_property_dump()

2017-09-21 Thread Shuah Khan
+ "%s: GET cmd 0x%08x (%s) len %d: %*ph\n", > + __func__, > + tvp->cmd, dtv_cmds[tvp->cmd].name, > + tvp->u.buffer.len, > + tvp->u.buffer.len, tvp->u.buffer.data); > > return 0; > } > Why not keep common dtv_property_dum(0 and make these enhancements to add more information to the dump in a common routine so both get and set are covered. I think this change coupled with the change in 17/25 is moving away from common simpler code to embedded debug code. I am not clear on the value it adds. thanks, -- Shuah

  1   2   3   4   5   6   7   8   >