Dave Airlie [Fri, 29 Sep 2017 07:13:24 +0000 (17:13 +1000)]
amdgpu/dc: inline some of the bw_fixed code.
This results in a ~4.5k code size reduction.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 07:13:23 +0000 (17:13 +1000)]
amdgpu/dc: move some one line dp functions to inlines.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 07:13:22 +0000 (17:13 +1000)]
amdgpu/dc: hide some unused aux/i2c payload apis.
I've no idea if these are used on other platforms, but they
aren't used outside this file here, so make them static.
Drops 300 bytes.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 05:45:08 +0000 (15:45 +1000)]
amdgpu/dc: inline a bunch of the fixed 31_32 helpers.
This decreases code size by a few hundred bytes.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 05:45:07 +0000 (15:45 +1000)]
amdgpu/dc: inline some of the fixed 32_32 fns
This drops ~400 bytes here.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 04:34:42 +0000 (14:34 +1000)]
amdgpu/dc: fix construct return values on irq service.
This just removes more unused return/errors paths.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 04:34:41 +0000 (14:34 +1000)]
amdgpu: fixup construct to void paths on some more dc objects.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 04:34:40 +0000 (14:34 +1000)]
amdgpu/dc: remove pointless return from build_pipe_hw_param
This never returned anything else.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 04:34:39 +0000 (14:34 +1000)]
amdgpu/dc: another round of dce/dcn construct cleanups.
This removes any remaining pointless return codepaths from the
DCE code.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 04:34:38 +0000 (14:34 +1000)]
amdgpu/dc: cleanup construct returns in gpio.
This is similiar to previous patches, don't return when we don't
need to, also do error checking before allocating memory, makes
it simpler to cleanup after.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 05:44:54 +0000 (15:44 +1000)]
amdgpu/dc: remove pointless returns in the i2caux constructor paths. (v2)
There was lots of return true, and error checking that was never used
in these paths.
Just remove it all.
v2: I missed one return true.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 04:34:36 +0000 (14:34 +1000)]
amdgpu/dc: make some audio functions return void
There is no need to check for these pointers being valid
at this level. Check earlier if required.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 04:34:35 +0000 (14:34 +1000)]
amdgpu/dc: make program_regamma_pwl return void
The return value was unused.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 04:34:34 +0000 (14:34 +1000)]
amdgpu/dc: make get_audio_clock_info return void.
This function never returned false under any sane circumstances.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 03:16:00 +0000 (13:16 +1000)]
amdgpu/dc: make dce80 timing generator construct return void.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 03:15:59 +0000 (13:15 +1000)]
amdgpu/dc: make dce transform constructor void
This never returns anything but true.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 03:15:58 +0000 (13:15 +1000)]
amdgpu/dc: make opp construct void.
This doesn't return anything except true.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 03:15:57 +0000 (13:15 +1000)]
amdgpu/dc: make link encoder construct void.
This only ever returned true.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 03:15:56 +0000 (13:15 +1000)]
amdgpu/dc: make stream encoder constructor return void.
The checks weren't useful here really.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 03:15:55 +0000 (13:15 +1000)]
amdgpu/dc: make timing generator constructor return void.
This can't fail as is.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 00:39:29 +0000 (10:39 +1000)]
amdgpu/dc: constify a bunch of dc structs.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 00:32:24 +0000 (10:32 +1000)]
amdgpu/dm: constify rgb formats.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 00:32:23 +0000 (10:32 +1000)]
amdgpu/dm: constify plane type.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 00:27:41 +0000 (10:27 +1000)]
amdgpu/dm: constify yuv_formats.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 00:23:15 +0000 (10:23 +1000)]
amdgpu/dc: static constify update_surface_trace_level
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 29 Sep 2017 00:20:39 +0000 (10:20 +1000)]
amdgpu/dc: drop dc_ver char
This isn't referenced anywhere, and if it was it should be const.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Thu, 28 Sep 2017 19:39:41 +0000 (15:39 -0400)]
drm/amd/display: Remove DWB
It's not in a good shape and currently completely unused.
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Thu, 28 Sep 2017 03:29:32 +0000 (13:29 +1000)]
amdgpu/dc: remove wait_reg/wait_reg_func interfaces.
These aren't used in the tree anywhere, and there is a TODO.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Thu, 28 Sep 2017 02:42:01 +0000 (12:42 +1000)]
amdgpu/dc: don't check for 0 on register read/writes always.
This adds ~50k to the driver text segment, and 10k to data segment.
text data bss dec hex filename
2385556 39681 1045 2426282 2505aa drivers/gpu/drm/amd/amdgpu/amdgpu.o
text data bss dec hex filename
2336593 28857 1045 2366495 241c1f drivers/gpu/drm/amd/amdgpu/amdgpu.o
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Thu, 28 Sep 2017 02:29:53 +0000 (12:29 +1000)]
amdgpu/dc: drop dml display_mode_support.c (v2)
This code isn't used, and this function is huge, reimport later if
going to be used.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Thu, 28 Sep 2017 01:24:06 +0000 (11:24 +1000)]
amdgpu/dc: separate out some common code from bios parsers.
This extracts the bios parser object id handling into a common file.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Thu, 28 Sep 2017 00:55:25 +0000 (10:55 +1000)]
amdgpu/dc: drop dml_util_is_420
This is unused code.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Thu, 28 Sep 2017 00:45:26 +0000 (10:45 +1000)]
amdgpu/dc: inline a bunch of the dml wrappers.
This reduces code size.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Thu, 28 Sep 2017 00:45:25 +0000 (10:45 +1000)]
amdgpu/dc: inline a bunch of float operations.
This reduces code size for the bw calcs code.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Thu, 28 Sep 2017 00:10:22 +0000 (10:10 +1000)]
amdgpu/dc: drop display_pipe_clocks.c.
This code isn't used at all in the kernel tree, perhaps it can wait to
be imported when it is. It also does a lot of floating point calcs,
so probably good to drop it until it's needed and we can ensure
proper fpu accessors.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Thu, 28 Sep 2017 00:22:48 +0000 (10:22 +1000)]
amdgpu/dc: move filter taps to being static const data (v2)
This just adds two accessor methods, and moves all the data
to static const.
v2: fix dcn build.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Wed, 27 Sep 2017 23:21:33 +0000 (09:21 +1000)]
amdgpu/dc: add static to construct function
There was a global construct symbol in the module symbols, kill it.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Thu, 28 Sep 2017 15:53:19 +0000 (11:53 -0400)]
drm/doc: Reference AMD DC todos
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Wed, 27 Sep 2017 19:36:11 +0000 (15:36 -0400)]
drm/amd/display: DC I2C review
While reviewing I2C in DC identified a few places. Added a couple to the
TODO list.
1) Connector info read
See get_ext_display_connection_info
On some boards the connector information has to be read through a
special I2C channel. This line is only used for this purpose and only on
driver init.
2) SCDC stuff
This should all be reworked to go through DRM's SCDC code. When this is
done some unnecessary I2C code can be retired as well.
3) Max TMDS clock read
See dal_ddc_service_i2c_query_dp_dual_mode_adaptor
This should happen in DRM as well. I haven't checked if there's
currently functionality in DRM. If not we can propose something.
4) HDMI retimer programming
Some boards have an HDMI retimer that we need to program to pass PHY
compliance.
1 & 3 might be a good exercise if someone is looking for things to do.
v2: Merge dp_dual_mode_adaptor TODO
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Wed, 27 Sep 2017 14:53:50 +0000 (10:53 -0400)]
drm/amd/display: Use kernel alloc/free
Abstractions are frowned upon.
cocci script:
virtual context
virtual patch
virtual org
virtual report
@@
expression ptr;
@@
- dm_alloc(ptr)
+ kzalloc(ptr, GFP_KERNEL)
@@
expression ptr, size;
@@
- dm_realloc(ptr, size)
+ krealloc(ptr, size, GFP_KERNEL)
@@
expression ptr;
@@
- dm_free(ptr)
+ kfree(ptr)
v2: use GFP_KERNEL, not GFP_ATOMIC. add cocci script
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Daniel Vetter [Wed, 27 Sep 2017 10:15:50 +0000 (12:15 +0200)]
drm/amd: DC pull request review
Ok, here's one more attempt at scrolling through 130k diff.
Overall verdict from me is that DC is big project, and like any big
project it's never done. So at least for me the goal isn't to make
things perfect, becaue if that's the hoop to jump through we wouldn't
have any gpu drivers at all. More important is whether merging a new
driver base will benefit the overall subsystem, and here this
primarily means whether the DC team understands how upstream works and
is designed, and whether the code is largely aligned with upstream
(especially the atomic modeset) architecture.
Looking back over the last two years I think that's the case now, so
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
for merging this pull.
While scrolling through the pull I spotted a bunch more things that
should be refactored, but most of these will be a real pain with DC
is out of tree, and much easier in tree since in many of these areas
the in-tree helpers aren't up to snuff yet for what DC needs. That
kind of work is best done when there's one tree with everything
integrated.
That's also why I think we should merge DC into drm-next directly, so
we can get started on the integration polish right away. That has a
bit higher risk of Linus having a spazz, so here's my recommendation
for merging:
- There's a few additions to drm_dp_helper.h sprinkled all over the
pull. I think those should be put into a patch of it's own, and
merged first. No need to rebase DC, git merge will dtrt and not end
up with duplicates.
- dm_alloc/realloc/free is something Dave Airlie noticed, and I agree
it's an easy red flag that might upset Linus. cocci can fix this
easy, so no real problem I think to patch up in one big patch (I
thought we've had a "remove malloc wrappers" todo item in the very
first review, apparently there was more than one such wrapper).
- The history is huge, but AMD folks want to keep it if possible, and
I see the value in that. Would be good to get an ack from Linus for
that (but shouldn't be an issue, not the first time we've merged the
full history of out-of-tree work).
Short&longer term TODO items are still tracked, might be a good idea
to integrate those the overall drm todo in our gpu documentation, for
more visibility.
So in a way this is kinda like staging, except not with the horribly
broken process of having an entirely separate tree for staging drivers
which just makes refactoring needlessly painful (which defeats the
point of staging really). So staging-within-the-subsystem. We've had
that before, with early nouveau.
And yes some of the files are utterly horrible to read and not
anything close to kernel coding style standards. But that's the point,
they're essentially gospel from hw engineers that happens to be
parseable by gcc.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Alex Deucher [Fri, 2 Jun 2017 18:38:03 +0000 (14:38 -0400)]
drm/amdgpu: drop experimental flag for vega10
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Bhawanpreet Lakha [Mon, 18 Sep 2017 19:19:31 +0000 (15:19 -0400)]
drm/amd/display: fix pflip irq registor for raven
The pflip registor index was incorrect, this was overriding the macro
and caused a dummy irq call.
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Shirish S [Tue, 26 Sep 2017 06:56:41 +0000 (12:26 +0530)]
drm/amd/display: don't clean-up bottom pipe plane_state
In the scenario of setting underlay, dc_validate_global_state()
is called after constructing the context with all
relevant bottom_pipe related configurations in dm_update_planes_state().
Currently, in dc_validate_global_state(), without checking for bottom_pipe's
existence, the pipe_ctx structure is initialised to 0, hence
nullyfying the plane_state of bottom_pipe which shall be accessed
in populate_initial_data() called from bw_calcs().
Due to this null pointer access kernel panics and leads to reboot
when underlay is tried to set.
This patch fixes the issue by no longer clearing the top_pipe. This
workaround is no longer required.
Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Sun, 24 Sep 2017 18:31:51 +0000 (14:31 -0400)]
drm/amd/display: Remove unused dc_validate_guaranteed function
It got refactored away and was never cleaned.
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Wed, 13 Sep 2017 00:04:48 +0000 (20:04 -0400)]
drm/amd/display: Reduce DC chattiness
Log DC init but default log level to 0 (default for
amdgpu_dc_log) otherwise. Bug reporters can still make
DC more chatty by using the dc_log module param.
amdgpu.dc_log = 1
v2: Only provide runtime option, no compile time config
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Tue, 12 Sep 2017 23:33:40 +0000 (19:33 -0400)]
drm/amd/display: Pass log_mask from DM
Linux and Windows often desire different log levels.
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Wed, 13 Sep 2017 00:02:11 +0000 (20:02 -0400)]
drm/amdgpu: Add dc_log module parameter
We want to make DC less chatty but still allow bug reporters to
provide more detailed logs.
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Mon, 11 Sep 2017 22:48:27 +0000 (18:48 -0400)]
drm/amd/display: Clean Kconfig formatting
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Fri, 8 Sep 2017 14:25:25 +0000 (10:25 -0400)]
drm/amd/display: Update include to bring in line with internal tree
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Fri, 8 Sep 2017 14:24:21 +0000 (10:24 -0400)]
drm/amd/display: Change comments to bring in line with internal tree
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Fri, 8 Sep 2017 14:23:42 +0000 (10:23 -0400)]
drm/amd/display: Format changes to bring in line with internal tree
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Roman Li [Tue, 5 Sep 2017 22:23:46 +0000 (18:23 -0400)]
drm/amd/display: Disable FBC for linear tiling
- Fixing text console on FBC-enabled builds
Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Vitaly Prosyak [Tue, 5 Sep 2017 20:58:37 +0000 (15:58 -0500)]
drm/amd/display: Update DPP registers
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Thu, 17 Aug 2017 18:58:07 +0000 (14:58 -0400)]
drm/amd/display: Create fake sink if needed when commit stream
The problem we're trying to fix is this (and similar):
1) X Desktop with single display
2) VT switch
3) Unplug display
4) VT switch back to X
5) re-plug same display
Before this we'd fail at step 4 when trying to create a dc_stream_state
because of a missing sink. This change will fake a sink in this case.
The same scenario applies to S3 resume.
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Tue, 5 Sep 2017 18:16:09 +0000 (14:16 -0400)]
drm/amd/display: Break out amdgpu_dm_connector
Stop using amdgpu_connector and roll our own. There is no overlap
with amdgpu.
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
pana [Fri, 1 Sep 2017 07:43:22 +0000 (15:43 +0800)]
drm/amd/display: Add 2X Cursor Magnification Code
Signed-off-by: Pandey, Arun <Arun.Pandey@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Tue, 5 Sep 2017 19:50:48 +0000 (15:50 -0400)]
drm/amd/display: No need to keep track of unreffed clk sources
This simplifies clock source reprogramming a bit.
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Yue Hin Lau [Tue, 5 Sep 2017 15:50:34 +0000 (11:50 -0400)]
drm/amd/display: move dwb registers to header file
Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Eric Bernstein [Thu, 31 Aug 2017 20:04:24 +0000 (16:04 -0400)]
drm/amd/display: remove output_format from ipp_setup
Signed-off-by: Eric Bernstein <eric.bernstein@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Mon, 28 Aug 2017 23:44:38 +0000 (19:44 -0400)]
drm/amd/display: Remove switching of clk sources at end of commit
This should be taken care of in validate now.
All of timing sync is quite broken at the moment anyways. Will submit
another patch set to address that.
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Mon, 28 Aug 2017 23:05:17 +0000 (19:05 -0400)]
drm/amd/display: Power down clock source at commit
Still one more in dc_validate_global
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Mon, 28 Aug 2017 22:43:45 +0000 (18:43 -0400)]
drm/amd/display: Don't reset clock source at unref
Powering down the clock source during unref is unsafe as we might want
to unref during atomic_check
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Yue Hin Lau [Tue, 29 Aug 2017 20:54:39 +0000 (16:54 -0400)]
drm/amd/display: seperate dpp_cm_helper functions into new file
Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Andrew Jiang [Fri, 1 Sep 2017 20:03:16 +0000 (16:03 -0400)]
drm/amd/display: Fix context alloc failed logging
Since there was no return statement in the fail block immediately
preceding the context_alloc_fail block, any failure within the
function caused a context alloc failed error message to be printed.
Since the context_alloc_fail block is only used once, move it to
where the goto is directly and accompany it with a return statement.
Signed-off-by: Andrew Jiang <Andrew.Jiang@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Tony Cheng [Fri, 1 Sep 2017 20:14:01 +0000 (16:14 -0400)]
drm/amd/display: fix default dithering
bug: default is mapped to no dithering.
default to spatial dithering based on color depth
Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Thu, 31 Aug 2017 20:08:51 +0000 (16:08 -0400)]
drm/amd/display: Enable dcn10_power_on_fe log by default
This should only happen on full update. If this ever happens
on regular pageflips it needs to be debugged.
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Charlene Liu [Fri, 1 Sep 2017 16:51:47 +0000 (12:51 -0400)]
drm/amd/display: fix crc_source_select use hardcoded color depth
Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Wenjing Liu [Thu, 31 Aug 2017 20:49:56 +0000 (16:49 -0400)]
drm/amd/display: set CP2520 Test pattern to use DP_TEST_PATTERN_HBR2_COMPLIANCE_EYE
Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Hersen Wu [Mon, 11 Sep 2017 20:42:14 +0000 (16:42 -0400)]
drm/amd/display: USB-C to HDMI dongle not light
RV1 support only USB-C active DP-2-HDMI dongle. HPD short pulse is
generated only for DP signal.
When processing HPD short pulse, it must be DP active dongle. No need
for I2C-Over-AUX detection.
v2: Add description
Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Shirish S [Mon, 21 Aug 2017 08:32:17 +0000 (14:02 +0530)]
drm/amd/display: dce110: fix plane validation
For MPO to work with per surface rendering and flipping,
the previous logic of restricting plane[1] only as underlay
needs to be removed.
validate_surface_sets() now checks only the width and height
bounds in case of underlay rather than checking format.
Without this patch one cannot set underlay only.
Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Hersen Wu [Mon, 28 Aug 2017 21:15:34 +0000 (17:15 -0400)]
drm/amd/display: Request to have DCN RV pipe Harvesting
TODO: Current change only work for sucessive last fused pipe,
like p3, or p3,p2. It does not work for fused p1,p2.
Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Wenjing Liu [Wed, 30 Aug 2017 21:49:39 +0000 (17:49 -0400)]
drm/amd/display: Use TPS4 instead of CP2520_3 for phy pattern 7
[Description]
We originally use TPS4 phy test pattern for test pattern 7.
On RV we switched to a new method to use CP2520.
CP2520 should produce the same result.
However in reality, it fails DP PHY automation test.
We use the original method instead.
Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Yongqiang Sun [Wed, 30 Aug 2017 18:29:40 +0000 (14:29 -0400)]
drm/amd/display: Remove sanity check.
Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Yongqiang Sun [Wed, 30 Aug 2017 15:55:40 +0000 (11:55 -0400)]
drm/amd/display: Added negative check for vertical line start.
In case of vstartup happens before vsync, set vertical line
start to 0.
Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Logatharshan Thothiralingam [Fri, 18 Aug 2017 23:09:57 +0000 (19:09 -0400)]
drm/amd/display: Get OTG info if OTG master enabled
Signed-off-by: Logatharshan Thothiralingam <logatharshan.thothiralingam@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Fri, 1 Sep 2017 01:17:05 +0000 (21:17 -0400)]
drm/amdgpu: Remove unused flip_flags from amdgpu_crtc
No more need since Andrey's change to use drm_crtc's version
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Yue Hin Lau [Tue, 29 Aug 2017 19:01:06 +0000 (15:01 -0400)]
drm/amd/display: clean up cm register programming functions
Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Tony Cheng [Mon, 28 Aug 2017 13:51:03 +0000 (09:51 -0400)]
drm/amd/display: delete dead code
Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Mon, 28 Aug 2017 14:59:39 +0000 (10:59 -0400)]
drm/amd/display: Don't spam log with failed validation
In a lot of case we fail validation of timings for legitimate
reasons. No need to print an error.
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Sat, 26 Aug 2017 02:34:51 +0000 (22:34 -0400)]
drm/amd/display: Restore missing DCE8 xfm regs
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Harry Wentland [Fri, 25 Aug 2017 20:33:40 +0000 (16:33 -0400)]
drm/amd/display: Set add_stream_ctx for CZ, Hawaii and others
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Yongqiang Sun [Tue, 29 Aug 2017 19:27:20 +0000 (15:27 -0400)]
drm/amd/display: Disable OTG double buffer.
Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Yongqiang Sun [Tue, 29 Aug 2017 16:50:21 +0000 (12:50 -0400)]
drm/amd/display: Program reg for vertical interrupt.
Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Roman Li [Fri, 25 Aug 2017 20:44:20 +0000 (16:44 -0400)]
drm/amd/display: program fbc for scatter/gather
Fixing screen flickering when FBC enabled on Stoney
Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Charlene Liu [Mon, 28 Aug 2017 23:35:25 +0000 (19:35 -0400)]
drm/amd/display: add backlight control in blankstream.
Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Charlene Liu [Mon, 28 Aug 2017 23:33:23 +0000 (19:33 -0400)]
drm/amd/display: not override the FMT setting set by VBIOS for eDP
Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Yue Hin Lau [Mon, 28 Aug 2017 18:05:17 +0000 (14:05 -0400)]
drm/amd/display: clean up functions in dcn10_dpp_cm
Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Charlene Liu [Mon, 28 Aug 2017 20:28:34 +0000 (16:28 -0400)]
drm/amd/display: only polling VSync Phase within VSync peroroid
Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Eric Yang [Mon, 28 Aug 2017 20:50:17 +0000 (16:50 -0400)]
drm/amd/display: Fix time out on boot
On boot, hubp 0 is powergated during enable accel mode, so we time out
when we try to blank in undo wa.
Fix: Check power gate status before set blank
Signed-off-by: Eric Yang <Eric.Yang2@amd.com>
Reviewed-by: Hersen Wu <hersenxs.wu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Andrey Grodzovsky [Mon, 28 Aug 2017 18:25:01 +0000 (14:25 -0400)]
drm/amd/display: Move dis_clk into dc_state.
dis_clk is single instance across pipes.
Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Charlene Liu [Thu, 24 Aug 2017 21:12:48 +0000 (17:12 -0400)]
drm/amd/display: add aux arbitration logic
Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Mikita Lipski [Wed, 23 Aug 2017 19:29:18 +0000 (15:29 -0400)]
drm/amd/display: Add a clock source to a sharing pipe
Fix to allow DVI displays to share the same clock source
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Bhawanpreet Lakha [Mon, 28 Aug 2017 16:04:23 +0000 (12:04 -0400)]
drm/amd/display: Rename dc resource_validate_ctx methods
Rename dc_resource methods from validate_ctx to state
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Jerry Zuo [Fri, 25 Aug 2017 20:16:10 +0000 (16:16 -0400)]
drm/amd/display: Rename dc validate_context and current_context
Rename all the dc validate_context to dc_state and
dc current_context to current_state.
Signed-off-by: Jerry Zuo <Jerry.Zuo@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Yue Hin Lau [Fri, 25 Aug 2017 20:13:55 +0000 (16:13 -0400)]
drm/amd/display: clean up header file includes
Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Yongqiang Sun [Tue, 22 Aug 2017 19:03:06 +0000 (15:03 -0400)]
drm/amd/display: Remove mpc from bios left over, keep double buffer disabled.
Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Hersen Wu [Thu, 24 Aug 2017 21:40:00 +0000 (17:40 -0400)]
drm/amd/display: DF C-state entry blocked when DPMS
Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
Reviewed-by: Hersen Wu <hersenxs.wu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Yue Hin Lau [Sat, 19 Aug 2017 20:34:36 +0000 (16:34 -0400)]
drm/amd/display: move cm registers from ipp to dpp_cm
Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Eric Bernstein [Thu, 24 Aug 2017 20:16:50 +0000 (16:16 -0400)]
drm/amd/display: Update DSCL
Signed-off-by: Eric Bernstein <eric.bernstein@amd.com>
Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>