From patchwork Wed Mar 11 11:33:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ander Conselvan de Oliveira X-Patchwork-Id: 5983631 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 01DCE9F2A9 for ; Wed, 11 Mar 2015 11:33:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 38227203C3 for ; Wed, 11 Mar 2015 11:33:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 292C6203B0 for ; Wed, 11 Mar 2015 11:33:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E4C8F6E827; Wed, 11 Mar 2015 04:33:14 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id B517D6E81B for ; Wed, 11 Mar 2015 04:33:13 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 11 Mar 2015 04:31:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,381,1422950400"; d="scan'208";a="697111813" Received: from linux.intel.com ([10.23.219.25]) by orsmga002.jf.intel.com with ESMTP; 11 Mar 2015 04:33:13 -0700 Received: from localhost (aconselv-mobl3.ger.corp.intel.com [10.237.72.71]) by linux.intel.com (Postfix) with ESMTP id 51111300001; Wed, 11 Mar 2015 04:32:56 -0700 (PDT) From: Ander Conselvan de Oliveira To: daniel@ffwll.ch Date: Wed, 11 Mar 2015 13:33:00 +0200 Message-Id: <1426073581-30504-1-git-send-email-ander.conselvan.de.oliveira@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <20150310190508.GT3800@phenom.ffwll.local> References: <20150310190508.GT3800@phenom.ffwll.local> Cc: Ander Conselvan de Oliveira , intel-gfx@lists.freedesktop.org Subject: [Intel-gfx] [PATCH igt 1/2] lib/kms: Add a way to override an output's mode X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 So that it is possible to use a custom mode with the simplified mode set API. --- lib/igt_kms.c | 9 +++++++++ lib/igt_kms.h | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 26e4913..0dccd2d 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -895,6 +895,9 @@ static void igt_output_refresh(igt_output_t *output) if (!output->valid) return; + if (output->use_override_mode) + output->config.default_mode = output->override_mode; + if (!output->name) { drmModeConnector *c = output->config.connector; @@ -1797,6 +1800,12 @@ drmModeModeInfo *igt_output_get_mode(igt_output_t *output) return &output->config.default_mode; } +void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode) +{ + output->override_mode = *mode; + output->use_override_mode = true; +} + void igt_output_set_pipe(igt_output_t *output, enum pipe pipe) { igt_display_t *display = output->display; diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 2fab30e..ddf4432 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -228,6 +228,9 @@ typedef struct { bool valid; unsigned long pending_crtc_idx_mask; + bool use_override_mode; + drmModeModeInfo override_mode; + #ifdef HAVE_ATOMIC /* Property set for nuclear pageflip */ drmModePropertySetPtr set; @@ -255,6 +258,7 @@ int igt_display_get_n_pipes(igt_display_t *display); const char *igt_output_name(igt_output_t *output); drmModeModeInfo *igt_output_get_mode(igt_output_t *output); +void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode); void igt_output_set_pipe(igt_output_t *output, enum pipe pipe); igt_plane_t *igt_output_get_plane(igt_output_t *output, enum igt_plane plane);