public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Zhao <keith.zhao@starfivetech.com>
To: Icenowy Zheng <uwu@icenowy.me>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>
Cc: "aou@eecs.berkeley.edu" <aou@eecs.berkeley.edu>,
	"suijingfeng@loongson.cn" <suijingfeng@loongson.cn>,
	"tzimmermann@suse.de" <tzimmermann@suse.de>,
	"paul.walmsley@sifive.com" <paul.walmsley@sifive.com>,
	"mripard@kernel.org" <mripard@kernel.org>,
	Xingyu Wu <xingyu.wu@starfivetech.com>,
	Jack Zhu <jack.zhu@starfivetech.com>,
	"palmer@dabbelt.com" <palmer@dabbelt.com>,
	"krzysztof.kozlowski+dt@linaro.org" 
	<krzysztof.kozlowski+dt@linaro.org>,
	William Qiu <william.qiu@starfivetech.com>,
	Shengyang Chen <shengyang.chen@starfivetech.com>,
	Changhuang Liang <changhuang.liang@starfivetech.com>
Subject: Re: [v3 4/6] drm/vs: Add KMS crtc&plane
Date: Thu, 7 Dec 2023 19:31:43 +0800	[thread overview]
Message-ID: <580e13ab-a73e-4ce7-999a-8a8685faf2dd@starfivetech.com> (raw)
In-Reply-To: <7acd5af8fd4c5bf6ee0614f72cf6cb6751c89dc3.camel@icenowy.me>



On 2023/12/7 16:41, Icenowy Zheng wrote:
> 在 2023-12-04星期一的 20:33 +0800,Keith Zhao写道:
> *snip*
> 
>> +static void update_cursor_plane(struct vs_dc *dc, struct vs_plane
>> *plane,
>> +                               struct drm_plane *drm_plane,
>> +                               struct drm_atomic_state *drm_state)
>> +{
>> +       struct drm_plane_state *state =
>> drm_atomic_get_new_plane_state(drm_state,
>> +                                                                    
>>   drm_plane);
>> +       struct vs_plane_state *plane_state =
>> to_vs_plane_state(state);
>> +       struct drm_framebuffer *drm_fb = state->fb;
>> +       struct dc_hw_cursor cursor;
>> +
>> +       cursor.address = plane_state->dma_addr[0];
>> +       cursor.x = state->crtc_x;
>> +       cursor.y = state->crtc_y;
> 
> From my experiments on poking with registers on T-Head TH1520 (also
> uses DC8200 display controller and a similar driver), the DC8200
> hardware have a different definition of cursor position X and Y with
> the CRTC plane state.
> 
> For CRTC plane state, hot_x and hot_y are only provided as reference,
> and the cursor should be displayed with its (0,0) drawn to (crtc_x,
> crtc_y) ([XY]_crtc are values specified in CRTC state, the right part
> of the assignments here), when the cursor is moved to (0,0) but the hot
> point is not (0,0), it could be negative.
> 
> However, for DC8200 registers definition, cursor XY position could not
> be negative -- the cursor will disappear then; because in its
> definition, the cursor XY position should be where the cursor is
> pointing to, instead of its (0,0). DC8200 will draw (0,0) of the cursor
> to (x - hot_x, y - hot_y). So to met the expectation of the KMS plane
> settings, the DC8200 position should be set to (crtc_x + hot_x, crtc_y
> + hot_y) instead. Thus these two lines of code should be:
> 
> ```
>         cursor.x = state->crtc_x + drm_fb->hot_x;
>         cursor.y = state->crtc_y + drm_fb->hot_y;
> ```
> 
> 
>> +       cursor.hot_x = drm_fb->hot_x;
>> +       cursor.hot_y = drm_fb->hot_y;
>> +       cursor.display_id = to_vs_display_id(dc, state->crtc);
>> +       update_cursor_size(state, &cursor);
>> +       cursor.enable = true;
>> +
>> +       dc_hw_update_cursor(&dc->hw, cursor.display_id, &cursor);
>> +}
> *snip
hello Icenowy:
you are deep understanding on dc8200.
by the way of practice
I tested this change on the debian desktop, is there a way to compare the cursor behavior change?
Thanks




  reply	other threads:[~2023-12-07 11:31 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 12:33 [v3 0/6] DRM driver for verisilicon Keith Zhao
2023-12-04 12:33 ` [v3 1/6] dt-bindings: display: Add yamls for JH7110 display system Keith Zhao
2023-12-05  6:59   ` Krzysztof Kozlowski
2023-12-06 12:50   ` Sui Jingfeng
2023-12-08 16:33     ` Rob Herring
2023-12-08 16:31   ` Rob Herring
2023-12-04 12:33 ` [v3 2/6] riscv: dts: starfive: jh7110: display subsystem Keith Zhao
2023-12-04 12:33 ` [v3 3/6] drm/vs: Register DRM device Keith Zhao
2023-12-04 13:30   ` Philipp Zabel
2023-12-11  9:00     ` Keith Zhao
2023-12-11  9:17       ` mripard
2023-12-05 11:33   ` Dmitry Baryshkov
2023-12-04 12:33 ` [v3 4/6] drm/vs: Add KMS crtc&plane Keith Zhao
2023-12-05 12:48   ` Dmitry Baryshkov
2023-12-06  8:55   ` Maxime Ripard
2023-12-06 12:53     ` Keith Zhao
2024-01-31  8:57     ` 回复: " Keith Zhao
2024-01-31 16:30       ` Maxime Ripard
2024-01-31  9:33     ` Keith Zhao
2024-01-31 13:23       ` Maxime Ripard
     [not found]         ` <NTZPR01MB1050C500508E29152E845511EE43A@NTZPR01MB1050.CHNPR01.prod.partner.outlook.cn>
2024-02-09 15:37           ` Maxime Ripard
2023-12-07  8:41   ` Icenowy Zheng
2023-12-07 11:31     ` Keith Zhao [this message]
2023-12-07 15:29       ` Icenowy Zheng
2023-12-27  3:57       ` Icenowy Zheng
2023-12-04 12:33 ` [v3 5/6] drm/vs: Add hdmi driver Keith Zhao
2023-12-05 13:02   ` Dmitry Baryshkov
2023-12-06  9:04   ` Maxime Ripard
2023-12-06 12:02     ` Keith Zhao
2023-12-06 12:56       ` Maxime Ripard
2023-12-06 14:11         ` Keith Zhao
2023-12-07  9:02           ` Andy Yan
2023-12-07 10:48             ` Keith Zhao
2023-12-08  0:37               ` Andy Yan
2023-12-08  3:00                 ` Keith Zhao
2023-12-08  3:23                   ` Andy Yan
2023-12-08  9:14                     ` Maxime Ripard
2023-12-11 10:24                       ` Keith Zhao
2023-12-11 12:13                         ` Andy Yan
2023-12-13  1:40                           ` Keith Zhao
2023-12-14  2:51                             ` Andy Yan
2023-12-11 17:34   ` Rob Herring
2023-12-04 12:33 ` [v3 6/6] drm/vs: simple encoder Keith Zhao
2023-12-05 13:14   ` Dmitry Baryshkov
2023-12-05 13:18     ` Dmitry Baryshkov
2024-05-15 10:07       ` Keith Zhao
2024-05-15 15:17         ` Dmitry Baryshkov
2024-05-16  2:57           ` Keith Zhao
2023-12-05  6:55 ` [v3 0/6] DRM driver for verisilicon Krzysztof Kozlowski
2023-12-05 10:27 ` Sui Jingfeng
2023-12-05 11:59 ` 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=580e13ab-a73e-4ce7-999a-8a8685faf2dd@starfivetech.com \
    --to=keith.zhao@starfivetech.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=changhuang.liang@starfivetech.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jack.zhu@starfivetech.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mripard@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=shengyang.chen@starfivetech.com \
    --cc=suijingfeng@loongson.cn \
    --cc=tzimmermann@suse.de \
    --cc=uwu@icenowy.me \
    --cc=william.qiu@starfivetech.com \
    --cc=xingyu.wu@starfivetech.com \
    /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