From: Sui Jingfeng <15330273260@189.cn>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Sumit Semwal <sumit.semwal@linaro.org>,
Christian Koenig <christian.koenig@amd.com>,
linaro-mm-sig@lists.linaro.org, Li Yi <liyi@loongson.cn>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
nathan@kernel.org, linux-media@vger.kernel.org,
loongson-kernel@lists.loongnix.cn
Subject: Re: [PATCH v10 2/2] drm: add kms driver for loongson display controller
Date: Tue, 11 Apr 2023 16:49:19 +0800 [thread overview]
Message-ID: <2f024efb-3e9f-8777-9f32-ca1f0e436b40@189.cn> (raw)
In-Reply-To: <CACvgo53h+X26wngVmxpn3oVb9kbJezTHx61p3rZDR7sw1AQrWQ@mail.gmail.com>
Hi,
On 2023/4/4 22:10, Emil Velikov wrote:
>> --- /dev/null
>> +++ b/drivers/gpu/drm/loongson/lsdc_drv.c
>> +static const struct lsdc_desc dc_in_ls7a1000 = {
>> + .chip = CHIP_LS7A1000,
>> + .num_of_crtc = LSDC_NUM_CRTC,
>> + .max_pixel_clk = 200000,
>> + .max_width = 2048,
>> + .max_height = 2048,
>> + .num_of_hw_cursor = 1,
>> + .hw_cursor_w = 32,
>> + .hw_cursor_h = 32,
>> + .pitch_align = 256,
>> + .mc_bits = 40,
>> + .has_vblank_counter = false,
>> + .has_scan_pos = true,
>> + .has_builtin_i2c = true,
>> + .has_vram = true,
>> + .has_hpd_reg = false,
>> + .is_soc = false,
>> +};
>> +
>> +static const struct lsdc_desc dc_in_ls7a2000 = {
>> + .chip = CHIP_LS7A2000,
>> + .num_of_crtc = LSDC_NUM_CRTC,
>> + .max_pixel_clk = 350000,
>> + .max_width = 4096,
>> + .max_height = 4096,
>> + .num_of_hw_cursor = 2,
>> + .hw_cursor_w = 64,
>> + .hw_cursor_h = 64,
>> + .pitch_align = 64,
>> + .mc_bits = 40, /* support 48, but use 40 for backward compatibility */
>> + .has_vblank_counter = true,
>> + .has_scan_pos = true,
>> + .has_builtin_i2c = true,
>> + .has_vram = true,
>> + .has_hpd_reg = true,
>> + .is_soc = false,
>> +};
>> +
> Roughly a quarter of the above are identical. It might be better to
> drop them for now and re-introduce as needed with future code.
>
My initial intent here is to give a skeleton of our hardware features to
reviewers,
Not only for gearing the control, but also for easier the reviewing process.
Without this, other part of this patch may looks questionable again.
We could remove all of the features look up key in the struct lsdc_desc,
leave the .chip member there only. Hard coded everything else according
to the chip only.
But the code looks ugly by doing that way. We want weaken the
If loongson SoC is introduced, the identical will decrease.
It's OK, I could drop as much as possible at next version.
>> +const char *chip_to_str(enum loongson_chip_family chip)
>> +{
>> + if (chip == CHIP_LS7A2000)
>> + return "LS7A2000";
>> +
>> + if (chip == CHIP_LS7A1000)
>> + return "LS7A1000";
>> +
> If it were me, I would add the name into the lsdc_desc.
>
Agree, this is acceptable. Will be changed at the next version.
next prev parent reply other threads:[~2023-04-11 8:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-03 17:13 [PATCH v10 0/2] " Sui Jingfeng
2023-04-03 17:13 ` [PATCH v10 1/2] MAINTAINERS: add maintainers for DRM LOONGSON driver Sui Jingfeng
2023-04-03 17:13 ` [PATCH v10 2/2] drm: add kms driver for loongson display controller Sui Jingfeng
2023-04-04 14:10 ` Emil Velikov
2023-04-05 16:40 ` Sui Jingfeng
2023-04-05 16:55 ` Sui Jingfeng
2023-04-11 3:33 ` Sui Jingfeng
2023-04-11 5:39 ` Sui Jingfeng
2023-04-11 8:18 ` Sui Jingfeng
2023-04-11 8:49 ` Sui Jingfeng [this message]
2023-04-11 10:21 ` Sui Jingfeng
2023-04-11 10:44 ` Sui Jingfeng
2023-04-11 12:15 ` Sui Jingfeng
2023-04-24 14:07 ` Sui Jingfeng
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=2f024efb-3e9f-8777-9f32-ca1f0e436b40@189.cn \
--to=15330273260@189.cn \
--cc=airlied@gmail.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.l.velikov@gmail.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=liyi@loongson.cn \
--cc=loongson-kernel@lists.loongnix.cn \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nathan@kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®