<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/gpu/drm/vkms, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/gpu/drm/vkms?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/gpu/drm/vkms?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-09-14T11:22:18Z</updated>
<entry>
<title>Merge drm/drm-next into drm-misc-next</title>
<updated>2022-09-14T11:22:18Z</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2022-09-14T11:22:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a108772d03d8bdb43258218b00bfe43bbe1e8800'/>
<id>urn:sha1:a108772d03d8bdb43258218b00bfe43bbe1e8800</id>
<content type='text'>
We need 6.0-rc1 to merge the backlight rework PR.

Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
</content>
</entry>
<entry>
<title>drm/vkms: fix 32bit compilation error by replacing macros</title>
<updated>2022-09-11T12:28:56Z</updated>
<author>
<name>Melissa Wen</name>
<email>mwen@igalia.com</email>
</author>
<published>2022-09-10T19:03:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=89b03aeaef16f8ab48c10c399f97c836bdbae838'/>
<id>urn:sha1:89b03aeaef16f8ab48c10c399f97c836bdbae838</id>
<content type='text'>
Replace vkms_formats macro for fixed-point operations with functions
from drm/drm_fixed.h to do the same job and fix 32-bit compilation
errors.

v2:
- don't cast results to s32 (Igor)
- add missing drm_fixp2int conversion (Igor)

Fixes: a19c2ac9858 ("drm: vkms: Add support to the RGB565 format")
Tested-by: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt; (v1)
Reviewed-by: Alex Deucher &lt;alexander.deucher@amd.com&gt; (v1)
Reported-by: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Melissa Wen &lt;mwen@igalia.com&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220910190303.682897-1-mwen@igalia.com
</content>
</entry>
<entry>
<title>drm/vkms: fix variable dereferenced before check warning</title>
<updated>2022-09-10T22:18:56Z</updated>
<author>
<name>Harshit Mogalapalli</name>
<email>harshit.m.mogalapalli@oracle.com</email>
</author>
<published>2022-09-08T10:56:23Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=aaa65520280e96dc47fa5065b74bddff30279abe'/>
<id>urn:sha1:aaa65520280e96dc47fa5065b74bddff30279abe</id>
<content type='text'>
Smatch warns:

drivers/gpu/drm/vkms/vkms_plane.c:110 vkms_plane_atomic_update() warn:
 variable dereferenced before check 'fb' (see line 108)

Fix the warning by moving the dereference after the NULL check.

Fixes: 8ba1648567e2 ("drm: vkms: Refactor the plane composer to accept new formats")
Signed-off-by: Harshit Mogalapalli &lt;harshit.m.mogalapalli@oracle.com&gt;
Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Signed-off-by: Melissa Wen &lt;melissa.srw@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220908105623.72777-1-harshit.m.mogalapalli@oracle.com
</content>
</entry>
<entry>
<title>drm: vkms: Add support to the RGB565 format</title>
<updated>2022-09-05T21:25:08Z</updated>
<author>
<name>Igor Torrente</name>
<email>igormtorrente@gmail.com</email>
</author>
<published>2022-09-05T19:08:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=396369d6754993e40f1c84b2e22e40e92dfa4c49'/>
<id>urn:sha1:396369d6754993e40f1c84b2e22e40e92dfa4c49</id>
<content type='text'>
This commit also adds new helper macros to deal with fixed-point
arithmetic.

It was done to improve the precision of the conversion to ARGB16161616
since the "conversion ratio" is not an integer.

V3: Adapt the handlers to the new format introduced in patch 7 V3.
V5: Minor improvements
V6: Minor improvements (Pekka Paalanen)

Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Signed-off-by: Igor Torrente &lt;igormtorrente@gmail.com&gt;
Signed-off-by: Melissa Wen &lt;melissa.srw@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-10-igormtorrente@gmail.com
</content>
</entry>
<entry>
<title>drm: vkms: Adds XRGB_16161616 and ARGB_1616161616 formats</title>
<updated>2022-09-05T21:23:38Z</updated>
<author>
<name>Igor Torrente</name>
<email>igormtorrente@gmail.com</email>
</author>
<published>2022-09-05T19:08:10Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=3675d8a1726337bd1e839a185e0a7ce0bc459b6b'/>
<id>urn:sha1:3675d8a1726337bd1e839a185e0a7ce0bc459b6b</id>
<content type='text'>
This will be useful to write tests that depends on these formats.

ARGB and XRGB follows the a similar implementation of the former formats.
Just adjusting for 16 bits per channel.

V3: Adapt the handlers to the new format introduced in patch 7 V3.
V5: Minor improvements
    Added le16_to_cpu/cpu_to_le16 to the 16 bits color read/writes.

Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Signed-off-by: Igor Torrente &lt;igormtorrente@gmail.com&gt;
Signed-off-by: Melissa Wen &lt;melissa.srw@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-9-igormtorrente@gmail.com
</content>
</entry>
<entry>
<title>drm: vkms: Supports to the case where primary plane doesn't match the CRTC</title>
<updated>2022-09-05T21:18:42Z</updated>
<author>
<name>Igor Torrente</name>
<email>igormtorrente@gmail.com</email>
</author>
<published>2022-09-05T19:08:09Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=bc0d7fdefec62e0cb83c1bcd3c7bd033f5e826e0'/>
<id>urn:sha1:bc0d7fdefec62e0cb83c1bcd3c7bd033f5e826e0</id>
<content type='text'>
We will remove the current assumption that the primary plane has the
same size and position as CRTC and that the primary plane is the
bottom-most in zpos order, or is even enabled. At least as far
as the blending machinery is concerned.

For that we will add CRTC dimension information to `vkms_crtc_state`
and add a opaque black backgound color.

Because now we need to fill the background, we had a loss in
performance with this change. Results running the IGT[1] test
`igt@kms_cursor_crc@pipe-a-cursor-512x512-onscreen` ten times:

|                  Frametime                   |
|:--------------------------------------------:|
|  Implementation |  Previous |   This commit  |
|:---------------:|:---------:|:--------------:|
| frametime range |  5~18 ms  |     10~22 ms   |
|     Average     |  8.47 ms  |     12.32 ms   |

[1] IGT commit id: bc3f6833a12221a46659535dac06ebb312490eb4

V6: Improve the commit description (Pekka Paalanen).
    Update some comments (Pekka Paalanen).
    Remove some fields from `vkms_crtc_state` and move where
    some variables are set (Pekka Paalanen).

Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Signed-off-by: Igor Torrente &lt;igormtorrente@gmail.com&gt;
Signed-off-by: Melissa Wen &lt;melissa.srw@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-8-igormtorrente@gmail.com
</content>
</entry>
<entry>
<title>drm: vkms: Refactor the plane composer to accept new formats</title>
<updated>2022-09-05T21:18:35Z</updated>
<author>
<name>Igor Torrente</name>
<email>igormtorrente@gmail.com</email>
</author>
<published>2022-09-05T19:08:08Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=8ba1648567e289c90fa4f65b4204d0f160e22ac3'/>
<id>urn:sha1:8ba1648567e289c90fa4f65b4204d0f160e22ac3</id>
<content type='text'>
Currently the blend function only accepts XRGB_8888 and ARGB_8888
as a color input.

This patch refactors all the functions related to the plane composition
to overcome this limitation.

The pixels blend is done using the new internal format. And new handlers
are being added to convert a specific format to/from this internal format.

So the blend operation depends on these handlers to convert to this common
format. The blended result, if necessary, is converted to the writeback
buffer format.

This patch introduces three major differences to the blend function.
1 - All the planes are blended at once.
2 - The blend calculus is done as per line instead of per pixel.
3 - It is responsible to calculates the CRC and writing the writeback
buffer(if necessary).

These changes allow us to allocate way less memory in the intermediate
buffer to compute these operations. Because now we don't need to
have the entire intermediate image lines at once, just one line is
enough.

| Memory consumption (output dimensions) |
|:--------------------------------------:|
|       Current      |     This patch    |
|:------------------:|:-----------------:|
|   Width * Heigth   |     2 * Width     |

Beyond memory, we also have a minor performance benefit from all
these changes. Results running the IGT[1] test
`igt@kms_cursor_crc@pipe-a-cursor-512x512-onscreen` ten times:

|                 Frametime                  |
|:------------------------------------------:|
|  Implementation |  Current  |  This commit |
|:---------------:|:---------:|:------------:|
| frametime range |  9~22 ms  |    5~17 ms   |
|     Average     |  11.4 ms  |    7.8 ms    |

[1] IGT commit id: bc3f6833a12221a46659535dac06ebb312490eb4

V2: Improves the performance drastically, by performing the operations
    per-line and not per-pixel(Pekka Paalanen).
    Minor improvements(Pekka Paalanen).
V3: Changes the code to blend the planes all at once. This improves
    performance, memory consumption, and removes much of the weirdness
    of the V2(Pekka Paalanen and me).
    Minor improvements(Pekka Paalanen and me).
V4: Rebase the code and adapt it to the new NUM_OVERLAY_PLANES constant.
V5: Minor checkpatch fixes and the removal of TO-DO item(Melissa Wen).
    Several security/robustness improvents(Pekka Paalanen).
    Removes check_planes_x_bounds function and allows partial
    partly off-screen(Pekka Paalanen).
V6: Fix a mismatch of some variable sizes (Pekka Paalanen).
    Several minor improvements (Pekka Paalanen).

Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Igor Torrente &lt;igormtorrente@gmail.com&gt;
Signed-off-by: Melissa Wen &lt;melissa.srw@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-7-igormtorrente@gmail.com
</content>
</entry>
<entry>
<title>drm: vkms: Add fb information to `vkms_writeback_job`</title>
<updated>2022-09-05T21:12:18Z</updated>
<author>
<name>Igor Torrente</name>
<email>igormtorrente@gmail.com</email>
</author>
<published>2022-09-05T19:08:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=bbdf7b2a0b0e69e4e18b5722341dfa6266d19390'/>
<id>urn:sha1:bbdf7b2a0b0e69e4e18b5722341dfa6266d19390</id>
<content type='text'>
This commit is the groundwork to introduce new formats to the planes and
writeback buffer. As part of it, a new buffer metadata field is added to
`vkms_writeback_job`, this metadata is represented by the `vkms_frame_info`
struct.

Also adds two new function pointers (`line_to_frame_func` and
`frame_to_line_func`) are defined to handle format conversion
from/to internal format.

A new internal format(`struct pixel_argb_u16`) is introduced to deal with
all possible inputs. It consists of 16 bits fields that represent each of
the channels.

These things will allow us, in the future, to have different compositing
and wb format types.

V2: Change the code to get the drm_framebuffer reference and not copy its
    contents (Thomas Zimmermann).
V3: Drop the refcount in the wb code (Thomas Zimmermann).
V5: Add {wb,plane}_format_transform_func to vkms_writeback_job
    and vkms_plane_state (Pekka Paalanen)
V6: Improvements to some struct/struct members names (Pekka Paalanen).
    Splits this patch in two (Pekka Paalanen).
V7: Replace line_to_frame_func and frame_to_line_func typedefs
   with the function signature and void* (Melissa Wen).

Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Signed-off-by: Igor Torrente &lt;igormtorrente@gmail.com&gt;
Signed-off-by: Melissa Wen &lt;melissa.srw@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-6-igormtorrente@gmail.com
</content>
</entry>
<entry>
<title>drm: vkms: get the reference to `drm_framebuffer` instead if coping it</title>
<updated>2022-09-05T21:12:17Z</updated>
<author>
<name>Igor Torrente</name>
<email>igormtorrente@gmail.com</email>
</author>
<published>2022-09-05T19:08:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2eef1ef6e22b241f26d7bf0f1554a9863277e526'/>
<id>urn:sha1:2eef1ef6e22b241f26d7bf0f1554a9863277e526</id>
<content type='text'>
Instead of coping `drm_framebuffer` - which can cause problems -
we just get the reference and add the ref count.

Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Signed-off-by: Igor Torrente &lt;igormtorrente@gmail.com&gt;
Signed-off-by: Melissa Wen &lt;melissa.srw@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-5-igormtorrente@gmail.com
</content>
</entry>
<entry>
<title>drm: drm_atomic_helper: Add a new helper to deal with the writeback connector validation</title>
<updated>2022-09-05T21:12:16Z</updated>
<author>
<name>Igor Torrente</name>
<email>igormtorrente@gmail.com</email>
</author>
<published>2022-09-05T19:08:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=254fe9c106ed69245fbe0beac582054c98a91482'/>
<id>urn:sha1:254fe9c106ed69245fbe0beac582054c98a91482</id>
<content type='text'>
Add a helper function to validate the connector configuration received in
the encoder atomic_check by the drivers.

So the drivers don't need to do these common validations themselves.

V2: Move the format verification to a new helper at the drm_atomic_helper.c
    (Thomas Zimmermann).
V3: Format check improvements (Leandro Ribeiro).
    Minor improvements(Thomas Zimmermann).
V5: Fix some grammar issues in the commit message (André Almeida).

Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Signed-off-by: Igor Torrente &lt;igormtorrente@gmail.com&gt;
Signed-off-by: Melissa Wen &lt;melissa.srw@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-4-igormtorrente@gmail.com
</content>
</entry>
</feed>
