From patchwork Thu Oct 29 13:03:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Abriou X-Patchwork-Id: 7519021 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 87537BEEA4 for ; Thu, 29 Oct 2015 13:04:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D314D209D4 for ; Thu, 29 Oct 2015 13:03:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 91D4720975 for ; Thu, 29 Oct 2015 13:03:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9126C6E6A1; Thu, 29 Oct 2015 06:03:53 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id A93B86E6A1 for ; Thu, 29 Oct 2015 06:03:51 -0700 (PDT) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.14.5/8.14.5) with SMTP id t9TD2iSH003650; Thu, 29 Oct 2015 14:03:47 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 1xttd3xm5s-1 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 29 Oct 2015 14:03:47 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C53BF31; Thu, 29 Oct 2015 13:03:20 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EEA4A547A; Thu, 29 Oct 2015 13:03:45 +0000 (GMT) Received: from localhost (10.201.23.35) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.235.1; Thu, 29 Oct 2015 14:03:45 +0100 From: Vincent Abriou To: Subject: [PATCH 1/1] drm/sti: set mixer background color through module param Date: Thu, 29 Oct 2015 14:03:34 +0100 Message-ID: <1446123814-7609-1-git-send-email-vincent.abriou@st.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.201.23.35] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.15.21, 1.0.33, 0.0.0000 definitions=2015-10-29_09:2015-10-28, 2015-10-29, 1970-01-01 signatures=0 Cc: Nicolas VANHAELEWYN , Vincent Abriou , Fabien Dessenne , Benjamin Gaignard 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, 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 Add bkgcolor module parameter that allow to change the background color of the mixer. It can be set with an RGB value coded as 0xRRGGBB. The default value is black. Signed-off-by: Vincent Abriou Signed-off-by: Nicolas VANHAELEWYN --- drivers/gpu/drm/sti/sti_mixer.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_mixer.c b/drivers/gpu/drm/sti/sti_mixer.c index 4c18b50..49db835 100644 --- a/drivers/gpu/drm/sti/sti_mixer.c +++ b/drivers/gpu/drm/sti/sti_mixer.c @@ -10,6 +10,11 @@ #include "sti_mixer.h" #include "sti_vtg.h" +/* Module parameter to set the background color of the mixer */ +static unsigned int bkg_color = 0x000000; +MODULE_PARM_DESC(bkgcolor, "Value of the background color 0xRRGGBB"); +module_param_named(bkgcolor, bkg_color, int, 0644); + /* Identity: G=Y , B=Cb , R=Cr */ static const u32 mixerColorSpaceMatIdentity[] = { 0x10000000, 0x00000000, 0x10000000, 0x00001000, @@ -80,11 +85,9 @@ void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable) } static void sti_mixer_set_background_color(struct sti_mixer *mixer, - u8 red, u8 green, u8 blue) + unsigned int rgb) { - u32 val = (red << 16) | (green << 8) | blue; - - sti_mixer_reg_write(mixer, GAM_MIXER_BKC, val); + sti_mixer_reg_write(mixer, GAM_MIXER_BKC, rgb); } static void sti_mixer_set_background_area(struct sti_mixer *mixer, @@ -174,7 +177,7 @@ int sti_mixer_active_video_area(struct sti_mixer *mixer, sti_mixer_reg_write(mixer, GAM_MIXER_AVO, ydo << 16 | xdo); sti_mixer_reg_write(mixer, GAM_MIXER_AVS, yds << 16 | xds); - sti_mixer_set_background_color(mixer, 0xFF, 0, 0); + sti_mixer_set_background_color(mixer, bkg_color); sti_mixer_set_background_area(mixer, mode); sti_mixer_set_background_status(mixer, true);