Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3216604pxb; Sun, 7 Feb 2021 01:41:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxjeDgZtXDLs1wHfcMAt1ChBTDyjgCGQkC/6omVec422PzVWyX6H6srKz4+HqacjZLPfuvW X-Received: by 2002:a17:906:ada:: with SMTP id z26mr11893076ejf.218.1612690898761; Sun, 07 Feb 2021 01:41:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612690898; cv=none; d=google.com; s=arc-20160816; b=kLN8Lc0P1Kpe4saEPTtgM+6F8lUYEeO1bYCdl6R/39DwTctncy1hMZfrnHMJLVuGNI Sq+Tk9eo95jGEhfiUY6xE883bJoky+3x6m/BRpHVxIJ/3yQ5PSslH8OodYQSI1ZVI93e k0KGuhZVsOxXu8IfdgBqsUb0KtXhCW0/o7GFGfw3eFO/PiEz0oRYJOXsP4hPtzmr1E6r dhCJ0ymgQL81xDchK8akqOKTMsB5Y8eKeNXUIAZzFeazC7dx7z5NgB18mBbzmCiJ4H4D 2MNwJ6YESxrAOtV06VJn2d010FesiKVmeC0z/XinCZo0m50a8M2cQrDjpSdRHRTnZ+NL rpnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=oG8UuFWzfJqkv2XW5txDA/xJM4YW9culKt5veHh2BgA=; b=QB12G6TT9fPIj8MeIHbPCeuriNY6mjWoodAhgMOgMHOBuctu0nMgOq5m9nFRWbHIom oa6M1Uh3LMBzOP7PCkezmrcNTwFdSUhAHESoYUzrvG1UOVZqGM6bytDTRykxgyAW6A2P Q9+kkZ3DvJzldeHZUx1GWPhOZLWjaxO77xTDPj04zkFzz4TGotvsB0Z63rBnhFQd5rMw BBY2OQji5b3uSjVmsFwX+PigGLmQSImfd74Eiwo3PJXVQtS1a4wv5Qz84vI2X0LkbJ8m hiiW7x3u7U9gH+BJ2oRXX/pRuUOuQPjfvHeMqf2WOzt13pkA3jcOO4+Qnaf8ykwUDpX0 dRHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=d07Sfmdr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw9si8757355ejb.734.2021.02.07.01.41.14; Sun, 07 Feb 2021 01:41:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=d07Sfmdr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229566AbhBGJks (ORCPT + 99 others); Sun, 7 Feb 2021 04:40:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbhBGJkq (ORCPT ); Sun, 7 Feb 2021 04:40:46 -0500 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49431C06174A for ; Sun, 7 Feb 2021 01:40:06 -0800 (PST) Received: by mail-lj1-x229.google.com with SMTP id y14so12957441ljn.8 for ; Sun, 07 Feb 2021 01:40:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oG8UuFWzfJqkv2XW5txDA/xJM4YW9culKt5veHh2BgA=; b=d07Sfmdr0dMMF1m60A94qoOnxCI4Ibg8PMS8ENR++ZRhiVhNmzBR9GWeABSz8CbR3N l1bRxFrfzBm0Znbaws1P0A5z43C7ANHTeOqU/EkWVG2OX5LTrt1ex78eSpAZ7DSI9U/F iz57wZhbnhpw9BYHLz4fyj5oSv4GXePD6gOZDg6MWSDB1n8Qjpu7h5dKgSRmjJzOUhua iCRoeihp9cbz0+Im0ZuctCGABErN4knHPmWm8ph7bw3AwIbXk49E0VuodHmxS51Fa9m/ 8gWalfeUQgsaqTU/azWpaqL2hwCBi3X/jdhw2NYLDzSOxkdCLy30BrmxYhUngKPP6w3Y QFlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oG8UuFWzfJqkv2XW5txDA/xJM4YW9culKt5veHh2BgA=; b=mxTx1SgU9UrSgjoqEdPQqDbF3U3krq2MUj912d7IPDJ4mGbs0bjuQ9JNERD34sFK4k IOF6JUGIfDOaZdNw1xD7g5G0Zr912HYmXw9w6ASb93aVzF9D1w4aSCrvYZqdVAy7Bfrg PsLnuBqUe8eiaEohwzCekc2uHkXOrZhq0HeXy5bQltW7FsWIpRknB/rCTSfd1RdzHFsn 5HvmX3tC1mAXnu8/ejxIwsKqaTZHRdkCkPzW3JQZ0Z8B8rhpuZpQCGFMH02kOKmiApAq tfVfKNq/o5kTvC8dMihOpJv5d50NS38yGrJ5Jwc7Wk8illltvnExCCHEYaaJnRr7VIHu FS4A== X-Gm-Message-State: AOAM532LveOnZSoJMIuyXyJXuOw3YR/J/4B9gfWWWs3zobsMWRFCornU cXKyrdO59wBoo0Rn3PkizBA13t6KvYnS8h19 X-Received: by 2002:a2e:8883:: with SMTP id k3mr7434504lji.198.1612690804648; Sun, 07 Feb 2021 01:40:04 -0800 (PST) Received: from raszit-komputer-amd.raszit-server.ovh ([62.122.232.191]) by smtp.gmail.com with ESMTPSA id y18sm1639118lfe.29.2021.02.07.01.40.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Feb 2021 01:40:04 -0800 (PST) From: Marcin Raszka To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Marcin Raszka Subject: [PATCH] I was wondering why I can't set the resolution to 2560x1080, while in windows 7 I can without a problem. I looked at the radeon driver code and found it doesn't support this resolution. So I made some changes. I added the hdmi_mhz parameter. In cmdline I set radeon.hdmi_mhz=190 Only tested on the Radeon HD 5830 Date: Sun, 7 Feb 2021 10:39:52 +0100 Message-Id: <20210207093952.7087-1-djraszit@gmail.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --- drivers/gpu/drm/radeon/radeon_benchmark.c | 5 ++-- drivers/gpu/drm/radeon/radeon_connectors.c | 30 ++++++++++++++-------- drivers/gpu/drm/radeon/radeon_drv.c | 5 ++++ drivers/gpu/drm/radeon/radeon_encoders.c | 6 +++-- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_benchmark.c b/drivers/gpu/drm/radeon/radeon_benchmark.c index ac9a5ec481c3..c283b6b15925 100644 --- a/drivers/gpu/drm/radeon/radeon_benchmark.c +++ b/drivers/gpu/drm/radeon/radeon_benchmark.c @@ -30,7 +30,7 @@ #define RADEON_BENCHMARK_COPY_DMA 0 #define RADEON_BENCHMARK_ITERATIONS 1024 -#define RADEON_BENCHMARK_COMMON_MODES_N 17 +#define RADEON_BENCHMARK_COMMON_MODES_N 18 static int radeon_benchmark_do_move(struct radeon_device *rdev, unsigned size, uint64_t saddr, uint64_t daddr, @@ -184,7 +184,8 @@ void radeon_benchmark(struct radeon_device *rdev, int test_number) 1680 * 1050 * 4, 1600 * 1200 * 4, 1920 * 1080 * 4, - 1920 * 1200 * 4 + 1920 * 1200 * 4, + 2560 * 1080 * 4 }; switch (test_number) { diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 607ad5620bd9..37927222f5b3 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -37,6 +37,8 @@ #include #include +extern int hdmimhz; + static int radeon_dp_handle_hpd(struct drm_connector *connector) { struct radeon_connector *radeon_connector = to_radeon_connector(connector); @@ -503,7 +505,7 @@ static void radeon_add_common_modes(struct drm_encoder *encoder, struct drm_conn struct mode_size { int w; int h; - } common_modes[17] = { + } common_modes[18] = { { 640, 480}, { 720, 480}, { 800, 600}, @@ -520,10 +522,11 @@ static void radeon_add_common_modes(struct drm_encoder *encoder, struct drm_conn {1680, 1050}, {1600, 1200}, {1920, 1080}, - {1920, 1200} + {1920, 1200}, + {2560, 1080} }; - for (i = 0; i < 17; i++) { + for (i = 0; i < 18; i++) { if (radeon_encoder->devices & (ATOM_DEVICE_TV_SUPPORT)) { if (common_modes[i].w > 1024 || common_modes[i].h > 768) @@ -1491,25 +1494,32 @@ static enum drm_mode_status radeon_dvi_mode_valid(struct drm_connector *connecto (mode->clock > 135000)) return MODE_CLOCK_HIGH; - if (radeon_connector->use_digital && (mode->clock > 165000)) { + if (radeon_connector->use_digital && (mode->clock > (hdmimhz * 1000))) { if ((radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I) || (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) || - (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_B)) + (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_B)){ + printk("MODE_CLOCK_HIHG0 %d", hdmimhz); return MODE_OK; - else if (ASIC_IS_DCE6(rdev) && drm_detect_hdmi_monitor(radeon_connector_edid(connector))) { + }else if (ASIC_IS_DCE6(rdev) && drm_detect_hdmi_monitor(radeon_connector_edid(connector))) { /* HDMI 1.3+ supports max clock of 340 Mhz */ - if (mode->clock > 340000) + if (mode->clock > 340000){ + printk("MODE_CLOCK_HIHG1 %d", hdmimhz); return MODE_CLOCK_HIGH; - else + }else{ + printk("MODE_OK1"); return MODE_OK; + } } else { + printk("MODE_CLOCK_HIHG2 %d", hdmimhz); return MODE_CLOCK_HIGH; } } /* check against the max pixel clock */ - if ((mode->clock / 10) > rdev->clock.max_pixel_clock) + if ((mode->clock / 10) > rdev->clock.max_pixel_clock){ + printk("MODE_CLOCK_HIHG3 %d", hdmimhz); return MODE_CLOCK_HIGH; + } return MODE_OK; } @@ -1809,7 +1819,7 @@ static enum drm_mode_status radeon_dp_mode_valid(struct drm_connector *connector if (mode->clock > 340000) return MODE_CLOCK_HIGH; } else { - if (mode->clock > 165000) + if (mode->clock > (hdmimhz * 1000)) return MODE_CLOCK_HIGH; } } diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index e45d7344ac2b..fce8f9ab8018 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -281,6 +281,11 @@ int radeon_cik_support = 1; MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled (default), 0 = disabled)"); module_param_named(cik_support, radeon_cik_support, int, 0444); +int hdmimhz = 165; +MODULE_PARM_DESC(hdmi_mhz, "set HDMI max frequency, default is 165"); +module_param_named(hdmi_mhz, hdmimhz, int, 0444); + + static struct pci_device_id pciidlist[] = { radeon_PCI_IDS }; diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 46549d5179ee..6b805bcd5726 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -35,6 +35,8 @@ #include "radeon_legacy_encoders.h" #include "atom.h" +extern int hdmimhz; + static uint32_t radeon_encoder_clones(struct drm_encoder *encoder) { struct drm_device *dev = encoder->dev; @@ -389,7 +391,7 @@ bool radeon_dig_monitor_is_duallink(struct drm_encoder *encoder, else return false; } else { - if (pixel_clock > 165000) + if (pixel_clock > (hdmimhz * 1000)) return true; else return false; @@ -414,7 +416,7 @@ bool radeon_dig_monitor_is_duallink(struct drm_encoder *encoder, else return false; } else { - if (pixel_clock > 165000) + if (pixel_clock > (hdmimhz * 1000)) return true; else return false; -- 2.30.0