From patchwork Sat Jun 8 16:44:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 2692721 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 48519DF24C for ; Sat, 8 Jun 2013 16:44:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4942BE612F for ; Sat, 8 Jun 2013 09:44:46 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by gabe.freedesktop.org (Postfix) with ESMTP id 87B1AE6130; Sat, 8 Jun 2013 09:44:18 -0700 (PDT) Received: from jsimmons (helo=localhost) by casper.infradead.org with local-esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UlMFT-0005Qy-WC; Sat, 08 Jun 2013 16:44:17 +0000 Date: Sat, 8 Jun 2013 17:44:15 +0100 (BST) From: James Simmons To: DRI development list Subject: [RFC 2/21] DRM: Add VIA DRM driver Message-ID: User-Agent: Alpine 2.03 (LFD 1266 2009-07-14) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130608_174416_133625_EF12D6A0 X-CRM114-Status: GOOD ( 21.68 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 NO_RELAYS Informational: message was not relayed via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: OpenChrome Development X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org commit f0be3523498cd2422d95af1e5e47f51e099f90e4 Author: James Simmons Date: Thu Jun 6 18:57:00 2013 -0400 via: register setting helpers The code in the crtc_hw was written to handle to cases of programming the registers on the graphics card. Basic routines of programming of the registers already existing in the vga.h header in include/video that has been used for some of the frame buffer drivers. We add some of the missing bit masking and setting routines into crtc_hw.h but it would be nice some day to move those over to vga.h itself. Addition code had been written to handle two common cases. The first case is that all the bits to be set are all located into the same register. The function to handle this is load_register_table. The second case is when the bits for a specific function are scattered across several registers. The load_value_to_registers handles the second case. This code is written such that it can be used by any other driver and could even be placed some where that it can be shared by multiple drivers. Signed-Off-by: James Simmons diff --git a/drivers/gpu/drm/via/crtc_hw.c b/drivers/gpu/drm/via/crtc_hw.c new file mode 100644 index 0000000..f71c14e --- /dev/null +++ b/drivers/gpu/drm/via/crtc_hw.c @@ -0,0 +1,88 @@ +/* + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR(S) OR COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Authors: + * James Simmons + */ + +#include