From patchwork Sun Nov 16 02:04:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Stefan_Br=C3=BCns?= X-Patchwork-Id: 5312741 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5970FC11AC for ; Sun, 16 Nov 2014 02:14:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 99995201ED for ; Sun, 16 Nov 2014 02:14:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DC7A2201DD for ; Sun, 16 Nov 2014 02:14:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0FC7B6E8E6; Sat, 15 Nov 2014 18:14:42 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx-out-1.rwth-aachen.de (mx-out-1.rwth-aachen.de [134.130.5.186]) by gabe.freedesktop.org (Postfix) with ESMTP id 758846E8E6 for ; Sat, 15 Nov 2014 18:14:40 -0800 (PST) X-IronPort-AV: E=Sophos;i="5.07,394,1413237600"; d="scan'208";a="359542112" Received: from hub2.rwth-ad.de (HELO mail.rwth-aachen.de) ([134.130.26.143]) by mx-1.rz.rwth-aachen.de with ESMTP; 16 Nov 2014 03:04:56 +0100 Received: from appserver.fset.rwth-aachen.de (137.226.172.40) by mail.rwth-aachen.de (134.130.26.143) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 16 Nov 2014 03:04:55 +0100 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= To: Subject: [PATCH 1/2] drm/edid: new drm_edid_block_checksum helper function Date: Sun, 16 Nov 2014 03:04:53 +0100 X-Mailer: git-send-email 1.8.4.5 MIME-Version: 1.0 X-PMWin-Version: 3.1.3.0, Antivirus-Engine: 3.53.0, Antivirus-Data: 5.08 Message-ID: <2414370f-2d71-46b6-af8b-323482cb7b6e@HUB2.rwth-ad.de> Cc: stefan.bruens@rwth-aachen.de X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Signed-off-by: Stefan BrĂ¼ns --- drivers/gpu/drm/drm_edid.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 0755d01..505960e 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1184,6 +1184,17 @@ static bool drm_edid_is_zero(u8 *in_edid, int length) return true; } +static u8 +drm_edid_block_checksum(u8 *raw_edid) +{ + int i; + u8 csum = 0; + for (i = 0; i < EDID_LENGTH; i++) + csum += raw_edid[i]; + + return csum; +} + static u8 * drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter) {