From patchwork Thu Aug 3 22:03:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mentz X-Patchwork-Id: 9879919 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8270560360 for ; Thu, 3 Aug 2017 22:03:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7014428455 for ; Thu, 3 Aug 2017 22:03:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6431C2870B; Thu, 3 Aug 2017 22:03:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D41FF28455 for ; Thu, 3 Aug 2017 22:03:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751910AbdHCWDu (ORCPT ); Thu, 3 Aug 2017 18:03:50 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:35447 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751736AbdHCWDt (ORCPT ); Thu, 3 Aug 2017 18:03:49 -0400 Received: by mail-pf0-f177.google.com with SMTP id t86so66247pfe.2 for ; Thu, 03 Aug 2017 15:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=0I5Br069WiIXAsb8KYG3ETgdIqOXdu2OVqkL3gyLd6I=; b=dVyjWP867K6Y0voyjQkfaaI/GwHOJSKGVntBAySgkjoyHG30OHFQwKhn7ujXn01bnT 1m+up4tyfOuo2l9Vtn5xJqET4SVuGPvSeny5cUXi+/skwcgDqKrC/ooc5oyHc8/oM0Mp glgQ3tyOHMoOuekUd7/eysJZ+tDnJbjkgfK9rcoECnWVgrV/35BwXMLzXmgOWHFhgfzI tVzR/Zw2RnOEjXG3hXzInsfNHkwGrlnehh9xj+ZjQGoGAfwk64SPyLP2aAP+65JaUDOh VBCpWtTalxZY6qQqnpbK0QAB0mTNTcJk/CA2WU2ki43ab20/Udx44Y7SMf0fnCIRnF8k iJpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0I5Br069WiIXAsb8KYG3ETgdIqOXdu2OVqkL3gyLd6I=; b=f+Mrijf/+VZhqs7hQzkVRzdbU7/vKhq7GwuxcsHu5fGAIhpWhrCo0TfUWYBBXmTcuF XICh7ZmWIZtydeMPJTOzqnd5RB3mwUG9vBmrnwe4AiLDCamFB/Ksd3lNsD4qUKx4jbjU cn5RAEe09CTNFqvVdyiUoeMuOZtau5El1UmdRdsOn04vby1iL+phN7s+wrQkJUF+SFxE Cdzb+VyY9sVHQvcjv2ZTGfSbbqdmNRSu3DXop41yTOoaIh1BMQb3ufCb2LLJVd5FNRxq ntNbVKkhimCtZXDEV7iiI0ojTBmslD06lF1cvBwTctOKdrt7ChFqVS3DA8v78TuswBs8 Jy9A== X-Gm-Message-State: AIVw112boB2I6r8HctCmGHux232d2odklDoOcPAccZRlzl4z97GkSXZE eddgjsYmx5/BpdXtrQGM4A== X-Received: by 10.98.215.74 with SMTP id v10mr258585pfl.314.1501797828212; Thu, 03 Aug 2017 15:03:48 -0700 (PDT) Received: from danielmentz.mtv.corp.google.com ([100.98.120.46]) by smtp.gmail.com with ESMTPSA id f2sm7991pgc.17.2017.08.03.15.03.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Aug 2017 15:03:47 -0700 (PDT) From: Daniel Mentz To: linux-media@vger.kernel.org Cc: Daniel Mentz , Hans Verkuil Subject: [PATCH] [media] v4l2-compat-ioctl32: Copy v4l2_window->global_alpha Date: Thu, 3 Aug 2017 15:03:10 -0700 Message-Id: <20170803220310.1550-1-danielmentz@google.com> X-Mailer: git-send-email 2.14.0.rc1.383.gd1ce394fe2-goog Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit b2787845fb91 ("V4L/DVB (5289): Add support for video output overlays.") added the field global_alpha to struct v4l2_window but did not update the compat layer accordingly. This change adds global_alpha to struct v4l2_window32 and copies the value for global_alpha back and forth. Cc: Hans Verkuil Signed-off-by: Daniel Mentz --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c index 6f52970f8b54..84ad195562c7 100644 --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c @@ -43,6 +43,7 @@ struct v4l2_window32 { compat_caddr_t clips; /* actually struct v4l2_clip32 * */ __u32 clipcount; compat_caddr_t bitmap; + __u8 global_alpha; }; static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up) @@ -51,7 +52,8 @@ static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user copy_from_user(&kp->w, &up->w, sizeof(up->w)) || get_user(kp->field, &up->field) || get_user(kp->chromakey, &up->chromakey) || - get_user(kp->clipcount, &up->clipcount)) + get_user(kp->clipcount, &up->clipcount) || + get_user(kp->global_alpha, &up->global_alpha)) return -EFAULT; if (kp->clipcount > 2048) return -EINVAL; @@ -84,7 +86,8 @@ static int put_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user if (copy_to_user(&up->w, &kp->w, sizeof(kp->w)) || put_user(kp->field, &up->field) || put_user(kp->chromakey, &up->chromakey) || - put_user(kp->clipcount, &up->clipcount)) + put_user(kp->clipcount, &up->clipcount) || + put_user(kp->global_alpha, &up->global_alpha)) return -EFAULT; return 0; }