From patchwork Fri May 8 01:12:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 6361841 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 26CBABEEE1 for ; Fri, 8 May 2015 01:14:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C7D02015A for ; Fri, 8 May 2015 01:14:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA05D203B7 for ; Fri, 8 May 2015 01:14:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751740AbbEHBNJ (ORCPT ); Thu, 7 May 2015 21:13:09 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:36632 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751986AbbEHBM4 (ORCPT ); Thu, 7 May 2015 21:12:56 -0400 Received: from 177.43.30.133.dynamic.adsl.gvt.net.br ([177.43.30.133] helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1YqWqT-0004Hb-3C; Fri, 08 May 2015 01:12:53 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.84) (envelope-from ) id 1YqWqH-0005TY-Fk; Thu, 07 May 2015 22:12:41 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Jonathan Corbet , Hyun Kwon , Laurent Pinchart , Michal Simek , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , Hans Verkuil , Sakari Ailus , Sylwester Nawrocki , Ramakrishnan Muthukrishnan , Markus Elfring , linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-api@vger.kernel.org Subject: [PATCH 03/18] media controller: use MEDIA_ENT_T_AV_DMA for A/V DMA engines Date: Thu, 7 May 2015 22:12:25 -0300 Message-Id: X-Mailer: git-send-email 2.1.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP At the Video4Linux API, the /dev/video?, /dev/vbi? and /dev/radio? device nodes are used for the chipset that provides the bridge between video/radio streams and the USB, PCI or CPU buses. Such bridge is also typically used to control the V4L2 device as a hole. For video streaming devices and SDR radio devices, they're also associated with the DMA engines that transfer the video stream (or SDR stream) to the CPU's memory. It should be noticed, however, this is not true on non-SDR radio devices, and may also not be true on embedded devices that, due to DRM reasons, don't allow writing unencrypted data on a memory that could be seen by the CPU. So, we'll eventually need to add another entity for such bridge chipsets that have a video/vbi/radio device node associated, but don't have DMA engines on (some) devnodes. As, currently, we don't have any such case, let's for now just rename the device nodes that are associated with a DMA engine as MEDIA_ENT_T_AV_DMA. So, MEDIA_ENT_T_DEVNODE_V4L -> MEDIA_ENT_T_AV_DMA PS.: This is not actually true for USB devices, as the DMA engine is an internal component, as it is up to the Kernel to strip the stream payload from the URB packages. Signed-off-by: Mauro Carvalho Chehab diff --git a/Documentation/DocBook/media/v4l/media-ioc-enum-entities.xml b/Documentation/DocBook/media/v4l/media-ioc-enum-entities.xml index 5872f8bbf774..5b8147629159 100644 --- a/Documentation/DocBook/media/v4l/media-ioc-enum-entities.xml +++ b/Documentation/DocBook/media/v4l/media-ioc-enum-entities.xml @@ -183,7 +183,7 @@ Unknown device node - MEDIA_ENT_T_DEVNODE_V4L + MEDIA_ENT_T_AV_DMA V4L video, radio or vbi device node diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c index efde88adf624..7fa0cc0f08f0 100644 --- a/drivers/media/platform/xilinx/xilinx-dma.c +++ b/drivers/media/platform/xilinx/xilinx-dma.c @@ -193,7 +193,7 @@ static int xvip_pipeline_validate(struct xvip_pipeline *pipe, while ((entity = media_entity_graph_walk_next(&graph))) { struct xvip_dma *dma; - if (entity->type != MEDIA_ENT_T_DEVNODE_V4L) + if (entity->type != MEDIA_ENT_T_AV_DMA) continue; dma = to_xvip_dma(media_entity_to_video_device(entity)); diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c index 71a1b93b0790..9ef920221b5a 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c @@ -912,7 +912,7 @@ int __video_register_device(struct video_device *vdev, int type, int nr, /* Part 5: Register the entity. */ if (vdev->v4l2_dev->mdev && vdev->vfl_type != VFL_TYPE_SUBDEV) { - vdev->entity.type = MEDIA_ENT_T_DEVNODE_V4L; + vdev->entity.type = MEDIA_ENT_T_AV_DMA; vdev->entity.name = vdev->name; vdev->entity.info.dev.major = VIDEO_MAJOR; vdev->entity.info.dev.minor = vdev->minor; diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index 63596063b213..9f8fc8330b3e 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -535,7 +535,7 @@ v4l2_subdev_link_validate_get_format(struct media_pad *pad, return v4l2_subdev_call(sd, pad, get_fmt, NULL, fmt); } - WARN(pad->entity->type != MEDIA_ENT_T_DEVNODE_V4L, + WARN(pad->entity->type != MEDIA_ENT_T_AV_DMA, "Driver bug! Wrong media entity type 0x%08x, entity %s\n", pad->entity->type, pad->entity->name); diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h index 775c11c6b173..a7aa2aac9c23 100644 --- a/include/uapi/linux/media.h +++ b/include/uapi/linux/media.h @@ -44,12 +44,12 @@ struct media_device_info { /* Used values for media_entity_desc::type */ -#define MEDIA_ENT_T_DEVNODE_V4L (((1 << 16)) + 1) -#define MEDIA_ENT_T_DEVNODE_DVB_FE (MEDIA_ENT_T_DEVNODE_V4L + 3) -#define MEDIA_ENT_T_DEVNODE_DVB_DEMUX (MEDIA_ENT_T_DEVNODE_V4L + 4) -#define MEDIA_ENT_T_DEVNODE_DVB_DVR (MEDIA_ENT_T_DEVNODE_V4L + 5) -#define MEDIA_ENT_T_DEVNODE_DVB_CA (MEDIA_ENT_T_DEVNODE_V4L + 6) -#define MEDIA_ENT_T_DEVNODE_DVB_NET (MEDIA_ENT_T_DEVNODE_V4L + 7) +#define MEDIA_ENT_T_AV_DMA (((1 << 16)) + 1) +#define MEDIA_ENT_T_DEVNODE_DVB_FE (MEDIA_ENT_T_AV_DMA + 3) +#define MEDIA_ENT_T_DEVNODE_DVB_DEMUX (MEDIA_ENT_T_AV_DMA + 4) +#define MEDIA_ENT_T_DEVNODE_DVB_DVR (MEDIA_ENT_T_AV_DMA + 5) +#define MEDIA_ENT_T_DEVNODE_DVB_CA (MEDIA_ENT_T_AV_DMA + 6) +#define MEDIA_ENT_T_DEVNODE_DVB_NET (MEDIA_ENT_T_AV_DMA + 7) #define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR ((2 << 16) + 1) #define MEDIA_ENT_T_V4L2_SUBDEV_FLASH (MEDIA_ENT_T_V4L2_SUBDEV_SENSOR + 1)