From: "Michel Dänzer" <michel@daenzer.net>
To: "Deng, Emily" <Emily.Deng@amd.com>, Alex Deucher <alexdeucher@gmail.com>
Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 3/3] drm/amdgpu:Limit the resolution for virtual_display
Date: Wed, 6 Jan 2021 16:25:07 +0100 [thread overview]
Message-ID: <43274fba-2ba2-76fc-3f9f-b9af7658af89@daenzer.net> (raw)
In-Reply-To: <BY5PR12MB411509E4392319DED71623C28FD00@BY5PR12MB4115.namprd12.prod.outlook.com>
On 2021-01-06 11:40 a.m., Deng, Emily wrote:
>> From: Alex Deucher <alexdeucher@gmail.com>
>> On Tue, Jan 5, 2021 at 3:37 AM Emily.Deng <Emily.Deng@amd.com> wrote:
>>>
>>> Limit the resolution not bigger than 16384, which means
>>> dev->mode_info.num_crtc * common_modes[i].w not bigger than 16384.
>>>
>>> Signed-off-by: Emily.Deng <Emily.Deng@amd.com>
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 7 +++++--
>>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
>>> b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
>>> index 2b16c8faca34..c23d37b02fd7 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
>>> @@ -319,6 +319,7 @@ dce_virtual_encoder(struct drm_connector
>>> *connector) static int dce_virtual_get_modes(struct drm_connector
>>> *connector) {
>>> struct drm_device *dev = connector->dev;
>>> + struct amdgpu_device *adev = dev->dev_private;
>>> struct drm_display_mode *mode = NULL;
>>> unsigned i;
>>> static const struct mode_size { @@ -350,8 +351,10 @@ static
>>> int dce_virtual_get_modes(struct drm_connector *connector)
>>> };
>>>
>>> for (i = 0; i < ARRAY_SIZE(common_modes); i++) {
>>> - mode = drm_cvt_mode(dev, common_modes[i].w,
>> common_modes[i].h, 60, false, false, false);
>>> - drm_mode_probed_add(connector, mode);
>>> + if (adev->mode_info.num_crtc <= 4 ||
>>> + common_modes[i].w <= 2560) {
>>
>> You are also limiting the number of crtcs here. Intended? Won't this break 5
>> or 6 crtc configs?
>>
>> Alex
> Yes, it is intended, for num_crtc bigger then 4, don't support resolution bigger then 2560, because of the max supported width is 16384 for xcb protocol.
There's no such limitation with Wayland. I'd recommend against
artificially imposing limits from X11 to the kernel.
(As a side note, the X11 protocol limit should actually be 32768; the
16384 limit exposed in the RANDR extension comes from the kernel driver,
specifically drmModeGetResources's max_width/height)
--
Earthling Michel Dänzer | https://redhat.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2021-01-06 15:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-05 8:37 [PATCH 1/3] drm/amdgpu: Add new mode 2560x1440 Emily.Deng
2021-01-05 8:37 ` [PATCH 2/3] drm/amdgpu: Correct the read sclk for navi10 Emily.Deng
2021-01-05 9:07 ` Quan, Evan
2021-01-06 1:00 ` Deng, Emily
2021-01-05 8:37 ` [PATCH 3/3] drm/amdgpu:Limit the resolution for virtual_display Emily.Deng
2021-01-05 17:23 ` Alex Deucher
2021-01-06 10:40 ` Deng, Emily
2021-01-06 15:25 ` Michel Dänzer [this message]
2021-01-07 2:28 ` Deng, Emily
2021-01-07 8:42 ` Michel Dänzer
2021-01-07 10:38 ` Deng, Emily
2021-01-05 17:24 ` [PATCH 1/3] drm/amdgpu: Add new mode 2560x1440 Alex Deucher
-- strict thread matches above, loose matches on Subject: below --
2021-01-06 1:05 Emily.Deng
2021-01-06 1:05 ` [PATCH 3/3] drm/amdgpu:Limit the resolution for virtual_display Emily.Deng
2021-01-06 1:36 Emily.Deng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43274fba-2ba2-76fc-3f9f-b9af7658af89@daenzer.net \
--to=michel@daenzer.net \
--cc=Emily.Deng@amd.com \
--cc=alexdeucher@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox