<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c, branch v5.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-06-10T20:59:53Z</updated>
<entry>
<title>drm/amd: drop use of drmP.h in amdgpu.h</title>
<updated>2019-06-10T20:59:53Z</updated>
<author>
<name>Sam Ravnborg</name>
<email>sam@ravnborg.org</email>
</author>
<published>2019-06-09T22:07:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f867723b41f871c88388462c007976bb9a4c72da'/>
<id>urn:sha1:f867723b41f871c88388462c007976bb9a4c72da</id>
<content type='text'>
Delete the unused drmP.h from amdgpu.h.
Fix fallout in various files.

Signed-off-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Reviewed-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Cc: "Christian König" &lt;christian.koenig@amd.com&gt;
Cc: "David (ChunMing) Zhou" &lt;David1.Zhou@amd.com&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190609220757.10862-5-sam@ravnborg.org
</content>
</entry>
<entry>
<title>drm/amd/display: Re-enable CRC capture following modeset</title>
<updated>2019-01-28T16:44:03Z</updated>
<author>
<name>Nicholas Kazlauskas</name>
<email>nicholas.kazlauskas@amd.com</email>
</author>
<published>2019-01-15T15:33:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=43a6a02eb3558d1f3a0618f9bf02328662fb06e3'/>
<id>urn:sha1:43a6a02eb3558d1f3a0618f9bf02328662fb06e3</id>
<content type='text'>
[Why]
During any modeset the CRTC stream is removed and a new stream is added.
This new stream doesn't carry over CRC capture state if it was
previously set.

[How]
Re-program the stream for CRC capture. The existing DRM callback can
be re-used here for the most part - the only modification needed is
additional locking now that it's called from within commit tail.

Signed-off-by: Nicholas Kazlauskas &lt;nicholas.kazlauskas@amd.com&gt;
Reviewed-by: Harry Wentland &lt;Harry.Wentland@amd.com&gt;
Reviewed-by: Sun peng Li &lt;Sunpeng.Li@amd.com&gt;
Acked-by: Leo Li &lt;sunpeng.li@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amd/display: Enable vblank interrupt during CRC capture</title>
<updated>2019-01-28T16:43:55Z</updated>
<author>
<name>Nicholas Kazlauskas</name>
<email>nicholas.kazlauskas@amd.com</email>
</author>
<published>2019-01-14T21:04:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=428da2bdb05d76c48d0bd8fbfa2e4c102685be08'/>
<id>urn:sha1:428da2bdb05d76c48d0bd8fbfa2e4c102685be08</id>
<content type='text'>
[Why]
In order to read CRC events when CRC capture is enabled the vblank
interrput handler needs to be running for the CRTC. The handler is
enabled while there is an active vblank reference.

When running IGT tests there will often be no active vblank reference
but the test expects to read a CRC value. This is valid usage (and
works on i915 since they have a CRC interrupt handler) so the reference
to the vblank should be grabbed while capture is active.

This issue was found running:

igt@kms_plane_multiple@atomic-pipe-b-tiling-none

The pipe-b is the only one in the initial commit and was not previously
active so no vblank reference is grabbed. The vblank interrupt is
not enabled and the test times out.

[How]
Keep a reference to the vblank as long as CRC capture is enabled.
If userspace never explicitly disables it then the reference is
also dropped when removing the CRTC from the context (stream = NULL).

Signed-off-by: Nicholas Kazlauskas &lt;nicholas.kazlauskas@amd.com&gt;
Reviewed-by: Harry Wentland &lt;Harry.Wentland@amd.com&gt;
Reviewed-by: Sun peng Li &lt;Sunpeng.Li@amd.com&gt;
Acked-by: Leo Li &lt;sunpeng.li@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amd/display: Guard against null stream_state in set_crc_source</title>
<updated>2018-11-05T19:21:42Z</updated>
<author>
<name>Nicholas Kazlauskas</name>
<email>nicholas.kazlauskas@amd.com</email>
</author>
<published>2018-10-18T19:49:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f41a895026b8cb6f765190de7d2e7bc3ccbbd183'/>
<id>urn:sha1:f41a895026b8cb6f765190de7d2e7bc3ccbbd183</id>
<content type='text'>
[Why]

The igt@kms_plane@pixel-format-pipe tests can create a sequence where
stream_state is NULL during amdgpu_dm_crtc_set_crc_source which results
in a null pointer dereference.

[How]

Guard against stream_state being NULL before accessing its fields. This
doesn't fix the root cause of the issue so a DRM_ERROR is generated
to still fail the tests.

Signed-off-by: Nicholas Kazlauskas &lt;nicholas.kazlauskas@amd.com&gt;
Reviewed-by: David Francis &lt;David.Francis@amd.com&gt;
Acked-by: Leo Li &lt;sunpeng.li@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>Merge drm/drm-next into drm-misc-next</title>
<updated>2018-08-27T14:00:03Z</updated>
<author>
<name>Sean Paul</name>
<email>seanpaul@chromium.org</email>
</author>
<published>2018-08-27T14:00:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bc537a9cc47eec7f4e32b8164c494ddc35dca8ac'/>
<id>urn:sha1:bc537a9cc47eec7f4e32b8164c494ddc35dca8ac</id>
<content type='text'>
Now that 4.19-rc1 is cut, backmerge it into -misc-next.

Signed-off-by: Sean Paul &lt;seanpaul@chromium.org&gt;
</content>
</entry>
<entry>
<title>drm/crc: Cleanup crtc_crc_open function</title>
<updated>2018-08-22T16:47:58Z</updated>
<author>
<name>Mahesh Kumar</name>
<email>mahesh1.kumar@intel.com</email>
</author>
<published>2018-08-21T08:38:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c0811a7d5befe34a17772760100e26b09a561c0e'/>
<id>urn:sha1:c0811a7d5befe34a17772760100e26b09a561c0e</id>
<content type='text'>
This patch make changes to allocate crc-entries buffer before
enabling CRC generation.
It moves all the failure check early in the function before setting
the source or memory allocation.
Now set_crc_source takes only two variable inputs, values_cnt we
already gets as part of verify_crc_source.

Changes since V1:
 - refactor code to use single spin lock
Changes since V2:
 - rebase
Changes since V3:
 - rebase on top of VKMS driver

Signed-off-by: Mahesh Kumar &lt;mahesh1.kumar@intel.com&gt;
Cc: dri-devel@lists.freedesktop.org
Cc: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Cc: Haneen Mohammed &lt;hamohammed.sa@gmail.com&gt;
Reviewed-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Acked-by: Leo Li &lt;sunpeng.li@amd.com&gt; (V2)
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt; (V3)
Signed-off-by: Rodrigo Vivi &lt;rodrigo.vivi@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20180821083858.26275-3-mahesh1.kumar@intel.com
</content>
</entry>
<entry>
<title>drm/amd/display: Guard against null crtc in CRC IRQ</title>
<updated>2018-08-13T22:29:44Z</updated>
<author>
<name>Nicholas Kazlauskas</name>
<email>nicholas.kazlauskas@amd.com</email>
</author>
<published>2018-08-03T14:40:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dddc0557e3a02499ce336b1e2e67f5afaecccc80'/>
<id>urn:sha1:dddc0557e3a02499ce336b1e2e67f5afaecccc80</id>
<content type='text'>
[Why]

A null pointer deference can occur if crtc is null in
amdgpu_dm_crtc_handle_crc_irq. This can happen if get_crtc_by_otg_inst
returns NULL during dm_crtc_high_irq, leading to a hang in some IGT
test cases.

[How]

Check that CRTC is non-null before accessing its fields.

Signed-off-by: Nicholas Kazlauskas &lt;nicholas.kazlauskas@amd.com&gt;
Reviewed-by: Sun peng Li &lt;Sunpeng.Li@amd.com&gt;
Acked-by: Leo Li &lt;sunpeng.li@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu_dm/crc: Implement verify_crc_source callback</title>
<updated>2018-08-13T12:00:20Z</updated>
<author>
<name>Mahesh Kumar</name>
<email>mahesh1.kumar@intel.com</email>
</author>
<published>2018-07-13T13:59:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3b3b8448ebd1e54927bf7a77be9d6eac11441bfd'/>
<id>urn:sha1:3b3b8448ebd1e54927bf7a77be9d6eac11441bfd</id>
<content type='text'>
This patch implements "verify_crc_source" callback function for
AMD drm driver.

Signed-off-by: Mahesh Kumar &lt;mahesh1.kumar@intel.com&gt;
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Acked-by: Leo Li &lt;sunpeng.li@amd.com&gt;
Signed-off-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20180713135942.25061-5-mahesh1.kumar@intel.com
</content>
</entry>
<entry>
<title>drm/amd/display: Skip 2 frames when first reading CRC</title>
<updated>2018-02-19T19:20:11Z</updated>
<author>
<name>Leo (Sunpeng) Li</name>
<email>sunpeng.li@amd.com</email>
</author>
<published>2018-02-06T15:20:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a0a31ec4ce6a8c8bc4f4b8619b537e4a9a0ddaf1'/>
<id>urn:sha1:a0a31ec4ce6a8c8bc4f4b8619b537e4a9a0ddaf1</id>
<content type='text'>
Skipping the first frame will prevent uncoooked values most of the time.
However, in some unlikely cases, the second frame will be uncooked as
well.

Signed-off-by: Leo (Sunpeng) Li &lt;sunpeng.li@amd.com&gt;
Reviewed-by: Harry Wentland &lt;Harry.Wentland@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amd/display: When enabling CRC, disable dither &amp; enable truncation</title>
<updated>2018-02-19T19:20:09Z</updated>
<author>
<name>Leo (Sunpeng) Li</name>
<email>sunpeng.li@amd.com</email>
</author>
<published>2018-01-23T22:43:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aed7b06e49d2a4ceec6e71a33a2365576fc9c4da'/>
<id>urn:sha1:aed7b06e49d2a4ceec6e71a33a2365576fc9c4da</id>
<content type='text'>
When user-mode is using 8bpc, the hardware represents it internally
using a higher bit depth. This causes problems when comparing CRCs for
color managment tests.

We need to disable dithering as well, since it makes CRC values
non-deterministic.

It's easy to see why dithering needs to be disabled, The reason why
truncation also needs to be enabled is better described with an example.
Consider the folowing which tests the color transform matrix (CTM):

Expected CRC = FB_A -&gt; Degamma (Bypassed) -&gt; CTM (Bypassed)
                                                  |
                                                  v
                            Obtain CRC  &lt;- Regamma(Bypassed)

Actual CRC = FB_B -&gt; Degamma (Bypassed) -&gt; CTM (0.5*Identity)
                                                  |
                                                  v
                            Obtain CRC  &lt;- Regamma(Bypassed)

FB_A contains a solid red color at half intensity (127 @ 8bpc)
FB_B contains a solid red color at full intensity (255 @ 8bpc)

We expect that Expected CRC = Actual CRC, but that's not the case. When
the CTM is applied, the output is at half intensity, but also at a
higher bit depth within hardware. i.e. 255/2 = 127.5: not representable
in 8bpc, but can be at 10bpc. This causes the two CRC's to be different.

The solution is to truncate the output bit depth to the same as input
when enabling CRC capture. Since Linux only supports 8bpc, hard code
that for now.

Signed-off-by: Leo (Sunpeng) Li &lt;sunpeng.li@amd.com&gt;
Reviewed-by: Harry Wentland &lt;Harry.Wentland@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
</feed>
