drm/exynos: Merge overlay_ops into manager_ops

This patch merges overlay_ops into manager_ops. In all cases,
overlay_ops is implemented in the same place as manager ops, it doesn't
serve a functional purpose, and doesn't make things more clear.

Change-Id: Ib024506b6b6102a1fa5c82d22597532806bc1c93
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: Add an initialize function to manager and display

This patch adds an initialize function to the manager and display
operations. This allows them to keep track of drm_device in their
local context, as well as adds an initialization hook right after
the encoder is created.

BUG=chromium:234846
TEST=No regressions noted

Change-Id: Ibc88cf01adf6fcabafde5ccbe4d2dccc21c28d6d
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56279
drm/exynos: Use manager_op initialize in fimd

This patch implements the intitialize manager op in fimd. This will
allow us to keep track of drm_dev in context instead of using subdev,
which in turn makes it easier to remove subdev from fimd.

Change-Id: I3f1c1ca547030f61772910556c62957517dbc50b
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: hdmi: Implement initialize op for hdmi

This patch implements the initialize callback in the hdmi and mixer
manager. This allows us to get rid of drm_dev in the drm_hdmi level and
track it in the mixer and hdmi drivers. This is one of the things
holding back the complete removal of the drm_hdmi layer.

Change-Id: I56a3e31a0fc79693bc486d0ff4ba146ca74d783b
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: Pass exynos_drm_manager in manager ops instead of dev

This patch changes the manager ops callbacks from accepting the subdrv
device pointer to taking a pointer to the manager. This will allow us
to move closer to decoupling manager/display from subdrv, and subsequently
decoupling the crtc/plane from the encoder.

Change-Id: If5174f23fcbe05dba574128fccee7c326bbfdfce
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: Remove apply manager callback

This patch removes the apply() manager callback in favor of putting the
relevant commits in the individual drivers. This will mitigate some of
the difference between the suspend/resume path and the dpms path

Change-Id: I7d3ea0ef935bc374f44bdb9b6e7efa512eb5bbb4
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: Remove dpms link between encoder/connector

This patch removes the call from encoder dpms into connector dpms (which
will then call back into encoder dpms through the helper function). The
callback is likely to keep connector->dpms in the right state when
initiating dpms from crtc or encoder, but this isn't the right way to do
it. This patch is the first step towards rationalizing power management
in the exynos drm driver.

Change-Id: I64f77cc6d6c57c993a2c054f899557bca757e29c
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: Rename display_op power_on to dpms

This patch renames the display_op power_on to dpms to accurately reflect
what the function does.

The side-effect of this patch is that the new hdmi dpms callback is now
invoked twice in the dpms path. This is safe and will be dealt with when
the exynos_drm shim goes away.

Change-Id: I49d2ad045a8204d7a669ecb58b22811b12153b6a
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: Don't keep dpms state in encoder

This patch removes the dpms state tracking in encoder. This
state is at best confusing and at worst incorrect since the display
drivers can turn on and off without propagating the value.

Change-Id: I1bbdd8afb8da64cb74d72a762cbf81c236f62faa
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: Use unsigned long for possible_crtcs

Change all instances of possible_crtcs in the exynos drm driver to be
unsigned long. This matches the type used in the drm layer.

BUG=None
TEST=Compiles, no regressions on snow

Change-Id: I82bbd9d5020a169394e0d859b5aa283364206be0
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58208
drm/exynos: Split manager/display/subdrv

This patch splits display and manager from subdrv. The result is that
crtc functions can directly call into manager callbacks and encoder
functions can directly call into display callbacks. This will allow
us to remove the exynos_drm_hdmi shim and support mixer/hdmi & fimd/dp
with common code.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: hdmi: remove the i2c drivers and use devtree

The i2c client was previously being passed into the hdmi driver via a
dedicated i2c driver, and then a global variable. This patch removes all
of that and just uses the device tree to get the i2c_client. This patch
also properly references the client so we don't lose it before we're
done with it.

Change-Id: Ic5d31cf8d652f0f2943d5d9f53a917b09de76bbd
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: Remove exynos_drm_hdmi shim

This patch trims exynos_drm_hdmi out of the driver. The reason it
existed in the first place was to make up for the mixture of
display/overlay/manager ops being spread across hdmi and mixer. With
that code now rationalized, mixer and hdmi map directly to
exynos_drm_crtc and exynos_drm_encoder, respectively. Since there is a
1:1 mapping, we no longer need this layer.

Change-Id: Ied88631eff8c85b15c24d0ab721c6843510b3171
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: Use drm_mode_copy to copy modes

This patch changes the manual copying of mode to adjusted_mode in
mode_fixup to use drm_mode_copy instead of handling things manually.

BUG=None
TEST=No regressions

Change-Id: Id0daa5a472981aeca69a0522c7939fcc8bcd9981
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58225
drm/exynos: Disable unused crtc planes from crtc

This patch moves the code which disables unused crtc planes from the
encoder to the crtc. Since there is a 1:1 encoder/crtc mapping in
exynos, the only valid crtc change the pre-existing code could catch is
disconnecting an active crtc from the encoder. Thus it is functionally
equivalent to just disable all planes attached to a crtc when the crtc
is disabled.

Change-Id: I63dd231c969808e962eb3bdd568f86d9250bd69f
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: Add mode_set manager operation

This patch adds a mode_set callback to the manager operations which
sets the crtc's current mode to the manager driver.

Change-Id: I4795b157edd303b839c937dbac5caa5430fce8a2
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: Implement mode_fixup manager operation

This patch adds a new manager callback for mode_fixup and pipes it
through exynos_drm_crtc.

Change-Id: If0c64638b960b11ae9c40ddb036eba31d5a91964
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: Use mode_set to configure fimd

This patch uses the mode passed into mode_set to configure fimd instead
of directly using the panel from context. This will allow us to move
the exynos_drm_display implementation from fimd into the DP driver
where it belongs.

Change-Id: I5735fd5ee861145bf0311b7f45543b75b9b83a10
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: Remove unused/useless fimd_context members

This patch removes a few fimd_context members which are either entirely
unused or unneeded.

Change-Id: I4ac5ab1cea19d3f8e97e021475b665f04d41599a
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drm/exynos: Move dp driver from video/ to drm/

This patch moves the code from video/ to drm/

Change-Id: Icce103fab1949d0cc1a84a340d321bbe9e8a97e1
Signed-off-by: Sean Paul <seanpaul@chromium.org>