From patchwork Fri May 20 19:01:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Curtin X-Patchwork-Id: 15996 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id F1354C0F2A for ; Fri, 20 May 2022 19:02:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AC3E265668; Fri, 20 May 2022 21:02:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1653073327; bh=r0VndMyAzdRVOz0AwPsURz1bdZLxlL4mF3KHsbRrKA0=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=2/ddTDiBTd0GHtK8QoAvCSFIDyJMK5EB10+jHnpAEpmnXd/To6jRvIzYT34ks3qFu Md28+XJho0i7JWDWIvX/CSZlzQQaZDtItlnqAEScyGm+IO7OuElaoPxjzjAS7Z7NHo srwzKK2pM09qYA+zLak+icLBPuPN70L0X4OPmB7S+ZsPKD8CTubTVlm42Q5R2Gpb+p 22wM+jwJ0EjfYq0/FCqULEagi+y3BKaykZv+kCX+z9yFqK4uRcer0+rdKY2+W3aZbs JzXcFK2T3MqGv/MUNk7OGCha1pjfe4gs7hoPlRD9U7jUkiFyFsijI+wKwUKiKnJ3aV esT3L494YlpVQ== Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 200C560440 for ; Fri, 20 May 2022 21:02:06 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="TQf1Xura"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653073325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q0ZKnWxQTh5EMFLbQWkWKhTE3WuJvgfJ/LJIrH00cN4=; b=TQf1Xura4aGBbeLbJjaNQIO6SAYSWCeyVrsk38QFsBfvGRe00i8/tBVq0plIkl01KbFrcN 2wBlgwzDaxWypqwlJTuiYkKs2JaIh2hm760x9gt6Tbawyuz1cWLb6QAMFfPwWv/HaPBRSL CI49vsZN/2sjEIzRRsPN+Mwqm60nb4w= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-85-tgzC3h3aPxi42ajCYhBpGA-1; Fri, 20 May 2022 15:02:04 -0400 X-MC-Unique: tgzC3h3aPxi42ajCYhBpGA-1 Received: by mail-wm1-f70.google.com with SMTP id e9-20020a05600c4e4900b00394779649b1so6488662wmq.3 for ; Fri, 20 May 2022 12:02:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q0ZKnWxQTh5EMFLbQWkWKhTE3WuJvgfJ/LJIrH00cN4=; b=51qz+ni7m9RN2cv4dSDVhw87JXRJ2ZlepQbzVTgF1CBUB8w5J9igpSlrkc+JFvaUyh +vp+rnjWXwK+DAOLoW5H68seau1XxzW3kQDaIjhwjBFqFmNELLr3BJrZegvreRN/GJnd WTd+Z+6bPu2CeQRmph/BhenQrLaUnQQWuqpB+A1agMZpwwJUCpqEWjZmNYPr+0vtdmDv HA9JIgY+nCS4CKZyyy+w3Ej/UPSOrMZh+1H1fbzRHJC+ZMMOJen3jwPxnRS3z47CE2TZ xvOEMvFUGRIzAxtUnMgZeLhK4zj2YzYqvkh3LZC7jHSBgvyIBBAnwWJpoUL0jnoI7OCJ 6naw== X-Gm-Message-State: AOAM532StK1idsPgbA0Xyc2JYHNnhj9MDr6fnTbpqsHuaGgU6gXr+8sV pbxPFkjbsBDImTcSCRThPjMe1sVgXk/rInfNJm9ZOshYwL0crwIvgjT3TTDZOv+vrTBa5fFea74 BtrxPMUJWer74SVJl6q+LjrE5n403Im/EMxoL+15AbPRwKcsX8Cax3gj1GAofUGtpZEzxKslEBh yItBcMZDE3 X-Received: by 2002:a7b:cf11:0:b0:397:33e3:87b2 with SMTP id l17-20020a7bcf11000000b0039733e387b2mr6796248wmg.152.1653073322431; Fri, 20 May 2022 12:02:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7zKlobN4ImtziXCN1ORC6T1thLx6eao4L3X0gNaq/inRsO0gcfdQI8scI5aezGnIOvgpDHQ== X-Received: by 2002:a7b:cf11:0:b0:397:33e3:87b2 with SMTP id l17-20020a7bcf11000000b0039733e387b2mr6796231wmg.152.1653073322227; Fri, 20 May 2022 12:02:02 -0700 (PDT) Received: from p1.Home ([2001:8a0:6724:4500:a69c:e66f:828e:b340]) by smtp.gmail.com with ESMTPSA id u30-20020adfa19e000000b0020d10a249eesm3337016wru.13.2022.05.20.12.02.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 12:02:01 -0700 (PDT) To: libcamera-devel@lists.libcamera.org, laurent.pinchart@ideasonboard.com, kieran.bingham@ideasonboard.com, jacopo@jmondi.org, javierm@redhat.com Date: Fri, 20 May 2022 20:01:03 +0100 Message-Id: <20220520190106.425386-2-ecurtin@redhat.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220520190106.425386-1-ecurtin@redhat.com> References: <20220520190106.425386-1-ecurtin@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ecurtin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [libcamera-devel] [PATCH v9 1/4] cam: event_loop: Rename addEvent to addFdEvent X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Eric Curtin via libcamera-devel From: Eric Curtin Reply-To: Eric Curtin Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" With the addition of addTimerEvent, the naming of addEvent is specific to the management of an fd, while the naming is generic. Update the name to make the naming scheme consistent in specifying the type of event to be added. Signed-off-by: Eric Curtin Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Tested-by: Jacopo Mondi --- src/cam/drm.cpp | 4 ++-- src/cam/event_loop.cpp | 4 ++-- src/cam/event_loop.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cam/drm.cpp b/src/cam/drm.cpp index 46e34eb5..42c5a3b1 100644 --- a/src/cam/drm.cpp +++ b/src/cam/drm.cpp @@ -432,8 +432,8 @@ int Device::init() if (ret < 0) return ret; - EventLoop::instance()->addEvent(fd_, EventLoop::Read, - std::bind(&Device::drmEvent, this)); + EventLoop::instance()->addFdEvent(fd_, EventLoop::Read, + std::bind(&Device::drmEvent, this)); return 0; } diff --git a/src/cam/event_loop.cpp b/src/cam/event_loop.cpp index e25784c0..2e3ce995 100644 --- a/src/cam/event_loop.cpp +++ b/src/cam/event_loop.cpp @@ -60,8 +60,8 @@ void EventLoop::callLater(const std::function &func) event_base_once(base_, -1, EV_TIMEOUT, dispatchCallback, this, nullptr); } -void EventLoop::addEvent(int fd, EventType type, - const std::function &callback) +void EventLoop::addFdEvent(int fd, EventType type, + const std::function &callback) { std::unique_ptr event = std::make_unique(callback); short events = (type & Read ? EV_READ : 0) diff --git a/src/cam/event_loop.h b/src/cam/event_loop.h index a4613eb2..79902d87 100644 --- a/src/cam/event_loop.h +++ b/src/cam/event_loop.h @@ -34,8 +34,8 @@ public: void callLater(const std::function &func); - void addEvent(int fd, EventType type, - const std::function &handler); + void addFdEvent(int fd, EventType type, + const std::function &handler); private: struct Event {