Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp55375pxb; Tue, 12 Apr 2022 16:39:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwa8Uc/rCI6I4jELRzhsZPhXBiTHmgZXnRIGI+UUUwjzskoo6u07utatqmhASxK8HuTSfpU X-Received: by 2002:a17:902:b183:b0:14f:c266:20d5 with SMTP id s3-20020a170902b18300b0014fc26620d5mr40139994plr.136.1649806757536; Tue, 12 Apr 2022 16:39:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649806757; cv=none; d=google.com; s=arc-20160816; b=REgscMt9M2fnUbiiYzAA5SV0+qhJ5UyaIl3Q2T5J+8icIzYq9sHKxBzUpq5D0w97dq KdqAfZP85SlFahAZoa4/CQ0vrfDtgVKHB4r2ckTmWaaFN4F6OdaqghIkCiMH/Qv479Se hNKP0Deq7ulK44LDBKZmaRityCRk58ckEZoMwBlzDgYUHS4GSq+5sHhxJIVeVaVh+UDt 7PLUZYVhUvn+aLe1JPE/h5POqoteVwjmVb7dbLfcJidSK8k0cI9MGOztzj7s5m4LjQZf XOxqsqMqJ2UPtlNtXi3JmsyUI2RGZnyn1Fhu6uEk7/eEOv7Q2gPAl7AQJ/IG4vxCyn1n KRtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from:dkim-signature :dkim-filter; bh=AgbekYe0S46Vr5OLHiFsmZOewWJmWOdqv5BV4g+6iIw=; b=SqGizn1FQf/ISlCc9GEaN1+pOzi7mG5diF2zs2/tWdPZoHB5VhjhaPgoxT0TiJtaCL 4tNTeXjaSrvRsI3Exbnq8q5FuJvHfrWhteYxrCTKB/5j/wgQDF4lqA5sX3vYMJkfAhEK C/n6nN4hUcWun1Dnh2XtaeiRnKLoEuQueR9NBs7N9IbLcI1I0KebjhDvc0/fwZViqGyA 3CzzBtmINSRueKdEAexO3JpaIQdECMOG+tp1/qyaRoTPGz/Ku6hc8uEpNPVJwsi3x6ws L444VVvSZMa2yxtbSN0VxivUfCRK/dvVMb3Qr0bdRM8WdAABMRpYITFmtGm91zOZd4sf 2JqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=XSccBTnR; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k27-20020a63ff1b000000b003829aca7f1asi3938251pgi.637.2022.04.12.16.39.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 16:39:17 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=XSccBTnR; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EDAAC114DCB; Tue, 12 Apr 2022 14:30:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239062AbiDLEcY (ORCPT + 99 others); Tue, 12 Apr 2022 00:32:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346615AbiDLEcC (ORCPT ); Tue, 12 Apr 2022 00:32:02 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9805B9FCB; Mon, 11 Apr 2022 21:29:15 -0700 (PDT) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id AA8D0205657E; Mon, 11 Apr 2022 21:29:14 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com AA8D0205657E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1649737754; bh=AgbekYe0S46Vr5OLHiFsmZOewWJmWOdqv5BV4g+6iIw=; h=From:To:Subject:Date:From; b=XSccBTnRuJkj5P9mKo4JTcEaCN2IysTkyLsxTlYl8xaJERLHXoQWu3ZwmyWYq04uO 4QRFGoypXiTnMcEB6aLUTzJnXWX/UfjVz22QNUKTTaLx4TvUJ0o4WtbrZmL9nIGEuZ dqV61xETbTn48KEsbF219Xf3ViUvug42xM/51fLo= From: Saurabh Sengar To: ssengar@microsoft.com, drawat.floss@gmail.com, airlied@linux.ie, daniel@ffwll.ch, linux-hyperv@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, mikelley@microsoft.com, decui@microsoft.com Subject: [PATCH v4] drm/hyperv: Add error message for fb size greater than allocated Date: Mon, 11 Apr 2022 21:28:59 -0700 Message-Id: <1649737739-10113-1-git-send-email-ssengar@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add error message when the size of requested framebuffer is more than the allocated size by vmbus mmio region for framebuffer Signed-off-by: Saurabh Sengar --- v3 -> v4 : * Shorter error message * Alignment match for open parenthesis * Added -> Add (typo fix in commit message) drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c index e82b815..27f4fcb 100644 --- a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +++ b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c @@ -123,8 +123,11 @@ static int hyperv_pipe_check(struct drm_simple_display_pipe *pipe, if (fb->format->format != DRM_FORMAT_XRGB8888) return -EINVAL; - if (fb->pitches[0] * fb->height > hv->fb_size) + if (fb->pitches[0] * fb->height > hv->fb_size) { + drm_err(&hv->dev, "fb size requested by %s for %dX%d (pitch %d) greater than %ld\n", + current->comm, fb->width, fb->height, fb->pitches[0], hv->fb_size); return -EINVAL; + } return 0; } -- 1.8.3.1