From patchwork Thu Jul 13 08:23:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311548 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04DF9C001DF for ; Thu, 13 Jul 2023 08:25:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB91010E636; Thu, 13 Jul 2023 08:25:34 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id AE04610E62F for ; Thu, 13 Jul 2023 08:25:22 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrcc-0005qL-Qz; Thu, 13 Jul 2023 10:24:23 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrca-00E4j6-Ln; Thu, 13 Jul 2023 10:24:20 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrcZ-004Vgl-O4; Thu, 13 Jul 2023 10:24:19 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 01/17] drm/atomic_state: Rename struct drm_atomic_state::dev to drm Date: Thu, 13 Jul 2023 10:23:52 +0200 Message-Id: <20230713082408.2266984-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=113545; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=odOBpsyb5Hk3jxkUHoH7bB3ek/1KqrI7aLEjpR6s44s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7SB55pVVU2MatB6BO1JiCk4U6kZxGP2UeYMP FCtqry3XGyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0gQAKCRCPgPtYfRL+ Ts/jB/9k+wxXtl5T8rLjEaZB8b8a9B7sPb8Nx6423X1hZSTU6AtslgBVw2SLJJeq0nIjazMwXN9 +0GU6ejPzs33SUT5Klu/z+bMXqyzetvhbjIbryVdKmsZIS5a50LcbAVkq7Ew7IbE/rRPHGiEDTA rTWnES+Pe5l7f6ESYHdDRONYpwVxEYwFUKf1j/HRsMy5pQ6eBO6m5q9pcoLo4hfji8Ls30z0//L Q8GKdx6GbSnT/Uw7LWjxhyxXzDvtn/jpfcVHBzLSIm1C8CW/f6Z9UdvYUozH0Mac/1mk3Tkp4gT wgCeDMRLCgDtt+blUPH1mruH4gJ3HVwEGEW3KM7YixWxnngu X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 58 +++++++++--------- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 2 +- .../gpu/drm/arm/display/komeda/komeda_kms.c | 4 +- drivers/gpu/drm/arm/malidp_drv.c | 4 +- drivers/gpu/drm/ast/ast_mode.c | 2 +- drivers/gpu/drm/display/drm_dp_mst_topology.c | 12 ++-- drivers/gpu/drm/drm_atomic.c | 42 ++++++------- drivers/gpu/drm/drm_atomic_helper.c | 14 ++--- drivers/gpu/drm/drm_atomic_uapi.c | 2 +- drivers/gpu/drm/drm_mode_object.c | 2 +- drivers/gpu/drm/i915/display/g4x_hdmi.c | 2 +- drivers/gpu/drm/i915/display/hsw_ips.c | 6 +- drivers/gpu/drm/i915/display/i9xx_wm.c | 6 +- drivers/gpu/drm/i915/display/icl_dsi.c | 2 +- .../gpu/drm/i915/display/intel_atomic_plane.c | 6 +- drivers/gpu/drm/i915/display/intel_bw.c | 12 ++-- drivers/gpu/drm/i915/display/intel_cdclk.c | 22 +++---- drivers/gpu/drm/i915/display/intel_cdclk.h | 4 +- drivers/gpu/drm/i915/display/intel_cx0_phy.c | 2 +- drivers/gpu/drm/i915/display/intel_ddi.c | 2 +- drivers/gpu/drm/i915/display/intel_display.c | 60 +++++++++---------- drivers/gpu/drm/i915/display/intel_display.h | 16 ++--- drivers/gpu/drm/i915/display/intel_dp.c | 4 +- drivers/gpu/drm/i915/display/intel_dp_mst.c | 4 +- drivers/gpu/drm/i915/display/intel_dpll.c | 20 +++---- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 23 +++---- drivers/gpu/drm/i915/display/intel_fbc.c | 8 +-- .../gpu/drm/i915/display/intel_global_state.c | 12 ++-- drivers/gpu/drm/i915/display/intel_hdmi.c | 2 +- drivers/gpu/drm/i915/display/intel_pmdemand.c | 14 ++--- drivers/gpu/drm/i915/display/intel_psr.c | 12 ++-- drivers/gpu/drm/i915/display/intel_snps_phy.c | 2 +- drivers/gpu/drm/i915/display/intel_wm.c | 12 ++-- drivers/gpu/drm/i915/display/skl_watermark.c | 32 +++++----- drivers/gpu/drm/i915/display/skl_watermark.h | 4 +- drivers/gpu/drm/i915/display/vlv_dsi.c | 2 +- drivers/gpu/drm/imx/ipuv3/imx-drm-core.c | 2 +- drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_mixer.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_pipe.c | 4 +- drivers/gpu/drm/msm/msm_atomic.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/crc.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +- drivers/gpu/drm/omapdrm/omap_drv.c | 4 +- drivers/gpu/drm/omapdrm/omap_overlay.c | 4 +- drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 2 +- drivers/gpu/drm/sun4i/sun4i_backend.c | 2 +- drivers/gpu/drm/tegra/drm.c | 2 +- drivers/gpu/drm/tidss/tidss_kms.c | 2 +- drivers/gpu/drm/vc4/tests/vc4_mock_output.c | 4 +- .../gpu/drm/vc4/tests/vc4_test_pv_muxing.c | 2 +- drivers/gpu/drm/vc4/vc4_kms.c | 14 ++--- drivers/gpu/drm/vkms/vkms_drv.c | 2 +- include/drm/drm_atomic.h | 20 +++---- include/drm/drm_atomic_helper.h | 4 +- 58 files changed, 262 insertions(+), 257 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 514f6785a020..83ec2bb5c3b1 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -3880,7 +3880,7 @@ static int register_outbox_irq_handlers(struct amdgpu_device *adev) int dm_atomic_get_state(struct drm_atomic_state *state, struct dm_atomic_state **dm_state) { - struct drm_device *dev = state->dev; + struct drm_device *dev = state->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_display_manager *dm = &adev->dm; struct drm_private_state *priv_state; @@ -3900,7 +3900,7 @@ int dm_atomic_get_state(struct drm_atomic_state *state, static struct dm_atomic_state * dm_atomic_get_new_state(struct drm_atomic_state *state) { - struct drm_device *dev = state->dev; + struct drm_device *dev = state->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_display_manager *dm = &adev->dm; struct drm_private_obj *obj; @@ -8098,7 +8098,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, &bundle->flip_addrs[planes_count].address, afb->tmz_surface, false); - drm_dbg_state(state->dev, "plane: id=%d dcc_en=%d\n", + drm_dbg_state(state->drm, "plane: id=%d dcc_en=%d\n", new_plane_state->plane->index, bundle->plane_infos[planes_count].dcc.enable); @@ -8161,7 +8161,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, dc_plane, bundle->flip_addrs[planes_count].flip_timestamp_in_us); - drm_dbg_state(state->dev, "%s Flipping to hi: 0x%x, low: 0x%x\n", + drm_dbg_state(state->drm, + "%s Flipping to hi: 0x%x, low: 0x%x\n", __func__, bundle->flip_addrs[planes_count].address.grph.addr.high_part, bundle->flip_addrs[planes_count].address.grph.addr.low_part); @@ -8476,7 +8477,7 @@ static void amdgpu_dm_crtc_copy_transient_flags(struct drm_crtc_state *crtc_stat */ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) { - struct drm_device *dev = state->dev; + struct drm_device *dev = state->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_display_manager *dm = &adev->dm; struct dm_atomic_state *dm_state; @@ -8536,17 +8537,17 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); dm_old_crtc_state = to_dm_crtc_state(old_crtc_state); - drm_dbg_state(state->dev, - "amdgpu_crtc id:%d crtc_state_flags: enable:%d, active:%d, " - "planes_changed:%d, mode_changed:%d,active_changed:%d," - "connectors_changed:%d\n", - acrtc->crtc_id, - new_crtc_state->enable, - new_crtc_state->active, - new_crtc_state->planes_changed, - new_crtc_state->mode_changed, - new_crtc_state->active_changed, - new_crtc_state->connectors_changed); + drm_dbg_state(state->drm, + "amdgpu_crtc id:%d crtc_state_flags: enable:%d, active:%d, " + "planes_changed:%d, mode_changed:%d,active_changed:%d," + "connectors_changed:%d\n", + acrtc->crtc_id, + new_crtc_state->enable, + new_crtc_state->active, + new_crtc_state->planes_changed, + new_crtc_state->mode_changed, + new_crtc_state->active_changed, + new_crtc_state->connectors_changed); /* Disable cursor if disabling crtc */ if (old_crtc_state->active && !new_crtc_state->active) { @@ -9322,17 +9323,17 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm, if (!drm_atomic_crtc_needs_modeset(new_crtc_state)) goto skip_modeset; - drm_dbg_state(state->dev, - "amdgpu_crtc id:%d crtc_state_flags: enable:%d, active:%d, " - "planes_changed:%d, mode_changed:%d,active_changed:%d," - "connectors_changed:%d\n", - acrtc->crtc_id, - new_crtc_state->enable, - new_crtc_state->active, - new_crtc_state->planes_changed, - new_crtc_state->mode_changed, - new_crtc_state->active_changed, - new_crtc_state->connectors_changed); + drm_dbg_state(state->drm, + "amdgpu_crtc id:%d crtc_state_flags: enable:%d, active:%d, " + "planes_changed:%d, mode_changed:%d,active_changed:%d," + "connectors_changed:%d\n", + acrtc->crtc_id, + new_crtc_state->enable, + new_crtc_state->active, + new_crtc_state->planes_changed, + new_crtc_state->mode_changed, + new_crtc_state->active_changed, + new_crtc_state->connectors_changed); /* Remove stream for any changed/disabled CRTC */ if (!enable) { @@ -10073,7 +10074,8 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, if (!modified) continue; - drm_for_each_plane_mask(plane, state->dev, crtc->state->plane_mask) { + drm_for_each_plane_mask(plane, state->drm, + crtc->state->plane_mask) { if (plane->type == DRM_PLANE_TYPE_CURSOR) continue; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c index a4cb23d059bd..1d207d43a71e 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c @@ -395,7 +395,7 @@ int amdgpu_dm_verify_lut_sizes(const struct drm_crtc_state *crtc_state) int amdgpu_dm_update_crtc_color_mgmt(struct dm_crtc_state *crtc) { struct dc_stream_state *stream = crtc->stream; - struct amdgpu_device *adev = drm_to_adev(crtc->base.state->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->base.state->drm); bool has_rom = adev->asic_type <= CHIP_RAVEN; struct drm_color_ctm *ctm = NULL; const struct drm_color_lut *degamma_lut, *regamma_lut; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c index 440fc0869a34..80684dea114e 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c @@ -319,7 +319,7 @@ static int count_crtc_active_planes(struct drm_crtc_state *new_crtc_state) struct drm_plane *plane; int num_active = 0; - drm_for_each_plane_mask(plane, state->dev, new_crtc_state->plane_mask) { + drm_for_each_plane_mask(plane, state->drm, new_crtc_state->plane_mask) { struct drm_plane_state *new_plane_state; /* Cursor planes are "fake". */ diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c index 62dc64550793..dd3c455bb1bb 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c @@ -69,7 +69,7 @@ static const struct drm_driver komeda_kms_driver = { static void komeda_kms_atomic_commit_hw_done(struct drm_atomic_state *state) { - struct drm_device *dev = state->dev; + struct drm_device *dev = state->drm; struct komeda_kms_dev *kms = to_kdev(dev); int i; @@ -88,7 +88,7 @@ static void komeda_kms_atomic_commit_hw_done(struct drm_atomic_state *state) static void komeda_kms_commit_tail(struct drm_atomic_state *old_state) { - struct drm_device *dev = old_state->dev; + struct drm_device *dev = old_state->drm; bool fence_cookie = dma_fence_begin_signalling(); drm_atomic_helper_commit_modeset_disables(dev, old_state); diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 46ff3521570c..b23ca9b90b7c 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -189,7 +189,7 @@ static int malidp_set_and_wait_config_valid(struct drm_device *drm) static void malidp_atomic_commit_hw_done(struct drm_atomic_state *state) { - struct drm_device *drm = state->dev; + struct drm_device *drm = state->drm; struct malidp_drm *malidp = drm_to_malidp(drm); int loop = 5; @@ -230,7 +230,7 @@ static void malidp_atomic_commit_hw_done(struct drm_atomic_state *state) static void malidp_atomic_commit_tail(struct drm_atomic_state *state) { - struct drm_device *drm = state->dev; + struct drm_device *drm = state->drm; struct malidp_drm *malidp = drm_to_malidp(drm); struct drm_crtc *crtc; struct drm_crtc_state *old_crtc_state; diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index f711d592da52..f91ff312edfd 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -1741,7 +1741,7 @@ static int ast_astdp_output_init(struct ast_device *ast) static void ast_mode_config_helper_atomic_commit_tail(struct drm_atomic_state *state) { - struct ast_device *ast = to_ast_device(state->dev); + struct ast_device *ast = to_ast_device(state->drm); /* * Concurrent operations could possibly trigger a call to diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index 8fe7b635e5bb..5070670b29b5 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -3404,7 +3404,8 @@ int drm_dp_add_payload_part2(struct drm_dp_mst_topology_mgr *mgr, /* Skip failed payloads */ if (payload->vc_start_slot == -1) { - drm_dbg_kms(state->dev, "Part 1 of payload creation for %s failed, skipping part 2\n", + drm_dbg_kms(state->drm, + "Part 1 of payload creation for %s failed, skipping part 2\n", payload->port->connector->name); return -EIO; } @@ -4492,7 +4493,8 @@ void drm_dp_mst_atomic_wait_for_dependencies(struct drm_atomic_state *state) for (j = 0; j < old_mst_state->num_commit_deps; j++) { ret = drm_crtc_commit_wait(old_mst_state->commit_deps[j]); if (ret < 0) - drm_err(state->dev, "Failed to wait for %s: %d\n", + drm_err(state->drm, + "Failed to wait for %s: %d\n", old_mst_state->commit_deps[j]->crtc->name, ret); } @@ -5332,14 +5334,14 @@ int drm_dp_mst_atomic_enable_dsc(struct drm_atomic_state *state, payload = drm_atomic_get_mst_payload_state(mst_state, port); if (!payload) { - drm_dbg_atomic(state->dev, + drm_dbg_atomic(state->drm, "[MST PORT:%p] Couldn't find payload in mst state %p\n", port, mst_state); return -EINVAL; } if (payload->dsc_enabled == enable) { - drm_dbg_atomic(state->dev, + drm_dbg_atomic(state->drm, "[MST PORT:%p] DSC flag is already set to %d, returning %d time slots\n", port, enable, payload->time_slots); time_slots = payload->time_slots; @@ -5347,7 +5349,7 @@ int drm_dp_mst_atomic_enable_dsc(struct drm_atomic_state *state, if (enable) { time_slots = drm_dp_atomic_find_time_slots(state, port->mgr, port, pbn); - drm_dbg_atomic(state->dev, + drm_dbg_atomic(state->drm, "[MST PORT:%p] Enabling DSC flag, reallocating %d time slots on the port\n", port, time_slots); if (time_slots < 0) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 2c454568a607..8a07506a20a2 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -140,7 +140,7 @@ drm_atomic_state_init(struct drm_device *dev, struct drm_atomic_state *state) if (!state->planes) goto fail; - state->dev = dev; + state->drm = dev; drm_dbg_atomic(dev, "Allocated atomic state %p\n", state); @@ -189,7 +189,7 @@ EXPORT_SYMBOL(drm_atomic_state_alloc); */ void drm_atomic_state_default_clear(struct drm_atomic_state *state) { - struct drm_device *dev = state->dev; + struct drm_device *dev = state->drm; struct drm_mode_config *config = &dev->mode_config; int i; @@ -279,7 +279,7 @@ EXPORT_SYMBOL(drm_atomic_state_default_clear); */ void drm_atomic_state_clear(struct drm_atomic_state *state) { - struct drm_device *dev = state->dev; + struct drm_device *dev = state->drm; struct drm_mode_config *config = &dev->mode_config; if (config->funcs->atomic_state_clear) @@ -299,11 +299,11 @@ EXPORT_SYMBOL(drm_atomic_state_clear); void __drm_atomic_state_free(struct kref *ref) { struct drm_atomic_state *state = container_of(ref, typeof(*state), ref); - struct drm_mode_config *config = &state->dev->mode_config; + struct drm_mode_config *config = &state->drm->mode_config; drm_atomic_state_clear(state); - drm_dbg_atomic(state->dev, "Freeing atomic state %p\n", state); + drm_dbg_atomic(state->drm, "Freeing atomic state %p\n", state); if (config->funcs->atomic_state_free) { config->funcs->atomic_state_free(state); @@ -360,7 +360,7 @@ drm_atomic_get_crtc_state(struct drm_atomic_state *state, state->crtcs[index].ptr = crtc; crtc_state->state = state; - drm_dbg_atomic(state->dev, "Added [CRTC:%d:%s] %p state to %p\n", + drm_dbg_atomic(state->drm, "Added [CRTC:%d:%s] %p state to %p\n", crtc->base.id, crtc->name, crtc_state, state); return crtc_state; @@ -863,7 +863,7 @@ drm_atomic_get_private_obj_state(struct drm_atomic_state *state, state->num_private_objs = num_objs; - drm_dbg_atomic(state->dev, + drm_dbg_atomic(state->drm, "Added new private object %p state %p to %p\n", obj, obj_state, state); @@ -1279,7 +1279,7 @@ int drm_atomic_add_affected_connectors(struct drm_atomic_state *state, struct drm_crtc *crtc) { - struct drm_mode_config *config = &state->dev->mode_config; + struct drm_mode_config *config = &state->drm->mode_config; struct drm_connector *connector; struct drm_connector_state *conn_state; struct drm_connector_list_iter conn_iter; @@ -1302,7 +1302,7 @@ drm_atomic_add_affected_connectors(struct drm_atomic_state *state, * Changed connectors are already in @state, so only need to look * at the connector_mask in crtc_state. */ - drm_connector_list_iter_begin(state->dev, &conn_iter); + drm_connector_list_iter_begin(state->drm, &conn_iter); drm_for_each_connector_iter(connector, &conn_iter) { if (!(crtc_state->connector_mask & drm_connector_mask(connector))) continue; @@ -1353,7 +1353,7 @@ drm_atomic_add_affected_planes(struct drm_atomic_state *state, "Adding all current planes for [CRTC:%d:%s] to %p\n", crtc->base.id, crtc->name, state); - drm_for_each_plane_mask(plane, state->dev, old_crtc_state->plane_mask) { + drm_for_each_plane_mask(plane, state->drm, old_crtc_state->plane_mask) { struct drm_plane_state *plane_state = drm_atomic_get_plane_state(state, plane); @@ -1377,7 +1377,7 @@ EXPORT_SYMBOL(drm_atomic_add_affected_planes); */ int drm_atomic_check_only(struct drm_atomic_state *state) { - struct drm_device *dev = state->dev; + struct drm_device *dev = state->drm; struct drm_mode_config *config = &dev->mode_config; struct drm_plane *plane; struct drm_plane_state *old_plane_state; @@ -1426,7 +1426,7 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } if (config->funcs->atomic_check) { - ret = config->funcs->atomic_check(state->dev, state); + ret = config->funcs->atomic_check(state->drm, state); if (ret) { drm_dbg_atomic(dev, "atomic driver check for %p failed: %d\n", @@ -1488,8 +1488,8 @@ EXPORT_SYMBOL(drm_atomic_check_only); */ int drm_atomic_commit(struct drm_atomic_state *state) { - struct drm_mode_config *config = &state->dev->mode_config; - struct drm_printer p = drm_info_printer(state->dev->dev); + struct drm_mode_config *config = &state->drm->mode_config; + struct drm_printer p = drm_info_printer(state->drm->dev); int ret; if (drm_debug_enabled(DRM_UT_STATE)) @@ -1499,9 +1499,9 @@ int drm_atomic_commit(struct drm_atomic_state *state) if (ret) return ret; - drm_dbg_atomic(state->dev, "committing %p\n", state); + drm_dbg_atomic(state->drm, "committing %p\n", state); - return config->funcs->atomic_commit(state->dev, state, false); + return config->funcs->atomic_commit(state->drm, state, false); } EXPORT_SYMBOL(drm_atomic_commit); @@ -1521,16 +1521,16 @@ EXPORT_SYMBOL(drm_atomic_commit); */ int drm_atomic_nonblocking_commit(struct drm_atomic_state *state) { - struct drm_mode_config *config = &state->dev->mode_config; + struct drm_mode_config *config = &state->drm->mode_config; int ret; ret = drm_atomic_check_only(state); if (ret) return ret; - drm_dbg_atomic(state->dev, "committing %p nonblocking\n", state); + drm_dbg_atomic(state->drm, "committing %p nonblocking\n", state); - return config->funcs->atomic_commit(state->dev, state, true); + return config->funcs->atomic_commit(state->drm, state, true); } EXPORT_SYMBOL(drm_atomic_nonblocking_commit); @@ -1736,11 +1736,11 @@ void drm_atomic_print_new_state(const struct drm_atomic_state *state, int i; if (!p) { - drm_err(state->dev, "invalid drm printer\n"); + drm_err(state->drm, "invalid drm printer\n"); return; } - drm_dbg_atomic(state->dev, "checking %p\n", state); + drm_dbg_atomic(state->drm, "checking %p\n", state); for_each_new_plane_in_state(state, plane, plane_state, i) drm_atomic_plane_print_state(p, plane_state); diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 41b8066f61ff..664d0595ea89 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -159,7 +159,7 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state, * and the CRTC is disabled if no encoder is left. This preserves * compatibility with the legacy set_config behavior. */ - drm_connector_list_iter_begin(state->dev, &conn_iter); + drm_connector_list_iter_begin(state->drm, &conn_iter); drm_for_each_connector_iter(connector, &conn_iter) { struct drm_crtc_state *crtc_state; @@ -1731,7 +1731,7 @@ EXPORT_SYMBOL(drm_atomic_helper_wait_for_flip_done); */ void drm_atomic_helper_commit_tail(struct drm_atomic_state *old_state) { - struct drm_device *dev = old_state->dev; + struct drm_device *dev = old_state->drm; drm_atomic_helper_commit_modeset_disables(dev, old_state); @@ -1761,7 +1761,7 @@ EXPORT_SYMBOL(drm_atomic_helper_commit_tail); */ void drm_atomic_helper_commit_tail_rpm(struct drm_atomic_state *old_state) { - struct drm_device *dev = old_state->dev; + struct drm_device *dev = old_state->drm; drm_atomic_helper_commit_modeset_disables(dev, old_state); @@ -1782,7 +1782,7 @@ EXPORT_SYMBOL(drm_atomic_helper_commit_tail_rpm); static void commit_tail(struct drm_atomic_state *old_state) { - struct drm_device *dev = old_state->dev; + struct drm_device *dev = old_state->drm; const struct drm_mode_config_helper_funcs *funcs; struct drm_crtc_state *new_crtc_state; struct drm_crtc *crtc; @@ -2271,7 +2271,7 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state, const struct drm_mode_config_helper_funcs *funcs; int i, ret; - funcs = state->dev->mode_config.helper_private; + funcs = state->drm->mode_config.helper_private; for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { commit = kzalloc(sizeof(*commit), GFP_KERNEL); @@ -2451,13 +2451,13 @@ void drm_atomic_helper_fake_vblank(struct drm_atomic_state *old_state) if (!new_crtc_state->no_vblank) continue; - spin_lock_irqsave(&old_state->dev->event_lock, flags); + spin_lock_irqsave(&old_state->drm->event_lock, flags); if (new_crtc_state->event) { drm_crtc_send_vblank_event(crtc, new_crtc_state->event); new_crtc_state->event = NULL; } - spin_unlock_irqrestore(&old_state->dev->event_lock, flags); + spin_unlock_irqrestore(&old_state->drm->event_lock, flags); } } EXPORT_SYMBOL(drm_atomic_helper_fake_vblank); diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index 98d3b10c08ae..44f7b5c3b2d1 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -967,7 +967,7 @@ int drm_atomic_connector_commit_dpms(struct drm_atomic_state *state, int i, ret, old_mode = connector->dpms; bool active = false; - ret = drm_modeset_lock(&state->dev->mode_config.connection_mutex, + ret = drm_modeset_lock(&state->drm->mode_config.connection_mutex, state->acquire_ctx); if (ret) return ret; diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c index ac0d2ce3f870..63f071e77d77 100644 --- a/drivers/gpu/drm/drm_mode_object.c +++ b/drivers/gpu/drm/drm_mode_object.c @@ -528,7 +528,7 @@ static int set_property_atomic(struct drm_mode_object *obj, state->acquire_ctx = &ctx; retry: - if (prop == state->dev->mode_config.dpms_property) { + if (prop == state->drm->mode_config.dpms_property) { if (obj->type != DRM_MODE_OBJECT_CONNECTOR) { ret = -EINVAL; goto out; diff --git a/drivers/gpu/drm/i915/display/g4x_hdmi.c b/drivers/gpu/drm/i915/display/g4x_hdmi.c index 5c187e6e0472..7f3743dea587 100644 --- a/drivers/gpu/drm/i915/display/g4x_hdmi.c +++ b/drivers/gpu/drm/i915/display/g4x_hdmi.c @@ -602,7 +602,7 @@ intel_hdmi_hotplug(struct intel_encoder *encoder, int g4x_hdmi_connector_atomic_check(struct drm_connector *connector, struct drm_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->dev); + struct drm_i915_private *i915 = to_i915(state->drm); struct drm_connector_list_iter conn_iter; struct drm_connector *conn; int ret; diff --git a/drivers/gpu/drm/i915/display/hsw_ips.c b/drivers/gpu/drm/i915/display/hsw_ips.c index 8eca0de065b6..b052dfa21690 100644 --- a/drivers/gpu/drm/i915/display/hsw_ips.c +++ b/drivers/gpu/drm/i915/display/hsw_ips.c @@ -91,7 +91,7 @@ bool hsw_ips_disable(const struct intel_crtc_state *crtc_state) static bool hsw_ips_need_disable(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_crtc_state *old_crtc_state = intel_atomic_get_old_crtc_state(state, crtc); const struct intel_crtc_state *new_crtc_state = @@ -132,7 +132,7 @@ bool hsw_ips_pre_update(struct intel_atomic_state *state, static bool hsw_ips_need_enable(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_crtc_state *old_crtc_state = intel_atomic_get_old_crtc_state(state, crtc); const struct intel_crtc_state *new_crtc_state = @@ -215,7 +215,7 @@ bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state) int hsw_ips_compute_config(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); diff --git a/drivers/gpu/drm/i915/display/i9xx_wm.c b/drivers/gpu/drm/i915/display/i9xx_wm.c index af0c79a4c9a4..51a896bbebc4 100644 --- a/drivers/gpu/drm/i915/display/i9xx_wm.c +++ b/drivers/gpu/drm/i915/display/i9xx_wm.c @@ -2788,7 +2788,7 @@ static bool ilk_validate_pipe_wm(const struct drm_i915_private *dev_priv, static int ilk_compute_pipe_wm(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); struct intel_pipe_wm *pipe_wm; @@ -3386,7 +3386,7 @@ static int ilk_sanitize_watermarks_add_affected(struct drm_atomic_state *state) struct drm_plane *plane; struct intel_crtc *crtc; - for_each_intel_crtc(state->dev, crtc) { + for_each_intel_crtc(state->drm, crtc) { struct intel_crtc_state *crtc_state; crtc_state = intel_atomic_get_crtc_state(state, crtc); @@ -3402,7 +3402,7 @@ static int ilk_sanitize_watermarks_add_affected(struct drm_atomic_state *state) } } - drm_for_each_plane(plane, state->dev) { + drm_for_each_plane(plane, state->drm) { struct drm_plane_state *plane_state; plane_state = drm_atomic_get_plane_state(state, plane); diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index c133928a0655..74f2e2ed5c19 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -1227,7 +1227,7 @@ static void gen11_dsi_enable(struct intel_atomic_state *state, struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); struct intel_crtc *crtc = to_intel_crtc(conn_state->crtc); - drm_WARN_ON(state->base.dev, crtc_state->has_pch_encoder); + drm_WARN_ON(state->base.drm, crtc_state->has_pch_encoder); /* Wa_1409054076:icl,jsl,ehl */ icl_apply_kvmr_pipe_a_wa(encoder, crtc->pipe, true); diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 7d9578ebae55..5f4ff7c19452 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -675,7 +675,7 @@ intel_crtc_get_plane(struct intel_crtc *crtc, enum plane_id plane_id) int intel_plane_atomic_check(struct intel_atomic_state *state, struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_plane_state *new_plane_state = intel_atomic_get_new_plane_state(state, plane); const struct intel_plane_state *old_plane_state = @@ -750,7 +750,7 @@ skl_next_plane_to_commit(struct intel_atomic_state *state, } /* should never happen */ - drm_WARN_ON(state->base.dev, 1); + drm_WARN_ON(state->base.drm, 1); return NULL; } @@ -881,7 +881,7 @@ static void i9xx_crtc_planes_update_arm(struct intel_atomic_state *state, void intel_crtc_planes_update_arm(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); if (DISPLAY_VER(i915) >= 9) skl_crtc_planes_update_arm(state, crtc); diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c index bef96db62c80..aee6d03eb322 100644 --- a/drivers/gpu/drm/i915/display/intel_bw.c +++ b/drivers/gpu/drm/i915/display/intel_bw.c @@ -771,7 +771,7 @@ static unsigned int intel_bw_data_rate(struct drm_i915_private *dev_priv, struct intel_bw_state * intel_atomic_get_old_bw_state(struct intel_atomic_state *state) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_global_state *bw_state; bw_state = intel_atomic_get_old_global_obj_state(state, &dev_priv->display.bw.obj); @@ -782,7 +782,7 @@ intel_atomic_get_old_bw_state(struct intel_atomic_state *state) struct intel_bw_state * intel_atomic_get_new_bw_state(struct intel_atomic_state *state) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_global_state *bw_state; bw_state = intel_atomic_get_new_global_obj_state(state, &dev_priv->display.bw.obj); @@ -793,7 +793,7 @@ intel_atomic_get_new_bw_state(struct intel_atomic_state *state) struct intel_bw_state * intel_atomic_get_bw_state(struct intel_atomic_state *state) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_global_state *bw_state; bw_state = intel_atomic_get_global_obj_state(state, &dev_priv->display.bw.obj); @@ -1134,7 +1134,7 @@ int intel_bw_min_cdclk(struct drm_i915_private *i915, int intel_bw_calc_min_cdclk(struct intel_atomic_state *state, bool *need_cdclk_calc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_bw_state *new_bw_state = NULL; const struct intel_bw_state *old_bw_state = NULL; const struct intel_cdclk_state *cdclk_state; @@ -1207,7 +1207,7 @@ int intel_bw_calc_min_cdclk(struct intel_atomic_state *state, static int intel_bw_check_data_rate(struct intel_atomic_state *state, bool *changed) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_crtc_state *new_crtc_state, *old_crtc_state; struct intel_crtc *crtc; int i; @@ -1254,7 +1254,7 @@ static int intel_bw_check_data_rate(struct intel_atomic_state *state, bool *chan int intel_bw_atomic_check(struct intel_atomic_state *state) { bool changed = false; - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_bw_state *new_bw_state; const struct intel_bw_state *old_bw_state; int ret; diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c index 4207863b7b2a..92a5cea8fa7f 100644 --- a/drivers/gpu/drm/i915/display/intel_cdclk.c +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c @@ -2357,7 +2357,7 @@ static void intel_set_cdclk(struct drm_i915_private *dev_priv, static void intel_cdclk_pcode_pre_notify(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_cdclk_state *old_cdclk_state = intel_atomic_get_old_cdclk_state(state); const struct intel_cdclk_state *new_cdclk_state = @@ -2402,7 +2402,7 @@ static void intel_cdclk_pcode_pre_notify(struct intel_atomic_state *state) static void intel_cdclk_pcode_post_notify(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_cdclk_state *new_cdclk_state = intel_atomic_get_new_cdclk_state(state); const struct intel_cdclk_state *old_cdclk_state = @@ -2447,7 +2447,7 @@ static void intel_cdclk_pcode_post_notify(struct intel_atomic_state *state) void intel_set_cdclk_pre_plane_update(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_cdclk_state *old_cdclk_state = intel_atomic_get_old_cdclk_state(state); const struct intel_cdclk_state *new_cdclk_state = @@ -2479,7 +2479,7 @@ intel_set_cdclk_pre_plane_update(struct intel_atomic_state *state) void intel_set_cdclk_post_plane_update(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_cdclk_state *old_cdclk_state = intel_atomic_get_old_cdclk_state(state); const struct intel_cdclk_state *new_cdclk_state = @@ -2636,7 +2636,7 @@ int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state) static int intel_compute_min_cdclk(struct intel_cdclk_state *cdclk_state) { struct intel_atomic_state *state = cdclk_state->base.state; - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); const struct intel_bw_state *bw_state; struct intel_crtc *crtc; struct intel_crtc_state *crtc_state; @@ -2706,7 +2706,7 @@ static int intel_compute_min_cdclk(struct intel_cdclk_state *cdclk_state) static int bxt_compute_min_voltage_level(struct intel_cdclk_state *cdclk_state) { struct intel_atomic_state *state = cdclk_state->base.state; - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc *crtc; struct intel_crtc_state *crtc_state; u8 min_voltage_level; @@ -2742,7 +2742,7 @@ static int bxt_compute_min_voltage_level(struct intel_cdclk_state *cdclk_state) static int vlv_modeset_calc_cdclk(struct intel_cdclk_state *cdclk_state) { struct intel_atomic_state *state = cdclk_state->base.state; - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); int min_cdclk, cdclk; min_cdclk = intel_compute_min_cdclk(cdclk_state); @@ -2798,7 +2798,7 @@ static int bdw_modeset_calc_cdclk(struct intel_cdclk_state *cdclk_state) static int skl_dpll0_vco(struct intel_cdclk_state *cdclk_state) { struct intel_atomic_state *state = cdclk_state->base.state; - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc *crtc; struct intel_crtc_state *crtc_state; int vco, i; @@ -2866,7 +2866,7 @@ static int skl_modeset_calc_cdclk(struct intel_cdclk_state *cdclk_state) static int bxt_modeset_calc_cdclk(struct intel_cdclk_state *cdclk_state) { struct intel_atomic_state *state = cdclk_state->base.state; - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); int min_cdclk, min_voltage_level, cdclk, vco; min_cdclk = intel_compute_min_cdclk(cdclk_state); @@ -2944,7 +2944,7 @@ static const struct intel_global_state_funcs intel_cdclk_funcs = { struct intel_cdclk_state * intel_atomic_get_cdclk_state(struct intel_atomic_state *state) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_global_state *cdclk_state; cdclk_state = intel_atomic_get_global_obj_state(state, &dev_priv->display.cdclk.obj); @@ -3020,7 +3020,7 @@ static bool intel_cdclk_need_serialize(struct drm_i915_private *i915, int intel_modeset_calc_cdclk(struct intel_atomic_state *state) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); const struct intel_cdclk_state *old_cdclk_state; struct intel_cdclk_state *new_cdclk_state; enum pipe pipe = INVALID_PIPE; diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.h b/drivers/gpu/drm/i915/display/intel_cdclk.h index 48fd7d39e0cd..07383dfa4b47 100644 --- a/drivers/gpu/drm/i915/display/intel_cdclk.h +++ b/drivers/gpu/drm/i915/display/intel_cdclk.h @@ -77,9 +77,9 @@ intel_atomic_get_cdclk_state(struct intel_atomic_state *state); #define to_intel_cdclk_state(x) container_of((x), struct intel_cdclk_state, base) #define intel_atomic_get_old_cdclk_state(state) \ - to_intel_cdclk_state(intel_atomic_get_old_global_obj_state(state, &to_i915(state->base.dev)->display.cdclk.obj)) + to_intel_cdclk_state(intel_atomic_get_old_global_obj_state(state, &to_i915(state->base.drm)->display.cdclk.obj)) #define intel_atomic_get_new_cdclk_state(state) \ - to_intel_cdclk_state(intel_atomic_get_new_global_obj_state(state, &to_i915(state->base.dev)->display.cdclk.obj)) + to_intel_cdclk_state(intel_atomic_get_new_global_obj_state(state, &to_i915(state->base.drm)->display.cdclk.obj)) int intel_cdclk_init(struct drm_i915_private *dev_priv); void intel_cdclk_debugfs_register(struct drm_i915_private *i915); diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c b/drivers/gpu/drm/i915/display/intel_cx0_phy.c index 0600fdcd06ef..41837b17602d 100644 --- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c +++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c @@ -2998,7 +2998,7 @@ intel_mtl_port_pll_type(struct intel_encoder *encoder, void intel_c10pll_state_verify(struct intel_atomic_state *state, struct intel_crtc_state *new_crtc_state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_c10pll_state mpllb_hw_state = { 0 }; struct intel_c10pll_state *mpllb_sw_state = &new_crtc_state->cx0pll_state.c10; struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc); diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index 090f242e610c..e60baa96a7ae 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -3241,7 +3241,7 @@ static void intel_enable_ddi(struct intel_atomic_state *state, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - drm_WARN_ON(state->base.dev, crtc_state->has_pch_encoder); + drm_WARN_ON(state->base.drm, crtc_state->has_pch_encoder); if (!intel_crtc_is_bigjoiner_slave(crtc_state)) intel_ddi_enable_transcoder_func(encoder, crtc_state); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index d8533603ad05..0a9774eaf9f1 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -783,7 +783,7 @@ intel_get_crtc_new_encoder(const struct intel_atomic_state *state, num_encoders++; } - drm_WARN(state->base.dev, num_encoders != 1, + drm_WARN(state->base.drm, num_encoders != 1, "%d encoders for pipe %c\n", num_encoders, pipe_name(master_crtc->pipe)); @@ -932,7 +932,7 @@ static bool vrr_disabling(const struct intel_crtc_state *old_crtc_state, static void intel_post_plane_update(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); const struct intel_crtc_state *old_crtc_state = intel_atomic_get_old_crtc_state(state, crtc); const struct intel_crtc_state *new_crtc_state = @@ -1035,7 +1035,7 @@ static void intel_crtc_async_flip_disable_wa(struct intel_atomic_state *state, static void intel_pre_plane_update(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); const struct intel_crtc_state *old_crtc_state = intel_atomic_get_old_crtc_state(state, crtc); const struct intel_crtc_state *new_crtc_state = @@ -1173,7 +1173,7 @@ static void intel_crtc_disable_planes(struct intel_atomic_state *state, static void intel_encoders_update_prepare(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_crtc_state *new_crtc_state, *old_crtc_state; struct intel_crtc *crtc; int i; @@ -4049,9 +4049,9 @@ static int icl_add_linked_planes(struct intel_atomic_state *state) if (IS_ERR(linked_plane_state)) return PTR_ERR(linked_plane_state); - drm_WARN_ON(state->base.dev, + drm_WARN_ON(state->base.drm, linked_plane_state->planar_linked_plane != plane); - drm_WARN_ON(state->base.dev, + drm_WARN_ON(state->base.drm, linked_plane_state->planar_slave == plane_state->planar_slave); } @@ -4418,7 +4418,7 @@ compute_baseline_pipe_bpp(struct intel_atomic_state *state, static bool check_digital_port_conflicts(struct intel_atomic_state *state) { - struct drm_device *dev = state->base.dev; + struct drm_device *dev = state->base.drm; struct drm_connector *connector; struct drm_connector_list_iter conn_iter; unsigned int used_ports = 0; @@ -5420,7 +5420,7 @@ intel_verify_planes(struct intel_atomic_state *state) int intel_modeset_all_pipes(struct intel_atomic_state *state, const char *reason) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc *crtc; /* @@ -5501,7 +5501,7 @@ static int hsw_mode_set_planes_workaround(struct intel_atomic_state *state) return 0; /* w/a possibly needed, check how many crtc's are already enabled. */ - for_each_intel_crtc(state->base.dev, crtc) { + for_each_intel_crtc(state->base.drm, crtc) { crtc_state = intel_atomic_get_crtc_state(&state->base, crtc); if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state); @@ -5546,7 +5546,7 @@ u8 intel_calc_active_pipes(struct intel_atomic_state *state, static int intel_modeset_checks(struct intel_atomic_state *state) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); state->modeset = true; @@ -5576,7 +5576,7 @@ static int intel_crtc_add_planes_to_state(struct intel_atomic_state *state, struct intel_crtc *crtc, u8 plane_ids_mask) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_plane *plane; for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, plane) { @@ -5633,7 +5633,7 @@ static int intel_crtc_add_bigjoiner_planes(struct intel_atomic_state *state, static int intel_bigjoiner_add_affected_planes(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_crtc_state *crtc_state; struct intel_crtc *crtc; int i; @@ -5659,7 +5659,7 @@ static int intel_bigjoiner_add_affected_planes(struct intel_atomic_state *state) static int intel_atomic_check_planes(struct intel_atomic_state *state) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc_state *old_crtc_state, *new_crtc_state; struct intel_plane_state __maybe_unused *plane_state; struct intel_plane *plane; @@ -5773,7 +5773,7 @@ static bool intel_pipes_need_modeset(struct intel_atomic_state *state, static int intel_atomic_check_bigjoiner(struct intel_atomic_state *state, struct intel_crtc *master_crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_crtc_state *master_crtc_state = intel_atomic_get_new_crtc_state(state, master_crtc); struct intel_crtc *slave_crtc; @@ -5844,7 +5844,7 @@ static int intel_atomic_check_bigjoiner(struct intel_atomic_state *state, static void kill_bigjoiner_slave(struct intel_atomic_state *state, struct intel_crtc *master_crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_crtc_state *master_crtc_state = intel_atomic_get_new_crtc_state(state, master_crtc); struct intel_crtc *slave_crtc; @@ -5883,7 +5883,7 @@ static void kill_bigjoiner_slave(struct intel_atomic_state *state, static int intel_async_flip_check_uapi(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_crtc_state *new_crtc_state = intel_atomic_get_new_crtc_state(state, crtc); const struct intel_plane_state *old_plane_state; @@ -5940,7 +5940,7 @@ static int intel_async_flip_check_uapi(struct intel_atomic_state *state, static int intel_async_flip_check_hw(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_crtc_state *old_crtc_state, *new_crtc_state; const struct intel_plane_state *new_plane_state, *old_plane_state; struct intel_plane *plane; @@ -6123,7 +6123,7 @@ static int intel_async_flip_check_hw(struct intel_atomic_state *state, struct in static int intel_bigjoiner_add_affected_crtcs(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_crtc_state *crtc_state; struct intel_crtc *crtc; u8 affected_pipes = 0; @@ -6412,7 +6412,7 @@ static int intel_atomic_prepare_commit(struct intel_atomic_state *state) struct intel_crtc *crtc; int i, ret; - ret = drm_atomic_helper_prepare_planes(state->base.dev, &state->base); + ret = drm_atomic_helper_prepare_planes(state->base.drm, &state->base); if (ret < 0) return ret; @@ -6487,7 +6487,7 @@ static void intel_pipe_fastset(const struct intel_crtc_state *old_crtc_state, static void commit_pipe_pre_planes(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); const struct intel_crtc_state *old_crtc_state = intel_atomic_get_old_crtc_state(state, crtc); const struct intel_crtc_state *new_crtc_state = @@ -6517,7 +6517,7 @@ static void commit_pipe_pre_planes(struct intel_atomic_state *state, static void commit_pipe_post_planes(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); const struct intel_crtc_state *new_crtc_state = intel_atomic_get_new_crtc_state(state, crtc); @@ -6534,7 +6534,7 @@ static void commit_pipe_post_planes(struct intel_atomic_state *state, static void intel_enable_crtc(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); const struct intel_crtc_state *new_crtc_state = intel_atomic_get_new_crtc_state(state, crtc); @@ -6556,7 +6556,7 @@ static void intel_enable_crtc(struct intel_atomic_state *state, static void intel_update_crtc(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_crtc_state *old_crtc_state = intel_atomic_get_old_crtc_state(state, crtc); struct intel_crtc_state *new_crtc_state = @@ -6627,7 +6627,7 @@ static void intel_old_crtc_state_disables(struct intel_atomic_state *state, struct intel_crtc_state *new_crtc_state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); /* * We need to disable pipe CRC before disabling the pipe, @@ -6718,7 +6718,7 @@ static void intel_commit_modeset_enables(struct intel_atomic_state *state) static void skl_commit_modeset_enables(struct intel_atomic_state *state) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc *crtc; struct intel_crtc_state *old_crtc_state, *new_crtc_state; struct skl_ddb_entry entries[I915_MAX_PIPES] = {}; @@ -6859,7 +6859,7 @@ void intel_atomic_helper_free_state_worker(struct work_struct *work) static void intel_atomic_commit_fence_wait(struct intel_atomic_state *intel_state) { struct wait_queue_entry wait_fence, wait_reset; - struct drm_i915_private *dev_priv = to_i915(intel_state->base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_state->base.drm); init_wait_entry(&wait_fence, 0); init_wait_entry(&wait_reset, 0); @@ -6887,7 +6887,7 @@ static void intel_atomic_cleanup_work(struct work_struct *work) { struct intel_atomic_state *state = container_of(work, struct intel_atomic_state, base.commit_work); - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_crtc_state *old_crtc_state; struct intel_crtc *crtc; int i; @@ -6904,7 +6904,7 @@ static void intel_atomic_cleanup_work(struct work_struct *work) static void intel_atomic_prepare_plane_clear_colors(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_plane *plane; struct intel_plane_state *plane_state; int i; @@ -6947,7 +6947,7 @@ static void intel_atomic_prepare_plane_clear_colors(struct intel_atomic_state *s static void intel_atomic_commit_tail(struct intel_atomic_state *state) { - struct drm_device *dev = state->base.dev; + struct drm_device *dev = state->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_crtc_state *new_crtc_state, *old_crtc_state; struct intel_crtc *crtc; @@ -7180,7 +7180,7 @@ intel_atomic_commit_ready(struct i915_sw_fence *fence, break; case FENCE_FREE: { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_atomic_helper *helper = &i915->display.atomic_helper; diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h index c744c021af23..9991dffe09ea 100644 --- a/drivers/gpu/drm/i915/display/intel_display.h +++ b/drivers/gpu/drm/i915/display/intel_display.h @@ -317,7 +317,7 @@ enum phy_fia { #define for_each_old_intel_plane_in_state(__state, plane, old_plane_state, __i) \ for ((__i) = 0; \ - (__i) < (__state)->base.dev->mode_config.num_total_plane && \ + (__i) < (__state)->base.drm->mode_config.num_total_plane && \ ((plane) = to_intel_plane((__state)->base.planes[__i].ptr), \ (old_plane_state) = to_intel_plane_state((__state)->base.planes[__i].old_state), 1); \ (__i)++) \ @@ -325,7 +325,7 @@ enum phy_fia { #define for_each_old_intel_crtc_in_state(__state, crtc, old_crtc_state, __i) \ for ((__i) = 0; \ - (__i) < (__state)->base.dev->mode_config.num_crtc && \ + (__i) < (__state)->base.drm->mode_config.num_crtc && \ ((crtc) = to_intel_crtc((__state)->base.crtcs[__i].ptr), \ (old_crtc_state) = to_intel_crtc_state((__state)->base.crtcs[__i].old_state), 1); \ (__i)++) \ @@ -333,7 +333,7 @@ enum phy_fia { #define for_each_new_intel_plane_in_state(__state, plane, new_plane_state, __i) \ for ((__i) = 0; \ - (__i) < (__state)->base.dev->mode_config.num_total_plane && \ + (__i) < (__state)->base.drm->mode_config.num_total_plane && \ ((plane) = to_intel_plane((__state)->base.planes[__i].ptr), \ (new_plane_state) = to_intel_plane_state((__state)->base.planes[__i].new_state), 1); \ (__i)++) \ @@ -341,7 +341,7 @@ enum phy_fia { #define for_each_new_intel_crtc_in_state(__state, crtc, new_crtc_state, __i) \ for ((__i) = 0; \ - (__i) < (__state)->base.dev->mode_config.num_crtc && \ + (__i) < (__state)->base.drm->mode_config.num_crtc && \ ((crtc) = to_intel_crtc((__state)->base.crtcs[__i].ptr), \ (new_crtc_state) = to_intel_crtc_state((__state)->base.crtcs[__i].new_state), 1); \ (__i)++) \ @@ -349,7 +349,7 @@ enum phy_fia { #define for_each_oldnew_intel_plane_in_state(__state, plane, old_plane_state, new_plane_state, __i) \ for ((__i) = 0; \ - (__i) < (__state)->base.dev->mode_config.num_total_plane && \ + (__i) < (__state)->base.drm->mode_config.num_total_plane && \ ((plane) = to_intel_plane((__state)->base.planes[__i].ptr), \ (old_plane_state) = to_intel_plane_state((__state)->base.planes[__i].old_state), \ (new_plane_state) = to_intel_plane_state((__state)->base.planes[__i].new_state), 1); \ @@ -358,7 +358,7 @@ enum phy_fia { #define for_each_oldnew_intel_crtc_in_state(__state, crtc, old_crtc_state, new_crtc_state, __i) \ for ((__i) = 0; \ - (__i) < (__state)->base.dev->mode_config.num_crtc && \ + (__i) < (__state)->base.drm->mode_config.num_crtc && \ ((crtc) = to_intel_crtc((__state)->base.crtcs[__i].ptr), \ (old_crtc_state) = to_intel_crtc_state((__state)->base.crtcs[__i].old_state), \ (new_crtc_state) = to_intel_crtc_state((__state)->base.crtcs[__i].new_state), 1); \ @@ -366,7 +366,7 @@ enum phy_fia { for_each_if(crtc) #define for_each_oldnew_intel_crtc_in_state_reverse(__state, crtc, old_crtc_state, new_crtc_state, __i) \ - for ((__i) = (__state)->base.dev->mode_config.num_crtc - 1; \ + for ((__i) = (__state)->base.drm->mode_config.num_crtc - 1; \ (__i) >= 0 && \ ((crtc) = to_intel_crtc((__state)->base.crtcs[__i].ptr), \ (old_crtc_state) = to_intel_crtc_state((__state)->base.crtcs[__i].old_state), \ @@ -377,7 +377,7 @@ enum phy_fia { #define intel_atomic_crtc_state_for_each_plane_state( \ plane, plane_state, \ crtc_state) \ - for_each_intel_plane_mask(((crtc_state)->uapi.state->dev), (plane), \ + for_each_intel_plane_mask(((crtc_state)->uapi.state->drm), (plane), \ ((crtc_state)->uapi.plane_mask)) \ for_each_if ((plane_state = \ to_intel_plane_state(__drm_atomic_get_current_plane_state((crtc_state)->uapi.state, &plane->base)))) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 9f40da20e88d..8aec1cfd53b8 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5100,7 +5100,7 @@ void intel_dp_encoder_shutdown(struct intel_encoder *intel_encoder) static int intel_modeset_tile_group(struct intel_atomic_state *state, int tile_group_id) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct drm_connector_list_iter conn_iter; struct drm_connector *connector; int ret = 0; @@ -5141,7 +5141,7 @@ static int intel_modeset_tile_group(struct intel_atomic_state *state, static int intel_modeset_affected_transcoders(struct intel_atomic_state *state, u8 transcoders) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc *crtc; if (transcoders == 0) diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index e3f176a093d2..e4ef3833c1ed 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -401,7 +401,7 @@ static unsigned int intel_dp_mst_transcoder_mask(struct intel_atomic_state *state, struct intel_dp *mst_port) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); const struct intel_digital_connector_state *conn_state; struct intel_connector *connector; u8 transcoders = 0; @@ -454,7 +454,7 @@ static int intel_dp_mst_atomic_master_trans_check(struct intel_connector *connector, struct intel_atomic_state *state) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct drm_connector_list_iter connector_list_iter; struct intel_connector *connector_iter; int ret = 0; diff --git a/drivers/gpu/drm/i915/display/intel_dpll.c b/drivers/gpu/drm/i915/display/intel_dpll.c index 999badfe2906..b0fb96717932 100644 --- a/drivers/gpu/drm/i915/display/intel_dpll.c +++ b/drivers/gpu/drm/i915/display/intel_dpll.c @@ -936,7 +936,7 @@ static void i8xx_compute_dpll(struct intel_crtc_state *crtc_state, static int hsw_crtc_compute_clock(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); struct intel_encoder *encoder = @@ -965,7 +965,7 @@ static int hsw_crtc_compute_clock(struct intel_atomic_state *state, static int hsw_crtc_get_shared_dpll(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); struct intel_encoder *encoder = @@ -999,7 +999,7 @@ static int dg2_crtc_compute_clock(struct intel_atomic_state *state, static int mtl_crtc_compute_clock(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); struct intel_encoder *encoder = @@ -1140,7 +1140,7 @@ static void ilk_compute_dpll(struct intel_crtc_state *crtc_state, static int ilk_crtc_compute_clock(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); const struct intel_limit *limit; @@ -1294,7 +1294,7 @@ static int vlv_crtc_compute_clock(struct intel_atomic_state *state, static int g4x_crtc_compute_clock(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); const struct intel_limit *limit; @@ -1341,7 +1341,7 @@ static int g4x_crtc_compute_clock(struct intel_atomic_state *state, static int pnv_crtc_compute_clock(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); const struct intel_limit *limit; @@ -1377,7 +1377,7 @@ static int pnv_crtc_compute_clock(struct intel_atomic_state *state, static int i9xx_crtc_compute_clock(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); const struct intel_limit *limit; @@ -1415,7 +1415,7 @@ static int i9xx_crtc_compute_clock(struct intel_atomic_state *state, static int i8xx_crtc_compute_clock(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); const struct intel_limit *limit; @@ -1495,7 +1495,7 @@ static const struct intel_dpll_funcs i8xx_dpll_funcs = { int intel_dpll_crtc_compute_clock(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); int ret; @@ -1521,7 +1521,7 @@ int intel_dpll_crtc_compute_clock(struct intel_atomic_state *state, int intel_dpll_crtc_get_shared_dpll(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); int ret; diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c index 6b2d8a1e2aa9..ef039b1b34eb 100644 --- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c +++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c @@ -129,12 +129,13 @@ intel_atomic_get_shared_dpll_state(struct drm_atomic_state *s) { struct intel_atomic_state *state = to_intel_atomic_state(s); - drm_WARN_ON(s->dev, !drm_modeset_is_locked(&s->dev->mode_config.connection_mutex)); + drm_WARN_ON(s->drm, + !drm_modeset_is_locked(&s->drm->mode_config.connection_mutex)); if (!state->dpll_set) { state->dpll_set = true; - intel_atomic_duplicate_dpll_state(to_i915(s->dev), + intel_atomic_duplicate_dpll_state(to_i915(s->drm), state->shared_dpll); } @@ -455,7 +456,7 @@ static void intel_put_dpll(struct intel_atomic_state *state, */ void intel_shared_dpll_swap_state(struct intel_atomic_state *state) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_shared_dpll_state *shared_dpll = state->shared_dpll; enum intel_dpll_id i; @@ -960,7 +961,7 @@ static int hsw_ddi_wrpll_compute_dpll(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); unsigned int p, n2, r2; @@ -3255,7 +3256,7 @@ static int icl_get_combo_phy_dpll(struct intel_atomic_state *state, static int icl_compute_tc_phy_dplls(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); struct icl_port_dpll *port_dpll = @@ -3288,7 +3289,7 @@ static int icl_get_tc_phy_dplls(struct intel_atomic_state *state, struct intel_crtc *crtc, struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); struct icl_port_dpll *port_dpll = @@ -3334,7 +3335,7 @@ static int icl_compute_dplls(struct intel_atomic_state *state, struct intel_crtc *crtc, struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); enum phy phy = intel_port_to_phy(dev_priv, encoder->port); if (intel_phy_is_combo(dev_priv, phy)) @@ -3351,7 +3352,7 @@ static int icl_get_dplls(struct intel_atomic_state *state, struct intel_crtc *crtc, struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); enum phy phy = intel_port_to_phy(dev_priv, encoder->port); if (intel_phy_is_combo(dev_priv, phy)) @@ -4201,7 +4202,7 @@ int intel_compute_shared_dplls(struct intel_atomic_state *state, struct intel_crtc *crtc, struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); const struct intel_dpll_mgr *dpll_mgr = dev_priv->display.dpll.mgr; if (drm_WARN_ON(&dev_priv->drm, !dpll_mgr)) @@ -4234,7 +4235,7 @@ int intel_reserve_shared_dplls(struct intel_atomic_state *state, struct intel_crtc *crtc, struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); const struct intel_dpll_mgr *dpll_mgr = dev_priv->display.dpll.mgr; if (drm_WARN_ON(&dev_priv->drm, !dpll_mgr)) @@ -4257,7 +4258,7 @@ int intel_reserve_shared_dplls(struct intel_atomic_state *state, void intel_release_shared_dplls(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); const struct intel_dpll_mgr *dpll_mgr = dev_priv->display.dpll.mgr; /* diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c index 7f8b2d7713c7..3e43e15d50ce 100644 --- a/drivers/gpu/drm/i915/display/intel_fbc.c +++ b/drivers/gpu/drm/i915/display/intel_fbc.c @@ -971,7 +971,7 @@ static void intel_fbc_update_state(struct intel_atomic_state *state, struct intel_crtc *crtc, struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); const struct intel_plane_state *plane_state = @@ -1043,7 +1043,7 @@ static bool intel_fbc_is_ok(const struct intel_plane_state *plane_state) static int intel_fbc_check_plane(struct intel_atomic_state *state, struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_plane_state *plane_state = intel_atomic_get_new_plane_state(state, plane); const struct drm_framebuffer *fb = plane_state->hw.fb; @@ -1218,7 +1218,7 @@ static bool __intel_fbc_pre_update(struct intel_atomic_state *state, struct intel_crtc *crtc, struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_fbc *fbc = plane->fbc; bool need_vblank_wait = false; @@ -1427,7 +1427,7 @@ static void __intel_fbc_enable(struct intel_atomic_state *state, struct intel_crtc *crtc, struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_plane_state *plane_state = intel_atomic_get_new_plane_state(state, plane); struct intel_fbc *fbc = plane->fbc; diff --git a/drivers/gpu/drm/i915/display/intel_global_state.c b/drivers/gpu/drm/i915/display/intel_global_state.c index e8e8be54143b..09d72c3f3f95 100644 --- a/drivers/gpu/drm/i915/display/intel_global_state.c +++ b/drivers/gpu/drm/i915/display/intel_global_state.c @@ -84,7 +84,7 @@ static bool modeset_lock_is_held(struct drm_modeset_acquire_ctx *ctx, static void assert_global_state_read_locked(struct intel_atomic_state *state) { struct drm_modeset_acquire_ctx *ctx = state->base.acquire_ctx; - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc *crtc; for_each_intel_crtc(&dev_priv->drm, crtc) { @@ -99,7 +99,7 @@ struct intel_global_state * intel_atomic_get_global_obj_state(struct intel_atomic_state *state, struct intel_global_obj *obj) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); int index, num_objs, i; size_t size; struct __intel_global_objs_state *arr; @@ -173,7 +173,7 @@ intel_atomic_get_new_global_obj_state(struct intel_atomic_state *state, void intel_atomic_swap_global_state(struct intel_atomic_state *state) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_global_state *old_obj_state, *new_obj_state; struct intel_global_obj *obj; int i; @@ -220,7 +220,7 @@ void intel_atomic_clear_global_state(struct intel_atomic_state *state) int intel_atomic_lock_global_state(struct intel_global_state *obj_state) { struct intel_atomic_state *state = obj_state->state; - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc *crtc; for_each_intel_crtc(&dev_priv->drm, crtc) { @@ -240,7 +240,7 @@ int intel_atomic_lock_global_state(struct intel_global_state *obj_state) int intel_atomic_serialize_global_state(struct intel_global_state *obj_state) { struct intel_atomic_state *state = obj_state->state; - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc *crtc; for_each_intel_crtc(&dev_priv->drm, crtc) { @@ -259,7 +259,7 @@ int intel_atomic_serialize_global_state(struct intel_global_state *obj_state) bool intel_atomic_global_state_is_serialized(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_crtc *crtc; for_each_intel_crtc(&i915->drm, crtc) diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index 7ac5e6c5e00d..4b41a58fcb03 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -2624,7 +2624,7 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = { static int intel_hdmi_connector_atomic_check(struct drm_connector *connector, struct drm_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->dev); + struct drm_i915_private *i915 = to_i915(state->drm); if (HAS_DDI(i915)) return intel_digital_connector_atomic_check(connector, state); diff --git a/drivers/gpu/drm/i915/display/intel_pmdemand.c b/drivers/gpu/drm/i915/display/intel_pmdemand.c index f7608d363634..adad6efe9354 100644 --- a/drivers/gpu/drm/i915/display/intel_pmdemand.c +++ b/drivers/gpu/drm/i915/display/intel_pmdemand.c @@ -41,7 +41,7 @@ static const struct intel_global_state_funcs intel_pmdemand_funcs = { static struct intel_pmdemand_state * intel_atomic_get_pmdemand_state(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_global_state *pmdemand_state = intel_atomic_get_global_obj_state(state, &i915->display.pmdemand.obj); @@ -55,7 +55,7 @@ intel_atomic_get_pmdemand_state(struct intel_atomic_state *state) static struct intel_pmdemand_state * intel_atomic_get_old_pmdemand_state(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_global_state *pmdemand_state = intel_atomic_get_old_global_obj_state(state, &i915->display.pmdemand.obj); @@ -69,7 +69,7 @@ intel_atomic_get_old_pmdemand_state(struct intel_atomic_state *state) static struct intel_pmdemand_state * intel_atomic_get_new_pmdemand_state(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_global_state *pmdemand_state = intel_atomic_get_new_global_obj_state(state, &i915->display.pmdemand.obj); @@ -235,7 +235,7 @@ intel_pmdemand_encoder_has_tc_phy(struct drm_i915_private *i915, static bool intel_pmdemand_connector_needs_update(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct drm_connector_state *old_conn_state; struct drm_connector_state *new_conn_state; struct drm_connector *connector; @@ -305,7 +305,7 @@ static bool intel_pmdemand_needs_update(struct intel_atomic_state *state) int intel_pmdemand_atomic_check(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_bw_state *new_bw_state; const struct intel_cdclk_state *new_cdclk_state; const struct intel_dbuf_state *new_dbuf_state; @@ -576,7 +576,7 @@ intel_pmdemand_state_changed(const struct intel_pmdemand_state *new, void intel_pmdemand_pre_plane_update(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_pmdemand_state *new_pmdemand_state = intel_atomic_get_new_pmdemand_state(state); const struct intel_pmdemand_state *old_pmdemand_state = @@ -599,7 +599,7 @@ void intel_pmdemand_pre_plane_update(struct intel_atomic_state *state) void intel_pmdemand_post_plane_update(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_pmdemand_state *new_pmdemand_state = intel_atomic_get_new_pmdemand_state(state); const struct intel_pmdemand_state *old_pmdemand_state = diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index d58ed9b62e67..27bb8914a7ad 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -1861,7 +1861,7 @@ static bool psr2_sel_fetch_pipe_state_supported(const struct intel_crtc_state *c int intel_psr2_sel_fetch_update(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); struct drm_rect pipe_clip = { .x1 = 0, .y1 = -1, .x2 = INT_MAX, .y2 = -1 }; struct intel_plane_state *new_plane_state, *old_plane_state; @@ -2028,7 +2028,7 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state, void intel_psr_pre_plane_update(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_crtc_state *old_crtc_state = intel_atomic_get_old_crtc_state(state, crtc); const struct intel_crtc_state *new_crtc_state = @@ -2038,7 +2038,7 @@ void intel_psr_pre_plane_update(struct intel_atomic_state *state, if (!HAS_PSR(i915)) return; - for_each_intel_encoder_mask_with_psr(state->base.dev, encoder, + for_each_intel_encoder_mask_with_psr(state->base.drm, encoder, old_crtc_state->uapi.encoder_mask) { struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_psr *psr = &intel_dp->psr; @@ -2073,13 +2073,13 @@ void intel_psr_pre_plane_update(struct intel_atomic_state *state, static void _intel_psr_post_plane_update(const struct intel_atomic_state *state, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_encoder *encoder; if (!crtc_state->has_psr) return; - for_each_intel_encoder_mask_with_psr(state->base.dev, encoder, + for_each_intel_encoder_mask_with_psr(state->base.drm, encoder, crtc_state->uapi.encoder_mask) { struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_psr *psr = &intel_dp->psr; @@ -2112,7 +2112,7 @@ static void _intel_psr_post_plane_update(const struct intel_atomic_state *state, void intel_psr_post_plane_update(const struct intel_atomic_state *state) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct drm_i915_private *dev_priv = to_i915(state->base.drm); struct intel_crtc_state *crtc_state; struct intel_crtc *crtc; int i; diff --git a/drivers/gpu/drm/i915/display/intel_snps_phy.c b/drivers/gpu/drm/i915/display/intel_snps_phy.c index 88ef56b6e0fd..6f5cd530539c 100644 --- a/drivers/gpu/drm/i915/display/intel_snps_phy.c +++ b/drivers/gpu/drm/i915/display/intel_snps_phy.c @@ -1995,7 +1995,7 @@ int intel_snps_phy_check_hdmi_link_rate(int clock) void intel_mpllb_state_verify(struct intel_atomic_state *state, struct intel_crtc_state *new_crtc_state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_mpllb_state mpllb_hw_state = { 0 }; struct intel_mpllb_state *mpllb_sw_state = &new_crtc_state->mpllb_state; struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc); diff --git a/drivers/gpu/drm/i915/display/intel_wm.c b/drivers/gpu/drm/i915/display/intel_wm.c index b615449e70b4..69179179e331 100644 --- a/drivers/gpu/drm/i915/display/intel_wm.c +++ b/drivers/gpu/drm/i915/display/intel_wm.c @@ -51,7 +51,7 @@ void intel_update_watermarks(struct drm_i915_private *i915) int intel_compute_pipe_wm(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); if (i915->display.funcs.wm->compute_pipe_wm) return i915->display.funcs.wm->compute_pipe_wm(state, crtc); @@ -62,7 +62,7 @@ int intel_compute_pipe_wm(struct intel_atomic_state *state, int intel_compute_intermediate_wm(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); if (!i915->display.funcs.wm->compute_intermediate_wm) return 0; @@ -76,7 +76,7 @@ int intel_compute_intermediate_wm(struct intel_atomic_state *state, bool intel_initial_watermarks(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); if (i915->display.funcs.wm->initial_watermarks) { i915->display.funcs.wm->initial_watermarks(state, crtc); @@ -89,7 +89,7 @@ bool intel_initial_watermarks(struct intel_atomic_state *state, void intel_atomic_update_watermarks(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); if (i915->display.funcs.wm->atomic_update_watermarks) i915->display.funcs.wm->atomic_update_watermarks(state, crtc); @@ -98,7 +98,7 @@ void intel_atomic_update_watermarks(struct intel_atomic_state *state, void intel_optimize_watermarks(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); if (i915->display.funcs.wm->optimize_watermarks) i915->display.funcs.wm->optimize_watermarks(state, crtc); @@ -106,7 +106,7 @@ void intel_optimize_watermarks(struct intel_atomic_state *state, int intel_compute_global_watermarks(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); if (i915->display.funcs.wm->compute_global_watermarks) return i915->display.funcs.wm->compute_global_watermarks(state); diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c index 063929a42a42..2e56ddd408ea 100644 --- a/drivers/gpu/drm/i915/display/skl_watermark.c +++ b/drivers/gpu/drm/i915/display/skl_watermark.c @@ -207,7 +207,7 @@ static void skl_sagv_disable(struct drm_i915_private *i915) static void skl_sagv_pre_plane_update(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_bw_state *new_bw_state = intel_atomic_get_new_bw_state(state); @@ -220,7 +220,7 @@ static void skl_sagv_pre_plane_update(struct intel_atomic_state *state) static void skl_sagv_post_plane_update(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_bw_state *new_bw_state = intel_atomic_get_new_bw_state(state); @@ -233,7 +233,7 @@ static void skl_sagv_post_plane_update(struct intel_atomic_state *state) static void icl_sagv_pre_plane_update(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_bw_state *old_bw_state = intel_atomic_get_old_bw_state(state); const struct intel_bw_state *new_bw_state = @@ -265,7 +265,7 @@ static void icl_sagv_pre_plane_update(struct intel_atomic_state *state) static void icl_sagv_post_plane_update(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_bw_state *old_bw_state = intel_atomic_get_old_bw_state(state); const struct intel_bw_state *new_bw_state = @@ -297,7 +297,7 @@ static void icl_sagv_post_plane_update(struct intel_atomic_state *state) void intel_sagv_pre_plane_update(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); /* * Just return if we can't control SAGV or don't have it. @@ -317,7 +317,7 @@ void intel_sagv_pre_plane_update(struct intel_atomic_state *state) void intel_sagv_post_plane_update(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); /* * Just return if we can't control SAGV or don't have it. @@ -433,7 +433,7 @@ bool intel_can_enable_sagv(struct drm_i915_private *i915, static int intel_compute_sagv_mask(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); int ret; struct intel_crtc *crtc; struct intel_crtc_state *new_crtc_state; @@ -594,7 +594,7 @@ static void intel_crtc_dbuf_weights(const struct intel_dbuf_state *dbuf_state, unsigned int *weight_total) { struct drm_i915_private *i915 = - to_i915(dbuf_state->base.state->base.dev); + to_i915(dbuf_state->base.state->base.drm); enum pipe pipe; *weight_start = 0; @@ -2539,7 +2539,7 @@ skl_ddb_add_affected_planes(const struct intel_crtc_state *old_crtc_state, static u8 intel_dbuf_enabled_slices(const struct intel_dbuf_state *dbuf_state) { - struct drm_i915_private *i915 = to_i915(dbuf_state->base.state->base.dev); + struct drm_i915_private *i915 = to_i915(dbuf_state->base.state->base.drm); u8 enabled_slices; enum pipe pipe; @@ -2558,7 +2558,7 @@ static u8 intel_dbuf_enabled_slices(const struct intel_dbuf_state *dbuf_state) static int skl_compute_ddb(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_dbuf_state *old_dbuf_state; struct intel_dbuf_state *new_dbuf_state = NULL; const struct intel_crtc_state *old_crtc_state; @@ -2672,7 +2672,7 @@ static char enast(bool enable) static void skl_print_wm_changes(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_crtc_state *old_crtc_state; const struct intel_crtc_state *new_crtc_state; struct intel_plane *plane; @@ -3446,7 +3446,7 @@ static const struct intel_global_state_funcs intel_dbuf_funcs = { struct intel_dbuf_state * intel_atomic_get_dbuf_state(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); struct intel_global_state *dbuf_state; dbuf_state = intel_atomic_get_global_obj_state(state, &i915->display.dbuf.obj); @@ -3476,7 +3476,7 @@ int intel_dbuf_init(struct drm_i915_private *i915) */ static void update_mbus_pre_enable(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); u32 mbus_ctl, dbuf_min_tracker_val; enum dbuf_slice slice; const struct intel_dbuf_state *dbuf_state = @@ -3511,7 +3511,7 @@ static void update_mbus_pre_enable(struct intel_atomic_state *state) void intel_dbuf_pre_plane_update(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_dbuf_state *new_dbuf_state = intel_atomic_get_new_dbuf_state(state); const struct intel_dbuf_state *old_dbuf_state = @@ -3532,7 +3532,7 @@ void intel_dbuf_pre_plane_update(struct intel_atomic_state *state) void intel_dbuf_post_plane_update(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_dbuf_state *new_dbuf_state = intel_atomic_get_new_dbuf_state(state); const struct intel_dbuf_state *old_dbuf_state = @@ -3570,7 +3570,7 @@ static bool xelpdp_is_only_pipe_per_dbuf_bank(enum pipe pipe, u8 active_pipes) void intel_mbus_dbox_update(struct intel_atomic_state *state) { - struct drm_i915_private *i915 = to_i915(state->base.dev); + struct drm_i915_private *i915 = to_i915(state->base.drm); const struct intel_dbuf_state *new_dbuf_state, *old_dbuf_state; const struct intel_crtc_state *new_crtc_state; const struct intel_crtc *crtc; diff --git a/drivers/gpu/drm/i915/display/skl_watermark.h b/drivers/gpu/drm/i915/display/skl_watermark.h index f91a3d4ddc07..e99171b6cae5 100644 --- a/drivers/gpu/drm/i915/display/skl_watermark.h +++ b/drivers/gpu/drm/i915/display/skl_watermark.h @@ -64,9 +64,9 @@ intel_atomic_get_dbuf_state(struct intel_atomic_state *state); #define to_intel_dbuf_state(x) container_of((x), struct intel_dbuf_state, base) #define intel_atomic_get_old_dbuf_state(state) \ - to_intel_dbuf_state(intel_atomic_get_old_global_obj_state(state, &to_i915(state->base.dev)->display.dbuf.obj)) + to_intel_dbuf_state(intel_atomic_get_old_global_obj_state(state, &to_i915(state->base.drm)->display.dbuf.obj)) #define intel_atomic_get_new_dbuf_state(state) \ - to_intel_dbuf_state(intel_atomic_get_new_global_obj_state(state, &to_i915(state->base.dev)->display.dbuf.obj)) + to_intel_dbuf_state(intel_atomic_get_new_global_obj_state(state, &to_i915(state->base.drm)->display.dbuf.obj)) int intel_dbuf_init(struct drm_i915_private *i915); void intel_dbuf_pre_plane_update(struct intel_atomic_state *state); diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c index ae2f3ab3e73d..8067c814aa66 100644 --- a/drivers/gpu/drm/i915/display/vlv_dsi.c +++ b/drivers/gpu/drm/i915/display/vlv_dsi.c @@ -831,7 +831,7 @@ static void bxt_dsi_enable(struct intel_atomic_state *state, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - drm_WARN_ON(state->base.dev, crtc_state->has_pch_encoder); + drm_WARN_ON(state->base.drm, crtc_state->has_pch_encoder); intel_crtc_vblank_on(crtc_state); } diff --git a/drivers/gpu/drm/imx/ipuv3/imx-drm-core.c b/drivers/gpu/drm/imx/ipuv3/imx-drm-core.c index 4a866ac60fff..6f0cf5c7f732 100644 --- a/drivers/gpu/drm/imx/ipuv3/imx-drm-core.c +++ b/drivers/gpu/drm/imx/ipuv3/imx-drm-core.c @@ -74,7 +74,7 @@ static const struct drm_mode_config_funcs imx_drm_mode_config_funcs = { static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state) { - struct drm_device *dev = state->dev; + struct drm_device *dev = state->drm; struct drm_plane *plane; struct drm_plane_state *old_plane_state, *new_plane_state; bool plane_disabling = false; diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index af3ce5a6a636..26301ccca2ff 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -736,7 +736,7 @@ int mgag200_vga_connector_helper_get_modes(struct drm_connector *connector) static void mgag200_mode_config_helper_atomic_commit_tail(struct drm_atomic_state *state) { - struct mga_device *mdev = to_mga_device(state->dev); + struct mga_device *mdev = to_mga_device(state->drm); /* * Concurrent operations could possibly trigger a call to diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index aa8499de1b9f..6c44e1e65fcc 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -324,7 +324,7 @@ dpu_kms_get_existing_global_state(struct dpu_kms *dpu_kms) */ struct dpu_global_state *dpu_kms_get_global_state(struct drm_atomic_state *s) { - struct msm_drm_private *priv = s->dev->dev_private; + struct msm_drm_private *priv = s->drm->dev_private; struct dpu_kms *dpu_kms = to_dpu_kms(priv->kms); struct drm_private_state *priv_state; int ret; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c index 323079cfd698..b7039b5102d6 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c @@ -81,7 +81,7 @@ mdp5_get_existing_global_state(struct mdp5_kms *mdp5_kms) */ struct mdp5_global_state *mdp5_get_global_state(struct drm_atomic_state *s) { - struct msm_drm_private *priv = s->dev->dev_private; + struct msm_drm_private *priv = s->drm->dev_private; struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(priv->kms)); struct drm_private_state *priv_state; int ret; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_mixer.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_mixer.c index 2536def2a000..cb6198f6c379 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_mixer.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_mixer.c @@ -39,7 +39,7 @@ int mdp5_mixer_assign(struct drm_atomic_state *s, struct drm_crtc *crtc, uint32_t caps, struct mdp5_hw_mixer **mixer, struct mdp5_hw_mixer **r_mixer) { - struct msm_drm_private *priv = s->dev->dev_private; + struct msm_drm_private *priv = s->drm->dev_private; struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(priv->kms)); struct mdp5_global_state *global_state = mdp5_get_global_state(s); struct mdp5_hw_mixer_state *new_state; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_pipe.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_pipe.c index e4b8a789835a..17e0a49f9b75 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_pipe.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_pipe.c @@ -11,7 +11,7 @@ int mdp5_pipe_assign(struct drm_atomic_state *s, struct drm_plane *plane, struct mdp5_hw_pipe **hwpipe, struct mdp5_hw_pipe **r_hwpipe) { - struct msm_drm_private *priv = s->dev->dev_private; + struct msm_drm_private *priv = s->drm->dev_private; struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(priv->kms)); struct mdp5_global_state *new_global_state, *old_global_state; struct mdp5_hw_pipe_state *old_state, *new_state; @@ -121,7 +121,7 @@ int mdp5_pipe_assign(struct drm_atomic_state *s, struct drm_plane *plane, int mdp5_pipe_release(struct drm_atomic_state *s, struct mdp5_hw_pipe *hwpipe) { - struct msm_drm_private *priv = s->dev->dev_private; + struct msm_drm_private *priv = s->drm->dev_private; struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(priv->kms)); struct mdp5_global_state *state; struct mdp5_hw_pipe_state *new_state; diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c index 9c45d641b521..2068b3ade228 100644 --- a/drivers/gpu/drm/msm/msm_atomic.c +++ b/drivers/gpu/drm/msm/msm_atomic.c @@ -201,7 +201,7 @@ int msm_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) void msm_atomic_commit_tail(struct drm_atomic_state *state) { - struct drm_device *dev = state->dev; + struct drm_device *dev = state->drm; struct msm_drm_private *priv = dev->dev_private; struct msm_kms *kms = priv->kms; struct drm_crtc *async_crtc = NULL; diff --git a/drivers/gpu/drm/nouveau/dispnv50/crc.c b/drivers/gpu/drm/nouveau/dispnv50/crc.c index 9c942fbd836d..beeb73e033ea 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/crc.c +++ b/drivers/gpu/drm/nouveau/dispnv50/crc.c @@ -292,7 +292,7 @@ void nv50_crc_atomic_init_notifier_contexts(struct drm_atomic_state *state) void nv50_crc_atomic_release_notifier_contexts(struct drm_atomic_state *state) { const struct nv50_crc_func *func = - nv50_disp(state->dev)->core->func->crc; + nv50_disp(state->drm)->core->func->crc; struct drm_crtc_state *new_crtc_state; struct drm_crtc *crtc; int i; diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 33066b3ab7f1..02f51144d228 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -1941,7 +1941,7 @@ nv50_disp_atomic_commit_core(struct drm_atomic_state *state, u32 *interlock) { struct drm_dp_mst_topology_mgr *mgr; struct drm_dp_mst_topology_state *mst_state; - struct nouveau_drm *drm = nouveau_drm(state->dev); + struct nouveau_drm *drm = nouveau_drm(state->drm); struct nv50_disp *disp = nv50_disp(drm->dev); struct nv50_core *core = disp->core; struct nv50_mstm *mstm; @@ -1987,7 +1987,7 @@ nv50_disp_atomic_commit_wndw(struct drm_atomic_state *state, u32 *interlock) static void nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) { - struct drm_device *dev = state->dev; + struct drm_device *dev = state->drm; struct drm_crtc_state *new_crtc_state, *old_crtc_state; struct drm_crtc *crtc; struct drm_plane_state *new_plane_state; diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index e2697fe80e62..04c42b9f6e5d 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -67,7 +67,7 @@ static void omap_atomic_wait_for_completion(struct drm_device *dev, static void omap_atomic_commit_tail(struct drm_atomic_state *old_state) { - struct drm_device *dev = old_state->dev; + struct drm_device *dev = old_state->drm; struct omap_drm_private *priv = dev->dev_private; bool fence_cookie = dma_fence_begin_signalling(); @@ -244,7 +244,7 @@ omap_get_existing_global_state(struct omap_drm_private *priv) struct omap_global_state *__must_check omap_get_global_state(struct drm_atomic_state *s) { - struct omap_drm_private *priv = s->dev->dev_private; + struct omap_drm_private *priv = s->drm->dev_private; struct drm_private_state *priv_state; priv_state = drm_atomic_get_private_obj_state(s, &priv->glob_obj); diff --git a/drivers/gpu/drm/omapdrm/omap_overlay.c b/drivers/gpu/drm/omapdrm/omap_overlay.c index fb97c74386f2..32f7bd119c2c 100644 --- a/drivers/gpu/drm/omapdrm/omap_overlay.c +++ b/drivers/gpu/drm/omapdrm/omap_overlay.c @@ -74,7 +74,7 @@ int omap_overlay_assign(struct drm_atomic_state *s, struct drm_plane *plane, struct drm_plane **overlay_map = state->hwoverlay_to_plane; struct omap_hw_overlay *ovl, *r_ovl; - ovl = omap_plane_find_free_overlay(s->dev, overlay_map, caps, fourcc); + ovl = omap_plane_find_free_overlay(s->drm, overlay_map, caps, fourcc); if (!ovl) return -ENOMEM; @@ -82,7 +82,7 @@ int omap_overlay_assign(struct drm_atomic_state *s, struct drm_plane *plane, *overlay = ovl; if (r_overlay) { - r_ovl = omap_plane_find_free_overlay(s->dev, overlay_map, + r_ovl = omap_plane_find_free_overlay(s->drm, overlay_map, caps, fourcc); if (!r_ovl) { overlay_map[ovl->idx] = NULL; diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c index adfb36b0e815..0fc8bc9f3fbf 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c @@ -513,7 +513,7 @@ static int rcar_du_atomic_check(struct drm_device *dev, static void rcar_du_atomic_commit_tail(struct drm_atomic_state *old_state) { - struct drm_device *dev = old_state->dev; + struct drm_device *dev = old_state->drm; struct rcar_du_device *rcdu = to_rcar_du_device(dev); struct drm_crtc_state *crtc_state; struct drm_crtc *crtc; diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c index 335fd0edb904..1159e6da1b1d 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.c +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c @@ -470,7 +470,7 @@ static int sun4i_backend_atomic_check(struct sunxi_engine *engine, struct drm_plane_state *plane_states[SUN4I_BACKEND_NUM_LAYERS] = { 0 }; struct sun4i_backend *backend = engine_to_sun4i_backend(engine); struct drm_atomic_state *state = crtc_state->state; - struct drm_device *drm = state->dev; + struct drm_device *drm = state->drm; struct drm_plane *plane; unsigned int num_planes = 0; unsigned int num_alpha_planes = 0; diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index ff36171c8fb7..6cfea8bef59b 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -73,7 +73,7 @@ static void tegra_atomic_post_commit(struct drm_device *drm, static void tegra_atomic_commit_tail(struct drm_atomic_state *old_state) { - struct drm_device *drm = old_state->dev; + struct drm_device *drm = old_state->drm; struct tegra_drm *tegra = drm->dev_private; if (tegra->hub) { diff --git a/drivers/gpu/drm/tidss/tidss_kms.c b/drivers/gpu/drm/tidss/tidss_kms.c index c979ad1af236..bd8b585db093 100644 --- a/drivers/gpu/drm/tidss/tidss_kms.c +++ b/drivers/gpu/drm/tidss/tidss_kms.c @@ -23,7 +23,7 @@ static void tidss_atomic_commit_tail(struct drm_atomic_state *old_state) { - struct drm_device *ddev = old_state->dev; + struct drm_device *ddev = old_state->drm; struct tidss_device *tidss = to_tidss(ddev); bool fence_cookie = dma_fence_begin_signalling(); diff --git a/drivers/gpu/drm/vc4/tests/vc4_mock_output.c b/drivers/gpu/drm/vc4/tests/vc4_mock_output.c index 6e11fcc9ef45..8a34fbf2ecfb 100644 --- a/drivers/gpu/drm/vc4/tests/vc4_mock_output.c +++ b/drivers/gpu/drm/vc4/tests/vc4_mock_output.c @@ -65,7 +65,7 @@ int vc4_mock_atomic_add_output(struct kunit *test, struct drm_atomic_state *state, enum vc4_encoder_type type) { - struct drm_device *drm = state->dev; + struct drm_device *drm = state->drm; struct drm_connector_state *conn_state; struct drm_crtc_state *crtc_state; struct vc4_dummy_output *output; @@ -103,7 +103,7 @@ int vc4_mock_atomic_del_output(struct kunit *test, struct drm_atomic_state *state, enum vc4_encoder_type type) { - struct drm_device *drm = state->dev; + struct drm_device *drm = state->drm; struct drm_connector_state *conn_state; struct drm_crtc_state *crtc_state; struct vc4_dummy_output *output; diff --git a/drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c b/drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c index ae0bd0f81698..9e66cc136f5b 100644 --- a/drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c +++ b/drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c @@ -124,7 +124,7 @@ get_vc4_crtc_state_for_encoder(struct kunit *test, const struct drm_atomic_state *state, enum vc4_encoder_type type) { - struct drm_device *drm = state->dev; + struct drm_device *drm = state->drm; struct drm_crtc_state *new_crtc_state; struct drm_encoder *encoder; struct drm_crtc *crtc; diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index 5495f2a94fa9..e66918d7ce69 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -46,7 +46,7 @@ struct vc4_load_tracker_state { static struct vc4_ctm_state *vc4_get_ctm_state(struct drm_atomic_state *state, struct drm_private_obj *manager) { - struct drm_device *dev = state->dev; + struct drm_device *dev = state->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); struct drm_private_state *priv_state; int ret; @@ -169,7 +169,7 @@ vc4_ctm_commit(struct vc4_dev *vc4, struct drm_atomic_state *state) struct vc4_hvs_state * vc4_hvs_get_new_global_state(const struct drm_atomic_state *state) { - struct vc4_dev *vc4 = to_vc4_dev(state->dev); + struct vc4_dev *vc4 = to_vc4_dev(state->drm); struct drm_private_state *priv_state; priv_state = drm_atomic_get_new_private_obj_state(state, &vc4->hvs_channels); @@ -182,7 +182,7 @@ vc4_hvs_get_new_global_state(const struct drm_atomic_state *state) struct vc4_hvs_state * vc4_hvs_get_old_global_state(const struct drm_atomic_state *state) { - struct vc4_dev *vc4 = to_vc4_dev(state->dev); + struct vc4_dev *vc4 = to_vc4_dev(state->drm); struct drm_private_state *priv_state; priv_state = drm_atomic_get_old_private_obj_state(state, &vc4->hvs_channels); @@ -195,7 +195,7 @@ vc4_hvs_get_old_global_state(const struct drm_atomic_state *state) struct vc4_hvs_state * vc4_hvs_get_global_state(struct drm_atomic_state *state) { - struct vc4_dev *vc4 = to_vc4_dev(state->dev); + struct vc4_dev *vc4 = to_vc4_dev(state->drm); struct drm_private_state *priv_state; priv_state = drm_atomic_get_private_obj_state(state, &vc4->hvs_channels); @@ -322,7 +322,7 @@ static void vc5_hvs_pv_muxing_commit(struct vc4_dev *vc4, static void vc4_atomic_commit_tail(struct drm_atomic_state *state) { - struct drm_device *dev = state->dev; + struct drm_device *dev = state->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_hvs *hvs = vc4->hvs; struct drm_crtc_state *new_crtc_state; @@ -571,7 +571,7 @@ vc4_ctm_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) static int vc4_load_tracker_atomic_check(struct drm_atomic_state *state) { struct drm_plane_state *old_plane_state, *new_plane_state; - struct vc4_dev *vc4 = to_vc4_dev(state->dev); + struct vc4_dev *vc4 = to_vc4_dev(state->drm); struct vc4_load_tracker_state *load_state; struct drm_private_state *priv_state; struct drm_plane *plane; @@ -920,7 +920,7 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, static int vc4_core_clock_atomic_check(struct drm_atomic_state *state) { - struct vc4_dev *vc4 = to_vc4_dev(state->dev); + struct vc4_dev *vc4 = to_vc4_dev(state->drm); struct drm_private_state *priv_state; struct vc4_hvs_state *hvs_new_state; struct vc4_load_tracker_state *load_state; diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c index e3c9c9571c8d..a58d7e0d3078 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -63,7 +63,7 @@ static void vkms_release(struct drm_device *dev) static void vkms_atomic_commit_tail(struct drm_atomic_state *old_state) { - struct drm_device *dev = old_state->dev; + struct drm_device *dev = old_state->drm; struct drm_crtc *crtc; struct drm_crtc_state *old_crtc_state; int i; diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index 9a022caacf93..675ee54f2a28 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -348,7 +348,7 @@ struct __drm_private_objs_state { /** * struct drm_atomic_state - the global state object for atomic updates * @ref: count of all references to this state (will not be freed until zero) - * @dev: parent DRM device + * @drm: parent DRM device * @async_update: hint for asynchronous plane update * @planes: pointer to array of structures with per-plane data * @crtcs: pointer to array of CRTC pointers @@ -365,7 +365,7 @@ struct __drm_private_objs_state { struct drm_atomic_state { struct kref ref; - struct drm_device *dev; + struct drm_device *drm; /** * @allow_modeset: @@ -826,7 +826,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); */ #define for_each_oldnew_crtc_in_state(__state, crtc, old_crtc_state, new_crtc_state, __i) \ for ((__i) = 0; \ - (__i) < (__state)->dev->mode_config.num_crtc; \ + (__i) < (__state)->drm->mode_config.num_crtc; \ (__i)++) \ for_each_if ((__state)->crtcs[__i].ptr && \ ((crtc) = (__state)->crtcs[__i].ptr, \ @@ -849,7 +849,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); */ #define for_each_old_crtc_in_state(__state, crtc, old_crtc_state, __i) \ for ((__i) = 0; \ - (__i) < (__state)->dev->mode_config.num_crtc; \ + (__i) < (__state)->drm->mode_config.num_crtc; \ (__i)++) \ for_each_if ((__state)->crtcs[__i].ptr && \ ((crtc) = (__state)->crtcs[__i].ptr, \ @@ -869,7 +869,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); */ #define for_each_new_crtc_in_state(__state, crtc, new_crtc_state, __i) \ for ((__i) = 0; \ - (__i) < (__state)->dev->mode_config.num_crtc; \ + (__i) < (__state)->drm->mode_config.num_crtc; \ (__i)++) \ for_each_if ((__state)->crtcs[__i].ptr && \ ((crtc) = (__state)->crtcs[__i].ptr, \ @@ -891,7 +891,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); */ #define for_each_oldnew_plane_in_state(__state, plane, old_plane_state, new_plane_state, __i) \ for ((__i) = 0; \ - (__i) < (__state)->dev->mode_config.num_total_plane; \ + (__i) < (__state)->drm->mode_config.num_total_plane; \ (__i)++) \ for_each_if ((__state)->planes[__i].ptr && \ ((plane) = (__state)->planes[__i].ptr, \ @@ -913,7 +913,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); * state delta needs to be considered, for example in atomic check functions. */ #define for_each_oldnew_plane_in_state_reverse(__state, plane, old_plane_state, new_plane_state, __i) \ - for ((__i) = ((__state)->dev->mode_config.num_total_plane - 1); \ + for ((__i) = ((__state)->drm->mode_config.num_total_plane - 1); \ (__i) >= 0; \ (__i)--) \ for_each_if ((__state)->planes[__i].ptr && \ @@ -930,7 +930,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); * @__i: int iteration cursor, for macro-internal use */ #define for_each_new_plane_in_state_reverse(__state, plane, new_plane_state, __i) \ - for ((__i) = ((__state)->dev->mode_config.num_total_plane - 1); \ + for ((__i) = ((__state)->drm->mode_config.num_total_plane - 1); \ (__i) >= 0; \ (__i)--) \ for_each_if ((__state)->planes[__i].ptr && \ @@ -950,7 +950,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); */ #define for_each_old_plane_in_state(__state, plane, old_plane_state, __i) \ for ((__i) = 0; \ - (__i) < (__state)->dev->mode_config.num_total_plane; \ + (__i) < (__state)->drm->mode_config.num_total_plane; \ (__i)++) \ for_each_if ((__state)->planes[__i].ptr && \ ((plane) = (__state)->planes[__i].ptr, \ @@ -968,7 +968,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); */ #define for_each_new_plane_in_state(__state, plane, new_plane_state, __i) \ for ((__i) = 0; \ - (__i) < (__state)->dev->mode_config.num_total_plane; \ + (__i) < (__state)->drm->mode_config.num_total_plane; \ (__i)++) \ for_each_if ((__state)->planes[__i].ptr && \ ((plane) = (__state)->planes[__i].ptr, \ diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h index 536a0b0091c3..cdddabfc5d57 100644 --- a/include/drm/drm_atomic_helper.h +++ b/include/drm/drm_atomic_helper.h @@ -186,7 +186,7 @@ int drm_atomic_helper_page_flip_target( * validate the incoming state. */ #define drm_atomic_crtc_state_for_each_plane(plane, crtc_state) \ - drm_for_each_plane_mask(plane, (crtc_state)->state->dev, (crtc_state)->plane_mask) + drm_for_each_plane_mask(plane, (crtc_state)->state->drm, (crtc_state)->plane_mask) /** * drm_atomic_crtc_state_for_each_plane_state - iterate over attached planes in new state @@ -204,7 +204,7 @@ int drm_atomic_helper_page_flip_target( * active planes on this CRTC, but does not need to change it. */ #define drm_atomic_crtc_state_for_each_plane_state(plane, plane_state, crtc_state) \ - drm_for_each_plane_mask(plane, (crtc_state)->state->dev, (crtc_state)->plane_mask) \ + drm_for_each_plane_mask(plane, (crtc_state)->state->drm, (crtc_state)->plane_mask) \ for_each_if ((plane_state = \ __drm_atomic_get_current_plane_state((crtc_state)->state, \ plane))) From patchwork Thu Jul 13 08:23:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311541 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31B12EB64DD for ; Thu, 13 Jul 2023 08:25:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F35EA10E62A; Thu, 13 Jul 2023 08:25:08 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3F40A882AF for ; Thu, 13 Jul 2023 08:25:04 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrcc-0005qM-R1; Thu, 13 Jul 2023 10:24:22 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrca-00E4j9-SO; Thu, 13 Jul 2023 10:24:20 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrca-004Vgo-2c; Thu, 13 Jul 2023 10:24:20 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 02/17] drm/bridge: Rename struct drm_bridge::dev to drm Date: Thu, 13 Jul 2023 10:23:53 +0200 Message-Id: <20230713082408.2266984-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=31782; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OLbP+/dafnwf7T/HvWfsTcUifbKiVQWgJbT8z8cwjS0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7SDo/2b8wxYPmz5GWLYqbT2QJ+Lv1+e0NZfQ GFeBIgCenSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0gwAKCRCPgPtYfRL+ TgOyB/4jhUIjQt/reZlb3UtyQXF/4hX/WR+OkShsR33I0s6VrleIPjV5q/zFZ5Rq3x++G2onODO 88nueEI2nHUKek+Ox2HMD18EDkR6CFEWJdYzI2Xb7XL02yHmoGD0/LOhEhikL3HGskvVqqyJg+o 2MzV/GVjrLlsZDwB3vjZOPCAV9vULGxOtAQYUgOOpWTWunwrnrOaQOiYKyCDu9jbKQkW0V1XjmS 9d5mq8gSlgqB4HhrKAhM5u/TH3Z2ySO6P5xBbLc32aqJIKc2E6ow49BIIVJmxwAjGsyuMupNC+R O6hqhVgZ1oYuCwmKDakHvABtricbYBd6RJ3h9AwqCqU6jJg9 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 2 +- drivers/gpu/drm/bridge/analogix/analogix-anx6345.c | 4 ++-- drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 4 ++-- drivers/gpu/drm/bridge/analogix/anx7625.c | 6 +++--- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 2 +- .../gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 14 +++++++------- drivers/gpu/drm/bridge/chrontel-ch7033.c | 4 ++-- drivers/gpu/drm/bridge/ite-it6505.c | 8 ++++---- drivers/gpu/drm/bridge/lontium-lt8912b.c | 6 +++--- drivers/gpu/drm/bridge/lontium-lt9611.c | 4 ++-- drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 2 +- .../drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 6 +++--- drivers/gpu/drm/bridge/nxp-ptn3460.c | 5 +++-- drivers/gpu/drm/bridge/panel.c | 4 ++-- drivers/gpu/drm/bridge/parade-ps8640.c | 5 +++-- drivers/gpu/drm/bridge/sii902x.c | 6 +++--- drivers/gpu/drm/bridge/simple-bridge.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 6 +++--- drivers/gpu/drm/bridge/tc358767.c | 6 +++--- drivers/gpu/drm/bridge/tc358768.c | 2 +- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 7 ++++--- drivers/gpu/drm/bridge/ti-tfp410.c | 6 +++--- drivers/gpu/drm/drm_bridge.c | 14 +++++++------- drivers/gpu/drm/i2c/tda998x_drv.c | 2 +- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 ++-- drivers/gpu/drm/mcde/mcde_dsi.c | 2 +- drivers/gpu/drm/mediatek/mtk_dp.c | 8 ++++---- drivers/gpu/drm/meson/meson_dw_hdmi.c | 2 +- drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 6 +++--- drivers/gpu/drm/xlnx/zynqmp_dp.c | 2 +- include/drm/drm_bridge.h | 4 ++-- 31 files changed, 79 insertions(+), 76 deletions(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index 2254457ab5d0..52da4df1cc52 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -864,7 +864,7 @@ static int adv7511_connector_init(struct adv7511 *adv) adv->connector.polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; - ret = drm_connector_init(bridge->dev, &adv->connector, + ret = drm_connector_init(bridge->drm, &adv->connector, &adv7511_connector_funcs, DRM_MODE_CONNECTOR_HDMIA); if (ret < 0) { diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c index 72ab2ab77081..abb37a523499 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c @@ -536,7 +536,7 @@ static int anx6345_bridge_attach(struct drm_bridge *bridge, /* Register aux channel */ anx6345->aux.name = "DP-AUX"; anx6345->aux.dev = &anx6345->client->dev; - anx6345->aux.drm_dev = bridge->dev; + anx6345->aux.drm_dev = bridge->drm; anx6345->aux.transfer = anx6345_aux_transfer; err = drm_dp_aux_register(&anx6345->aux); @@ -545,7 +545,7 @@ static int anx6345_bridge_attach(struct drm_bridge *bridge, return err; } - err = drm_connector_init(bridge->dev, &anx6345->connector, + err = drm_connector_init(bridge->drm, &anx6345->connector, &anx6345_connector_funcs, DRM_MODE_CONNECTOR_eDP); if (err) { diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c index 06a3e3243e19..0b66b72a5913 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c @@ -905,7 +905,7 @@ static int anx78xx_bridge_attach(struct drm_bridge *bridge, /* Register aux channel */ anx78xx->aux.name = "DP-AUX"; anx78xx->aux.dev = &anx78xx->client->dev; - anx78xx->aux.drm_dev = bridge->dev; + anx78xx->aux.drm_dev = bridge->drm; anx78xx->aux.transfer = anx78xx_aux_transfer; err = drm_dp_aux_register(&anx78xx->aux); @@ -914,7 +914,7 @@ static int anx78xx_bridge_attach(struct drm_bridge *bridge, return err; } - err = drm_connector_init(bridge->dev, &anx78xx->connector, + err = drm_connector_init(bridge->drm, &anx78xx->connector, &anx78xx_connector_funcs, DRM_MODE_CONNECTOR_DisplayPort); if (err) { diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 8b985efdc086..9156c74a7b3b 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -1483,7 +1483,7 @@ static int _anx7625_hpd_polling(struct anx7625_data *ctx, anx7625_start_dp_work(ctx); if (!ctx->pdata.panel_bridge && ctx->bridge_attached) - drm_helper_hpd_irq_event(ctx->bridge.dev); + drm_helper_hpd_irq_event(ctx->bridge.drm); return 0; } @@ -1601,7 +1601,7 @@ static void anx7625_work_func(struct work_struct *work) goto unlock; if (ctx->bridge_attached) - drm_helper_hpd_irq_event(ctx->bridge.dev); + drm_helper_hpd_irq_event(ctx->bridge.drm); unlock: mutex_unlock(&ctx->lock); @@ -2185,7 +2185,7 @@ static int anx7625_bridge_attach(struct drm_bridge *bridge, return -ENODEV; } - ctx->aux.drm_dev = bridge->dev; + ctx->aux.drm_dev = bridge->drm; err = drm_dp_aux_register(&ctx->aux); if (err) { dev_err(dev, "failed to register aux channel: %d\n", err); diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c index f50d65f54314..6314047d47b1 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -612,7 +612,7 @@ static int cdns_dsi_bridge_attach(struct drm_bridge *bridge, struct cdns_dsi *dsi = input_to_dsi(input); struct cdns_dsi_output *output = &dsi->output; - if (!drm_core_check_feature(bridge->dev, DRIVER_ATOMIC)) { + if (!drm_core_check_feature(bridge->drm, DRIVER_ATOMIC)) { dev_err(dsi->base.dev, "cdns-dsi driver is only compatible with DRM devices supporting atomic updates"); return -ENOTSUPP; diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index ecb935e46b62..d102db6d4c65 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -812,7 +812,7 @@ static void cdns_mhdp_fw_cb(const struct firmware *fw, void *context) spin_unlock(&mhdp->start_lock); if (bridge_attached) { if (mhdp->connector.dev) - drm_kms_helper_hotplug_event(mhdp->bridge.dev); + drm_kms_helper_hotplug_event(mhdp->bridge.drm); else drm_bridge_hpd_notify(&mhdp->bridge, cdns_mhdp_detect(mhdp)); } @@ -1703,7 +1703,7 @@ static int cdns_mhdp_connector_init(struct cdns_mhdp_device *mhdp) conn->polled = DRM_CONNECTOR_POLL_HPD; - ret = drm_connector_init(bridge->dev, conn, &cdns_mhdp_conn_funcs, + ret = drm_connector_init(bridge->drm, conn, &cdns_mhdp_conn_funcs, DRM_MODE_CONNECTOR_DisplayPort); if (ret) { dev_err(mhdp->dev, "Failed to initialize connector with drm\n"); @@ -1738,7 +1738,7 @@ static int cdns_mhdp_attach(struct drm_bridge *bridge, dev_dbg(mhdp->dev, "%s\n", __func__); - mhdp->aux.drm_dev = bridge->dev; + mhdp->aux.drm_dev = bridge->drm; ret = drm_dp_aux_register(&mhdp->aux); if (ret < 0) return ret; @@ -2057,7 +2057,7 @@ static void cdns_mhdp_atomic_enable(struct drm_bridge *bridge, mhdp_state = to_cdns_mhdp_bridge_state(new_state); - mhdp_state->current_mode = drm_mode_duplicate(bridge->dev, mode); + mhdp_state->current_mode = drm_mode_duplicate(bridge->drm, mode); drm_mode_set_name(mhdp_state->current_mode); dev_dbg(mhdp->dev, "%s: Enabling mode %s\n", __func__, mode->name); @@ -2142,7 +2142,7 @@ cdns_mhdp_bridge_atomic_destroy_state(struct drm_bridge *bridge, cdns_mhdp_state = to_cdns_mhdp_bridge_state(state); if (cdns_mhdp_state->current_mode) { - drm_mode_destroy(bridge->dev, cdns_mhdp_state->current_mode); + drm_mode_destroy(bridge->drm, cdns_mhdp_state->current_mode); cdns_mhdp_state->current_mode = NULL; } @@ -2377,7 +2377,7 @@ static void cdns_mhdp_modeset_retry_fn(struct work_struct *work) mutex_unlock(&conn->dev->mode_config.mutex); /* Send Hotplug uevent so userspace can reprobe */ - drm_kms_helper_hotplug_event(mhdp->bridge.dev); + drm_kms_helper_hotplug_event(mhdp->bridge.drm); } static irqreturn_t cdns_mhdp_irq_handler(int irq, void *data) @@ -2445,7 +2445,7 @@ static void cdns_mhdp_hpd_work(struct work_struct *work) if (ret < 0) schedule_work(&mhdp->modeset_retry_work); else - drm_kms_helper_hotplug_event(mhdp->bridge.dev); + drm_kms_helper_hotplug_event(mhdp->bridge.drm); } else { drm_bridge_hpd_notify(&mhdp->bridge, cdns_mhdp_detect(mhdp)); } diff --git a/drivers/gpu/drm/bridge/chrontel-ch7033.c b/drivers/gpu/drm/bridge/chrontel-ch7033.c index a854eb84e399..9c12e1652e4a 100644 --- a/drivers/gpu/drm/bridge/chrontel-ch7033.c +++ b/drivers/gpu/drm/bridge/chrontel-ch7033.c @@ -263,7 +263,7 @@ static void ch7033_hpd_event(void *arg, enum drm_connector_status status) { struct ch7033_priv *priv = arg; - if (priv->bridge.dev) + if (priv->bridge.drm) drm_helper_hpd_irq_event(priv->connector.dev); } @@ -296,7 +296,7 @@ static int ch7033_bridge_attach(struct drm_bridge *bridge, drm_connector_helper_add(connector, &ch7033_connector_helper_funcs); - ret = drm_connector_init_with_ddc(bridge->dev, &priv->connector, + ret = drm_connector_init_with_ddc(bridge->drm, &priv->connector, &ch7033_connector_funcs, priv->next_bridge->type, priv->next_bridge->ddc); diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c index 504d51c42f79..e2340000ba11 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2387,8 +2387,8 @@ static void it6505_irq_hpd(struct it6505 *it6505) it6505_link_reset_step_train(it6505); } - if (it6505->bridge.dev) - drm_helper_hpd_irq_event(it6505->bridge.dev); + if (it6505->bridge.drm) + drm_helper_hpd_irq_event(it6505->bridge.drm); } static void it6505_irq_hpd_irq(struct it6505 *it6505) @@ -2727,7 +2727,7 @@ static void it6505_extcon_work(struct work_struct *work) pm_runtime_put_sync(dev); reinit_completion(&it6505->extcon_completion); - drm_helper_hpd_irq_event(it6505->bridge.dev); + drm_helper_hpd_irq_event(it6505->bridge.drm); memset(it6505->dpcd, 0, sizeof(it6505->dpcd)); DRM_DEV_DEBUG_DRIVER(dev, "power off it6505 success!"); } @@ -2883,7 +2883,7 @@ static int it6505_bridge_attach(struct drm_bridge *bridge, } /* Register aux channel */ - it6505->aux.drm_dev = bridge->dev; + it6505->aux.drm_dev = bridge->drm; ret = drm_dp_aux_register(&it6505->aux); diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c index 4eaea67fb71c..d275d2cb6a86 100644 --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c @@ -520,8 +520,8 @@ static void lt8912_bridge_hpd_cb(void *data, enum drm_connector_status status) { struct lt8912 *lt = data; - if (lt->bridge.dev) - drm_helper_hpd_irq_event(lt->bridge.dev); + if (lt->bridge.drm) + drm_helper_hpd_irq_event(lt->bridge.drm); } static int lt8912_bridge_connector_init(struct drm_bridge *bridge) @@ -538,7 +538,7 @@ static int lt8912_bridge_connector_init(struct drm_bridge *bridge) DRM_CONNECTOR_POLL_DISCONNECT; } - ret = drm_connector_init(bridge->dev, connector, + ret = drm_connector_init(bridge->drm, connector, <8912_connector_funcs, lt->hdmi_port->type); if (ret) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c index 5163e5224aad..89b91faf4c83 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c @@ -435,8 +435,8 @@ static irqreturn_t lt9611_irq_thread_handler(int irq, void *dev_id) regmap_write(lt9611->regmap, 0x8207, 0x3f); } - if (irq_flag3 & 0xc0 && lt9611->bridge.dev) - drm_kms_helper_hotplug_event(lt9611->bridge.dev); + if (irq_flag3 & 0xc0 && lt9611->bridge.drm) + drm_kms_helper_hotplug_event(lt9611->bridge.drm); /* video input changed */ if (irq_flag0 & 0x01) { diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c index 22c84d29c2bc..9189d2c3cdc8 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c @@ -347,7 +347,7 @@ static int lt9611uxc_connector_init(struct drm_bridge *bridge, struct lt9611uxc drm_connector_helper_add(<9611uxc->connector, <9611uxc_bridge_connector_helper_funcs); - ret = drm_connector_init(bridge->dev, <9611uxc->connector, + ret = drm_connector_init(bridge->drm, <9611uxc->connector, <9611uxc_bridge_connector_funcs, DRM_MODE_CONNECTOR_HDMIA); if (ret) { diff --git a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c index 460db3c8a08c..5c6edf47c1e0 100644 --- a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c +++ b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c @@ -214,7 +214,7 @@ static int ge_b850v3_lvds_create_connector(struct drm_bridge *bridge) drm_connector_helper_add(connector, &ge_b850v3_lvds_connector_helper_funcs); - ret = drm_connector_init(bridge->dev, connector, + ret = drm_connector_init(bridge->drm, connector, &ge_b850v3_lvds_connector_funcs, DRM_MODE_CONNECTOR_DisplayPort); if (ret) { @@ -234,8 +234,8 @@ static irqreturn_t ge_b850v3_lvds_irq_handler(int irq, void *dev_id) STDP4028_DPTX_IRQ_STS_REG, STDP4028_DPTX_IRQ_CLEAR); - if (ge_b850v3_lvds_ptr->bridge.dev) - drm_kms_helper_hotplug_event(ge_b850v3_lvds_ptr->bridge.dev); + if (ge_b850v3_lvds_ptr->bridge.drm) + drm_kms_helper_hotplug_event(ge_b850v3_lvds_ptr->bridge.drm); return IRQ_HANDLED; } diff --git a/drivers/gpu/drm/bridge/nxp-ptn3460.c b/drivers/gpu/drm/bridge/nxp-ptn3460.c index d81920227a8a..27b01a2c216e 100644 --- a/drivers/gpu/drm/bridge/nxp-ptn3460.c +++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c @@ -233,8 +233,9 @@ static int ptn3460_bridge_attach(struct drm_bridge *bridge, } ptn_bridge->connector.polled = DRM_CONNECTOR_POLL_HPD; - ret = drm_connector_init(bridge->dev, &ptn_bridge->connector, - &ptn3460_connector_funcs, DRM_MODE_CONNECTOR_LVDS); + ret = drm_connector_init(bridge->drm, &ptn_bridge->connector, + &ptn3460_connector_funcs, + DRM_MODE_CONNECTOR_LVDS); if (ret) { DRM_ERROR("Failed to initialize connector with drm\n"); return ret; diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index 9316384b4474..d5ce29a74910 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -73,7 +73,7 @@ static int panel_bridge_attach(struct drm_bridge *bridge, drm_connector_helper_add(connector, &panel_bridge_connector_helper_funcs); - ret = drm_connector_init(bridge->dev, connector, + ret = drm_connector_init(bridge->drm, connector, &panel_bridge_connector_funcs, panel_bridge->connector_type); if (ret) { @@ -86,7 +86,7 @@ static int panel_bridge_attach(struct drm_bridge *bridge, drm_connector_attach_encoder(&panel_bridge->connector, bridge->encoder); - if (bridge->dev->registered) { + if (bridge->drm->registered) { if (connector->funcs->reset) connector->funcs->reset(connector); drm_connector_register(connector); diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c b/drivers/gpu/drm/bridge/parade-ps8640.c index 8161b1a1a4b1..804fe0c6d276 100644 --- a/drivers/gpu/drm/bridge/parade-ps8640.c +++ b/drivers/gpu/drm/bridge/parade-ps8640.c @@ -482,14 +482,15 @@ static int ps8640_bridge_attach(struct drm_bridge *bridge, if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) return -EINVAL; - ps_bridge->aux.drm_dev = bridge->dev; + ps_bridge->aux.drm_dev = bridge->drm; ret = drm_dp_aux_register(&ps_bridge->aux); if (ret) { dev_err(dev, "failed to register DP AUX channel: %d\n", ret); return ret; } - ps_bridge->link = device_link_add(bridge->dev->dev, dev, DL_FLAG_STATELESS); + ps_bridge->link = device_link_add(bridge->drm->dev, dev, + DL_FLAG_STATELESS); if (!ps_bridge->link) { dev_err(dev, "failed to create device link"); ret = -EINVAL; diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c index 2bdc5b439beb..1370a09c0efe 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -421,7 +421,7 @@ static int sii902x_bridge_attach(struct drm_bridge *bridge, { struct sii902x *sii902x = bridge_to_sii902x(bridge); u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; - struct drm_device *drm = bridge->dev; + struct drm_device *drm = bridge->drm; int ret; if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) @@ -907,8 +907,8 @@ static irqreturn_t sii902x_interrupt(int irq, void *data) mutex_unlock(&sii902x->mutex); - if ((status & SII902X_HOTPLUG_EVENT) && sii902x->bridge.dev) { - drm_helper_hpd_irq_event(sii902x->bridge.dev); + if ((status & SII902X_HOTPLUG_EVENT) && sii902x->bridge.drm) { + drm_helper_hpd_irq_event(sii902x->bridge.drm); drm_bridge_hpd_notify(&sii902x->bridge, (status & SII902X_PLUGGED_STATUS) ? connector_status_connected : connector_status_disconnected); diff --git a/drivers/gpu/drm/bridge/simple-bridge.c b/drivers/gpu/drm/bridge/simple-bridge.c index d85d9ee463b8..3b94fa14de4b 100644 --- a/drivers/gpu/drm/bridge/simple-bridge.c +++ b/drivers/gpu/drm/bridge/simple-bridge.c @@ -121,7 +121,7 @@ static int simple_bridge_attach(struct drm_bridge *bridge, drm_connector_helper_add(&sbridge->connector, &simple_bridge_con_helper_funcs); - ret = drm_connector_init_with_ddc(bridge->dev, &sbridge->connector, + ret = drm_connector_init_with_ddc(bridge->drm, &sbridge->connector, &simple_bridge_con_funcs, sbridge->info->connector_type, sbridge->next_bridge->ddc); diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 22d43136cbe7..10d414c750a7 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2584,7 +2584,7 @@ static int dw_hdmi_connector_create(struct dw_hdmi *hdmi) drm_connector_helper_add(connector, &dw_hdmi_connector_helper_funcs); - drm_connector_init_with_ddc(hdmi->bridge.dev, connector, + drm_connector_init_with_ddc(hdmi->bridge.drm, connector, &dw_hdmi_connector_funcs, DRM_MODE_CONNECTOR_HDMIA, hdmi->ddc); @@ -3135,8 +3135,8 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) status == connector_status_connected ? "plugin" : "plugout"); - if (hdmi->bridge.dev) { - drm_helper_hpd_irq_event(hdmi->bridge.dev); + if (hdmi->bridge.drm) { + drm_helper_hpd_irq_event(hdmi->bridge.drm); drm_bridge_hpd_notify(&hdmi->bridge, status); } } diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index eaa7edb080fa..8e6cba732d3e 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1672,7 +1672,7 @@ static int tc_edp_bridge_attach(struct drm_bridge *bridge, { u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; struct tc_data *tc = bridge_to_tc(bridge); - struct drm_device *drm = bridge->dev; + struct drm_device *drm = bridge->drm; int ret; if (tc->panel_bridge) { @@ -2034,7 +2034,7 @@ static irqreturn_t tc_irq_handler(int irq, void *arg) dev_err(tc->dev, "syserr %x\n", stat); } - if (tc->hpd_pin >= 0 && tc->bridge.dev) { + if (tc->hpd_pin >= 0 && tc->bridge.drm) { /* * H is triggered when the GPIO goes high. * @@ -2048,7 +2048,7 @@ static irqreturn_t tc_irq_handler(int irq, void *arg) h ? "H" : "", lc ? "LC" : ""); if (h || lc) - drm_kms_helper_hotplug_event(tc->bridge.dev); + drm_kms_helper_hotplug_event(tc->bridge.drm); } regmap_write(tc->regmap, INTSTS_G, val); diff --git a/drivers/gpu/drm/bridge/tc358768.c b/drivers/gpu/drm/bridge/tc358768.c index 819a4b6ec2a0..cd99ea5ccddc 100644 --- a/drivers/gpu/drm/bridge/tc358768.c +++ b/drivers/gpu/drm/bridge/tc358768.c @@ -531,7 +531,7 @@ static int tc358768_bridge_attach(struct drm_bridge *bridge, { struct tc358768_priv *priv = bridge_to_tc358768(bridge); - if (!drm_core_check_feature(bridge->dev, DRIVER_ATOMIC)) { + if (!drm_core_check_feature(bridge->drm, DRIVER_ATOMIC)) { dev_err(priv->dev, "needs atomic updates support\n"); return -ENOTSUPP; } diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index c499a14d0b98..2e7e1adbc355 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -725,10 +725,11 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge, struct ti_sn65dsi86 *pdata = bridge_to_ti_sn65dsi86(bridge); int ret; - pdata->aux.drm_dev = bridge->dev; + pdata->aux.drm_dev = bridge->drm; ret = drm_dp_aux_register(&pdata->aux); if (ret < 0) { - drm_err(bridge->dev, "Failed to register DP AUX channel: %d\n", ret); + drm_err(bridge->drm, + "Failed to register DP AUX channel: %d\n", ret); return ret; } @@ -744,7 +745,7 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge, if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) return 0; - pdata->connector = drm_bridge_connector_init(pdata->bridge.dev, + pdata->connector = drm_bridge_connector_init(pdata->bridge.drm, pdata->bridge.encoder); if (IS_ERR(pdata->connector)) { ret = PTR_ERR(pdata->connector); diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index 22b07260a78e..3d8ecc6d78ef 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -107,8 +107,8 @@ static void tfp410_hpd_work_func(struct work_struct *work) dvi = container_of(work, struct tfp410, hpd_work.work); - if (dvi->bridge.dev) - drm_helper_hpd_irq_event(dvi->bridge.dev); + if (dvi->bridge.drm) + drm_helper_hpd_irq_event(dvi->bridge.drm); } static void tfp410_hpd_callback(void *arg, enum drm_connector_status status) @@ -151,7 +151,7 @@ static int tfp410_attach(struct drm_bridge *bridge, drm_connector_helper_add(&dvi->connector, &tfp410_con_helper_funcs); - ret = drm_connector_init_with_ddc(bridge->dev, &dvi->connector, + ret = drm_connector_init_with_ddc(bridge->drm, &dvi->connector, &tfp410_con_funcs, dvi->next_bridge->type, dvi->next_bridge->ddc); diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index c3d69af02e79..cdc373f56ce6 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -305,13 +305,13 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, if (!encoder || !bridge) return -EINVAL; - if (previous && (!previous->dev || previous->encoder != encoder)) + if (previous && (!previous->drm || previous->encoder != encoder)) return -EINVAL; - if (bridge->dev) + if (bridge->drm) return -EBUSY; - bridge->dev = encoder->dev; + bridge->drm = encoder->dev; bridge->encoder = encoder; if (previous) @@ -334,7 +334,7 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, goto err_detach_bridge; } - drm_atomic_private_obj_init(bridge->dev, &bridge->base, + drm_atomic_private_obj_init(bridge->drm, &bridge->base, &state->base, &drm_bridge_priv_state_funcs); } @@ -346,7 +346,7 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, bridge->funcs->detach(bridge); err_reset_bridge: - bridge->dev = NULL; + bridge->drm = NULL; bridge->encoder = NULL; list_del(&bridge->chain_node); @@ -367,7 +367,7 @@ void drm_bridge_detach(struct drm_bridge *bridge) if (WARN_ON(!bridge)) return; - if (WARN_ON(!bridge->dev)) + if (WARN_ON(!bridge->drm)) return; if (bridge->funcs->atomic_reset) @@ -377,7 +377,7 @@ void drm_bridge_detach(struct drm_bridge *bridge) bridge->funcs->detach(bridge); list_del(&bridge->chain_node); - bridge->dev = NULL; + bridge->drm = NULL; } /** diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 40bcd9067e69..f01e28ed5831 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -1372,7 +1372,7 @@ static int tda998x_bridge_attach(struct drm_bridge *bridge, return -EINVAL; } - return tda998x_connector_init(priv, bridge->dev); + return tda998x_connector_init(priv, bridge->drm); } static void tda998x_bridge_detach(struct drm_bridge *bridge) diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index 5ec75e9ba499..e74f946c7e4e 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -230,7 +230,7 @@ static int ingenic_drm_update_pixclk(struct notifier_block *nb, static void ingenic_drm_bridge_atomic_enable(struct drm_bridge *bridge, struct drm_bridge_state *old_bridge_state) { - struct ingenic_drm *priv = drm_device_get_priv(bridge->dev); + struct ingenic_drm *priv = drm_device_get_priv(bridge->drm); regmap_write(priv->map, JZ_REG_LCD_STATE, 0); @@ -261,7 +261,7 @@ static void ingenic_drm_crtc_atomic_enable(struct drm_crtc *crtc, static void ingenic_drm_bridge_atomic_disable(struct drm_bridge *bridge, struct drm_bridge_state *old_bridge_state) { - struct ingenic_drm *priv = drm_device_get_priv(bridge->dev); + struct ingenic_drm *priv = drm_device_get_priv(bridge->drm); unsigned int var; regmap_update_bits(priv->map, JZ_REG_LCD_CTRL, diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c index db82b38600b2..7d75eda3a1e7 100644 --- a/drivers/gpu/drm/mcde/mcde_dsi.c +++ b/drivers/gpu/drm/mcde/mcde_dsi.c @@ -1051,7 +1051,7 @@ static int mcde_dsi_bridge_attach(struct drm_bridge *bridge, enum drm_bridge_attach_flags flags) { struct mcde_dsi *d = bridge_to_mcde_dsi(bridge); - struct drm_device *drm = bridge->dev; + struct drm_device *drm = bridge->drm; if (!drm_core_check_feature(drm, DRIVER_ATOMIC)) { dev_err(d->dev, "we need atomic updates\n"); diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c index 64eee77452c0..35762532c29f 100644 --- a/drivers/gpu/drm/mediatek/mtk_dp.c +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -1822,8 +1822,8 @@ static irqreturn_t mtk_dp_hpd_event_thread(int hpd, void *dev) spin_unlock_irqrestore(&mtk_dp->irq_thread_lock, flags); if (status & MTK_DP_THREAD_CABLE_STATE_CHG) { - if (mtk_dp->bridge.dev) - drm_helper_hpd_irq_event(mtk_dp->bridge.dev); + if (mtk_dp->bridge.drm) + drm_helper_hpd_irq_event(mtk_dp->bridge.drm); if (!mtk_dp->train_info.cable_plugged_in) { mtk_dp_disable_sdp_aui(mtk_dp); @@ -2119,7 +2119,7 @@ static int mtk_dp_bridge_attach(struct drm_bridge *bridge, return -EINVAL; } - mtk_dp->aux.drm_dev = bridge->dev; + mtk_dp->aux.drm_dev = bridge->drm; ret = drm_dp_aux_register(&mtk_dp->aux); if (ret) { dev_err(mtk_dp->dev, @@ -2141,7 +2141,7 @@ static int mtk_dp_bridge_attach(struct drm_bridge *bridge, } } - mtk_dp->drm_dev = bridge->dev; + mtk_dp->drm_dev = bridge->drm; mtk_dp_hwirq_enable(mtk_dp, true); diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c index 18a0f4f4638c..6e2f393afc17 100644 --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c @@ -568,7 +568,7 @@ static irqreturn_t dw_hdmi_top_thread_irq(int irq, void *dev_id) dw_hdmi_setup_rx_sense(dw_hdmi->hdmi, hpd_connected, hpd_connected); - drm_helper_hpd_irq_event(dw_hdmi->bridge->dev); + drm_helper_hpd_irq_event(dw_hdmi->bridge->drm); drm_bridge_hpd_notify(dw_hdmi->bridge, hpd_connected ? connector_status_connected : connector_status_disconnected); diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c index 9b1391d27ed3..706d29f74c55 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -21,7 +21,7 @@ void msm_hdmi_bridge_destroy(struct drm_bridge *bridge) static void msm_hdmi_power_on(struct drm_bridge *bridge) { - struct drm_device *dev = bridge->dev; + struct drm_device *dev = bridge->drm; struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); struct hdmi *hdmi = hdmi_bridge->hdmi; const struct hdmi_platform_config *config = hdmi->config; @@ -53,7 +53,7 @@ static void msm_hdmi_power_on(struct drm_bridge *bridge) static void power_off(struct drm_bridge *bridge) { - struct drm_device *dev = bridge->dev; + struct drm_device *dev = bridge->drm; struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); struct hdmi *hdmi = hdmi_bridge->hdmi; const struct hdmi_platform_config *config = hdmi->config; @@ -271,7 +271,7 @@ static enum drm_mode_status msm_hdmi_bridge_mode_valid(struct drm_bridge *bridge struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); struct hdmi *hdmi = hdmi_bridge->hdmi; const struct hdmi_platform_config *config = hdmi->config; - struct msm_drm_private *priv = bridge->dev->dev_private; + struct msm_drm_private *priv = bridge->drm->dev_private; struct msm_kms *kms = priv->kms; long actual, requested; diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c index 0a7b466446fb..bd0f07ce9e62 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c @@ -1056,7 +1056,7 @@ static int zynqmp_dp_aux_init(struct zynqmp_dp *dp) dp->aux.name = "ZynqMP DP AUX"; dp->aux.dev = dp->dev; - dp->aux.drm_dev = dp->bridge.dev; + dp->aux.drm_dev = dp->bridge.drm; dp->aux.transfer = zynqmp_dp_aux_transfer; return drm_dp_aux_register(&dp->aux); diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index bf964cdfb330..fd4ddc04d7f9 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -709,8 +709,8 @@ enum drm_bridge_ops { struct drm_bridge { /** @base: inherit from &drm_private_object */ struct drm_private_obj base; - /** @dev: DRM device this bridge belongs to */ - struct drm_device *dev; + /** @drm: DRM device this bridge belongs to */ + struct drm_device *drm; /** @encoder: encoder to which this bridge is connected */ struct drm_encoder *encoder; /** @chain_node: used to form a bridge chain */ From patchwork Thu Jul 13 08:23:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311538 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 77E01C001B0 for ; Thu, 13 Jul 2023 08:24:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8F89C10E609; Thu, 13 Jul 2023 08:24:58 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4B68610E627 for ; Thu, 13 Jul 2023 08:24:54 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrcc-0005qN-Qz; Thu, 13 Jul 2023 10:24:22 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrca-00E4jC-Uh; Thu, 13 Jul 2023 10:24:20 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrca-004Vgr-9t; Thu, 13 Jul 2023 10:24:20 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 03/17] drm/client_dev: Rename struct drm_client_dev::dev to drm Date: Thu, 13 Jul 2023 10:23:54 +0200 Message-Id: <20230713082408.2266984-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=16647; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=26/+mVYFnvs0OLGBi2luQZQdlKXPa2OKS8cfFZum+lM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7SF3ZCXWGiZNHFnaPG0HiOlza/jlTTLIJMRY h1wOM3JZ8SJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0hQAKCRCPgPtYfRL+ TovbB/9E6oPX0pyE9MoTdhE9m+is6fWeafrNa5EeS7ZoiYocRBatFSNp0ejVqj/d38c2EvStMTw vP+qnJuyf4L2rLzqZTI5+/V08U0NcRY32+7+rRHaDan4+5+XDA9IUdrd82i0nDkS4vusL5pjYuT 4gmDdq2LXLuFNzb+j5bcM95MAL6u9+4Ffm1FAV1FQ+e9StSovHVBhjE4NOD0UYnkw/x3VBEGd4a ri4lTh6hDKzu7Zd2EMWSK+G+68IVPRNv3nZ0/SgX60dSipsN1IOp4oIqi4ugIgZgQQFM9WtzbU/ pYS1Z+Rd3/o7wHDGy6ixP0LWhXS7JQV+gXR3bcY1wf40b10+ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/armada/armada_fbdev.c | 4 ++-- drivers/gpu/drm/drm_client.c | 24 ++++++++++++----------- drivers/gpu/drm/drm_client_modeset.c | 24 +++++++++++------------ drivers/gpu/drm/drm_fbdev_dma.c | 4 ++-- drivers/gpu/drm/drm_fbdev_generic.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 4 ++-- drivers/gpu/drm/gma500/fbdev.c | 4 ++-- drivers/gpu/drm/msm/msm_fbdev.c | 4 ++-- drivers/gpu/drm/omapdrm/omap_fbdev.c | 4 ++-- drivers/gpu/drm/radeon/radeon_fbdev.c | 4 ++-- drivers/gpu/drm/tegra/fbdev.c | 4 ++-- include/drm/drm_client.h | 4 ++-- 12 files changed, 45 insertions(+), 43 deletions(-) diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c index 3943e89cc06c..241983120299 100644 --- a/drivers/gpu/drm/armada/armada_fbdev.c +++ b/drivers/gpu/drm/armada/armada_fbdev.c @@ -149,7 +149,7 @@ static void armada_fbdev_client_unregister(struct drm_client_dev *client) static int armada_fbdev_client_restore(struct drm_client_dev *client) { - drm_fb_helper_lastclose(client->dev); + drm_fb_helper_lastclose(client->drm); return 0; } @@ -157,7 +157,7 @@ static int armada_fbdev_client_restore(struct drm_client_dev *client) static int armada_fbdev_client_hotplug(struct drm_client_dev *client) { struct drm_fb_helper *fbh = drm_fb_helper_from_client(client); - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; int ret; if (dev->fb_helper) diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c index f6292ba0e6fc..a99417748053 100644 --- a/drivers/gpu/drm/drm_client.c +++ b/drivers/gpu/drm/drm_client.c @@ -34,7 +34,7 @@ static int drm_client_open(struct drm_client_dev *client) { - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; struct drm_file *file; file = drm_file_alloc(dev->primary); @@ -52,7 +52,7 @@ static int drm_client_open(struct drm_client_dev *client) static void drm_client_close(struct drm_client_dev *client) { - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; mutex_lock(&dev->filelist_mutex); list_del(&client->file->lhead); @@ -87,7 +87,7 @@ int drm_client_init(struct drm_device *dev, struct drm_client_dev *client, if (funcs && !try_module_get(funcs->owner)) return -ENODEV; - client->dev = dev; + client->drm = dev; client->name = name; client->funcs = funcs; @@ -125,7 +125,7 @@ EXPORT_SYMBOL(drm_client_init); */ void drm_client_register(struct drm_client_dev *client) { - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; mutex_lock(&dev->clientlist_mutex); list_add(&client->list, &dev->clientlist); @@ -149,7 +149,7 @@ EXPORT_SYMBOL(drm_client_register); */ void drm_client_release(struct drm_client_dev *client) { - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; drm_dbg_kms(dev, "%s\n", client->name); @@ -257,7 +257,7 @@ drm_client_buffer_create(struct drm_client_dev *client, u32 width, u32 height, { const struct drm_format_info *info = drm_format_info(format); struct drm_mode_create_dumb dumb_args = { }; - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; struct drm_client_buffer *buffer; struct drm_gem_object *obj; int ret; @@ -361,9 +361,10 @@ static void drm_client_buffer_rmfb(struct drm_client_buffer *buffer) if (!buffer->fb) return; - ret = drm_mode_rmfb(buffer->client->dev, buffer->fb->base.id, buffer->client->file); + ret = drm_mode_rmfb(buffer->client->drm, buffer->fb->base.id, + buffer->client->file); if (ret) - drm_err(buffer->client->dev, + drm_err(buffer->client->drm, "Error removing FB:%u (%d)\n", buffer->fb->base.id, ret); buffer->fb = NULL; @@ -386,11 +387,12 @@ static int drm_client_buffer_addfb(struct drm_client_buffer *buffer, fb_req.handle = handle; fb_req.pitch = buffer->pitch; - ret = drm_mode_addfb(client->dev, &fb_req, client->file); + ret = drm_mode_addfb(client->drm, &fb_req, client->file); if (ret) return ret; - buffer->fb = drm_framebuffer_lookup(client->dev, buffer->client->file, fb_req.fb_id); + buffer->fb = drm_framebuffer_lookup(client->drm, buffer->client->file, + fb_req.fb_id); if (WARN_ON(!buffer->fb)) return -ENOENT; @@ -436,7 +438,7 @@ drm_client_framebuffer_create(struct drm_client_dev *client, u32 width, u32 heig * object as DMA-buf. The framebuffer and our buffer structure are still * holding references to the GEM object to prevent its destruction. */ - drm_mode_destroy_dumb(client->dev, handle, client->file); + drm_mode_destroy_dumb(client->drm, handle, client->file); if (ret) { drm_client_buffer_delete(buffer); diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c index 1b12a3c201a3..57f1f9bc5b9b 100644 --- a/drivers/gpu/drm/drm_client_modeset.c +++ b/drivers/gpu/drm/drm_client_modeset.c @@ -34,7 +34,7 @@ struct drm_client_offset { int drm_client_modeset_create(struct drm_client_dev *client) { - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; unsigned int num_crtc = dev->mode_config.num_crtc; unsigned int max_connector_count = 1; struct drm_mode_set *modeset; @@ -76,7 +76,7 @@ static void drm_client_modeset_release(struct drm_client_dev *client) unsigned int i; drm_client_for_each_modeset(modeset, client) { - drm_mode_destroy(client->dev, modeset->mode); + drm_mode_destroy(client->drm, modeset->mode); modeset->mode = NULL; modeset->fb = NULL; @@ -490,7 +490,7 @@ static int drm_client_pick_crtcs(struct drm_client_dev *client, struct drm_display_mode **modes, int n, int width, int height) { - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; struct drm_connector *connector; int my_score, best_score, score; struct drm_crtc **crtcs, *crtc; @@ -568,7 +568,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, { const int count = min_t(unsigned int, connector_count, BITS_PER_LONG); unsigned long conn_configured, conn_seq, mask; - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; int i, j; bool *save_enabled; bool fallback = true, ret = true; @@ -768,7 +768,7 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, { struct drm_connector *connector, **connectors = NULL; struct drm_connector_list_iter conn_iter; - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; unsigned int total_modes_count = 0; struct drm_client_offset *offsets; unsigned int connector_count = 0; @@ -974,7 +974,7 @@ EXPORT_SYMBOL(drm_client_rotation); static int drm_client_modeset_commit_atomic(struct drm_client_dev *client, bool active, bool check) { - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; struct drm_plane *plane; struct drm_atomic_state *state; struct drm_modeset_acquire_ctx ctx; @@ -1064,7 +1064,7 @@ static int drm_client_modeset_commit_atomic(struct drm_client_dev *client, bool static int drm_client_modeset_commit_legacy(struct drm_client_dev *client) { - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; struct drm_mode_set *mode_set; struct drm_plane *plane; int ret = 0; @@ -1116,7 +1116,7 @@ int drm_client_modeset_check(struct drm_client_dev *client) { int ret; - if (!drm_drv_uses_atomic_modeset(client->dev)) + if (!drm_drv_uses_atomic_modeset(client->drm)) return 0; mutex_lock(&client->modeset_mutex); @@ -1140,7 +1140,7 @@ EXPORT_SYMBOL(drm_client_modeset_check); */ int drm_client_modeset_commit_locked(struct drm_client_dev *client) { - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; int ret; mutex_lock(&client->modeset_mutex); @@ -1165,7 +1165,7 @@ EXPORT_SYMBOL(drm_client_modeset_commit_locked); */ int drm_client_modeset_commit(struct drm_client_dev *client) { - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; int ret; if (!drm_master_internal_acquire(dev)) @@ -1181,7 +1181,7 @@ EXPORT_SYMBOL(drm_client_modeset_commit); static void drm_client_modeset_dpms_legacy(struct drm_client_dev *client, int dpms_mode) { - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; struct drm_connector *connector; struct drm_mode_set *modeset; struct drm_modeset_acquire_ctx ctx; @@ -1215,7 +1215,7 @@ static void drm_client_modeset_dpms_legacy(struct drm_client_dev *client, int dp */ int drm_client_modeset_dpms(struct drm_client_dev *client, int mode) { - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; int ret = 0; if (!drm_master_internal_acquire(dev)) diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c index 8217f1ddc007..e4a37e6fce75 100644 --- a/drivers/gpu/drm/drm_fbdev_dma.c +++ b/drivers/gpu/drm/drm_fbdev_dma.c @@ -168,7 +168,7 @@ static void drm_fbdev_dma_client_unregister(struct drm_client_dev *client) static int drm_fbdev_dma_client_restore(struct drm_client_dev *client) { - drm_fb_helper_lastclose(client->dev); + drm_fb_helper_lastclose(client->drm); return 0; } @@ -176,7 +176,7 @@ static int drm_fbdev_dma_client_restore(struct drm_client_dev *client) static int drm_fbdev_dma_client_hotplug(struct drm_client_dev *client) { struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client); - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; int ret; if (dev->fb_helper) diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index 98ae703848a0..c5d9aab52064 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -256,7 +256,7 @@ static void drm_fbdev_generic_client_unregister(struct drm_client_dev *client) static int drm_fbdev_generic_client_restore(struct drm_client_dev *client) { - drm_fb_helper_lastclose(client->dev); + drm_fb_helper_lastclose(client->drm); return 0; } @@ -264,7 +264,7 @@ static int drm_fbdev_generic_client_restore(struct drm_client_dev *client) static int drm_fbdev_generic_client_hotplug(struct drm_client_dev *client) { struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client); - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; int ret; if (dev->fb_helper) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index fdf65587f1fe..e7b9a13bd706 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -157,7 +157,7 @@ static void exynos_drm_fbdev_client_unregister(struct drm_client_dev *client) static int exynos_drm_fbdev_client_restore(struct drm_client_dev *client) { - drm_fb_helper_lastclose(client->dev); + drm_fb_helper_lastclose(client->drm); return 0; } @@ -165,7 +165,7 @@ static int exynos_drm_fbdev_client_restore(struct drm_client_dev *client) static int exynos_drm_fbdev_client_hotplug(struct drm_client_dev *client) { struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client); - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; int ret; if (dev->fb_helper) diff --git a/drivers/gpu/drm/gma500/fbdev.c b/drivers/gpu/drm/gma500/fbdev.c index 955cbe9f05a7..cd5ca18750b4 100644 --- a/drivers/gpu/drm/gma500/fbdev.c +++ b/drivers/gpu/drm/gma500/fbdev.c @@ -270,7 +270,7 @@ static void psb_fbdev_client_unregister(struct drm_client_dev *client) static int psb_fbdev_client_restore(struct drm_client_dev *client) { - drm_fb_helper_lastclose(client->dev); + drm_fb_helper_lastclose(client->drm); return 0; } @@ -278,7 +278,7 @@ static int psb_fbdev_client_restore(struct drm_client_dev *client) static int psb_fbdev_client_hotplug(struct drm_client_dev *client) { struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client); - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; int ret; if (dev->fb_helper) diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c index b933a85420f6..26bfcdc090e8 100644 --- a/drivers/gpu/drm/msm/msm_fbdev.c +++ b/drivers/gpu/drm/msm/msm_fbdev.c @@ -182,7 +182,7 @@ static void msm_fbdev_client_unregister(struct drm_client_dev *client) static int msm_fbdev_client_restore(struct drm_client_dev *client) { - drm_fb_helper_lastclose(client->dev); + drm_fb_helper_lastclose(client->drm); return 0; } @@ -190,7 +190,7 @@ static int msm_fbdev_client_restore(struct drm_client_dev *client) static int msm_fbdev_client_hotplug(struct drm_client_dev *client) { struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client); - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; int ret; if (dev->fb_helper) diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c index b7ccce0704a3..933f2353d05e 100644 --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c @@ -258,7 +258,7 @@ static void omap_fbdev_client_unregister(struct drm_client_dev *client) static int omap_fbdev_client_restore(struct drm_client_dev *client) { - drm_fb_helper_lastclose(client->dev); + drm_fb_helper_lastclose(client->drm); return 0; } @@ -266,7 +266,7 @@ static int omap_fbdev_client_restore(struct drm_client_dev *client) static int omap_fbdev_client_hotplug(struct drm_client_dev *client) { struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client); - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; int ret; if (dev->fb_helper) diff --git a/drivers/gpu/drm/radeon/radeon_fbdev.c b/drivers/gpu/drm/radeon/radeon_fbdev.c index ab9c1abbac97..74f8a182b02d 100644 --- a/drivers/gpu/drm/radeon/radeon_fbdev.c +++ b/drivers/gpu/drm/radeon/radeon_fbdev.c @@ -315,7 +315,7 @@ static void radeon_fbdev_client_unregister(struct drm_client_dev *client) static int radeon_fbdev_client_restore(struct drm_client_dev *client) { - drm_fb_helper_lastclose(client->dev); + drm_fb_helper_lastclose(client->drm); vga_switcheroo_process_delayed_switch(); return 0; @@ -324,7 +324,7 @@ static int radeon_fbdev_client_restore(struct drm_client_dev *client) static int radeon_fbdev_client_hotplug(struct drm_client_dev *client) { struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client); - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; struct radeon_device *rdev = dev->dev_private; int ret; diff --git a/drivers/gpu/drm/tegra/fbdev.c b/drivers/gpu/drm/tegra/fbdev.c index e74d9be981c7..93a0f4021af5 100644 --- a/drivers/gpu/drm/tegra/fbdev.c +++ b/drivers/gpu/drm/tegra/fbdev.c @@ -167,7 +167,7 @@ static void tegra_fbdev_client_unregister(struct drm_client_dev *client) static int tegra_fbdev_client_restore(struct drm_client_dev *client) { - drm_fb_helper_lastclose(client->dev); + drm_fb_helper_lastclose(client->drm); return 0; } @@ -175,7 +175,7 @@ static int tegra_fbdev_client_restore(struct drm_client_dev *client) static int tegra_fbdev_client_hotplug(struct drm_client_dev *client) { struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client); - struct drm_device *dev = client->dev; + struct drm_device *dev = client->drm; int ret; if (dev->fb_helper) diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h index c0a14b40c039..e1f971a30c06 100644 --- a/include/drm/drm_client.h +++ b/include/drm/drm_client.h @@ -70,9 +70,9 @@ struct drm_client_funcs { */ struct drm_client_dev { /** - * @dev: DRM device + * @drm: DRM device */ - struct drm_device *dev; + struct drm_device *drm; /** * @name: Name of the client. From patchwork Thu Jul 13 08:23:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311991 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7432AC001DF for ; Thu, 13 Jul 2023 12:54:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 59A6910E69C; Thu, 13 Jul 2023 12:54:18 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 610F010E625 for ; Thu, 13 Jul 2023 08:26:17 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrcc-0005qO-Un; Thu, 13 Jul 2023 10:24:23 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrcc-00E4jG-7Y; Thu, 13 Jul 2023 10:24:22 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrca-004Vgw-Tu; Thu, 13 Jul 2023 10:24:21 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 04/17] drm/connector: Rename struct drm_connector::dev to drm Date: Thu, 13 Jul 2023 10:23:55 +0200 Message-Id: <20230713082408.2266984-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=351283; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6n0d9tZjqcSRx+5Op+FUpdpxnLGSEGLNkU8pL1BWW6o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7SHPiz19OpUeKkACOTXrlxixzpeb0e1UUbch cPxXj5SxtOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0hwAKCRCPgPtYfRL+ TuvxB/9R70AJvhvU9PGRD6uzeiqwsH/fUV8cCVs5mf67xyT5rQc6Bu2D2ByisAgrby1dV1d3R1C G33RdhYkCBlvg0K08hd/BSV4eU9Uf6a9ASBklKMXas4n3/6pBNWVdY23H8ciP1Zl77wtDd4wK5g sbtQteeEvqubOrDWpv/ROGA65RhcaSnzOSn8ZOlQUpyOf1Yb9EnoImIT3B0IvP/R7Dy4lW7onls HyOyd1aqGpcnirYlwrgfj9NTMaOABtx6mzzMG7La1ainy6quAaqPyze0zgZNqiIax31ankSh57u GPhG3SwEWNu6vY4d9Dz2fsAvFRXAS4sDSx2o8h7R9+8bEZ7L X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-Mailman-Approved-At: Thu, 13 Jul 2023 12:53:45 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- .../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 52 +++---- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 +- drivers/gpu/drm/amd/amdgpu/atombios_dp.c | 4 +- .../gpu/drm/amd/amdgpu/atombios_encoders.c | 4 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 42 +++--- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 26 ++-- .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 2 +- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 +- .../arm/display/komeda/komeda_wb_connector.c | 2 +- drivers/gpu/drm/arm/malidp_mw.c | 4 +- drivers/gpu/drm/ast/ast_mode.c | 10 +- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 4 +- .../drm/bridge/analogix/analogix-anx78xx.c | 2 +- drivers/gpu/drm/bridge/analogix/anx7625.c | 2 +- .../drm/bridge/cadence/cdns-mhdp8546-core.c | 8 +- .../drm/bridge/cadence/cdns-mhdp8546-hdcp.c | 2 +- drivers/gpu/drm/bridge/chrontel-ch7033.c | 2 +- drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 6 +- drivers/gpu/drm/bridge/nxp-ptn3460.c | 2 +- drivers/gpu/drm/bridge/panel.c | 2 +- drivers/gpu/drm/bridge/ti-tfp410.c | 2 +- drivers/gpu/drm/display/drm_dp_cec.c | 2 +- drivers/gpu/drm/display/drm_dp_helper.c | 2 +- drivers/gpu/drm/display/drm_hdcp_helper.c | 4 +- drivers/gpu/drm/display/drm_scdc_helper.c | 10 +- drivers/gpu/drm/drm_atomic.c | 11 +- drivers/gpu/drm/drm_atomic_helper.c | 26 ++-- drivers/gpu/drm/drm_atomic_state_helper.c | 2 +- drivers/gpu/drm/drm_atomic_uapi.c | 14 +- drivers/gpu/drm/drm_bridge_connector.c | 2 +- drivers/gpu/drm/drm_connector.c | 75 +++++----- drivers/gpu/drm/drm_crtc_helper.c | 2 +- drivers/gpu/drm/drm_debugfs.c | 2 +- drivers/gpu/drm/drm_edid.c | 134 ++++++++++-------- drivers/gpu/drm/drm_edid_load.c | 10 +- drivers/gpu/drm/drm_mipi_dbi.c | 2 +- drivers/gpu/drm/drm_modes.c | 6 +- drivers/gpu/drm/drm_probe_helper.c | 23 +-- drivers/gpu/drm/drm_sysfs.c | 20 +-- drivers/gpu/drm/drm_writeback.c | 2 +- drivers/gpu/drm/exynos/exynos_dp.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 2 +- drivers/gpu/drm/gma500/cdv_device.c | 4 +- drivers/gpu/drm/gma500/cdv_intel_crt.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_dp.c | 6 +- drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 4 +- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 4 +- drivers/gpu/drm/gma500/oaktrail_hdmi.c | 2 +- drivers/gpu/drm/gma500/psb_intel_lvds.c | 8 +- drivers/gpu/drm/gma500/psb_intel_sdvo.c | 16 +-- drivers/gpu/drm/gud/gud_connector.c | 22 +-- .../gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c | 4 +- .../gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 4 +- drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 6 +- drivers/gpu/drm/i2c/tda998x_drv.c | 2 +- drivers/gpu/drm/i915/display/intel_atomic.c | 4 +- .../gpu/drm/i915/display/intel_backlight.c | 112 +++++++-------- .../gpu/drm/i915/display/intel_connector.c | 14 +- drivers/gpu/drm/i915/display/intel_crt.c | 14 +- drivers/gpu/drm/i915/display/intel_ddi.c | 2 +- .../drm/i915/display/intel_display_debugfs.c | 12 +- drivers/gpu/drm/i915/display/intel_dp.c | 30 ++-- .../drm/i915/display/intel_dp_aux_backlight.c | 12 +- drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 8 +- drivers/gpu/drm/i915/display/intel_dp_mst.c | 16 +-- drivers/gpu/drm/i915/display/intel_dsi.c | 6 +- .../i915/display/intel_dsi_dcs_backlight.c | 4 +- drivers/gpu/drm/i915/display/intel_dsi_vbt.c | 8 +- drivers/gpu/drm/i915/display/intel_dvo.c | 8 +- drivers/gpu/drm/i915/display/intel_hdcp.c | 84 +++++------ drivers/gpu/drm/i915/display/intel_hdmi.c | 24 ++-- drivers/gpu/drm/i915/display/intel_hotplug.c | 2 +- drivers/gpu/drm/i915/display/intel_lvds.c | 2 +- .../drm/i915/display/intel_modeset_verify.c | 5 +- drivers/gpu/drm/i915/display/intel_opregion.c | 2 +- drivers/gpu/drm/i915/display/intel_panel.c | 22 +-- drivers/gpu/drm/i915/display/intel_pps.c | 2 +- drivers/gpu/drm/i915/display/intel_psr.c | 2 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 12 +- drivers/gpu/drm/i915/display/intel_tv.c | 12 +- drivers/gpu/drm/i915/display/intel_vrr.c | 2 +- drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 2 +- drivers/gpu/drm/imx/ipuv3/parallel-display.c | 4 +- drivers/gpu/drm/loongson/lsdc_output_7a2000.c | 8 +- drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c | 2 +- drivers/gpu/drm/msm/dp/dp_display.c | 2 +- drivers/gpu/drm/msm/dp/dp_drm.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/dac.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/dfp.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/tvnv04.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 26 ++-- drivers/gpu/drm/nouveau/nouveau_backlight.c | 6 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 44 +++--- drivers/gpu/drm/omapdrm/dss/venc.c | 2 +- drivers/gpu/drm/panel/panel-abt-y030xx067a.c | 2 +- drivers/gpu/drm/panel/panel-arm-versatile.c | 2 +- .../drm/panel/panel-asus-z00t-tm5p5-n35596.c | 2 +- drivers/gpu/drm/panel/panel-auo-a030jtn01.c | 2 +- .../gpu/drm/panel/panel-boe-bf060y8m-aj0.c | 2 +- drivers/gpu/drm/panel/panel-boe-himax8279d.c | 2 +- .../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 2 +- drivers/gpu/drm/panel/panel-dsi-cm.c | 2 +- drivers/gpu/drm/panel/panel-ebbg-ft8719.c | 2 +- drivers/gpu/drm/panel/panel-edp.c | 6 +- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 2 +- .../gpu/drm/panel/panel-feixin-k101-im2ba02.c | 2 +- .../drm/panel/panel-feiyang-fy07024di26a30d.c | 2 +- drivers/gpu/drm/panel/panel-himax-hx8394.c | 2 +- drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 2 +- drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 2 +- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 2 +- drivers/gpu/drm/panel/panel-innolux-ej030na.c | 2 +- drivers/gpu/drm/panel/panel-innolux-p079zca.c | 2 +- .../gpu/drm/panel/panel-jadard-jd9365da-h3.c | 2 +- drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c | 2 +- .../gpu/drm/panel/panel-jdi-lt070me05000.c | 2 +- drivers/gpu/drm/panel/panel-khadas-ts050.c | 2 +- .../drm/panel/panel-kingdisplay-kd097d04.c | 2 +- .../drm/panel/panel-leadtek-ltk050h3146w.c | 2 +- .../drm/panel/panel-leadtek-ltk500hd1829.c | 2 +- drivers/gpu/drm/panel/panel-lg-lb035q02.c | 2 +- drivers/gpu/drm/panel/panel-lg-lg4573.c | 2 +- drivers/gpu/drm/panel/panel-lvds.c | 2 +- .../drm/panel/panel-magnachip-d53e6ea8966.c | 2 +- .../gpu/drm/panel/panel-mantix-mlaf057we51.c | 2 +- drivers/gpu/drm/panel/panel-nec-nl8048hl11.c | 2 +- .../gpu/drm/panel/panel-newvision-nv3051d.c | 2 +- .../gpu/drm/panel/panel-newvision-nv3052c.c | 2 +- drivers/gpu/drm/panel/panel-novatek-nt35510.c | 2 +- drivers/gpu/drm/panel/panel-novatek-nt35560.c | 4 +- drivers/gpu/drm/panel/panel-novatek-nt35950.c | 2 +- drivers/gpu/drm/panel/panel-novatek-nt36523.c | 2 +- .../gpu/drm/panel/panel-novatek-nt36672a.c | 2 +- drivers/gpu/drm/panel/panel-novatek-nt39016.c | 2 +- .../drm/panel/panel-olimex-lcd-olinuxino.c | 2 +- .../gpu/drm/panel/panel-orisetech-ota5601a.c | 2 +- .../gpu/drm/panel/panel-orisetech-otm8009a.c | 2 +- .../drm/panel/panel-osd-osd101t2587-53ts.c | 2 +- .../drm/panel/panel-panasonic-vvx10f034n00.c | 2 +- .../drm/panel/panel-raspberrypi-touchscreen.c | 2 +- drivers/gpu/drm/panel/panel-raydium-rm67191.c | 2 +- drivers/gpu/drm/panel/panel-raydium-rm68200.c | 2 +- drivers/gpu/drm/panel/panel-ronbo-rb070d30.c | 2 +- drivers/gpu/drm/panel/panel-samsung-db7430.c | 2 +- drivers/gpu/drm/panel/panel-samsung-ld9040.c | 2 +- drivers/gpu/drm/panel/panel-samsung-s6d16d0.c | 2 +- drivers/gpu/drm/panel/panel-samsung-s6d27a1.c | 2 +- drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c | 2 +- drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 2 +- .../gpu/drm/panel/panel-samsung-s6e63j0x03.c | 2 +- drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 2 +- .../panel/panel-samsung-s6e88a0-ams452ef01.c | 2 +- drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c | 2 +- drivers/gpu/drm/panel/panel-samsung-sofef00.c | 2 +- drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 4 +- .../gpu/drm/panel/panel-sharp-lq101r1sx01.c | 2 +- .../gpu/drm/panel/panel-sharp-ls037v7dw01.c | 2 +- .../gpu/drm/panel/panel-sharp-ls043t1le01.c | 2 +- .../gpu/drm/panel/panel-sharp-ls060t1sx01.c | 2 +- drivers/gpu/drm/panel/panel-simple.c | 6 +- drivers/gpu/drm/panel/panel-sitronix-st7701.c | 2 +- drivers/gpu/drm/panel/panel-sitronix-st7703.c | 2 +- .../gpu/drm/panel/panel-sitronix-st7789v.c | 2 +- drivers/gpu/drm/panel/panel-sony-acx565akm.c | 2 +- drivers/gpu/drm/panel/panel-sony-td4353-jdi.c | 3 +- .../panel/panel-sony-tulip-truly-nt35521.c | 2 +- drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 2 +- drivers/gpu/drm/panel/panel-tpo-td028ttec1.c | 2 +- drivers/gpu/drm/panel/panel-tpo-td043mtea1.c | 2 +- drivers/gpu/drm/panel/panel-tpo-tpg110.c | 2 +- drivers/gpu/drm/panel/panel-truly-nt35597.c | 2 +- .../gpu/drm/panel/panel-visionox-rm69299.c | 2 +- .../gpu/drm/panel/panel-visionox-vtdr6130.c | 2 +- .../gpu/drm/panel/panel-widechips-ws2401.c | 2 +- .../gpu/drm/panel/panel-xinpeng-xpp055c272.c | 2 +- drivers/gpu/drm/qxl/qxl_display.c | 10 +- drivers/gpu/drm/radeon/atombios_dp.c | 6 +- drivers/gpu/drm/radeon/atombios_encoders.c | 2 +- drivers/gpu/drm/radeon/radeon_atombios.c | 2 +- drivers/gpu/drm/radeon/radeon_audio.c | 2 +- drivers/gpu/drm/radeon/radeon_combios.c | 2 +- drivers/gpu/drm/radeon/radeon_connectors.c | 74 +++++----- .../drm/renesas/rcar-du/rcar_du_writeback.c | 2 +- .../renesas/shmobile/shmob_drm_backlight.c | 8 +- .../gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 4 +- drivers/gpu/drm/rockchip/inno_hdmi.c | 2 +- drivers/gpu/drm/rockchip/rk3066_hdmi.c | 2 +- drivers/gpu/drm/solomon/ssd130x.c | 4 +- drivers/gpu/drm/tegra/dpaux.c | 4 +- drivers/gpu/drm/tegra/dsi.c | 12 +- drivers/gpu/drm/tegra/hdmi.c | 4 +- drivers/gpu/drm/tegra/output.c | 4 +- drivers/gpu/drm/tegra/sor.c | 4 +- .../gpu/drm/tests/drm_client_modeset_test.c | 4 +- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 2 +- drivers/gpu/drm/tiny/cirrus.c | 4 +- drivers/gpu/drm/tiny/ofdrm.c | 2 +- drivers/gpu/drm/tiny/repaper.c | 2 +- drivers/gpu/drm/tiny/simpledrm.c | 2 +- drivers/gpu/drm/udl/udl_modeset.c | 2 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 6 +- drivers/gpu/drm/vc4/vc4_hdmi.c | 76 +++++----- drivers/gpu/drm/vc4/vc4_txp.c | 6 +- drivers/gpu/drm/virtio/virtgpu_display.c | 2 +- drivers/gpu/drm/vkms/vkms_writeback.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 4 +- drivers/gpu/drm/xen/xen_drm_front_conn.c | 4 +- drivers/media/cec/core/cec-adap.c | 2 +- include/drm/drm_connector.h | 6 +- 211 files changed, 815 insertions(+), 788 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c index d34037b85cf8..d8b446a64b5b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c @@ -42,7 +42,7 @@ void amdgpu_connector_hotplug(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); @@ -280,7 +280,7 @@ amdgpu_connector_get_hardcoded_edid(struct amdgpu_device *adev) static void amdgpu_connector_get_edid(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); @@ -472,7 +472,7 @@ static int amdgpu_connector_set_property(struct drm_connector *connector, struct drm_property *property, uint64_t val) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct drm_encoder *encoder; struct amdgpu_encoder *amdgpu_encoder; @@ -734,9 +734,9 @@ amdgpu_connector_lvds_detect(struct drm_connector *connector, bool force) int r; if (!drm_kms_helper_is_poll_worker()) { - r = pm_runtime_get_sync(connector->dev->dev); + r = pm_runtime_get_sync(connector->drm->dev); if (r < 0) { - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_put_autosuspend(connector->drm->dev); return connector_status_disconnected; } } @@ -760,8 +760,8 @@ amdgpu_connector_lvds_detect(struct drm_connector *connector, bool force) amdgpu_connector_update_scratch_regs(connector, ret); if (!drm_kms_helper_is_poll_worker()) { - pm_runtime_mark_last_busy(connector->dev->dev); - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_mark_last_busy(connector->drm->dev); + pm_runtime_put_autosuspend(connector->drm->dev); } return ret; @@ -792,7 +792,7 @@ static int amdgpu_connector_set_lcd_property(struct drm_connector *connector, struct drm_property *property, uint64_t value) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_encoder *amdgpu_encoder; enum amdgpu_rmx_type rmx_type; @@ -862,7 +862,7 @@ static int amdgpu_connector_vga_get_modes(struct drm_connector *connector) static enum drm_mode_status amdgpu_connector_vga_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); /* XXX check mode bandwidth */ @@ -884,9 +884,9 @@ amdgpu_connector_vga_detect(struct drm_connector *connector, bool force) int r; if (!drm_kms_helper_is_poll_worker()) { - r = pm_runtime_get_sync(connector->dev->dev); + r = pm_runtime_get_sync(connector->drm->dev); if (r < 0) { - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_put_autosuspend(connector->drm->dev); return connector_status_disconnected; } } @@ -944,8 +944,8 @@ amdgpu_connector_vga_detect(struct drm_connector *connector, bool force) out: if (!drm_kms_helper_is_poll_worker()) { - pm_runtime_mark_last_busy(connector->dev->dev); - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_mark_last_busy(connector->drm->dev); + pm_runtime_put_autosuspend(connector->drm->dev); } return ret; @@ -969,7 +969,7 @@ static const struct drm_connector_funcs amdgpu_connector_vga_funcs = { static bool amdgpu_connector_check_hpd_status_unchanged(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); enum drm_connector_status status; @@ -1000,7 +1000,7 @@ amdgpu_connector_check_hpd_status_unchanged(struct drm_connector *connector) static enum drm_connector_status amdgpu_connector_dvi_detect(struct drm_connector *connector, bool force) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); const struct drm_encoder_helper_funcs *encoder_funcs; @@ -1009,9 +1009,9 @@ amdgpu_connector_dvi_detect(struct drm_connector *connector, bool force) bool dret = false, broken_edid = false; if (!drm_kms_helper_is_poll_worker()) { - r = pm_runtime_get_sync(connector->dev->dev); + r = pm_runtime_get_sync(connector->drm->dev); if (r < 0) { - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_put_autosuspend(connector->drm->dev); return connector_status_disconnected; } } @@ -1161,8 +1161,8 @@ amdgpu_connector_dvi_detect(struct drm_connector *connector, bool force) exit: if (!drm_kms_helper_is_poll_worker()) { - pm_runtime_mark_last_busy(connector->dev->dev); - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_mark_last_busy(connector->drm->dev); + pm_runtime_put_autosuspend(connector->drm->dev); } return ret; @@ -1208,7 +1208,7 @@ static void amdgpu_connector_dvi_force(struct drm_connector *connector) static enum drm_mode_status amdgpu_connector_dvi_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); @@ -1360,7 +1360,7 @@ static bool amdgpu_connector_encoder_is_hbr2(struct drm_connector *connector) bool amdgpu_connector_is_dp12_capable(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); if ((adev->clock.default_dispclk >= 53900) && @@ -1374,7 +1374,7 @@ bool amdgpu_connector_is_dp12_capable(struct drm_connector *connector) static enum drm_connector_status amdgpu_connector_dp_detect(struct drm_connector *connector, bool force) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); enum drm_connector_status ret = connector_status_disconnected; @@ -1383,9 +1383,9 @@ amdgpu_connector_dp_detect(struct drm_connector *connector, bool force) int r; if (!drm_kms_helper_is_poll_worker()) { - r = pm_runtime_get_sync(connector->dev->dev); + r = pm_runtime_get_sync(connector->drm->dev); if (r < 0) { - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_put_autosuspend(connector->drm->dev); return connector_status_disconnected; } } @@ -1459,8 +1459,8 @@ amdgpu_connector_dp_detect(struct drm_connector *connector, bool force) amdgpu_connector_update_scratch_regs(connector, ret); out: if (!drm_kms_helper_is_poll_worker()) { - pm_runtime_mark_last_busy(connector->dev->dev); - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_mark_last_busy(connector->drm->dev); + pm_runtime_put_autosuspend(connector->drm->dev); } if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort || diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c index 53ff91fc6cf6..5ba42af8202a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c @@ -205,7 +205,7 @@ static const struct drm_connector_funcs amdgpu_vkms_connector_funcs = { static int amdgpu_vkms_conn_get_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_display_mode *mode = NULL; unsigned i; static const struct mode_size { diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_dp.c b/drivers/gpu/drm/amd/amdgpu/atombios_dp.c index 87c41e0e9b7c..968888ba326e 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_dp.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_dp.c @@ -189,7 +189,7 @@ void amdgpu_atombios_dp_aux_init(struct amdgpu_connector *amdgpu_connector) { amdgpu_connector->ddc_bus->rec.hpd = amdgpu_connector->hpd.hpd; amdgpu_connector->ddc_bus->aux.transfer = amdgpu_atombios_dp_aux_transfer; - amdgpu_connector->ddc_bus->aux.drm_dev = amdgpu_connector->base.dev; + amdgpu_connector->ddc_bus->aux.drm_dev = amdgpu_connector->base.drm; drm_dp_aux_init(&amdgpu_connector->ddc_bus->aux); amdgpu_connector->ddc_bus->has_aux = true; @@ -307,7 +307,7 @@ static u8 amdgpu_atombios_dp_encoder_service(struct amdgpu_device *adev, u8 amdgpu_atombios_dp_get_sinktype(struct amdgpu_connector *amdgpu_connector) { - struct drm_device *dev = amdgpu_connector->base.dev; + struct drm_device *dev = amdgpu_connector->base.drm; struct amdgpu_device *adev = drm_to_adev(dev); return amdgpu_atombios_dp_encoder_service(adev, ATOM_DP_ACTION_GET_SINK_TYPE, 0, diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c index d95b2dc78063..ac55c615dad0 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c @@ -1144,7 +1144,7 @@ amdgpu_atombios_encoder_set_edp_panel_power(struct drm_connector *connector, int action) { struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); - struct drm_device *dev = amdgpu_connector->base.dev; + struct drm_device *dev = amdgpu_connector->base.drm; struct amdgpu_device *adev = drm_to_adev(dev); union dig_transmitter_control args; int index = GetIndexIntoMasterTable(COMMAND, UNIPHYTransmitterControl); @@ -1814,7 +1814,7 @@ amdgpu_atombios_encoder_set_bios_scratch_regs(struct drm_connector *connector, struct drm_encoder *encoder, bool connected) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 83ec2bb5c3b1..7d48fcddb6da 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -194,7 +194,7 @@ static void update_subconnector_property(struct amdgpu_dm_connector *aconnector) subconnector = get_subconnector_type(link); drm_object_property_set_value(&connector->base, - connector->dev->mode_config.dp_subconnector_property, + connector->drm->mode_config.dp_subconnector_property, subconnector); } @@ -888,7 +888,7 @@ static int dm_early_init(void* handle); /* Allocate memory for FBC compressed data */ static void amdgpu_dm_fbc_init(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct dm_compressor_info *compressor = &adev->dm.compressor; struct amdgpu_dm_connector *aconn = to_amdgpu_dm_connector(connector); @@ -1304,9 +1304,9 @@ static void force_connector_state( { struct drm_connector *connector = &aconnector->base; - mutex_lock(&connector->dev->mode_config.mutex); + mutex_lock(&connector->drm->mode_config.mutex); aconnector->base.force = force_state; - mutex_unlock(&connector->dev->mode_config.mutex); + mutex_unlock(&connector->drm->mode_config.mutex); mutex_lock(&aconnector->hpd_lock); drm_kms_helper_connector_hotplug_event(connector); @@ -1333,7 +1333,7 @@ static void dm_handle_hpd_rx_offload_work(struct work_struct *work) goto skip; } - adev = drm_to_adev(aconnector->base.dev); + adev = drm_to_adev(aconnector->base.drm); dc_link = aconnector->dc_link; mutex_lock(&aconnector->hpd_lock); @@ -2994,7 +2994,7 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector) return; conn_base = &aconnector->base; - adev = drm_to_adev(conn_base->dev); + adev = drm_to_adev(conn_base->drm); caps = &adev->dm.backlight_caps[aconnector->bl_idx]; caps->ext_caps = &aconnector->dc_link->dpcd_sink_ext_caps; @@ -3025,7 +3025,7 @@ void amdgpu_dm_update_connector_after_detect( struct amdgpu_dm_connector *aconnector) { struct drm_connector *connector = &aconnector->base; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct dc_sink *sink; /* MST handled by drm_mst framework */ @@ -3173,7 +3173,7 @@ void amdgpu_dm_update_connector_after_detect( static void handle_hpd_irq_helper(struct amdgpu_dm_connector *aconnector) { struct drm_connector *connector = &aconnector->base; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; enum dc_connection_type new_connection_type = dc_connection_none; struct amdgpu_device *adev = drm_to_adev(dev); struct dm_connector_state *dm_con_state = to_dm_connector_state(connector->state); @@ -3339,7 +3339,7 @@ static void handle_hpd_rx_irq(void *param) { struct amdgpu_dm_connector *aconnector = (struct amdgpu_dm_connector *)param; struct drm_connector *connector = &aconnector->base; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct dc_link *dc_link = aconnector->dc_link; bool is_mst_root_connector = aconnector->mst_mgr.mst_state; bool result = false; @@ -4194,7 +4194,7 @@ static const struct backlight_ops amdgpu_dm_backlight_ops = { static void amdgpu_dm_register_backlight_device(struct amdgpu_dm_connector *aconnector) { - struct drm_device *drm = aconnector->base.dev; + struct drm_device *drm = aconnector->base.drm; struct amdgpu_display_manager *dm = &drm_to_adev(drm)->dm; struct backlight_properties props = { 0 }; char bl_name[16]; @@ -6149,7 +6149,7 @@ int amdgpu_dm_connector_atomic_set_property(struct drm_connector *connector, struct drm_property *property, uint64_t val) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct dm_connector_state *dm_old_state = to_dm_connector_state(connector->state); @@ -6204,7 +6204,7 @@ int amdgpu_dm_connector_atomic_get_property(struct drm_connector *connector, struct drm_property *property, uint64_t *val) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct dm_connector_state *dm_state = to_dm_connector_state(state); @@ -6254,7 +6254,7 @@ static void amdgpu_dm_connector_unregister(struct drm_connector *connector) static void amdgpu_dm_connector_destroy(struct drm_connector *connector) { struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector); - struct amdgpu_device *adev = drm_to_adev(connector->dev); + struct amdgpu_device *adev = drm_to_adev(connector->drm); struct amdgpu_display_manager *dm = &adev->dm; /* @@ -6537,7 +6537,7 @@ create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector, const struct dc_stream_state *old_stream) { struct drm_connector *connector = &aconnector->base; - struct amdgpu_device *adev = drm_to_adev(connector->dev); + struct amdgpu_device *adev = drm_to_adev(connector->drm); struct dc_stream_state *stream; const struct drm_connector_state *drm_state = dm_state ? &dm_state->base : NULL; int requested_bpc = drm_state ? drm_state->max_requested_bpc : 8; @@ -7082,9 +7082,9 @@ static void amdgpu_set_panel_orientation(struct drm_connector *connector) connector->connector_type != DRM_MODE_CONNECTOR_LVDS) return; - mutex_lock(&connector->dev->mode_config.mutex); + mutex_lock(&connector->drm->mode_config.mutex); amdgpu_dm_connector_get_modes(connector); - mutex_unlock(&connector->dev->mode_config.mutex); + mutex_unlock(&connector->drm->mode_config.mutex); encoder = amdgpu_dm_connector_to_encoder(connector); if (!encoder) @@ -7204,7 +7204,7 @@ static uint add_fs_modes(struct amdgpu_dm_connector *aconnector) m->vtotal + target_vtotal_diff < m->vsync_end) continue; - new_mode = drm_mode_duplicate(aconnector->base.dev, m); + new_mode = drm_mode_duplicate(aconnector->base.drm, m); if (!new_mode) goto out; @@ -7218,7 +7218,7 @@ static uint add_fs_modes(struct amdgpu_dm_connector *aconnector) drm_mode_probed_add(&aconnector->base, new_mode); new_modes_count += 1; } else - drm_mode_destroy(aconnector->base.dev, new_mode); + drm_mode_destroy(aconnector->base.drm, new_mode); } out: return new_modes_count; @@ -8990,7 +8990,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) static int dm_force_atomic_commit(struct drm_connector *connector) { int ret = 0; - struct drm_device *ddev = connector->dev; + struct drm_device *ddev = connector->drm; struct drm_atomic_state *state = drm_atomic_state_alloc(ddev); struct amdgpu_crtc *disconnected_acrtc = to_amdgpu_crtc(connector->encoder->crtc); struct drm_plane *plane = disconnected_acrtc->base.primary; @@ -10513,7 +10513,7 @@ static bool parse_edid_cea(struct amdgpu_dm_connector *aconnector, u8 *edid_ext, int len, struct amdgpu_hdmi_vsdb_info *vsdb_info) { - struct amdgpu_device *adev = drm_to_adev(aconnector->base.dev); + struct amdgpu_device *adev = drm_to_adev(aconnector->base.drm); bool ret; mutex_lock(&adev->dm.dc_lock); @@ -10579,7 +10579,7 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, struct dm_connector_state *dm_con_state = NULL; struct dc_sink *sink; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_hdmi_vsdb_info vsdb_info = {0}; bool freesync_capable = false; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c index 5ea3284b2b77..3b27f3c445a4 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c @@ -254,7 +254,7 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf, { struct amdgpu_dm_connector *connector = file_inode(f)->i_private; struct dc_link *link = connector->dc_link; - struct amdgpu_device *adev = drm_to_adev(connector->base.dev); + struct amdgpu_device *adev = drm_to_adev(connector->base.drm); struct dc *dc = (struct dc *)link->dc; struct dc_link_settings prefer_link_settings; char *wr_buf = NULL; @@ -1107,7 +1107,7 @@ static int dp_dsc_fec_support_show(struct seq_file *m, void *data) { struct drm_connector *connector = m->private; struct drm_modeset_acquire_ctx ctx; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector); int ret = 0; bool try_again = false; @@ -1180,7 +1180,7 @@ static ssize_t trigger_hotplug(struct file *f, const char __user *buf, struct amdgpu_dm_connector *aconnector = file_inode(f)->i_private; struct drm_connector *connector = &aconnector->base; struct dc_link *link = NULL; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); enum dc_connection_type new_connection_type = dc_connection_none; char *wr_buf = NULL; @@ -1381,7 +1381,7 @@ static ssize_t dp_dsc_clock_en_write(struct file *f, const char __user *buf, { struct amdgpu_dm_connector *aconnector = file_inode(f)->i_private; struct drm_connector *connector = &aconnector->base; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_crtc *crtc = NULL; struct dm_crtc_state *dm_crtc_state = NULL; struct pipe_ctx *pipe_ctx; @@ -1566,7 +1566,7 @@ static ssize_t dp_dsc_slice_width_write(struct file *f, const char __user *buf, struct amdgpu_dm_connector *aconnector = file_inode(f)->i_private; struct pipe_ctx *pipe_ctx; struct drm_connector *connector = &aconnector->base; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_crtc *crtc = NULL; struct dm_crtc_state *dm_crtc_state = NULL; int i; @@ -1749,7 +1749,7 @@ static ssize_t dp_dsc_slice_height_write(struct file *f, const char __user *buf, { struct amdgpu_dm_connector *aconnector = file_inode(f)->i_private; struct drm_connector *connector = &aconnector->base; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_crtc *crtc = NULL; struct dm_crtc_state *dm_crtc_state = NULL; struct pipe_ctx *pipe_ctx; @@ -1926,7 +1926,7 @@ static ssize_t dp_dsc_bits_per_pixel_write(struct file *f, const char __user *bu { struct amdgpu_dm_connector *aconnector = file_inode(f)->i_private; struct drm_connector *connector = &aconnector->base; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_crtc *crtc = NULL; struct dm_crtc_state *dm_crtc_state = NULL; struct pipe_ctx *pipe_ctx; @@ -2288,7 +2288,7 @@ static ssize_t dp_max_bpc_read(struct file *f, char __user *buf, { struct amdgpu_dm_connector *aconnector = file_inode(f)->i_private; struct drm_connector *connector = &aconnector->base; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct dm_connector_state *state; ssize_t result = 0; char *rd_buf = NULL; @@ -2364,7 +2364,7 @@ static ssize_t dp_max_bpc_write(struct file *f, const char __user *buf, struct amdgpu_dm_connector *aconnector = file_inode(f)->i_private; struct drm_connector *connector = &aconnector->base; struct dm_connector_state *state; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; char *wr_buf = NULL; uint32_t wr_buf_size = 42; int max_param_num = 1; @@ -2520,7 +2520,7 @@ static int dp_mst_progress_status_show(struct seq_file *m, void *unused) { struct drm_connector *connector = m->private; struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector); - struct amdgpu_device *adev = drm_to_adev(connector->dev); + struct amdgpu_device *adev = drm_to_adev(connector->drm); int i; mutex_lock(&aconnector->hpd_lock); @@ -2765,7 +2765,7 @@ static int allow_edp_hotplug_detection_get(void *data, u64 *val) { struct amdgpu_dm_connector *aconnector = data; struct drm_connector *connector = &aconnector->base; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); *val = adev->dm.dc->config.allow_edp_hotplug_detection; @@ -2778,7 +2778,7 @@ static int allow_edp_hotplug_detection_set(void *data, u64 val) { struct amdgpu_dm_connector *aconnector = data; struct drm_connector *connector = &aconnector->base; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); adev->dm.dc->config.allow_edp_hotplug_detection = (uint32_t) val; @@ -2888,7 +2888,7 @@ static ssize_t edp_ilr_write(struct file *f, const char __user *buf, { struct amdgpu_dm_connector *connector = file_inode(f)->i_private; struct dc_link *link = connector->dc_link; - struct amdgpu_device *adev = drm_to_adev(connector->base.dev); + struct amdgpu_device *adev = drm_to_adev(connector->base.drm); struct dc *dc = (struct dc *)link->dc; struct dc_link_settings prefer_link_settings; char *wr_buf = NULL; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c index 5536d17306d0..c63759332194 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c @@ -325,7 +325,7 @@ static void event_property_update(struct work_struct *work) if (!conn_state) continue; - dev = connector->dev; + dev = connector->drm; if (!dev) continue; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 46d0a8f57e55..b26520088e90 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -376,7 +376,7 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector) * will be retrieved from hdcp_work within dm_dp_mst_get_modes */ if (aconnector->dc_sink && connector->state) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); if (adev->dm.hdcp_workqueue) { @@ -419,7 +419,7 @@ dm_mst_atomic_best_encoder(struct drm_connector *connector, { struct drm_connector_state *connector_state = drm_atomic_get_new_connector_state(state, connector); - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_crtc *acrtc = to_amdgpu_crtc(connector_state->crtc); @@ -551,7 +551,7 @@ dm_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, const char *pathprop) { struct amdgpu_dm_connector *master = container_of(mgr, struct amdgpu_dm_connector, mst_mgr); - struct drm_device *dev = master->base.dev; + struct drm_device *dev = master->base.drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_dm_connector *aconnector; struct drm_connector *connector; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c index ebccb74306a7..d0d24ca4a4d4 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c @@ -90,7 +90,7 @@ static enum drm_mode_status komeda_wb_connector_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_mode_config *mode_config = &dev->mode_config; int w = mode->hdisplay, h = mode->vdisplay; diff --git a/drivers/gpu/drm/arm/malidp_mw.c b/drivers/gpu/drm/arm/malidp_mw.c index 626709bec6f5..0dd21bc77dd8 100644 --- a/drivers/gpu/drm/arm/malidp_mw.c +++ b/drivers/gpu/drm/arm/malidp_mw.c @@ -35,7 +35,7 @@ struct malidp_mw_connector_state { static int malidp_mw_connector_get_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; return drm_add_modes_noedid(connector, dev->mode_config.max_width, dev->mode_config.max_height); @@ -45,7 +45,7 @@ static enum drm_mode_status malidp_mw_connector_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_mode_config *mode_config = &dev->mode_config; int w = mode->hdisplay, h = mode->vdisplay; diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index f91ff312edfd..31a3e590395e 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -1346,7 +1346,7 @@ static int ast_crtc_init(struct drm_device *dev) static int ast_vga_connector_helper_get_modes(struct drm_connector *connector) { struct ast_vga_connector *ast_vga_connector = to_ast_vga_connector(connector); - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct ast_device *ast = to_ast_device(dev); struct edid *edid; int count; @@ -1452,7 +1452,7 @@ static int ast_vga_output_init(struct ast_device *ast) static int ast_sil164_connector_helper_get_modes(struct drm_connector *connector) { struct ast_sil164_connector *ast_sil164_connector = to_ast_sil164_connector(connector); - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct ast_device *ast = to_ast_device(dev); struct edid *edid; int count; @@ -1565,7 +1565,7 @@ static int ast_dp501_connector_helper_get_modes(struct drm_connector *connector) if (!edid) goto err_drm_connector_update_edid_property; - succ = ast_dp501_read_edid(connector->dev, edid); + succ = ast_dp501_read_edid(connector->drm, edid); if (!succ) goto err_kfree; @@ -1644,7 +1644,7 @@ static int ast_dp501_output_init(struct ast_device *ast) static int ast_astdp_connector_helper_get_modes(struct drm_connector *connector) { void *edid; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct ast_device *ast = to_ast_device(dev); int succ; @@ -1660,7 +1660,7 @@ static int ast_astdp_connector_helper_get_modes(struct drm_connector *connector) */ mutex_lock(&ast->ioregs_lock); - succ = ast_astdp_read_edid(connector->dev, edid); + succ = ast_astdp_read_edid(connector->drm, edid); if (succ < 0) goto err_mutex_unlock; diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index 52da4df1cc52..54001d4cf8bd 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -454,10 +454,10 @@ static void adv7511_hpd_work(struct work_struct *work) if (adv7511->connector.status != status) { adv7511->connector.status = status; - if (adv7511->connector.dev) { + if (adv7511->connector.drm) { if (status == connector_status_disconnected) cec_phys_addr_invalidate(adv7511->cec_adap); - drm_kms_helper_hotplug_event(adv7511->connector.dev); + drm_kms_helper_hotplug_event(adv7511->connector.drm); } else { drm_bridge_hpd_notify(&adv7511->bridge, status); } diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c index 0b66b72a5913..0f39d8807b40 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c @@ -1189,7 +1189,7 @@ static irqreturn_t anx78xx_intp_threaded_handler(int unused, void *data) mutex_unlock(&anx78xx->lock); if (event) - drm_helper_hpd_irq_event(anx78xx->connector.dev); + drm_helper_hpd_irq_event(anx78xx->connector.drm); return IRQ_HANDLED; } diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 9156c74a7b3b..ff7ea058ca64 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -2109,7 +2109,7 @@ static void hdcp_check_work_func(struct work_struct *work) return; } - drm_dev = ctx->connector->dev; + drm_dev = ctx->connector->drm; drm_modeset_lock(&drm_dev->mode_config.connection_mutex, NULL); mutex_lock(&ctx->hdcp_wq_lock); diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index d102db6d4c65..107dd0928d8e 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -811,7 +811,7 @@ static void cdns_mhdp_fw_cb(const struct firmware *fw, void *context) bridge_attached = mhdp->bridge_attached; spin_unlock(&mhdp->start_lock); if (bridge_attached) { - if (mhdp->connector.dev) + if (mhdp->connector.drm) drm_kms_helper_hotplug_event(mhdp->bridge.drm); else drm_bridge_hpd_notify(&mhdp->bridge, cdns_mhdp_detect(mhdp)); @@ -2367,14 +2367,14 @@ static void cdns_mhdp_modeset_retry_fn(struct work_struct *work) conn = &mhdp->connector; /* Grab the locks before changing connector property */ - mutex_lock(&conn->dev->mode_config.mutex); + mutex_lock(&conn->drm->mode_config.mutex); /* * Set connector link status to BAD and send a Uevent to notify * userspace to do a modeset. */ drm_connector_set_link_status_property(conn, DRM_MODE_LINK_STATUS_BAD); - mutex_unlock(&conn->dev->mode_config.mutex); + mutex_unlock(&conn->drm->mode_config.mutex); /* Send Hotplug uevent so userspace can reprobe */ drm_kms_helper_hotplug_event(mhdp->bridge.drm); @@ -2441,7 +2441,7 @@ static void cdns_mhdp_hpd_work(struct work_struct *work) int ret; ret = cdns_mhdp_update_link_status(mhdp); - if (mhdp->connector.dev) { + if (mhdp->connector.drm) { if (ret < 0) schedule_work(&mhdp->modeset_retry_work); else diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c index 946212a95598..f64d4159f6e0 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c @@ -486,7 +486,7 @@ static void cdns_mhdp_hdcp_prop_work(struct work_struct *work) struct cdns_mhdp_device *mhdp = container_of(hdcp, struct cdns_mhdp_device, hdcp); - struct drm_device *dev = mhdp->connector.dev; + struct drm_device *dev = mhdp->connector.drm; struct drm_connector_state *state; drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); diff --git a/drivers/gpu/drm/bridge/chrontel-ch7033.c b/drivers/gpu/drm/bridge/chrontel-ch7033.c index 9c12e1652e4a..74db1305f7aa 100644 --- a/drivers/gpu/drm/bridge/chrontel-ch7033.c +++ b/drivers/gpu/drm/bridge/chrontel-ch7033.c @@ -264,7 +264,7 @@ static void ch7033_hpd_event(void *arg, enum drm_connector_status status) struct ch7033_priv *priv = arg; if (priv->bridge.drm) - drm_helper_hpd_irq_event(priv->connector.dev); + drm_helper_hpd_irq_event(priv->connector.drm); } static int ch7033_bridge_attach(struct drm_bridge *bridge, diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c index 9189d2c3cdc8..84806d58aab0 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c @@ -170,9 +170,9 @@ static void lt9611uxc_hpd_work(struct work_struct *work) struct lt9611uxc *lt9611uxc = container_of(work, struct lt9611uxc, work); bool connected; - if (lt9611uxc->connector.dev) { - if (lt9611uxc->connector.dev->mode_config.funcs) - drm_kms_helper_hotplug_event(lt9611uxc->connector.dev); + if (lt9611uxc->connector.drm) { + if (lt9611uxc->connector.drm->mode_config.funcs) + drm_kms_helper_hotplug_event(lt9611uxc->connector.drm); } else { mutex_lock(<9611uxc->ocm_lock); diff --git a/drivers/gpu/drm/bridge/nxp-ptn3460.c b/drivers/gpu/drm/bridge/nxp-ptn3460.c index 27b01a2c216e..dae00374f523 100644 --- a/drivers/gpu/drm/bridge/nxp-ptn3460.c +++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c @@ -246,7 +246,7 @@ static int ptn3460_bridge_attach(struct drm_bridge *bridge, drm_connector_attach_encoder(&ptn_bridge->connector, bridge->encoder); - drm_helper_hpd_irq_event(ptn_bridge->connector.dev); + drm_helper_hpd_irq_event(ptn_bridge->connector.drm); return ret; } diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index d5ce29a74910..c7807543547d 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -107,7 +107,7 @@ static void panel_bridge_detach(struct drm_bridge *bridge) * allocated with drmm_kzalloc(). This might be tricky since the * drm_device pointer can only be retrieved when the bridge is attached. */ - if (connector->dev) + if (connector->drm) drm_connector_cleanup(connector); } diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index 3d8ecc6d78ef..64499fa1748a 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -173,7 +173,7 @@ static void tfp410_detach(struct drm_bridge *bridge) { struct tfp410 *dvi = drm_bridge_to_tfp410(bridge); - if (dvi->connector.dev && dvi->next_bridge->ops & DRM_BRIDGE_OP_HPD) { + if (dvi->connector.drm && dvi->next_bridge->ops & DRM_BRIDGE_OP_HPD) { drm_bridge_hpd_disable(dvi->next_bridge); cancel_delayed_work_sync(&dvi->hpd_work); } diff --git a/drivers/gpu/drm/display/drm_dp_cec.c b/drivers/gpu/drm/display/drm_dp_cec.c index ae39dc794190..fc50faf22908 100644 --- a/drivers/gpu/drm/display/drm_dp_cec.c +++ b/drivers/gpu/drm/display/drm_dp_cec.c @@ -361,7 +361,7 @@ void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid) cec_fill_conn_info_from_drm(&conn_info, connector); cec_s_conn_info(aux->cec.adap, &conn_info); - if (cec_register_adapter(aux->cec.adap, connector->dev->dev)) { + if (cec_register_adapter(aux->cec.adap, connector->drm->dev)) { cec_delete_adapter(aux->cec.adap); aux->cec.adap = NULL; } else { diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c index 16565a0a5da6..efee04cf6edd 100644 --- a/drivers/gpu/drm/display/drm_dp_helper.c +++ b/drivers/gpu/drm/display/drm_dp_helper.c @@ -1519,7 +1519,7 @@ void drm_dp_set_subconnector_property(struct drm_connector *connector, if (status == connector_status_connected) subconnector = drm_dp_subconnector_type(dpcd, port_cap); drm_object_property_set_value(&connector->base, - connector->dev->mode_config.dp_subconnector_property, + connector->drm->mode_config.dp_subconnector_property, subconnector); } EXPORT_SYMBOL(drm_dp_set_subconnector_property); diff --git a/drivers/gpu/drm/display/drm_hdcp_helper.c b/drivers/gpu/drm/display/drm_hdcp_helper.c index a3f0e6d96105..51b3ab5d0136 100644 --- a/drivers/gpu/drm/display/drm_hdcp_helper.c +++ b/drivers/gpu/drm/display/drm_hdcp_helper.c @@ -355,7 +355,7 @@ DRM_ENUM_NAME_FN(drm_get_hdcp_content_type_name, int drm_connector_attach_content_protection_property( struct drm_connector *connector, bool hdcp_content_type) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_property *prop = dev->mode_config.content_protection_property; @@ -407,7 +407,7 @@ EXPORT_SYMBOL(drm_connector_attach_content_protection_property); void drm_hdcp_update_content_protection(struct drm_connector *connector, u64 val) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_connector_state *state = connector->state; WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex)); diff --git a/drivers/gpu/drm/display/drm_scdc_helper.c b/drivers/gpu/drm/display/drm_scdc_helper.c index 6d2f244e5830..25df344de565 100644 --- a/drivers/gpu/drm/display/drm_scdc_helper.c +++ b/drivers/gpu/drm/display/drm_scdc_helper.c @@ -157,7 +157,7 @@ bool drm_scdc_get_scrambling_status(struct drm_connector *connector) ret = drm_scdc_readb(connector->ddc, SCDC_SCRAMBLER_STATUS, &status); if (ret < 0) { - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] Failed to read scrambling status: %d\n", connector->base.id, connector->name, ret); return false; @@ -187,7 +187,7 @@ bool drm_scdc_set_scrambling(struct drm_connector *connector, ret = drm_scdc_readb(connector->ddc, SCDC_TMDS_CONFIG, &config); if (ret < 0) { - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] Failed to read TMDS config: %d\n", connector->base.id, connector->name, ret); return false; @@ -200,7 +200,7 @@ bool drm_scdc_set_scrambling(struct drm_connector *connector, ret = drm_scdc_writeb(connector->ddc, SCDC_TMDS_CONFIG, config); if (ret < 0) { - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] Failed to enable scrambling: %d\n", connector->base.id, connector->name, ret); return false; @@ -247,7 +247,7 @@ bool drm_scdc_set_high_tmds_clock_ratio(struct drm_connector *connector, ret = drm_scdc_readb(connector->ddc, SCDC_TMDS_CONFIG, &config); if (ret < 0) { - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] Failed to read TMDS config: %d\n", connector->base.id, connector->name, ret); return false; @@ -260,7 +260,7 @@ bool drm_scdc_set_high_tmds_clock_ratio(struct drm_connector *connector, ret = drm_scdc_writeb(connector->ddc, SCDC_TMDS_CONFIG, config); if (ret < 0) { - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] Failed to set TMDS clock ratio: %d\n", connector->base.id, connector->name, ret); return false; diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 8a07506a20a2..f473848d5ecb 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -466,7 +466,7 @@ static int drm_atomic_connector_check(struct drm_connector *connector, return 0; if (writeback_job->fb && !state->crtc) { - drm_dbg_atomic(connector->dev, + drm_dbg_atomic(connector->drm, "[CONNECTOR:%d:%s] framebuffer without CRTC\n", connector->base.id, connector->name); return -EINVAL; @@ -477,7 +477,7 @@ static int drm_atomic_connector_check(struct drm_connector *connector, state->crtc); if (writeback_job->fb && !crtc_state->active) { - drm_dbg_atomic(connector->dev, + drm_dbg_atomic(connector->drm, "[CONNECTOR:%d:%s] has framebuffer, but [CRTC:%d] is off\n", connector->base.id, connector->name, state->crtc->base.id); @@ -486,7 +486,7 @@ static int drm_atomic_connector_check(struct drm_connector *connector, if (!writeback_job->fb) { if (writeback_job->out_fence) { - drm_dbg_atomic(connector->dev, + drm_dbg_atomic(connector->drm, "[CONNECTOR:%d:%s] requesting out-fence without framebuffer\n", connector->base.id, connector->name); return -EINVAL; @@ -1064,7 +1064,7 @@ drm_atomic_get_connector_state(struct drm_atomic_state *state, struct drm_connector *connector) { int ret, index; - struct drm_mode_config *config = &connector->dev->mode_config; + struct drm_mode_config *config = &connector->drm->mode_config; struct drm_connector_state *connector_state; WARN_ON(!state->acquire_ctx); @@ -1105,7 +1105,8 @@ drm_atomic_get_connector_state(struct drm_atomic_state *state, state->connectors[index].ptr = connector; connector_state->state = state; - drm_dbg_atomic(connector->dev, "Added [CONNECTOR:%d:%s] %p state to %p\n", + drm_dbg_atomic(connector->drm, + "Added [CONNECTOR:%d:%s] %p state to %p\n", connector->base.id, connector->name, connector_state, state); diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 664d0595ea89..98c9377aeef5 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -133,7 +133,7 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state, if (new_encoder) { if (encoder_mask & drm_encoder_mask(new_encoder)) { - drm_dbg_atomic(connector->dev, + drm_dbg_atomic(connector->drm, "[ENCODER:%d:%s] on [CONNECTOR:%d:%s] already assigned\n", new_encoder->base.id, new_encoder->name, connector->base.id, connector->name); @@ -171,7 +171,7 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state, continue; if (!disable_conflicting_encoders) { - drm_dbg_atomic(connector->dev, + drm_dbg_atomic(connector->drm, "[ENCODER:%d:%s] in use on [CRTC:%d:%s] by [CONNECTOR:%d:%s]\n", encoder->base.id, encoder->name, connector->state->crtc->base.id, @@ -187,7 +187,7 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state, goto out; } - drm_dbg_atomic(connector->dev, + drm_dbg_atomic(connector->drm, "[ENCODER:%d:%s] in use on [CRTC:%d:%s], disabling [CONNECTOR:%d:%s]\n", encoder->base.id, encoder->name, new_conn_state->crtc->base.id, new_conn_state->crtc->name, @@ -296,7 +296,8 @@ update_connector_routing(struct drm_atomic_state *state, struct drm_encoder *new_encoder; struct drm_crtc_state *crtc_state; - drm_dbg_atomic(connector->dev, "Updating routing for [CONNECTOR:%d:%s]\n", + drm_dbg_atomic(connector->drm, + "Updating routing for [CONNECTOR:%d:%s]\n", connector->base.id, connector->name); if (old_connector_state->crtc != new_connector_state->crtc) { @@ -312,7 +313,8 @@ update_connector_routing(struct drm_atomic_state *state, } if (!new_connector_state->crtc) { - drm_dbg_atomic(connector->dev, "Disabling [CONNECTOR:%d:%s]\n", + drm_dbg_atomic(connector->drm, + "Disabling [CONNECTOR:%d:%s]\n", connector->base.id, connector->name); set_best_encoder(state, new_connector_state, NULL); @@ -342,7 +344,7 @@ update_connector_routing(struct drm_atomic_state *state, */ if (!state->duplicated && drm_connector_is_unregistered(connector) && crtc_state->active) { - drm_dbg_atomic(connector->dev, + drm_dbg_atomic(connector->drm, "[CONNECTOR:%d:%s] is not registered\n", connector->base.id, connector->name); return -EINVAL; @@ -358,14 +360,14 @@ update_connector_routing(struct drm_atomic_state *state, new_encoder = drm_connector_get_single_encoder(connector); if (!new_encoder) { - drm_dbg_atomic(connector->dev, + drm_dbg_atomic(connector->drm, "No suitable encoder found for [CONNECTOR:%d:%s]\n", connector->base.id, connector->name); return -EINVAL; } if (!drm_encoder_crtc_ok(new_encoder, new_connector_state->crtc)) { - drm_dbg_atomic(connector->dev, + drm_dbg_atomic(connector->drm, "[ENCODER:%d:%s] incompatible with [CRTC:%d:%s]\n", new_encoder->base.id, new_encoder->name, @@ -377,7 +379,7 @@ update_connector_routing(struct drm_atomic_state *state, if (new_encoder == new_connector_state->best_encoder) { set_best_encoder(state, new_connector_state, new_encoder); - drm_dbg_atomic(connector->dev, + drm_dbg_atomic(connector->drm, "[CONNECTOR:%d:%s] keeps [ENCODER:%d:%s], now on [CRTC:%d:%s]\n", connector->base.id, connector->name, @@ -395,7 +397,7 @@ update_connector_routing(struct drm_atomic_state *state, crtc_state->connectors_changed = true; - drm_dbg_atomic(connector->dev, + drm_dbg_atomic(connector->drm, "[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d:%s]\n", connector->base.id, connector->name, @@ -2328,7 +2330,7 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state, */ if (nonblock && old_conn_state->commit && !try_wait_for_completion(&old_conn_state->commit->flip_done)) { - drm_dbg_atomic(conn->dev, + drm_dbg_atomic(conn->drm, "[CONNECTOR:%d:%s] busy with a previous commit\n", conn->base.id, conn->name); @@ -2406,7 +2408,7 @@ void drm_atomic_helper_wait_for_dependencies(struct drm_atomic_state *old_state) for_each_old_connector_in_state(old_state, conn, old_conn_state, i) { ret = drm_crtc_commit_wait(old_conn_state->commit); if (ret) - drm_err(conn->dev, + drm_err(conn->drm, "[CONNECTOR:%d:%s] commit wait timed out\n", conn->base.id, conn->name); } diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c index 784e63d70a42..c551dad67694 100644 --- a/drivers/gpu/drm/drm_atomic_state_helper.c +++ b/drivers/gpu/drm/drm_atomic_state_helper.c @@ -489,7 +489,7 @@ EXPORT_SYMBOL(drm_atomic_helper_connector_tv_margins_reset); */ void drm_atomic_helper_connector_tv_reset(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_cmdline_mode *cmdline = &connector->cmdline_mode; struct drm_connector_state *state = connector->state; struct drm_property *prop; diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index 44f7b5c3b2d1..84133002e46c 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -301,12 +301,12 @@ drm_atomic_set_crtc_for_connector(struct drm_connector_state *conn_state, drm_connector_get(conn_state->connector); conn_state->crtc = crtc; - drm_dbg_atomic(connector->dev, + drm_dbg_atomic(connector->drm, "Link [CONNECTOR:%d:%s] state %p to [CRTC:%d:%s]\n", connector->base.id, connector->name, conn_state, crtc->base.id, crtc->name); } else { - drm_dbg_atomic(connector->dev, + drm_dbg_atomic(connector->drm, "Link [CONNECTOR:%d:%s] state %p to [NOCRTC]\n", connector->base.id, connector->name, conn_state); @@ -676,11 +676,11 @@ static int drm_atomic_set_writeback_fb_for_connector( return ret; if (fb) - drm_dbg_atomic(conn->dev, + drm_dbg_atomic(conn->drm, "Set [FB:%d] for connector state %p\n", fb->base.id, conn_state); else - drm_dbg_atomic(conn->dev, + drm_dbg_atomic(conn->drm, "Set [NOFB] for connector state %p\n", conn_state); @@ -691,7 +691,7 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector, struct drm_connector_state *state, struct drm_file *file_priv, struct drm_property *property, uint64_t val) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_mode_config *config = &dev->mode_config; bool replaced = false; int ret; @@ -802,7 +802,7 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector, return connector->funcs->atomic_set_property(connector, state, property, val); } else { - drm_dbg_atomic(connector->dev, + drm_dbg_atomic(connector->drm, "[CONNECTOR:%d:%s] unknown property [PROP:%d:%s]\n", connector->base.id, connector->name, property->base.id, property->name); @@ -817,7 +817,7 @@ drm_atomic_connector_get_property(struct drm_connector *connector, const struct drm_connector_state *state, struct drm_property *property, uint64_t *val) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_mode_config *config = &dev->mode_config; if (property == config->prop_crtc_id) { diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c index fc6f16e14f36..a09be77daea1 100644 --- a/drivers/gpu/drm/drm_bridge_connector.c +++ b/drivers/gpu/drm/drm_bridge_connector.c @@ -112,7 +112,7 @@ static void drm_bridge_connector_hpd_cb(void *cb_data, { struct drm_bridge_connector *drm_bridge_connector = cb_data; struct drm_connector *connector = &drm_bridge_connector->base; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; enum drm_connector_status old_status; mutex_lock(&dev->mode_config.mutex); diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index bf8371dc2a61..c0d3bcf9f643 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -193,7 +193,7 @@ static void drm_connector_free(struct kref *kref) { struct drm_connector *connector = container_of(kref, struct drm_connector, base.refcount); - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; drm_mode_object_unregister(dev, &connector->base); connector->funcs->destroy(connector); @@ -240,7 +240,7 @@ static int __drm_connector_init(struct drm_device *dev, return ret; connector->base.properties = &connector->properties; - connector->dev = dev; + connector->drm = dev; connector->funcs = funcs; /* connector index is used with 32bit bitmasks */ @@ -462,7 +462,7 @@ EXPORT_SYMBOL(drmm_connector_init); */ void drm_connector_attach_edid_property(struct drm_connector *connector) { - struct drm_mode_config *config = &connector->dev->mode_config; + struct drm_mode_config *config = &connector->drm->mode_config; drm_object_attach_property(&connector->base, config->edid_property, @@ -525,7 +525,7 @@ static void drm_mode_remove(struct drm_connector *connector, struct drm_display_mode *mode) { list_del(&mode->head); - drm_mode_destroy(connector->dev, mode); + drm_mode_destroy(connector->drm, mode); } /** @@ -536,7 +536,7 @@ static void drm_mode_remove(struct drm_connector *connector, */ void drm_connector_cleanup(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_display_mode *mode, *t; /* The connector should have been removed from userspace long before @@ -612,7 +612,7 @@ int drm_connector_register(struct drm_connector *connector) { int ret = 0; - if (!connector->dev->registered) + if (!connector->drm->registered) return 0; mutex_lock(&connector->mutex); @@ -631,7 +631,7 @@ int drm_connector_register(struct drm_connector *connector) goto err_debugfs; } - drm_mode_object_register(connector->dev, &connector->base); + drm_mode_object_register(connector->drm, &connector->base); connector->registration_state = DRM_CONNECTOR_REGISTERED; @@ -797,7 +797,7 @@ EXPORT_SYMBOL(drm_connector_list_iter_begin); static void __drm_connector_put_safe(struct drm_connector *conn) { - struct drm_mode_config *config = &conn->dev->mode_config; + struct drm_mode_config *config = &conn->drm->mode_config; lockdep_assert_held(&config->connector_list_lock); @@ -1582,15 +1582,15 @@ EXPORT_SYMBOL(drm_mode_create_dvi_i_properties); */ void drm_connector_attach_dp_subconnector_property(struct drm_connector *connector) { - struct drm_mode_config *mode_config = &connector->dev->mode_config; + struct drm_mode_config *mode_config = &connector->drm->mode_config; if (!mode_config->dp_subconnector_property) mode_config->dp_subconnector_property = - drm_property_create_enum(connector->dev, - DRM_MODE_PROP_IMMUTABLE, - "subconnector", - drm_dp_subconnector_enum_list, - ARRAY_SIZE(drm_dp_subconnector_enum_list)); + drm_property_create_enum(connector->drm, + DRM_MODE_PROP_IMMUTABLE, + "subconnector", + drm_dp_subconnector_enum_list, + ARRAY_SIZE(drm_dp_subconnector_enum_list)); drm_object_attach_property(&connector->base, mode_config->dp_subconnector_property, @@ -1696,9 +1696,9 @@ EXPORT_SYMBOL(drm_connector_attach_dp_subconnector_property); */ int drm_connector_attach_content_type_property(struct drm_connector *connector) { - if (!drm_mode_create_content_type_property(connector->dev)) + if (!drm_mode_create_content_type_property(connector->drm)) drm_object_attach_property(&connector->base, - connector->dev->mode_config.content_type_property, + connector->drm->mode_config.content_type_property, DRM_MODE_CONTENT_TYPE_NO_DATA); return 0; } @@ -1714,7 +1714,7 @@ EXPORT_SYMBOL(drm_connector_attach_content_type_property); */ void drm_connector_attach_tv_margin_properties(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; drm_object_attach_property(&connector->base, dev->mode_config.tv_left_margin_property, @@ -2024,7 +2024,7 @@ EXPORT_SYMBOL(drm_mode_create_scaling_mode_property); int drm_connector_attach_vrr_capable_property( struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_property *prop; if (!connector->vrr_capable_property) { @@ -2058,7 +2058,7 @@ EXPORT_SYMBOL(drm_connector_attach_vrr_capable_property); int drm_connector_attach_scaling_mode_property(struct drm_connector *connector, u32 scaling_mode_mask) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_property *scaling_mode_property; int i; const unsigned valid_scaling_mode_mask = @@ -2159,7 +2159,7 @@ EXPORT_SYMBOL(drm_mode_create_aspect_ratio_property); static int drm_mode_create_colorspace_property(struct drm_connector *connector, u32 supported_colorspaces) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; u32 colorspaces = supported_colorspaces | BIT(DRM_MODE_COLORIMETRY_DEFAULT); struct drm_prop_enum_list enum_list[DRM_MODE_COLORIMETRY_COUNT]; int i, len; @@ -2318,7 +2318,7 @@ EXPORT_SYMBOL(drm_mode_create_suggested_offset_properties); int drm_connector_set_path_property(struct drm_connector *connector, const char *path) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; int ret; ret = drm_property_replace_global_blob(dev, @@ -2346,7 +2346,7 @@ EXPORT_SYMBOL(drm_connector_set_path_property); */ int drm_connector_set_tile_property(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; char tile[256]; int ret; @@ -2398,7 +2398,7 @@ EXPORT_SYMBOL(drm_connector_set_tile_property); void drm_connector_set_link_status_property(struct drm_connector *connector, uint64_t link_status) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); connector->state->link_status = link_status; @@ -2420,7 +2420,7 @@ EXPORT_SYMBOL(drm_connector_set_link_status_property); int drm_connector_attach_max_bpc_property(struct drm_connector *connector, int min, int max) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_property *prop; prop = connector->max_bpc_property; @@ -2452,7 +2452,7 @@ EXPORT_SYMBOL(drm_connector_attach_max_bpc_property); */ int drm_connector_attach_hdr_output_metadata_property(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_property *prop = dev->mode_config.hdr_output_metadata_property; drm_object_attach_property(&connector->base, prop, 0); @@ -2555,7 +2555,7 @@ int drm_connector_set_panel_orientation( struct drm_connector *connector, enum drm_panel_orientation panel_orientation) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_display_info *info = &connector->display_info; struct drm_property *prop; @@ -2667,16 +2667,16 @@ drm_connector_create_privacy_screen_properties(struct drm_connector *connector) /* Note sw-state only supports the first 2 values of the enum */ connector->privacy_screen_sw_state_property = - drm_property_create_enum(connector->dev, DRM_MODE_PROP_ENUM, - "privacy-screen sw-state", - privacy_screen_enum, 2); + drm_property_create_enum(connector->drm, DRM_MODE_PROP_ENUM, + "privacy-screen sw-state", + privacy_screen_enum, 2); connector->privacy_screen_hw_state_property = - drm_property_create_enum(connector->dev, - DRM_MODE_PROP_IMMUTABLE | DRM_MODE_PROP_ENUM, - "privacy-screen hw-state", - privacy_screen_enum, - ARRAY_SIZE(privacy_screen_enum)); + drm_property_create_enum(connector->drm, + DRM_MODE_PROP_IMMUTABLE | DRM_MODE_PROP_ENUM, + "privacy-screen hw-state", + privacy_screen_enum, + ARRAY_SIZE(privacy_screen_enum)); } EXPORT_SYMBOL(drm_connector_create_privacy_screen_properties); @@ -2724,7 +2724,7 @@ static int drm_connector_privacy_screen_notifier( { struct drm_connector *connector = container_of(nb, struct drm_connector, privacy_screen_notifier); - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); drm_connector_update_privacy_screen_properties(connector, true); @@ -2783,7 +2783,8 @@ void drm_connector_update_privacy_screen(const struct drm_connector_state *conne ret = drm_privacy_screen_set_sw_state(connector->privacy_screen, connector_state->privacy_screen_sw_state); if (ret) { - drm_err(connector->dev, "Error updating privacy-screen sw_state\n"); + drm_err(connector->drm, + "Error updating privacy-screen sw_state\n"); return; } @@ -2800,7 +2801,7 @@ int drm_connector_set_obj_prop(struct drm_mode_object *obj, struct drm_connector *connector = obj_to_connector(obj); /* Do DPMS ourselves */ - if (property == connector->dev->mode_config.dpms_property) { + if (property == connector->drm->mode_config.dpms_property) { ret = (*connector->funcs->dpms)(connector, (int)value); } else if (connector->funcs->set_property) ret = connector->funcs->set_property(connector, property, value); diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index a209659a996c..320c3f8690cb 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -908,7 +908,7 @@ int drm_helper_connector_dpms(struct drm_connector *connector, int mode) struct drm_crtc *crtc = encoder ? encoder->crtc : NULL; int old_dpms, encoder_dpms = DRM_MODE_DPMS_OFF; - WARN_ON(drm_drv_uses_atomic_modeset(connector->dev)); + WARN_ON(drm_drv_uses_atomic_modeset(connector->drm)); if (mode == connector->dpms) return 0; diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index 4855230ba2c6..f18d2af96db7 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -498,7 +498,7 @@ static const struct file_operations drm_connector_fops = { void drm_debugfs_connector_add(struct drm_connector *connector) { - struct drm_minor *minor = connector->dev->primary; + struct drm_minor *minor = connector->drm->primary; struct dentry *root; if (!minor->debugfs_root) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index f95152fac427..a148e87d8204 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2204,7 +2204,7 @@ static void connector_bad_edid(struct drm_connector *connector, if (connector->bad_edid_counter++ && !drm_debug_enabled(DRM_UT_KMS)) return; - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID is invalid:\n", + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] EDID is invalid:\n", connector->base.id, connector->name); for (i = 0; i < num_blocks; i++) edid_block_dump(KERN_DEBUG, edid + i, i); @@ -2252,13 +2252,14 @@ int drm_edid_override_set(struct drm_connector *connector, const void *edid, drm_edid = drm_edid_alloc(edid, size); if (!drm_edid_valid(drm_edid)) { - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID override invalid\n", + drm_dbg_kms(connector->drm, + "[CONNECTOR:%d:%s] EDID override invalid\n", connector->base.id, connector->name); drm_edid_free(drm_edid); return -EINVAL; } - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID override set\n", + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] EDID override set\n", connector->base.id, connector->name); mutex_lock(&connector->edid_override_mutex); @@ -2274,7 +2275,7 @@ int drm_edid_override_set(struct drm_connector *connector, const void *edid, /* For debugfs edid_override implementation */ int drm_edid_override_reset(struct drm_connector *connector) { - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID override reset\n", + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] EDID override reset\n", connector->base.id, connector->name); mutex_lock(&connector->edid_override_mutex); @@ -2309,7 +2310,7 @@ int drm_edid_override_connector_update(struct drm_connector *connector) drm_edid_free(override); - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] adding %d modes via fallback override/firmware EDID\n", connector->base.id, connector->name, num_modes); } @@ -2672,7 +2673,7 @@ const struct drm_edid *drm_edid_read_custom(struct drm_connector *connector, return NULL; /* Sanity check for now */ - drm_WARN_ON(connector->dev, !size); + drm_WARN_ON(connector->drm, !size); drm_edid = _drm_edid_alloc(edid, size); if (!drm_edid) @@ -2735,7 +2736,7 @@ EXPORT_SYMBOL(drm_edid_read_ddc); */ const struct drm_edid *drm_edid_read(struct drm_connector *connector) { - if (drm_WARN_ON(connector->dev, !connector->ddc)) + if (drm_WARN_ON(connector->drm, !connector->ddc)) return NULL; return drm_edid_read_ddc(connector, connector->ddc); @@ -2830,7 +2831,7 @@ EXPORT_SYMBOL(drm_edid_get_panel_id); struct edid *drm_get_edid_switcheroo(struct drm_connector *connector, struct i2c_adapter *adapter) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct pci_dev *pdev = to_pci_dev(dev->dev); struct edid *edid; @@ -2859,7 +2860,7 @@ EXPORT_SYMBOL(drm_get_edid_switcheroo); const struct drm_edid *drm_edid_read_switcheroo(struct drm_connector *connector, struct i2c_adapter *adapter) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct pci_dev *pdev = to_pci_dev(dev->dev); const struct drm_edid *drm_edid; @@ -3294,7 +3295,7 @@ static struct drm_display_mode *drm_mode_std(struct drm_connector *connector, const struct drm_edid *drm_edid, const struct std_timing *t) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_display_mode *m, *mode = NULL; int hsize, vsize; int vrefresh_rate; @@ -3436,7 +3437,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto const struct detailed_timing *timing) { const struct drm_display_info *info = &connector->display_info; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_display_mode *mode; const struct detailed_pixel_timing *pt = &timing->data.pixel_data; unsigned hactive = (pt->hactive_hblank_hi & 0xf0) << 4 | pt->hactive_lo; @@ -3648,7 +3649,7 @@ static int drm_dmt_modes_for_range(struct drm_connector *connector, { int i, modes = 0; struct drm_display_mode *newmode; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; for (i = 0; i < ARRAY_SIZE(drm_dmt_modes); i++) { if (mode_in_range(drm_dmt_modes + i, drm_edid, timing) && @@ -3683,7 +3684,7 @@ static int drm_gtf_modes_for_range(struct drm_connector *connector, { int i, modes = 0; struct drm_display_mode *newmode; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; for (i = 0; i < ARRAY_SIZE(extra_modes); i++) { const struct minimode *m = &extra_modes[i]; @@ -3712,7 +3713,7 @@ static int drm_gtf2_modes_for_range(struct drm_connector *connector, { int i, modes = 0; struct drm_display_mode *newmode; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; for (i = 0; i < ARRAY_SIZE(extra_modes); i++) { const struct minimode *m = &extra_modes[i]; @@ -3741,7 +3742,7 @@ static int drm_cvt_modes_for_range(struct drm_connector *connector, { int i, modes = 0; struct drm_display_mode *newmode; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; bool rb = drm_monitor_supports_rb(drm_edid); for (i = 0; i < ARRAY_SIZE(extra_modes); i++) { @@ -3834,7 +3835,7 @@ drm_est3_modes(struct drm_connector *connector, const struct detailed_timing *ti if (m >= ARRAY_SIZE(est3_modes)) break; if (est[i] & (1 << j)) { - mode = drm_mode_find_dmt(connector->dev, + mode = drm_mode_find_dmt(connector->drm, est3_modes[m].w, est3_modes[m].h, est3_modes[m].r, @@ -3869,7 +3870,7 @@ do_established_modes(const struct detailed_timing *timing, void *c) static int add_established_modes(struct drm_connector *connector, const struct drm_edid *drm_edid) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; const struct edid *edid = drm_edid->edid; unsigned long est_bits = edid->established_timings.t1 | (edid->established_timings.t2 << 8) | @@ -3961,7 +3962,7 @@ static int drm_cvt_modes(struct drm_connector *connector, { int i, j, modes = 0; struct drm_display_mode *newmode; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; const struct cvt_timing *cvt; static const int rates[] = { 60, 85, 75, 60, 50 }; const u8 empty[3] = { 0, 0, 0 }; @@ -4432,7 +4433,7 @@ static bool drm_valid_hdmi_vic(u8 vic) static int add_alternate_cea_modes(struct drm_connector *connector, const struct drm_edid *drm_edid) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_display_mode *mode, *tmp; LIST_HEAD(list); int modes = 0; @@ -4518,7 +4519,7 @@ static struct drm_display_mode * drm_display_mode_from_vic_index(struct drm_connector *connector, int vic_index) { const struct drm_display_info *info = &connector->display_info; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; if (!info->vics || vic_index >= info->vics_len || !info->vics[vic_index]) return NULL; @@ -4539,7 +4540,7 @@ drm_display_mode_from_vic_index(struct drm_connector *connector, int vic_index) static int do_y420vdb_modes(struct drm_connector *connector, const u8 *svds, u8 svds_len) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; int modes = 0, i; for (i = 0; i < svds_len; i++) { @@ -4641,7 +4642,7 @@ stereo_match_mandatory(const struct drm_display_mode *mode, static int add_hdmi_mandatory_stereo_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; const struct drm_display_mode *mode; struct list_head stereo_modes; int modes = 0, i; @@ -4675,11 +4676,12 @@ static int add_hdmi_mandatory_stereo_modes(struct drm_connector *connector) static int add_hdmi_mode(struct drm_connector *connector, u8 vic) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_display_mode *newmode; if (!drm_valid_hdmi_vic(vic)) { - drm_err(connector->dev, "[CONNECTOR:%d:%s] Unknown HDMI VIC: %d\n", + drm_err(connector->drm, + "[CONNECTOR:%d:%s] Unknown HDMI VIC: %d\n", connector->base.id, connector->name, vic); return 0; } @@ -5319,7 +5321,7 @@ static void fixup_detailed_cea_mode_clock(struct drm_connector *connector, if (mode->clock == clock) return; - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] detailed mode matches %s VIC %d, adjusting clock %d -> %d\n", connector->base.id, connector->name, type, vic, mode->clock, clock); @@ -5431,7 +5433,7 @@ drm_parse_hdmi_vsdb_audio(struct drm_connector *connector, const u8 *db) connector->audio_latency[1] = db[12]; } - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] HDMI: latency present %d %d, video latency %d %d, audio latency %d %d\n", connector->base.id, connector->name, connector->latency_present[0], connector->latency_present[1], @@ -5532,7 +5534,7 @@ static void drm_edid_to_eld(struct drm_connector *connector, return; mnl = get_monitor_name(drm_edid, &eld[DRM_ELD_MONITOR_NAME_STRING]); - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] ELD monitor %s\n", + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] ELD monitor %s\n", connector->base.id, connector->name, &eld[DRM_ELD_MONITOR_NAME_STRING]); @@ -5588,7 +5590,8 @@ static void drm_edid_to_eld(struct drm_connector *connector, eld[DRM_ELD_BASELINE_ELD_LEN] = DIV_ROUND_UP(drm_eld_calc_baseline_block_size(eld), 4); - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] ELD size %d, SAD count %d\n", + drm_dbg_kms(connector->drm, + "[CONNECTOR:%d:%s] ELD size %d, SAD count %d\n", connector->base.id, connector->name, drm_eld_size(eld), total_sad_count); } @@ -5947,7 +5950,7 @@ static void drm_parse_vcdb(struct drm_connector *connector, const u8 *db) { struct drm_display_info *info = &connector->display_info; - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] CEA VCDB 0x%02x\n", + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] CEA VCDB 0x%02x\n", connector->base.id, connector->name, db[2]); if (db[2] & EDID_CEA_VCDB_QS) @@ -6130,7 +6133,7 @@ static void drm_parse_hdmi_forum_scds(struct drm_connector *connector, dsc_support = true; } - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] HF-VSDB: max TMDS clock: %d KHz, HDMI 2.1 support: %s, DSC 1.2 support: %s\n", connector->base.id, connector->name, max_tmds_clock, str_yes_no(max_frl_rate), str_yes_no(dsc_support)); @@ -6151,38 +6154,44 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, if (hdmi[6] & DRM_EDID_HDMI_DC_30) { dc_bpc = 10; info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_30; - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 30.\n", + drm_dbg_kms(connector->drm, + "[CONNECTOR:%d:%s] HDMI sink does deep color 30.\n", connector->base.id, connector->name); } if (hdmi[6] & DRM_EDID_HDMI_DC_36) { dc_bpc = 12; info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_36; - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 36.\n", + drm_dbg_kms(connector->drm, + "[CONNECTOR:%d:%s] HDMI sink does deep color 36.\n", connector->base.id, connector->name); } if (hdmi[6] & DRM_EDID_HDMI_DC_48) { dc_bpc = 16; info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_48; - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 48.\n", + drm_dbg_kms(connector->drm, + "[CONNECTOR:%d:%s] HDMI sink does deep color 48.\n", connector->base.id, connector->name); } if (dc_bpc == 0) { - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] No deep color support on this HDMI sink.\n", + drm_dbg_kms(connector->drm, + "[CONNECTOR:%d:%s] No deep color support on this HDMI sink.\n", connector->base.id, connector->name); return; } - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] Assigning HDMI sink color depth as %d bpc.\n", + drm_dbg_kms(connector->drm, + "[CONNECTOR:%d:%s] Assigning HDMI sink color depth as %d bpc.\n", connector->base.id, connector->name, dc_bpc); info->bpc = dc_bpc; /* YCRCB444 is optional according to spec. */ if (hdmi[6] & DRM_EDID_HDMI_DC_Y444) { info->edid_hdmi_ycbcr444_dc_modes = info->edid_hdmi_rgb444_dc_modes; - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does YCRCB444 in deep color.\n", + drm_dbg_kms(connector->drm, + "[CONNECTOR:%d:%s] HDMI sink does YCRCB444 in deep color.\n", connector->base.id, connector->name); } @@ -6191,7 +6200,8 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, * then deep color 36 bit must be supported. */ if (!(hdmi[6] & DRM_EDID_HDMI_DC_36)) { - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink should do DC_36, but does not!\n", + drm_dbg_kms(connector->drm, + "[CONNECTOR:%d:%s] HDMI sink should do DC_36, but does not!\n", connector->base.id, connector->name); } } @@ -6219,7 +6229,8 @@ drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const u8 *db) if (len >= 8 && db[8] & BIT(5)) info->has_hdmi_infoframe = true; - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI: DVI dual %d, max TMDS clock %d kHz\n", + drm_dbg_kms(connector->drm, + "[CONNECTOR:%d:%s] HDMI: DVI dual %d, max TMDS clock %d kHz\n", connector->base.id, connector->name, info->dvi_dual, info->max_tmds_clock); @@ -6241,7 +6252,7 @@ static void drm_parse_microsoft_vsdb(struct drm_connector *connector, if (version == 1 || version == 2 || (version == 3 && !desktop_usage)) info->non_desktop = true; - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] HMD or specialized display VSDB version %u: 0x%02x\n", connector->base.id, connector->name, version, db[5]); } @@ -6265,7 +6276,7 @@ static void drm_parse_cea_ext(struct drm_connector *connector, info->cea_rev = edid_ext[1]; if (info->cea_rev != edid_ext[1]) - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] CEA extension version mismatch %u != %u\n", connector->base.id, connector->name, info->cea_rev, edid_ext[1]); @@ -6366,7 +6377,7 @@ static void drm_get_monitor_range(struct drm_connector *connector, drm_for_each_detailed_block(drm_edid, get_monitor_range, &closure); - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] Supported Monitor Refresh rate range is %d Hz - %d Hz\n", connector->base.id, connector->name, info->monitor_range.min_vfreq, info->monitor_range.max_vfreq); @@ -6380,7 +6391,7 @@ static void drm_parse_vesa_mso_data(struct drm_connector *connector, struct drm_display_info *info = &connector->display_info; if (block->num_bytes < 3) { - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] Unexpected vendor block size %u\n", connector->base.id, connector->name, block->num_bytes); return; @@ -6390,7 +6401,7 @@ static void drm_parse_vesa_mso_data(struct drm_connector *connector, return; if (sizeof(*vesa) != sizeof(*block) + block->num_bytes) { - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] Unexpected VESA vendor block size\n", connector->base.id, connector->name); return; @@ -6398,7 +6409,8 @@ static void drm_parse_vesa_mso_data(struct drm_connector *connector, switch (FIELD_GET(DISPLAYID_VESA_MSO_MODE, vesa->mso)) { default: - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] Reserved MSO mode value\n", + drm_dbg_kms(connector->drm, + "[CONNECTOR:%d:%s] Reserved MSO mode value\n", connector->base.id, connector->name); fallthrough; case 0: @@ -6419,14 +6431,14 @@ static void drm_parse_vesa_mso_data(struct drm_connector *connector, info->mso_pixel_overlap = FIELD_GET(DISPLAYID_VESA_MSO_OVERLAP, vesa->mso); if (info->mso_pixel_overlap > 8) { - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] Reserved MSO pixel overlap value %u\n", connector->base.id, connector->name, info->mso_pixel_overlap); info->mso_pixel_overlap = 8; } - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] MSO stream count %u, pixel overlap %u\n", connector->base.id, connector->name, info->mso_stream_count, info->mso_pixel_overlap); @@ -6550,7 +6562,7 @@ static void update_display_info(struct drm_connector *connector, if (info->bpc == 0 && edid->revision == 3 && edid->input & DRM_EDID_DIGITAL_DFP_1_X) { info->bpc = 8; - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] Assigning DFP sink color depth as %d bpc.\n", connector->base.id, connector->name, info->bpc); } @@ -6584,7 +6596,7 @@ static void update_display_info(struct drm_connector *connector, break; } - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] Assigning EDID-1.4 digital sink color depth as %d bpc.\n", connector->base.id, connector->name, info->bpc); @@ -6597,7 +6609,8 @@ static void update_display_info(struct drm_connector *connector, out: if (info->quirks & EDID_QUIRK_NON_DESKTOP) { - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] Non-desktop display%s\n", + drm_dbg_kms(connector->drm, + "[CONNECTOR:%d:%s] Non-desktop display%s\n", connector->base.id, connector->name, info->non_desktop ? " (redundant quirk)" : ""); info->non_desktop = true; @@ -6686,7 +6699,8 @@ static int add_displayid_detailed_1_modes(struct drm_connector *connector, for (i = 0; i < num_timings; i++) { struct displayid_detailed_timings_1 *timings = &det->timings[i]; - newmode = drm_mode_displayid_detailed(connector->dev, timings, type_7); + newmode = drm_mode_displayid_detailed(connector->drm, timings, + type_7); if (!newmode) continue; @@ -6759,7 +6773,7 @@ static void _drm_update_tile_info(struct drm_connector *connector, static int _drm_edid_connector_property_update(struct drm_connector *connector, const struct drm_edid *drm_edid) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; int ret; if (connector->edid_blob_ptr) { @@ -6905,7 +6919,7 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) const struct drm_edid *drm_edid; if (edid && !drm_edid_is_valid(edid)) { - drm_warn(connector->dev, "[CONNECTOR:%d:%s] EDID invalid.\n", + drm_warn(connector->drm, "[CONNECTOR:%d:%s] EDID invalid.\n", connector->base.id, connector->name); edid = NULL; } @@ -6934,7 +6948,7 @@ int drm_add_modes_noedid(struct drm_connector *connector, { int i, count, num_modes = 0; struct drm_display_mode *mode; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; count = ARRAY_SIZE(drm_dmt_modes); if (hdisplay < 0) @@ -7292,7 +7306,7 @@ static void drm_parse_tiled_block(struct drm_connector *connector, connector->tile_h_size = w + 1; connector->tile_v_size = h + 1; - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] tile cap 0x%x, size %dx%d, num tiles %dx%d, location %dx%d, vend %c%c%c", connector->base.id, connector->name, tile->tile_cap, @@ -7301,9 +7315,10 @@ static void drm_parse_tiled_block(struct drm_connector *connector, connector->tile_h_loc, connector->tile_v_loc, tile->topology_id[0], tile->topology_id[1], tile->topology_id[2]); - tg = drm_mode_get_tile_group(connector->dev, tile->topology_id); + tg = drm_mode_get_tile_group(connector->drm, tile->topology_id); if (!tg) - tg = drm_mode_create_tile_group(connector->dev, tile->topology_id); + tg = drm_mode_create_tile_group(connector->drm, + tile->topology_id); if (!tg) return; @@ -7311,11 +7326,12 @@ static void drm_parse_tiled_block(struct drm_connector *connector, /* if we haven't got a pointer, take the reference, drop ref to old tile group */ if (connector->tile_group) - drm_mode_put_tile_group(connector->dev, connector->tile_group); + drm_mode_put_tile_group(connector->drm, + connector->tile_group); connector->tile_group = tg; } else { /* if same tile group, then release the ref we just took. */ - drm_mode_put_tile_group(connector->dev, tg); + drm_mode_put_tile_group(connector->drm, tg); } } @@ -7344,7 +7360,7 @@ static void _drm_update_tile_info(struct drm_connector *connector, displayid_iter_end(&iter); if (!connector->has_tile && connector->tile_group) { - drm_mode_put_tile_group(connector->dev, connector->tile_group); + drm_mode_put_tile_group(connector->drm, connector->tile_group); connector->tile_group = NULL; } } diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c index 5d9ef267ebb3..e07fb48d0d8b 100644 --- a/drivers/gpu/drm/drm_edid_load.c +++ b/drivers/gpu/drm/drm_edid_load.c @@ -174,9 +174,9 @@ static const struct drm_edid *edid_load(struct drm_connector *connector, const c } else { int err; - err = request_firmware(&fw, name, connector->dev->dev); + err = request_firmware(&fw, name, connector->drm->dev); if (err) { - drm_err(connector->dev, + drm_err(connector->drm, "[CONNECTOR:%d:%s] Requesting EDID firmware \"%s\" failed (err=%d)\n", connector->base.id, connector->name, name, err); @@ -187,13 +187,15 @@ static const struct drm_edid *edid_load(struct drm_connector *connector, const c fwsize = fw->size; } - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] Loaded %s firmware EDID \"%s\"\n", + drm_dbg_kms(connector->drm, + "[CONNECTOR:%d:%s] Loaded %s firmware EDID \"%s\"\n", connector->base.id, connector->name, builtin >= 0 ? "built-in" : "external", name); drm_edid = drm_edid_alloc(fwdata, fwsize); if (!drm_edid_valid(drm_edid)) { - drm_err(connector->dev, "Invalid firmware EDID \"%s\"\n", name); + drm_err(connector->drm, "Invalid firmware EDID \"%s\"\n", + name); drm_edid_free(drm_edid); drm_edid = ERR_PTR(-EINVAL); } diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index c871d9f096b8..e13461bdb562 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -508,7 +508,7 @@ EXPORT_SYMBOL(mipi_dbi_pipe_destroy_plane_state); static int mipi_dbi_connector_get_modes(struct drm_connector *connector) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(connector->dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(connector->drm); return drm_connector_helper_get_modes_fixed(connector, &dbidev->mode); } diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index ac9a406250c5..d6f88ad14205 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -111,7 +111,7 @@ EXPORT_SYMBOL(drm_mode_destroy); void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode) { - WARN_ON(!mutex_is_locked(&connector->dev->mode_config.mutex)); + WARN_ON(!mutex_is_locked(&connector->drm->mode_config.mutex)); list_add_tail(&mode->head, &connector->probed_modes); } @@ -1886,7 +1886,7 @@ void drm_connector_list_update(struct drm_connector *connector) { struct drm_display_mode *pmode, *pt; - WARN_ON(!mutex_is_locked(&connector->dev->mode_config.mutex)); + WARN_ON(!mutex_is_locked(&connector->drm->mode_config.mutex)); list_for_each_entry_safe(pmode, pt, &connector->probed_modes, head) { struct drm_display_mode *mode; @@ -1922,7 +1922,7 @@ void drm_connector_list_update(struct drm_connector *connector) } list_del(&pmode->head); - drm_mode_destroy(connector->dev, pmode); + drm_mode_destroy(connector->drm, pmode); break; } diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 2fb9bf901a2c..9a992f989bc4 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -91,7 +91,7 @@ drm_mode_validate_pipeline(struct drm_display_mode *mode, struct drm_modeset_acquire_ctx *ctx, enum drm_mode_status *status) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_encoder *encoder; int ret; @@ -167,7 +167,7 @@ static int drm_helper_probe_add_cmdline_mode(struct drm_connector *connector) return 0; } - mode = drm_mode_create_from_cmdline_mode(connector->dev, + mode = drm_mode_create_from_cmdline_mode(connector->drm, cmdline_mode); if (mode == NULL) return 0; @@ -320,7 +320,8 @@ drm_helper_probe_detect_ctx(struct drm_connector *connector, bool force) drm_modeset_acquire_init(&ctx, 0); retry: - ret = drm_modeset_lock(&connector->dev->mode_config.connection_mutex, &ctx); + ret = drm_modeset_lock(&connector->drm->mode_config.connection_mutex, + &ctx); if (!ret) { if (funcs->detect_ctx) ret = funcs->detect_ctx(connector, &ctx, force); @@ -363,7 +364,7 @@ drm_helper_probe_detect(struct drm_connector *connector, bool force) { const struct drm_connector_helper_funcs *funcs = connector->helper_private; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; int ret; if (!ctx) @@ -409,7 +410,7 @@ static int __drm_helper_update_and_validate(struct drm_connector *connector, uint32_t maxX, uint32_t maxY, struct drm_modeset_acquire_ctx *ctx) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_display_mode *mode; int mode_flags = 0; int ret; @@ -522,7 +523,7 @@ static int __drm_helper_update_and_validate(struct drm_connector *connector, int drm_helper_probe_single_connector_modes(struct drm_connector *connector, uint32_t maxX, uint32_t maxY) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_display_mode *mode; int count = 0, ret; enum drm_connector_status old_status; @@ -708,7 +709,7 @@ EXPORT_SYMBOL(drm_kms_helper_hotplug_event); */ void drm_kms_helper_connector_hotplug_event(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; /* send a uevent + call fbdev */ drm_sysfs_connector_hotplug_event(connector); @@ -907,7 +908,7 @@ EXPORT_SYMBOL(drm_kms_helper_poll_fini); static bool check_connector_changed(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; enum drm_connector_status old_status; u64 old_epoch_counter; @@ -967,7 +968,7 @@ static bool check_connector_changed(struct drm_connector *connector) */ bool drm_connector_helper_hpd_irq_event(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; bool changed; mutex_lock(&dev->mode_config.mutex); @@ -1127,7 +1128,7 @@ EXPORT_SYMBOL(drm_connector_helper_get_modes_from_ddc); int drm_connector_helper_get_modes_fixed(struct drm_connector *connector, const struct drm_display_mode *fixed_mode) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_display_mode *mode; mode = drm_mode_duplicate(dev, fixed_mode); @@ -1203,7 +1204,7 @@ EXPORT_SYMBOL(drm_connector_helper_get_modes); */ int drm_connector_helper_tv_get_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_property *tv_mode_property = dev->mode_config.tv_mode_property; struct drm_cmdline_mode *cmdline = &connector->cmdline_mode; diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index b169b3e44a92..6ad7b54c8f13 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -187,7 +187,7 @@ static ssize_t status_store(struct device *device, const char *buf, size_t count) { struct drm_connector *connector = to_drm_connector(device); - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; enum drm_connector_force old_force; int ret; @@ -271,7 +271,7 @@ static ssize_t edid_show(struct file *filp, struct kobject *kobj, size_t size; ssize_t ret = 0; - mutex_lock(&connector->dev->mode_config.mutex); + mutex_lock(&connector->drm->mode_config.mutex); if (!connector->edid_blob_ptr) goto unlock; @@ -289,7 +289,7 @@ static ssize_t edid_show(struct file *filp, struct kobject *kobj, ret = count; unlock: - mutex_unlock(&connector->dev->mode_config.mutex); + mutex_unlock(&connector->drm->mode_config.mutex); return ret; } @@ -302,12 +302,12 @@ static ssize_t modes_show(struct device *device, struct drm_display_mode *mode; int written = 0; - mutex_lock(&connector->dev->mode_config.mutex); + mutex_lock(&connector->drm->mode_config.mutex); list_for_each_entry(mode, &connector->modes, head) { written += scnprintf(buf + written, PAGE_SIZE - written, "%s\n", mode->name); } - mutex_unlock(&connector->dev->mode_config.mutex); + mutex_unlock(&connector->drm->mode_config.mutex); return written; } @@ -360,7 +360,7 @@ static const struct attribute_group *connector_dev_groups[] = { int drm_sysfs_connector_add(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct device *kdev; int r; @@ -471,14 +471,14 @@ EXPORT_SYMBOL(drm_sysfs_hotplug_event); */ void drm_sysfs_connector_hotplug_event(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; char hotplug_str[] = "HOTPLUG=1", conn_id[21]; char *envp[] = { hotplug_str, conn_id, NULL }; snprintf(conn_id, sizeof(conn_id), "CONNECTOR=%u", connector->base.id); - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] generating connector hotplug event\n", connector->base.id, connector->name); @@ -499,7 +499,7 @@ EXPORT_SYMBOL(drm_sysfs_connector_hotplug_event); void drm_sysfs_connector_property_event(struct drm_connector *connector, struct drm_property *property) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; char hotplug_str[] = "HOTPLUG=1", conn_id[21], prop_id[21]; char *envp[4] = { hotplug_str, conn_id, prop_id, NULL }; @@ -511,7 +511,7 @@ void drm_sysfs_connector_property_event(struct drm_connector *connector, snprintf(prop_id, ARRAY_SIZE(prop_id), "PROPERTY=%u", property->base.id); - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s] generating connector property event for [PROP:%d:%s]\n", connector->base.id, connector->name, property->base.id, property->name); diff --git a/drivers/gpu/drm/drm_writeback.c b/drivers/gpu/drm/drm_writeback.c index a031c335bdb9..90982706259d 100644 --- a/drivers/gpu/drm/drm_writeback.c +++ b/drivers/gpu/drm/drm_writeback.c @@ -88,7 +88,7 @@ static const char *drm_writeback_fence_get_driver_name(struct dma_fence *fence) struct drm_writeback_connector *wb_connector = fence_to_wb_connector(fence); - return wb_connector->base.dev->driver->name; + return wb_connector->base.drm->driver->name; } static const char * diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c index 3404ec1367fb..b4850f4c9b01 100644 --- a/drivers/gpu/drm/exynos/exynos_dp.c +++ b/drivers/gpu/drm/exynos/exynos_dp.c @@ -79,7 +79,7 @@ static int exynos_dp_get_modes(struct analogix_dp_plat_data *plat_data, if (dp->plat_data.panel) return num_modes; - mode = drm_mode_create(connector->dev); + mode = drm_mode_create(connector->drm); if (!mode) { DRM_DEV_ERROR(dp->dev, "failed to create a new display mode.\n"); diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c b/drivers/gpu/drm/exynos/exynos_drm_dpi.c index 378e5381978f..16bef23c6a73 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c @@ -69,7 +69,7 @@ static int exynos_dpi_get_modes(struct drm_connector *connector) if (ctx->vm) { struct drm_display_mode *mode; - mode = drm_mode_create(connector->dev); + mode = drm_mode_create(connector->drm); if (!mode) { DRM_DEV_ERROR(ctx->dev, "failed to create a new display mode\n"); diff --git a/drivers/gpu/drm/gma500/cdv_device.c b/drivers/gpu/drm/gma500/cdv_device.c index 3e83299113e3..9c5b09dbe208 100644 --- a/drivers/gpu/drm/gma500/cdv_device.c +++ b/drivers/gpu/drm/gma500/cdv_device.c @@ -441,7 +441,7 @@ static const char *force_audio_names[] = { void cdv_intel_attach_force_audio_property(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct drm_property *prop; int i; @@ -470,7 +470,7 @@ static const char *broadcast_rgb_names[] = { void cdv_intel_attach_broadcast_rgb_property(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct drm_property *prop; int i; diff --git a/drivers/gpu/drm/gma500/cdv_intel_crt.c b/drivers/gpu/drm/gma500/cdv_intel_crt.c index 5a0acd914f76..2bb9b92aa414 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_crt.c +++ b/drivers/gpu/drm/gma500/cdv_intel_crt.c @@ -138,7 +138,7 @@ static void cdv_intel_crt_mode_set(struct drm_encoder *encoder, static bool cdv_intel_crt_detect_hotplug(struct drm_connector *connector, bool force) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; u32 hotplug_en; int i, tries = 0, ret = false; u32 orig; diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c index 8992a95076f2..578d179a6017 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c @@ -511,7 +511,7 @@ cdv_intel_dp_mode_valid(struct drm_connector *connector, struct cdv_intel_dp *intel_dp = encoder->dev_priv; int max_link_clock = cdv_intel_dp_link_clock(cdv_intel_dp_max_link_bw(encoder)); int max_lanes = cdv_intel_dp_max_lane_count(encoder); - struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev); + struct drm_psb_private *dev_priv = to_drm_psb_private(connector->drm); if (is_edp(encoder) && intel_dp->panel_fixed_mode) { if (mode->hdisplay > intel_dp->panel_fixed_mode->hdisplay) @@ -1739,7 +1739,7 @@ static int cdv_intel_dp_get_modes(struct drm_connector *connector) } if (is_edp(intel_encoder)) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); cdv_intel_edp_panel_vdd_off(intel_encoder); @@ -1805,7 +1805,7 @@ cdv_intel_dp_set_property(struct drm_connector *connector, struct drm_property *property, uint64_t val) { - struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev); + struct drm_psb_private *dev_priv = to_drm_psb_private(connector->drm); struct gma_encoder *encoder = gma_attached_encoder(connector); struct cdv_intel_dp *intel_dp = encoder->dev_priv; int ret; diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c index 2d95e0471291..555c33d51ffe 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c +++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c @@ -106,7 +106,7 @@ static void cdv_hdmi_dpms(struct drm_encoder *encoder, int mode) static void cdv_hdmi_save(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct gma_encoder *gma_encoder = gma_attached_encoder(connector); struct mid_intel_hdmi_priv *hdmi_priv = gma_encoder->dev_priv; @@ -115,7 +115,7 @@ static void cdv_hdmi_save(struct drm_connector *connector) static void cdv_hdmi_restore(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct gma_encoder *gma_encoder = gma_attached_encoder(connector); struct mid_intel_hdmi_priv *hdmi_priv = gma_encoder->dev_priv; diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c index f08a6803dc18..605cc7031015 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c +++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c @@ -155,7 +155,7 @@ static void cdv_intel_lvds_restore(struct drm_connector *connector) static enum drm_mode_status cdv_intel_lvds_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct drm_display_mode *fixed_mode = dev_priv->mode_dev.panel_fixed_mode; @@ -298,7 +298,7 @@ static void cdv_intel_lvds_mode_set(struct drm_encoder *encoder, */ static int cdv_intel_lvds_get_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; int ret; diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c index ed8626c73541..c9d1ad4c0a27 100644 --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c @@ -531,7 +531,7 @@ static enum drm_connector_status oaktrail_hdmi_detect(struct drm_connector *connector, bool force) { enum drm_connector_status status; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; u32 temp; diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c index 8486de230ec9..48e1a8b0d869 100644 --- a/drivers/gpu/drm/gma500/psb_intel_lvds.c +++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c @@ -252,7 +252,7 @@ static void psb_intel_lvds_encoder_dpms(struct drm_encoder *encoder, int mode) static void psb_intel_lvds_save(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct gma_encoder *gma_encoder = gma_attached_encoder(connector); struct psb_intel_lvds_priv *lvds_priv = @@ -291,7 +291,7 @@ static void psb_intel_lvds_save(struct drm_connector *connector) static void psb_intel_lvds_restore(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; u32 pp_status; struct gma_encoder *gma_encoder = gma_attached_encoder(connector); struct psb_intel_lvds_priv *lvds_priv = @@ -333,7 +333,7 @@ static void psb_intel_lvds_restore(struct drm_connector *connector) enum drm_mode_status psb_intel_lvds_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev); + struct drm_psb_private *dev_priv = to_drm_psb_private(connector->drm); struct gma_encoder *gma_encoder = gma_attached_encoder(connector); struct drm_display_mode *fixed_mode = dev_priv->mode_dev.panel_fixed_mode; @@ -490,7 +490,7 @@ static void psb_intel_lvds_mode_set(struct drm_encoder *encoder, */ static int psb_intel_lvds_get_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; int ret = 0; diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c index d6fd5d726216..91b5aa9d92ed 100644 --- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c +++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c @@ -1239,7 +1239,7 @@ psb_intel_sdvo_get_edid(struct drm_connector *connector) static struct edid * psb_intel_sdvo_get_analog_edid(struct drm_connector *connector) { - struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev); + struct drm_psb_private *dev_priv = to_drm_psb_private(connector->drm); return drm_get_edid(connector, &dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter); @@ -1498,7 +1498,7 @@ static void psb_intel_sdvo_get_tv_modes(struct drm_connector *connector) for (i = 0; i < ARRAY_SIZE(sdvo_tv_modes); i++) if (reply & (1 << i)) { struct drm_display_mode *nmode; - nmode = drm_mode_duplicate(connector->dev, + nmode = drm_mode_duplicate(connector->drm, &sdvo_tv_modes[i]); if (nmode) drm_mode_probed_add(connector, nmode); @@ -1508,7 +1508,7 @@ static void psb_intel_sdvo_get_tv_modes(struct drm_connector *connector) static void psb_intel_sdvo_get_lvds_modes(struct drm_connector *connector) { struct psb_intel_sdvo *psb_intel_sdvo = intel_attached_sdvo(connector); - struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev); + struct drm_psb_private *dev_priv = to_drm_psb_private(connector->drm); struct drm_display_mode *newmode; /* @@ -1522,7 +1522,7 @@ static void psb_intel_sdvo_get_lvds_modes(struct drm_connector *connector) /* Fetch modes from VBT */ if (dev_priv->sdvo_lvds_vbt_mode != NULL) { - newmode = drm_mode_duplicate(connector->dev, + newmode = drm_mode_duplicate(connector->drm, dev_priv->sdvo_lvds_vbt_mode); if (newmode != NULL) { /* Guarantee the mode is preferred */ @@ -1536,7 +1536,7 @@ static void psb_intel_sdvo_get_lvds_modes(struct drm_connector *connector) list_for_each_entry(newmode, &connector->probed_modes, head) { if (newmode->type & DRM_MODE_TYPE_PREFERRED) { psb_intel_sdvo->sdvo_lvds_fixed_mode = - drm_mode_duplicate(connector->dev, newmode); + drm_mode_duplicate(connector->drm, newmode); drm_mode_set_crtcinfo(psb_intel_sdvo->sdvo_lvds_fixed_mode, 0); @@ -1593,7 +1593,7 @@ psb_intel_sdvo_set_property(struct drm_connector *connector, { struct psb_intel_sdvo *psb_intel_sdvo = intel_attached_sdvo(connector); struct psb_intel_sdvo_connector *psb_intel_sdvo_connector = to_psb_intel_sdvo_connector(connector); - struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev); + struct drm_psb_private *dev_priv = to_drm_psb_private(connector->drm); uint16_t temp_value; uint8_t cmd; int ret; @@ -1736,7 +1736,7 @@ psb_intel_sdvo_set_property(struct drm_connector *connector, static void psb_intel_sdvo_save(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct gma_encoder *gma_encoder = gma_attached_encoder(connector); struct psb_intel_sdvo *sdvo = to_psb_intel_sdvo(&gma_encoder->base); @@ -1745,7 +1745,7 @@ static void psb_intel_sdvo_save(struct drm_connector *connector) static void psb_intel_sdvo_restore(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_encoder *encoder = &gma_attached_encoder(connector)->base; struct psb_intel_sdvo *sdvo = to_psb_intel_sdvo(encoder); struct drm_crtc *crtc = encoder->crtc; diff --git a/drivers/gpu/drm/gud/gud_connector.c b/drivers/gpu/drm/gud/gud_connector.c index 034e78360d4f..4a1880a0e325 100644 --- a/drivers/gpu/drm/gud/gud_connector.c +++ b/drivers/gpu/drm/gud/gud_connector.c @@ -48,7 +48,8 @@ static inline struct gud_connector *to_gud_connector(struct drm_connector *conne static void gud_conn_err(struct drm_connector *connector, const char *msg, int ret) { - dev_err(connector->dev->dev, "%s: %s (ret=%d)\n", connector->name, msg, ret); + dev_err(connector->drm->dev, "%s: %s (ret=%d)\n", connector->name, + msg, ret); } /* @@ -61,7 +62,7 @@ static void gud_connector_backlight_update_status_work(struct work_struct *work) struct gud_connector *gconn = container_of(work, struct gud_connector, backlight_work); struct drm_connector *connector = &gconn->connector; struct drm_connector_state *connector_state; - struct drm_device *drm = connector->dev; + struct drm_device *drm = connector->drm; struct drm_modeset_acquire_ctx ctx; struct drm_atomic_state *state; int idx, ret; @@ -134,7 +135,7 @@ static int gud_connector_backlight_register(struct gud_connector *gconn) }; name = kasprintf(GFP_KERNEL, "card%d-%s-backlight", - connector->dev->primary->index, connector->name); + connector->drm->primary->index, connector->name); if (!name) return -ENOMEM; @@ -152,11 +153,11 @@ static int gud_connector_backlight_register(struct gud_connector *gconn) static int gud_connector_detect(struct drm_connector *connector, struct drm_modeset_acquire_ctx *ctx, bool force) { - struct gud_device *gdrm = to_gud_device(connector->dev); + struct gud_device *gdrm = to_gud_device(connector->drm); int idx, ret; u8 status; - if (!drm_dev_enter(connector->dev, &idx)) + if (!drm_dev_enter(connector->drm, &idx)) return connector_status_disconnected; if (force) { @@ -217,14 +218,14 @@ static int gud_connector_get_edid_block(void *data, u8 *buf, unsigned int block, static int gud_connector_get_modes(struct drm_connector *connector) { - struct gud_device *gdrm = to_gud_device(connector->dev); + struct gud_device *gdrm = to_gud_device(connector->drm); struct gud_display_mode_req *reqmodes = NULL; struct gud_connector_get_edid_ctx edid_ctx; unsigned int i, num_modes = 0; struct edid *edid = NULL; int idx, ret; - if (!drm_dev_enter(connector->dev, &idx)) + if (!drm_dev_enter(connector->drm, &idx)) return 0; edid_ctx.edid_override = true; @@ -265,7 +266,7 @@ static int gud_connector_get_modes(struct drm_connector *connector) for (i = 0; i < num_modes; i++) { struct drm_display_mode *mode; - mode = drm_mode_create(connector->dev); + mode = drm_mode_create(connector->drm); if (!mode) { num_modes = i; goto out; @@ -400,7 +401,8 @@ static int gud_connector_add_tv_mode(struct gud_device *gdrm, struct drm_connect for (i = 0; i < num_modes; i++) modes[i] = &buf[i * GUD_CONNECTOR_TV_MODE_NAME_LEN]; - ret = drm_mode_create_tv_properties_legacy(connector->dev, num_modes, modes); + ret = drm_mode_create_tv_properties_legacy(connector->drm, num_modes, + modes); free: kfree(buf); if (ret < 0) @@ -412,7 +414,7 @@ static int gud_connector_add_tv_mode(struct gud_device *gdrm, struct drm_connect static struct drm_property * gud_connector_property_lookup(struct drm_connector *connector, u16 prop) { - struct drm_mode_config *config = &connector->dev->mode_config; + struct drm_mode_config *config = &connector->drm->mode_config; switch (prop) { case GUD_PROPERTY_TV_LEFT_MARGIN: diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c index 410bd019bb35..7f332da1ad32 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c @@ -26,7 +26,7 @@ static void hibmc_set_i2c_signal(void *data, u32 mask, int value) { struct hibmc_connector *hibmc_connector = data; - struct hibmc_drm_private *priv = to_hibmc_drm_private(hibmc_connector->base.dev); + struct hibmc_drm_private *priv = to_hibmc_drm_private(hibmc_connector->base.drm); u32 tmp_dir = readl(priv->mmio + GPIO_DATA_DIRECTION); if (value) { @@ -46,7 +46,7 @@ static void hibmc_set_i2c_signal(void *data, u32 mask, int value) static int hibmc_get_i2c_signal(void *data, u32 mask) { struct hibmc_connector *hibmc_connector = data; - struct hibmc_drm_private *priv = to_hibmc_drm_private(hibmc_connector->base.dev); + struct hibmc_drm_private *priv = to_hibmc_drm_private(hibmc_connector->base.drm); u32 tmp_dir = readl(priv->mmio + GPIO_DATA_DIRECTION); if ((tmp_dir & mask) != mask) { diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c index 8c6d2ea2a472..380125fd8bcb 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c @@ -36,8 +36,8 @@ static int hibmc_connector_get_modes(struct drm_connector *connector) } count = drm_add_modes_noedid(connector, - connector->dev->mode_config.max_width, - connector->dev->mode_config.max_height); + connector->drm->mode_config.max_width, + connector->drm->mode_config.max_height); drm_set_preferred_mode(connector, 1024, 768); out: diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c index 6c6b57298797..c61f811b74f5 100644 --- a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +++ b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c @@ -52,12 +52,12 @@ static int hyperv_blit_to_vram_fullscreen(struct drm_framebuffer *fb, static int hyperv_connector_get_modes(struct drm_connector *connector) { - struct hyperv_drm_device *hv = to_hv(connector->dev); + struct hyperv_drm_device *hv = to_hv(connector->drm); int count; count = drm_add_modes_noedid(connector, - connector->dev->mode_config.max_width, - connector->dev->mode_config.max_height); + connector->drm->mode_config.max_width, + connector->drm->mode_config.max_height); drm_set_preferred_mode(connector, hv->preferred_width, hv->preferred_height); diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index f01e28ed5831..53341c03d759 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -777,7 +777,7 @@ static void tda998x_detect_work(struct work_struct *work) { struct tda998x_priv *priv = container_of(work, struct tda998x_priv, detect_work); - struct drm_device *dev = priv->connector.dev; + struct drm_device *dev = priv->connector.drm; if (dev) drm_kms_helper_hotplug_event(dev); diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 7cf51dd8c056..fe573d1d520c 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -58,7 +58,7 @@ int intel_digital_connector_atomic_get_property(struct drm_connector *connector, struct drm_property *property, u64 *val) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_digital_connector_state *intel_conn_state = to_intel_digital_connector_state(state); @@ -91,7 +91,7 @@ int intel_digital_connector_atomic_set_property(struct drm_connector *connector, struct drm_property *property, u64 val) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_digital_connector_state *intel_conn_state = to_intel_digital_connector_state(state); diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c index 2e8f17c04522..19637048faba 100644 --- a/drivers/gpu/drm/i915/display/intel_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_backlight.c @@ -83,7 +83,7 @@ static u32 scale_hw_to_user(struct intel_connector *connector, u32 intel_backlight_invert_pwm_level(struct intel_connector *connector, u32 val) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; drm_WARN_ON(&i915->drm, panel->backlight.pwm_level_max == 0); @@ -102,7 +102,7 @@ u32 intel_backlight_invert_pwm_level(struct intel_connector *connector, u32 val) void intel_backlight_set_pwm_level(const struct drm_connector_state *conn_state, u32 val) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] set backlight PWM = %d\n", @@ -112,7 +112,7 @@ void intel_backlight_set_pwm_level(const struct drm_connector_state *conn_state, u32 intel_backlight_level_to_pwm(struct intel_connector *connector, u32 val) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; drm_WARN_ON_ONCE(&i915->drm, @@ -126,7 +126,7 @@ u32 intel_backlight_level_to_pwm(struct intel_connector *connector, u32 val) u32 intel_backlight_level_from_pwm(struct intel_connector *connector, u32 val) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; drm_WARN_ON_ONCE(&i915->drm, @@ -142,21 +142,21 @@ u32 intel_backlight_level_from_pwm(struct intel_connector *connector, u32 val) static u32 lpt_get_backlight(struct intel_connector *connector, enum pipe unused) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); return intel_de_read(i915, BLC_PWM_PCH_CTL2) & BACKLIGHT_DUTY_CYCLE_MASK; } static u32 pch_get_backlight(struct intel_connector *connector, enum pipe unused) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); return intel_de_read(i915, BLC_PWM_CPU_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; } static u32 i9xx_get_backlight(struct intel_connector *connector, enum pipe unused) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 val; @@ -176,7 +176,7 @@ static u32 i9xx_get_backlight(struct intel_connector *connector, enum pipe unuse static u32 vlv_get_backlight(struct intel_connector *connector, enum pipe pipe) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); if (drm_WARN_ON(&i915->drm, pipe != PIPE_A && pipe != PIPE_B)) return 0; @@ -186,7 +186,7 @@ static u32 vlv_get_backlight(struct intel_connector *connector, enum pipe pipe) static u32 bxt_get_backlight(struct intel_connector *connector, enum pipe unused) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; return intel_de_read(i915, BXT_BLC_PWM_DUTY(panel->backlight.controller)); @@ -204,7 +204,7 @@ static u32 ext_pwm_get_backlight(struct intel_connector *connector, enum pipe un static void lpt_set_backlight(const struct drm_connector_state *conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); u32 val; val = intel_de_read(i915, BLC_PWM_PCH_CTL2) & ~BACKLIGHT_DUTY_CYCLE_MASK; @@ -214,7 +214,7 @@ static void lpt_set_backlight(const struct drm_connector_state *conn_state, u32 static void pch_set_backlight(const struct drm_connector_state *conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); u32 tmp; tmp = intel_de_read(i915, BLC_PWM_CPU_CTL) & ~BACKLIGHT_DUTY_CYCLE_MASK; @@ -224,7 +224,7 @@ static void pch_set_backlight(const struct drm_connector_state *conn_state, u32 static void i9xx_set_backlight(const struct drm_connector_state *conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 tmp, mask; @@ -252,7 +252,7 @@ static void i9xx_set_backlight(const struct drm_connector_state *conn_state, u32 static void vlv_set_backlight(const struct drm_connector_state *conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); enum pipe pipe = to_intel_crtc(conn_state->crtc)->pipe; u32 tmp; @@ -263,7 +263,7 @@ static void vlv_set_backlight(const struct drm_connector_state *conn_state, u32 static void bxt_set_backlight(const struct drm_connector_state *conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; intel_de_write(i915, BXT_BLC_PWM_DUTY(panel->backlight.controller), level); @@ -281,7 +281,7 @@ static void intel_panel_actually_set_backlight(const struct drm_connector_state *conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] set backlight level = %d\n", @@ -297,7 +297,7 @@ void intel_backlight_set_acpi(const struct drm_connector_state *conn_state, u32 user_level, u32 user_max) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 hw_level; @@ -332,7 +332,7 @@ void intel_backlight_set_acpi(const struct drm_connector_state *conn_state, static void lpt_disable_backlight(const struct drm_connector_state *old_conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(old_conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); u32 tmp; intel_backlight_set_pwm_level(old_conn_state, level); @@ -358,7 +358,7 @@ static void lpt_disable_backlight(const struct drm_connector_state *old_conn_sta static void pch_disable_backlight(const struct drm_connector_state *old_conn_state, u32 val) { struct intel_connector *connector = to_intel_connector(old_conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); intel_backlight_set_pwm_level(old_conn_state, val); @@ -374,7 +374,7 @@ static void i9xx_disable_backlight(const struct drm_connector_state *old_conn_st static void i965_disable_backlight(const struct drm_connector_state *old_conn_state, u32 val) { - struct drm_i915_private *i915 = to_i915(old_conn_state->connector->dev); + struct drm_i915_private *i915 = to_i915(old_conn_state->connector->drm); intel_backlight_set_pwm_level(old_conn_state, val); @@ -384,7 +384,7 @@ static void i965_disable_backlight(const struct drm_connector_state *old_conn_st static void vlv_disable_backlight(const struct drm_connector_state *old_conn_state, u32 val) { struct intel_connector *connector = to_intel_connector(old_conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); enum pipe pipe = to_intel_crtc(old_conn_state->crtc)->pipe; intel_backlight_set_pwm_level(old_conn_state, val); @@ -395,7 +395,7 @@ static void vlv_disable_backlight(const struct drm_connector_state *old_conn_sta static void bxt_disable_backlight(const struct drm_connector_state *old_conn_state, u32 val) { struct intel_connector *connector = to_intel_connector(old_conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; intel_backlight_set_pwm_level(old_conn_state, val); @@ -410,7 +410,7 @@ static void bxt_disable_backlight(const struct drm_connector_state *old_conn_sta static void cnp_disable_backlight(const struct drm_connector_state *old_conn_state, u32 val) { struct intel_connector *connector = to_intel_connector(old_conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; intel_backlight_set_pwm_level(old_conn_state, val); @@ -433,7 +433,7 @@ static void ext_pwm_disable_backlight(const struct drm_connector_state *old_conn void intel_backlight_disable(const struct drm_connector_state *old_conn_state) { struct intel_connector *connector = to_intel_connector(old_conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; if (!panel->backlight.present) @@ -465,7 +465,7 @@ static void lpt_enable_backlight(const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 pch_ctl1, pch_ctl2; @@ -509,7 +509,7 @@ static void pch_enable_backlight(const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; u32 cpu_ctl2, pch_ctl1, pch_ctl2; @@ -557,7 +557,7 @@ static void i9xx_enable_backlight(const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 ctl, freq; @@ -597,7 +597,7 @@ static void i965_enable_backlight(const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; enum pipe pipe = to_intel_crtc(conn_state->crtc)->pipe; u32 ctl, ctl2, freq; @@ -633,7 +633,7 @@ static void vlv_enable_backlight(const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; enum pipe pipe = to_intel_crtc(crtc_state->uapi.crtc)->pipe; u32 ctl, ctl2; @@ -664,7 +664,7 @@ static void bxt_enable_backlight(const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; enum pipe pipe = to_intel_crtc(crtc_state->uapi.crtc)->pipe; u32 pwm_ctl, val; @@ -714,7 +714,7 @@ static void cnp_enable_backlight(const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 pwm_ctl; @@ -779,7 +779,7 @@ void intel_backlight_enable(const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; enum pipe pipe = to_intel_crtc(crtc_state->uapi.crtc)->pipe; @@ -798,7 +798,7 @@ void intel_backlight_enable(const struct intel_crtc_state *crtc_state, #if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) static u32 intel_panel_get_backlight(struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 val = 0; @@ -828,7 +828,7 @@ static void intel_panel_set_backlight(const struct drm_connector_state *conn_sta u32 user_level, u32 user_max) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 hw_level; @@ -851,7 +851,7 @@ static void intel_panel_set_backlight(const struct drm_connector_state *conn_sta static int intel_backlight_device_update_status(struct backlight_device *bd) { struct intel_connector *connector = bl_get_data(bd); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; drm_modeset_lock(&i915->drm.mode_config.connection_mutex, NULL); @@ -885,7 +885,7 @@ static int intel_backlight_device_update_status(struct backlight_device *bd) static int intel_backlight_device_get_brightness(struct backlight_device *bd) { struct intel_connector *connector = bl_get_data(bd); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); intel_wakeref_t wakeref; int ret = 0; @@ -911,7 +911,7 @@ static const struct backlight_ops intel_backlight_device_ops = { int intel_backlight_device_register(struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; struct backlight_properties props; struct backlight_device *bd; @@ -1008,7 +1008,7 @@ void intel_backlight_device_unregister(struct intel_connector *connector) */ static u32 cnp_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); return DIV_ROUND_CLOSEST(KHz(RUNTIME_INFO(i915)->rawclk_freq), pwm_freq_hz); @@ -1047,7 +1047,7 @@ static u32 spt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) */ static u32 lpt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 mul, clock; @@ -1070,7 +1070,7 @@ static u32 lpt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) */ static u32 pch_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); return DIV_ROUND_CLOSEST(KHz(RUNTIME_INFO(i915)->rawclk_freq), pwm_freq_hz * 128); @@ -1086,7 +1086,7 @@ static u32 pch_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) */ static u32 i9xx_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); int clock; if (IS_PINEVIEW(i915)) @@ -1104,7 +1104,7 @@ static u32 i9xx_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) */ static u32 i965_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); int clock; if (IS_G4X(i915)) @@ -1122,7 +1122,7 @@ static u32 i965_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) */ static u32 vlv_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); int mul, clock; if ((intel_de_read(i915, CBR1_VLV) & CBR_PWM_CLOCK_MUX_SELECT) == 0) { @@ -1141,7 +1141,7 @@ static u32 vlv_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) static u16 get_vbt_pwm_freq(struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); u16 pwm_freq_hz = connector->panel.vbt.backlight.pwm_freq_hz; if (pwm_freq_hz) { @@ -1160,7 +1160,7 @@ static u16 get_vbt_pwm_freq(struct intel_connector *connector) static u32 get_backlight_max_vbt(struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u16 pwm_freq_hz = get_vbt_pwm_freq(connector); u32 pwm; @@ -1186,7 +1186,7 @@ static u32 get_backlight_max_vbt(struct intel_connector *connector) */ static u32 get_backlight_min_vbt(struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; int min; @@ -1212,7 +1212,7 @@ static u32 get_backlight_min_vbt(struct intel_connector *connector) static int lpt_setup_backlight(struct intel_connector *connector, enum pipe unused) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 cpu_ctl2, pch_ctl1, pch_ctl2, val; bool alt, cpu_mode; @@ -1269,7 +1269,7 @@ static int lpt_setup_backlight(struct intel_connector *connector, enum pipe unus static int pch_setup_backlight(struct intel_connector *connector, enum pipe unused) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 cpu_ctl2, pch_ctl1, pch_ctl2; @@ -1300,7 +1300,7 @@ static int pch_setup_backlight(struct intel_connector *connector, enum pipe unus static int i9xx_setup_backlight(struct intel_connector *connector, enum pipe unused) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 ctl, val; @@ -1342,7 +1342,7 @@ static int i9xx_setup_backlight(struct intel_connector *connector, enum pipe unu static int i965_setup_backlight(struct intel_connector *connector, enum pipe unused) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 ctl, ctl2; @@ -1375,7 +1375,7 @@ static int i965_setup_backlight(struct intel_connector *connector, enum pipe unu static int vlv_setup_backlight(struct intel_connector *connector, enum pipe pipe) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 ctl, ctl2; @@ -1408,7 +1408,7 @@ static int vlv_setup_backlight(struct intel_connector *connector, enum pipe pipe static int bxt_setup_backlight(struct intel_connector *connector, enum pipe unused) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 pwm_ctl, val; @@ -1473,7 +1473,7 @@ static bool cnp_backlight_controller_is_valid(struct drm_i915_private *i915, int static int cnp_setup_backlight(struct intel_connector *connector, enum pipe unused) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; u32 pwm_ctl; @@ -1517,7 +1517,7 @@ cnp_setup_backlight(struct intel_connector *connector, enum pipe unused) static int ext_pwm_setup_backlight(struct intel_connector *connector, enum pipe pipe) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; const char *desc; u32 level; @@ -1626,7 +1626,7 @@ void intel_backlight_update(struct intel_atomic_state *state, const struct drm_connector_state *conn_state) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; if (!panel->backlight.present) @@ -1641,7 +1641,7 @@ void intel_backlight_update(struct intel_atomic_state *state, int intel_backlight_setup(struct intel_connector *connector, enum pipe pipe) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; int ret; @@ -1787,7 +1787,7 @@ void intel_backlight_init_funcs(struct intel_panel *panel) { struct intel_connector *connector = container_of(panel, struct intel_connector, panel); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); if (connector->base.connector_type == DRM_MODE_CONNECTOR_DSI && intel_dsi_dcs_init_backlight_funcs(connector) == 0) diff --git a/drivers/gpu/drm/i915/display/intel_connector.c b/drivers/gpu/drm/i915/display/intel_connector.c index ff3bcadebe59..53d6591f1308 100644 --- a/drivers/gpu/drm/i915/display/intel_connector.c +++ b/drivers/gpu/drm/i915/display/intel_connector.c @@ -118,7 +118,7 @@ int intel_connector_register(struct drm_connector *connector) if (ret) goto err; - if (i915_inject_probe_failure(to_i915(connector->dev))) { + if (i915_inject_probe_failure(to_i915(connector->drm))) { ret = -EFAULT; goto err_backlight; } @@ -162,7 +162,7 @@ bool intel_connector_get_hw_state(struct intel_connector *connector) enum pipe intel_connector_get_pipe(struct intel_connector *connector) { - struct drm_device *dev = connector->base.dev; + struct drm_device *dev = connector->base.drm; drm_WARN_ON(dev, !drm_modeset_is_locked(&dev->mode_config.connection_mutex)); @@ -222,7 +222,7 @@ static const struct drm_prop_enum_list force_audio_names[] = { void intel_attach_force_audio_property(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_i915_private *dev_priv = to_i915(dev); struct drm_property *prop; @@ -249,7 +249,7 @@ static const struct drm_prop_enum_list broadcast_rgb_names[] = { void intel_attach_broadcast_rgb_property(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_i915_private *dev_priv = to_i915(dev); struct drm_property *prop; @@ -271,9 +271,9 @@ intel_attach_broadcast_rgb_property(struct drm_connector *connector) void intel_attach_aspect_ratio_property(struct drm_connector *connector) { - if (!drm_mode_create_aspect_ratio_property(connector->dev)) + if (!drm_mode_create_aspect_ratio_property(connector->drm)) drm_object_attach_property(&connector->base, - connector->dev->mode_config.aspect_ratio_property, + connector->drm->mode_config.aspect_ratio_property, DRM_MODE_PICTURE_ASPECT_NONE); } @@ -294,7 +294,7 @@ intel_attach_dp_colorspace_property(struct drm_connector *connector) void intel_attach_scaling_mode_property(struct drm_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); u32 scaling_modes; scaling_modes = BIT(DRM_MODE_SCALE_ASPECT) | diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c index ab7cd5e60a0a..608ec14776d5 100644 --- a/drivers/gpu/drm/i915/display/intel_crt.c +++ b/drivers/gpu/drm/i915/display/intel_crt.c @@ -345,7 +345,7 @@ static enum drm_mode_status intel_crt_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_i915_private *dev_priv = to_i915(dev); int max_dotclk = dev_priv->max_dotclk_freq; int max_clock; @@ -458,7 +458,7 @@ static int hsw_crt_compute_config(struct intel_encoder *encoder, static bool ilk_crt_detect_hotplug(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector)); struct drm_i915_private *dev_priv = to_i915(dev); u32 adpa; @@ -508,7 +508,7 @@ static bool ilk_crt_detect_hotplug(struct drm_connector *connector) static bool valleyview_crt_detect_hotplug(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector)); struct drm_i915_private *dev_priv = to_i915(dev); bool reenable_hpd; @@ -563,7 +563,7 @@ static bool valleyview_crt_detect_hotplug(struct drm_connector *connector) static bool intel_crt_detect_hotplug(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_i915_private *dev_priv = to_i915(dev); u32 stat; bool ret = false; @@ -617,7 +617,7 @@ static const struct drm_edid *intel_crt_get_edid(struct drm_connector *connector drm_edid = drm_edid_read_ddc(connector, i2c); if (!drm_edid && !intel_gmbus_is_forced_bit(i2c)) { - drm_dbg_kms(connector->dev, + drm_dbg_kms(connector->drm, "CRT GMBUS EDID read failed, retry using GPIO bit-banging\n"); intel_gmbus_force_bit(i2c, true); drm_edid = drm_edid_read_ddc(connector, i2c); @@ -823,7 +823,7 @@ intel_crt_detect(struct drm_connector *connector, struct drm_modeset_acquire_ctx *ctx, bool force) { - struct drm_i915_private *dev_priv = to_i915(connector->dev); + struct drm_i915_private *dev_priv = to_i915(connector->drm); struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector)); struct intel_encoder *intel_encoder = &crt->base; struct drm_atomic_state *state; @@ -918,7 +918,7 @@ intel_crt_detect(struct drm_connector *connector, static int intel_crt_get_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector)); struct intel_encoder *intel_encoder = &crt->base; diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index e60baa96a7ae..7ada98354b17 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -688,7 +688,7 @@ int intel_ddi_toggle_hdcp_bits(struct intel_encoder *intel_encoder, bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector) { - struct drm_device *dev = intel_connector->base.dev; + struct drm_device *dev = intel_connector->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_encoder *encoder = intel_attached_encoder(intel_connector); int type = intel_connector->base.connector_type; diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c index 165e2c7e3126..53d577a71c2b 100644 --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c @@ -1125,7 +1125,7 @@ DEFINE_SHOW_ATTRIBUTE(i915_panel); static int i915_hdcp_sink_capability_show(struct seq_file *m, void *data) { struct drm_connector *connector = m->private; - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); struct intel_connector *intel_connector = to_intel_connector(connector); int ret; @@ -1152,7 +1152,7 @@ DEFINE_SHOW_ATTRIBUTE(i915_hdcp_sink_capability); static int i915_lpsp_capability_show(struct seq_file *m, void *data) { struct drm_connector *connector = m->private; - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); struct intel_encoder *encoder; bool lpsp_capable = false; @@ -1192,7 +1192,7 @@ DEFINE_SHOW_ATTRIBUTE(i915_lpsp_capability); static int i915_dsc_fec_support_show(struct seq_file *m, void *data) { struct drm_connector *connector = m->private; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_crtc *crtc; struct intel_dp *intel_dp; struct drm_modeset_acquire_ctx ctx; @@ -1304,7 +1304,7 @@ static const struct file_operations i915_dsc_fec_support_fops = { static int i915_dsc_bpc_show(struct seq_file *m, void *data) { struct drm_connector *connector = m->private; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_crtc *crtc; struct intel_crtc_state *crtc_state; struct intel_encoder *encoder = intel_attached_encoder(to_intel_connector(connector)); @@ -1370,7 +1370,7 @@ static const struct file_operations i915_dsc_bpc_fops = { static int i915_dsc_output_format_show(struct seq_file *m, void *data) { struct drm_connector *connector = m->private; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_crtc *crtc; struct intel_crtc_state *crtc_state; struct intel_encoder *encoder = intel_attached_encoder(to_intel_connector(connector)); @@ -1479,7 +1479,7 @@ void intel_connector_debugfs_add(struct intel_connector *intel_connector) { struct drm_connector *connector = &intel_connector->base; struct dentry *root = connector->debugfs_entry; - struct drm_i915_private *dev_priv = to_i915(connector->dev); + struct drm_i915_private *dev_priv = to_i915(connector->drm); /* The connector must have been registered beforehands. */ if (!root) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 8aec1cfd53b8..0cd561603ee1 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -1108,7 +1108,7 @@ intel_dp_mode_valid(struct drm_connector *_connector, { struct intel_connector *connector = to_intel_connector(_connector); struct intel_dp *intel_dp = intel_attached_dp(connector); - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct drm_i915_private *dev_priv = to_i915(connector->base.drm); const struct drm_display_mode *fixed_mode; int target_clock = mode->clock; int max_rate, mode_rate, max_lanes, max_link_clock; @@ -1439,7 +1439,7 @@ intel_dp_adjust_compliance_config(struct intel_dp *intel_dp, static bool has_seamless_m_n(struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); /* * Seamless M/N reprogramming only implemented @@ -2099,7 +2099,7 @@ static bool can_enable_drrs(struct intel_connector *connector, const struct intel_crtc_state *pipe_config, const struct drm_display_mode *downclock_mode) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); if (pipe_config->vrr.enable) return false; @@ -2129,7 +2129,7 @@ intel_dp_drrs_compute_config(struct intel_connector *connector, struct intel_crtc_state *pipe_config, int output_bpp) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); const struct drm_display_mode *downclock_mode = intel_panel_downclock_mode(connector, &pipe_config->hw.adjusted_mode); int pixel_clock; @@ -3011,7 +3011,7 @@ static void intel_edp_mso_mode_fixup(struct intel_connector *connector, struct drm_display_mode *mode) { struct intel_dp *intel_dp = intel_attached_dp(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); int n = intel_dp->mso_link_count; int overlap = intel_dp->mso_pixel_overlap; @@ -4851,7 +4851,7 @@ intel_dp_detect(struct drm_connector *connector, struct drm_modeset_acquire_ctx *ctx, bool force) { - struct drm_i915_private *dev_priv = to_i915(connector->dev); + struct drm_i915_private *dev_priv = to_i915(connector->drm); struct intel_dp *intel_dp = intel_attached_dp(to_intel_connector(connector)); struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); struct intel_encoder *encoder = &dig_port->base; @@ -5006,7 +5006,7 @@ static int intel_dp_get_modes(struct drm_connector *connector) struct intel_dp *intel_dp = intel_attached_dp(intel_connector); struct drm_display_mode *mode; - mode = drm_dp_downstream_mode(connector->dev, + mode = drm_dp_downstream_mode(connector->drm, intel_dp->dpcd, intel_dp->downstream_ports); if (mode) { @@ -5021,7 +5021,7 @@ static int intel_dp_get_modes(struct drm_connector *connector) static int intel_dp_connector_register(struct drm_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); struct intel_dp *intel_dp = intel_attached_dp(to_intel_connector(connector)); struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); struct intel_lspcon *lspcon = &dig_port->lspcon; @@ -5208,7 +5208,7 @@ static int intel_modeset_synced_crtcs(struct intel_atomic_state *state, static int intel_dp_connector_atomic_check(struct drm_connector *conn, struct drm_atomic_state *_state) { - struct drm_i915_private *dev_priv = to_i915(conn->dev); + struct drm_i915_private *dev_priv = to_i915(conn->drm); struct intel_atomic_state *state = to_intel_atomic_state(_state); struct drm_connector_state *conn_state = drm_atomic_get_new_connector_state(_state, conn); struct intel_connector *intel_conn = to_intel_connector(conn); @@ -5247,7 +5247,7 @@ static int intel_dp_connector_atomic_check(struct drm_connector *conn, static void intel_dp_oob_hotplug_event(struct drm_connector *connector) { struct intel_encoder *encoder = intel_attached_encoder(to_intel_connector(connector)); - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); spin_lock_irq(&i915->irq_lock); i915->display.hotplug.event_bits |= BIT(encoder->hpd_pin); @@ -5367,7 +5367,7 @@ has_gamut_metadata_dip(struct intel_encoder *encoder) static void intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connector) { - struct drm_i915_private *dev_priv = to_i915(connector->dev); + struct drm_i915_private *dev_priv = to_i915(connector->drm); enum port port = dp_to_dig_port(intel_dp)->base.port; if (!intel_dp_is_edp(intel_dp)) @@ -5401,7 +5401,7 @@ static void intel_edp_add_properties(struct intel_dp *intel_dp) { struct intel_connector *connector = intel_dp->attached_connector; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); const struct drm_display_mode *fixed_mode = intel_panel_preferred_fixed_mode(connector); @@ -5588,17 +5588,17 @@ static void intel_dp_modeset_retry_work_fn(struct work_struct *work) intel_connector = container_of(work, typeof(*intel_connector), modeset_retry_work); connector = &intel_connector->base; - drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s]\n", connector->base.id, + drm_dbg_kms(connector->drm, "[CONNECTOR:%d:%s]\n", connector->base.id, connector->name); /* Grab the locks before changing connector property*/ - mutex_lock(&connector->dev->mode_config.mutex); + mutex_lock(&connector->drm->mode_config.mutex); /* Set connector link status to BAD and send a Uevent to notify * userspace to do a modeset. */ drm_connector_set_link_status_property(connector, DRM_MODE_LINK_STATUS_BAD); - mutex_unlock(&connector->dev->mode_config.mutex); + mutex_unlock(&connector->drm->mode_config.mutex); /* Send Hotplug uevent so userspace can reprobe */ drm_kms_helper_connector_hotplug_event(connector); } diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c index 95cc5251843e..64907a3af0cc 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c @@ -114,7 +114,7 @@ static bool is_intel_tcon_cap(const u8 tcon_cap[4]) static bool intel_dp_aux_supports_hdr_backlight(struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder); struct drm_dp_aux *aux = &intel_dp->aux; struct intel_panel *panel = &connector->panel; @@ -165,7 +165,7 @@ intel_dp_aux_supports_hdr_backlight(struct intel_connector *connector) static u32 intel_dp_aux_hdr_get_backlight(struct intel_connector *connector, enum pipe pipe) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder); u8 tmp; @@ -202,7 +202,7 @@ static void intel_dp_aux_hdr_set_aux_backlight(const struct drm_connector_state *conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_device *dev = connector->base.dev; + struct drm_device *dev = connector->base.drm; struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder); u8 buf[4] = { 0 }; @@ -236,7 +236,7 @@ intel_dp_aux_hdr_enable_backlight(const struct intel_crtc_state *crtc_state, { struct intel_connector *connector = to_intel_connector(conn_state->connector); struct intel_panel *panel = &connector->panel; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder); int ret; u8 old_ctrl, ctrl; @@ -290,7 +290,7 @@ static const char *dpcd_vs_pwm_str(bool aux) static int intel_dp_aux_hdr_setup_backlight(struct intel_connector *connector, enum pipe pipe) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; struct drm_luminance_range_info *luminance_range = &connector->base.display_info.luminance_range; @@ -480,7 +480,7 @@ static const struct intel_panel_bl_funcs intel_dp_vesa_bl_funcs = { int intel_dp_aux_init_backlight_funcs(struct intel_connector *connector) { - struct drm_device *dev = connector->base.dev; + struct drm_device *dev = connector->base.drm; struct intel_panel *panel = &connector->panel; struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder); struct drm_i915_private *i915 = dp_to_i915(intel_dp); diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c index e0c177161407..631d60184b4b 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c @@ -667,7 +667,7 @@ intel_dp_mst_toggle_hdcp_stream_select(struct intel_connector *connector, bool enable) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; int ret; @@ -685,7 +685,7 @@ intel_dp_mst_hdcp_stream_encryption(struct intel_connector *connector, bool enable) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; enum port port = dig_port->base.port; enum transcoder cpu_transcoder = hdcp->stream_transcoder; @@ -719,7 +719,7 @@ intel_dp_mst_hdcp2_stream_encryption(struct intel_connector *connector, bool enable) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct hdcp_port_data *data = &dig_port->hdcp_port_data; struct intel_hdcp *hdcp = &connector->hdcp; enum transcoder cpu_transcoder = hdcp->stream_transcoder; @@ -796,7 +796,7 @@ static const struct intel_hdcp_shim intel_dp_mst_hdcp_shim = { int intel_dp_hdcp_init(struct intel_digital_port *dig_port, struct intel_connector *intel_connector) { - struct drm_device *dev = intel_connector->base.dev; + struct drm_device *dev = intel_connector->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_encoder *intel_encoder = &dig_port->base; enum port port = intel_encoder->port; diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index e4ef3833c1ed..0f327ce194bd 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -81,7 +81,7 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder, struct drm_dp_mst_topology_state *mst_state; struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; int bpp, slots = -EINVAL; @@ -183,7 +183,7 @@ static int intel_dp_dsc_mst_compute_link_config(struct intel_encoder *encoder, struct intel_dp *intel_dp = &intel_mst->primary->dp; struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; int slots = -EINVAL; @@ -565,7 +565,7 @@ static void intel_mst_disable_dp(struct intel_atomic_state *state, drm_atomic_get_mst_payload_state(old_mst_state, connector->port); struct drm_dp_mst_atomic_payload *new_payload = drm_atomic_get_mst_payload_state(new_mst_state, connector->port); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); drm_dbg_kms(&i915->drm, "active links %d\n", intel_dp->active_mst_links); @@ -588,7 +588,7 @@ static void intel_mst_post_disable_dp(struct intel_atomic_state *state, struct intel_dp *intel_dp = &dig_port->dp; struct intel_connector *connector = to_intel_connector(old_conn_state->connector); - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct drm_i915_private *dev_priv = to_i915(connector->base.drm); bool last_mst_stream; intel_dp->active_mst_links--; @@ -902,13 +902,13 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector, struct drm_modeset_acquire_ctx *ctx, enum drm_mode_status *status) { - struct drm_i915_private *dev_priv = to_i915(connector->dev); + struct drm_i915_private *dev_priv = to_i915(connector->drm); struct intel_connector *intel_connector = to_intel_connector(connector); struct intel_dp *intel_dp = intel_connector->mst_port; struct drm_dp_mst_topology_mgr *mgr = &intel_dp->mst_mgr; struct drm_dp_mst_port *port = intel_connector->port; const int min_bpp = 18; - int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; + int max_dotclk = to_i915(connector->drm)->max_dotclk_freq; int max_rate, mode_rate, max_lanes, max_link_clock; int ret; bool dsc = false, bigjoiner = false; @@ -1014,7 +1014,7 @@ static int intel_dp_mst_detect(struct drm_connector *connector, struct drm_modeset_acquire_ctx *ctx, bool force) { - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); struct intel_connector *intel_connector = to_intel_connector(connector); struct intel_dp *intel_dp = intel_connector->mst_port; @@ -1063,7 +1063,7 @@ static int intel_dp_mst_add_properties(struct intel_dp *intel_dp, struct drm_connector *connector, const char *pathprop) { - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); drm_object_attach_property(&connector->base, i915->drm.mode_config.path_property, 0); diff --git a/drivers/gpu/drm/i915/display/intel_dsi.c b/drivers/gpu/drm/i915/display/intel_dsi.c index 5efdd471ac2b..728620531032 100644 --- a/drivers/gpu/drm/i915/display/intel_dsi.c +++ b/drivers/gpu/drm/i915/display/intel_dsi.c @@ -40,11 +40,11 @@ int intel_dsi_get_modes(struct drm_connector *connector) enum drm_mode_status intel_dsi_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - struct drm_i915_private *dev_priv = to_i915(connector->dev); + struct drm_i915_private *dev_priv = to_i915(connector->drm); struct intel_connector *intel_connector = to_intel_connector(connector); const struct drm_display_mode *fixed_mode = intel_panel_fixed_mode(intel_connector, mode); - int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; + int max_dotclk = to_i915(connector->drm)->max_dotclk_freq; enum drm_mode_status status; drm_dbg_kms(&dev_priv->drm, "\n"); @@ -99,7 +99,7 @@ struct intel_dsi_host *intel_dsi_host_init(struct intel_dsi *intel_dsi, enum drm_panel_orientation intel_dsi_get_panel_orientation(struct intel_connector *connector) { - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct drm_i915_private *dev_priv = to_i915(connector->base.drm); enum drm_panel_orientation orientation; orientation = connector->panel.vbt.dsi.orientation; diff --git a/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c b/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c index 049443245310..3f2e7ccccef7 100644 --- a/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c @@ -162,7 +162,7 @@ static void dcs_enable_backlight(const struct intel_crtc_state *crtc_state, static int dcs_setup_backlight(struct intel_connector *connector, enum pipe unused) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_panel *panel = &connector->panel; if (panel->vbt.backlight.brightness_precision_bits > 8) @@ -189,7 +189,7 @@ static const struct intel_panel_bl_funcs dcs_bl_funcs = { int intel_dsi_dcs_init_backlight_funcs(struct intel_connector *intel_connector) { - struct drm_device *dev = intel_connector->base.dev; + struct drm_device *dev = intel_connector->base.drm; struct intel_encoder *encoder = intel_attached_encoder(intel_connector); struct intel_panel *panel = &intel_connector->panel; diff --git a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c index c7935ea498c4..2668362be33a 100644 --- a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c +++ b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c @@ -246,7 +246,7 @@ static const u8 *mipi_exec_delay(struct intel_dsi *intel_dsi, const u8 *data) static void vlv_exec_gpio(struct intel_connector *connector, u8 gpio_source, u8 gpio_index, bool value) { - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct drm_i915_private *dev_priv = to_i915(connector->base.drm); struct gpio_map *map; u16 pconf0, padval; u32 tmp; @@ -294,7 +294,7 @@ static void vlv_exec_gpio(struct intel_connector *connector, static void chv_exec_gpio(struct intel_connector *connector, u8 gpio_source, u8 gpio_index, bool value) { - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct drm_i915_private *dev_priv = to_i915(connector->base.drm); u16 cfg0, cfg1; u16 family_num; u8 port; @@ -348,7 +348,7 @@ static void chv_exec_gpio(struct intel_connector *connector, static void bxt_exec_gpio(struct intel_connector *connector, u8 gpio_source, u8 gpio_index, bool value) { - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct drm_i915_private *dev_priv = to_i915(connector->base.drm); /* XXX: this table is a quick ugly hack. */ static struct gpio_desc *bxt_gpio_table[U8_MAX + 1]; struct gpio_desc *gpio_desc = bxt_gpio_table[gpio_index]; @@ -375,7 +375,7 @@ static void bxt_exec_gpio(struct intel_connector *connector, static void icl_exec_gpio(struct intel_connector *connector, u8 gpio_source, u8 gpio_index, bool value) { - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct drm_i915_private *dev_priv = to_i915(connector->base.drm); drm_dbg_kms(&dev_priv->drm, "Skipping ICL GPIO element execution\n"); } diff --git a/drivers/gpu/drm/i915/display/intel_dvo.c b/drivers/gpu/drm/i915/display/intel_dvo.c index 9884678743b6..d69f288ce644 100644 --- a/drivers/gpu/drm/i915/display/intel_dvo.c +++ b/drivers/gpu/drm/i915/display/intel_dvo.c @@ -126,7 +126,7 @@ static struct intel_dvo *intel_attached_dvo(struct intel_connector *connector) static bool intel_dvo_connector_get_hw_state(struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_encoder *encoder = intel_attached_encoder(connector); struct intel_dvo *intel_dvo = enc_to_dvo(encoder); enum port port = encoder->port; @@ -220,7 +220,7 @@ intel_dvo_mode_valid(struct drm_connector *_connector, struct intel_dvo *intel_dvo = intel_attached_dvo(connector); const struct drm_display_mode *fixed_mode = intel_panel_fixed_mode(connector, mode); - int max_dotclk = to_i915(connector->base.dev)->max_dotclk_freq; + int max_dotclk = to_i915(connector->base.drm)->max_dotclk_freq; int target_clock = mode->clock; if (mode->flags & DRM_MODE_FLAG_DBLSCAN) @@ -313,7 +313,7 @@ static enum drm_connector_status intel_dvo_detect(struct drm_connector *_connector, bool force) { struct intel_connector *connector = to_intel_connector(_connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_dvo *intel_dvo = intel_attached_dvo(connector); drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s]\n", @@ -328,7 +328,7 @@ intel_dvo_detect(struct drm_connector *_connector, bool force) static int intel_dvo_get_modes(struct drm_connector *_connector) { struct intel_connector *connector = to_intel_connector(_connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); int num_modes; /* diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 5ed450111f77..b7cc69e5c2c3 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -164,7 +164,7 @@ bool intel_hdcp_capable(struct intel_connector *connector) bool intel_hdcp2_capable(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; bool capable = false; @@ -378,7 +378,7 @@ int intel_hdcp_validate_v_prime(struct intel_connector *connector, u8 *ksv_fifo, u8 num_downstream, u8 *bstatus) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder; enum port port = dig_port->base.port; u32 vprime, sha_text, sha_leftovers, rep_ctl; @@ -620,7 +620,7 @@ static int intel_hdcp_auth_downstream(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); const struct intel_hdcp_shim *shim = connector->hdcp.shim; u8 bstatus[2], num_downstream, *ksv_fifo; int ret, i, tries = 3; @@ -703,7 +703,7 @@ int intel_hdcp_auth_downstream(struct intel_connector *connector) static int intel_hdcp_auth(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; const struct intel_hdcp_shim *shim = hdcp->shim; enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder; @@ -875,7 +875,7 @@ static int intel_hdcp_auth(struct intel_connector *connector) static int _intel_hdcp_disable(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; enum port port = dig_port->base.port; enum transcoder cpu_transcoder = hdcp->cpu_transcoder; @@ -929,7 +929,7 @@ static int _intel_hdcp_disable(struct intel_connector *connector) static int _intel_hdcp_enable(struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; int i, ret, tries = 3; @@ -980,12 +980,12 @@ static struct intel_connector *intel_hdcp_to_connector(struct intel_hdcp *hdcp) static void intel_hdcp_update_value(struct intel_connector *connector, u64 value, bool update_property) { - struct drm_device *dev = connector->base.dev; + struct drm_device *dev = connector->base.drm; struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct intel_hdcp *hdcp = &connector->hdcp; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); - drm_WARN_ON(connector->base.dev, !mutex_is_locked(&hdcp->mutex)); + drm_WARN_ON(connector->base.drm, !mutex_is_locked(&hdcp->mutex)); if (hdcp->value == value) return; @@ -1010,7 +1010,7 @@ static void intel_hdcp_update_value(struct intel_connector *connector, static int intel_hdcp_check_link(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; enum port port = dig_port->base.port; enum transcoder cpu_transcoder; @@ -1082,7 +1082,7 @@ static void intel_hdcp_prop_work(struct work_struct *work) struct intel_hdcp *hdcp = container_of(work, struct intel_hdcp, prop_work); struct intel_connector *connector = intel_hdcp_to_connector(hdcp); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); drm_modeset_lock(&i915->drm.mode_config.connection_mutex, NULL); mutex_lock(&hdcp->mutex); @@ -1114,7 +1114,7 @@ hdcp2_prepare_ake_init(struct intel_connector *connector, { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct hdcp_port_data *data = &dig_port->hdcp_port_data; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct i915_hdcp_arbiter *arbiter; int ret; @@ -1144,7 +1144,7 @@ hdcp2_verify_rx_cert_prepare_km(struct intel_connector *connector, { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct hdcp_port_data *data = &dig_port->hdcp_port_data; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct i915_hdcp_arbiter *arbiter; int ret; @@ -1172,7 +1172,7 @@ static int hdcp2_verify_hprime(struct intel_connector *connector, { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct hdcp_port_data *data = &dig_port->hdcp_port_data; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct i915_hdcp_arbiter *arbiter; int ret; @@ -1198,7 +1198,7 @@ hdcp2_store_pairing_info(struct intel_connector *connector, { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct hdcp_port_data *data = &dig_port->hdcp_port_data; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct i915_hdcp_arbiter *arbiter; int ret; @@ -1225,7 +1225,7 @@ hdcp2_prepare_lc_init(struct intel_connector *connector, { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct hdcp_port_data *data = &dig_port->hdcp_port_data; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct i915_hdcp_arbiter *arbiter; int ret; @@ -1252,7 +1252,7 @@ hdcp2_verify_lprime(struct intel_connector *connector, { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct hdcp_port_data *data = &dig_port->hdcp_port_data; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct i915_hdcp_arbiter *arbiter; int ret; @@ -1278,7 +1278,7 @@ static int hdcp2_prepare_skey(struct intel_connector *connector, { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct hdcp_port_data *data = &dig_port->hdcp_port_data; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct i915_hdcp_arbiter *arbiter; int ret; @@ -1307,7 +1307,7 @@ hdcp2_verify_rep_topology_prepare_ack(struct intel_connector *connector, { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct hdcp_port_data *data = &dig_port->hdcp_port_data; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct i915_hdcp_arbiter *arbiter; int ret; @@ -1337,7 +1337,7 @@ hdcp2_verify_mprime(struct intel_connector *connector, { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct hdcp_port_data *data = &dig_port->hdcp_port_data; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct i915_hdcp_arbiter *arbiter; int ret; @@ -1361,7 +1361,7 @@ static int hdcp2_authenticate_port(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct hdcp_port_data *data = &dig_port->hdcp_port_data; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct i915_hdcp_arbiter *arbiter; int ret; @@ -1385,7 +1385,7 @@ static int hdcp2_authenticate_port(struct intel_connector *connector) static int hdcp2_close_session(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct i915_hdcp_arbiter *arbiter; int ret; @@ -1413,7 +1413,7 @@ static int hdcp2_deauthenticate_port(struct intel_connector *connector) static int hdcp2_authentication_key_exchange(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; union { struct hdcp2_ake_init ake_init; @@ -1608,7 +1608,7 @@ static int hdcp2_authenticate_repeater_topology(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; union { struct hdcp2_rep_send_receiverid_list recvid_list; @@ -1683,7 +1683,7 @@ int hdcp2_authenticate_repeater_topology(struct intel_connector *connector) static int hdcp2_authenticate_sink(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; const struct intel_hdcp_shim *shim = hdcp->shim; int ret; @@ -1730,7 +1730,7 @@ static int hdcp2_authenticate_sink(struct intel_connector *connector) static int hdcp2_enable_stream_encryption(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct hdcp_port_data *data = &dig_port->hdcp_port_data; struct intel_hdcp *hdcp = &connector->hdcp; enum transcoder cpu_transcoder = hdcp->cpu_transcoder; @@ -1771,7 +1771,7 @@ static int hdcp2_enable_stream_encryption(struct intel_connector *connector) static int hdcp2_enable_encryption(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; enum port port = dig_port->base.port; enum transcoder cpu_transcoder = hdcp->cpu_transcoder; @@ -1810,7 +1810,7 @@ static int hdcp2_enable_encryption(struct intel_connector *connector) static int hdcp2_disable_encryption(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; enum port port = dig_port->base.port; enum transcoder cpu_transcoder = hdcp->cpu_transcoder; @@ -1847,7 +1847,7 @@ static int hdcp2_disable_encryption(struct intel_connector *connector) static int hdcp2_propagate_stream_management_info(struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); int i, tries = 3, ret; if (!connector->hdcp.is_repeater) @@ -1876,7 +1876,7 @@ hdcp2_propagate_stream_management_info(struct intel_connector *connector) static int hdcp2_authenticate_and_encrypt(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); int ret = 0, i, tries = 3; for (i = 0; i < tries && !dig_port->hdcp_auth_status; i++) { @@ -1929,7 +1929,7 @@ static int hdcp2_authenticate_and_encrypt(struct intel_connector *connector) static int _intel_hdcp2_enable(struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; int ret; @@ -1956,7 +1956,7 @@ static int _intel_hdcp2_disable(struct intel_connector *connector, bool hdcp2_link_recovery) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct hdcp_port_data *data = &dig_port->hdcp_port_data; struct intel_hdcp *hdcp = &connector->hdcp; int ret; @@ -1994,7 +1994,7 @@ _intel_hdcp2_disable(struct intel_connector *connector, bool hdcp2_link_recovery static int intel_hdcp2_check_link(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; enum port port = dig_port->base.port; enum transcoder cpu_transcoder; @@ -2091,7 +2091,7 @@ static void intel_hdcp_check_work(struct work_struct *work) struct intel_hdcp, check_work); struct intel_connector *connector = intel_hdcp_to_connector(hdcp); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); if (drm_connector_is_unregistered(&connector->base)) return; @@ -2160,7 +2160,7 @@ static int initialize_hdcp_port_data(struct intel_connector *connector, struct intel_digital_port *dig_port, const struct intel_hdcp_shim *shim) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct hdcp_port_data *data = &dig_port->hdcp_port_data; enum port port = dig_port->base.port; @@ -2241,7 +2241,7 @@ static void intel_hdcp2_init(struct intel_connector *connector, struct intel_digital_port *dig_port, const struct intel_hdcp_shim *shim) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; int ret; @@ -2258,7 +2258,7 @@ int intel_hdcp_init(struct intel_connector *connector, struct intel_digital_port *dig_port, const struct intel_hdcp_shim *shim) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_hdcp *hdcp = &connector->hdcp; int ret; @@ -2450,7 +2450,7 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state, to_intel_connector(conn_state->connector); struct intel_hdcp *hdcp = &connector->hdcp; bool content_protection_type_changed, desired_and_not_enabled = false; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); if (!connector->hdcp.shim) return; @@ -2530,8 +2530,8 @@ void intel_hdcp_cleanup(struct intel_connector *connector) * If the connector is registered, it's possible userspace could kick * off another HDCP enable, which would re-spawn the workers. */ - drm_WARN_ON(connector->base.dev, - connector->base.registration_state == DRM_CONNECTOR_REGISTERED); + drm_WARN_ON(connector->base.drm, + connector->base.registration_state == DRM_CONNECTOR_REGISTERED); /* * Now that the connector is not registered, check_work won't be run, @@ -2548,7 +2548,7 @@ void intel_hdcp_cleanup(struct intel_connector *connector) * function should be called), we're "guaranteed" that prop_work is not * active (tl;dr This Should Never Happen). */ - drm_WARN_ON(connector->base.dev, work_pending(&hdcp->prop_work)); + drm_WARN_ON(connector->base.drm, work_pending(&hdcp->prop_work)); mutex_lock(&hdcp->mutex); hdcp->shim = NULL; @@ -2606,7 +2606,7 @@ void intel_hdcp_atomic_check(struct drm_connector *connector, void intel_hdcp_handle_cp_irq(struct intel_connector *connector) { struct intel_hdcp *hdcp = &connector->hdcp; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); if (!hdcp->shim) return; diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index 4b41a58fcb03..f2d0f223ffc3 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -1458,7 +1458,7 @@ int intel_hdmi_hdcp_read_v_prime_part(struct intel_digital_port *dig_port, static int kbl_repositioning_enc_en_signal(struct intel_connector *connector, enum transcoder cpu_transcoder) { - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct drm_i915_private *dev_priv = to_i915(connector->base.drm); struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct intel_crtc *crtc = to_intel_crtc(connector->base.state->crtc); u32 scanline; @@ -1497,7 +1497,7 @@ int intel_hdmi_hdcp_toggle_signalling(struct intel_digital_port *dig_port, { struct intel_hdmi *hdmi = &dig_port->hdmi; struct intel_connector *connector = hdmi->attached_connector; - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct drm_i915_private *dev_priv = to_i915(connector->base.drm); int ret; if (!enable) @@ -1943,7 +1943,7 @@ intel_hdmi_mode_clock_valid(struct drm_connector *connector, int clock, bool has_hdmi_sink, enum intel_output_format sink_format) { - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); struct intel_hdmi *hdmi = intel_attached_hdmi(to_intel_connector(connector)); enum drm_mode_status status = MODE_OK; int bpc; @@ -1981,7 +1981,7 @@ intel_hdmi_mode_valid(struct drm_connector *connector, struct drm_i915_private *dev_priv = intel_hdmi_to_i915(hdmi); enum drm_mode_status status; int clock = mode->clock; - int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; + int max_dotclk = to_i915(connector->drm)->max_dotclk_freq; bool has_hdmi_sink = intel_has_hdmi_sink(hdmi, connector->state); bool ycbcr_420_only; enum intel_output_format sink_format; @@ -2212,7 +2212,7 @@ static int intel_hdmi_compute_output_format(struct intel_encoder *encoder, struct intel_connector *connector = to_intel_connector(conn_state->connector); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; const struct drm_display_info *info = &connector->base.display_info; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); bool ycbcr_420_only = drm_mode_is_420_only(info, adjusted_mode); int ret; @@ -2397,7 +2397,7 @@ intel_hdmi_unset_edid(struct drm_connector *connector) static void intel_hdmi_dp_dual_mode_detect(struct drm_connector *connector) { - struct drm_i915_private *dev_priv = to_i915(connector->dev); + struct drm_i915_private *dev_priv = to_i915(connector->drm); struct intel_hdmi *hdmi = intel_attached_hdmi(to_intel_connector(connector)); struct intel_encoder *encoder = &hdmi_to_dig_port(hdmi)->base; struct i2c_adapter *adapter = @@ -2448,7 +2448,7 @@ intel_hdmi_dp_dual_mode_detect(struct drm_connector *connector) static bool intel_hdmi_set_edid(struct drm_connector *connector) { - struct drm_i915_private *dev_priv = to_i915(connector->dev); + struct drm_i915_private *dev_priv = to_i915(connector->drm); struct intel_hdmi *intel_hdmi = intel_attached_hdmi(to_intel_connector(connector)); intel_wakeref_t wakeref; const struct drm_edid *drm_edid; @@ -2494,7 +2494,7 @@ static enum drm_connector_status intel_hdmi_detect(struct drm_connector *connector, bool force) { enum drm_connector_status status = connector_status_disconnected; - struct drm_i915_private *dev_priv = to_i915(connector->dev); + struct drm_i915_private *dev_priv = to_i915(connector->drm); struct intel_hdmi *intel_hdmi = intel_attached_hdmi(to_intel_connector(connector)); struct intel_encoder *encoder = &hdmi_to_dig_port(intel_hdmi)->base; intel_wakeref_t wakeref; @@ -2534,7 +2534,7 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) static void intel_hdmi_force(struct drm_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s]\n", connector->base.id, connector->name); @@ -2556,7 +2556,7 @@ static int intel_hdmi_get_modes(struct drm_connector *connector) static struct i2c_adapter * intel_hdmi_get_i2c_adapter(struct drm_connector *connector) { - struct drm_i915_private *dev_priv = to_i915(connector->dev); + struct drm_i915_private *dev_priv = to_i915(connector->drm); struct intel_hdmi *intel_hdmi = intel_attached_hdmi(to_intel_connector(connector)); return intel_gmbus_get_adapter(dev_priv, intel_hdmi->ddc_bus); @@ -2564,7 +2564,7 @@ intel_hdmi_get_i2c_adapter(struct drm_connector *connector) static void intel_hdmi_create_i2c_symlink(struct drm_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); struct i2c_adapter *adapter = intel_hdmi_get_i2c_adapter(connector); struct kobject *i2c_kobj = &adapter->dev.kobj; struct kobject *connector_kobj = &connector->kdev->kobj; @@ -2641,7 +2641,7 @@ static const struct drm_connector_helper_funcs intel_hdmi_connector_helper_funcs static void intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *connector) { - struct drm_i915_private *dev_priv = to_i915(connector->dev); + struct drm_i915_private *dev_priv = to_i915(connector->drm); intel_attach_force_audio_property(connector); intel_attach_broadcast_rgb_property(connector); diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c index 1160fa20433b..bec50f2d6650 100644 --- a/drivers/gpu/drm/i915/display/intel_hotplug.c +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c @@ -263,7 +263,7 @@ enum intel_hotplug_state intel_encoder_hotplug(struct intel_encoder *encoder, struct intel_connector *connector) { - struct drm_device *dev = connector->base.dev; + struct drm_device *dev = connector->base.drm; enum drm_connector_status old_status; u64 old_epoch_counter; bool ret = false; diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c index 3ace56979b70..c7b96ea7666c 100644 --- a/drivers/gpu/drm/i915/display/intel_lvds.c +++ b/drivers/gpu/drm/i915/display/intel_lvds.c @@ -391,7 +391,7 @@ intel_lvds_mode_valid(struct drm_connector *_connector, struct intel_connector *connector = to_intel_connector(_connector); const struct drm_display_mode *fixed_mode = intel_panel_fixed_mode(connector, mode); - int max_pixclk = to_i915(connector->base.dev)->max_dotclk_freq; + int max_pixclk = to_i915(connector->base.drm)->max_dotclk_freq; enum drm_mode_status status; if (mode->flags & DRM_MODE_FLAG_DBLSCAN) diff --git a/drivers/gpu/drm/i915/display/intel_modeset_verify.c b/drivers/gpu/drm/i915/display/intel_modeset_verify.c index 138144a65a45..418b8526a081 100644 --- a/drivers/gpu/drm/i915/display/intel_modeset_verify.c +++ b/drivers/gpu/drm/i915/display/intel_modeset_verify.c @@ -27,7 +27,7 @@ static void intel_connector_verify_state(struct intel_crtc_state *crtc_state, struct drm_connector_state *conn_state) { struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s]\n", connector->base.base.id, connector->base.name); @@ -81,7 +81,8 @@ verify_connector_state(struct intel_atomic_state *state, intel_connector_verify_state(crtc_state, new_conn_state); - I915_STATE_WARN(to_i915(connector->dev), new_conn_state->best_encoder != encoder, + I915_STATE_WARN(to_i915(connector->drm), + new_conn_state->best_encoder != encoder, "connector's atomic encoder doesn't match legacy encoder\n"); } } diff --git a/drivers/gpu/drm/i915/display/intel_opregion.c b/drivers/gpu/drm/i915/display/intel_opregion.c index 84078fb82b2f..246002019175 100644 --- a/drivers/gpu/drm/i915/display/intel_opregion.c +++ b/drivers/gpu/drm/i915/display/intel_opregion.c @@ -1105,7 +1105,7 @@ intel_opregion_get_panel_type(struct drm_i915_private *dev_priv) const struct drm_edid *intel_opregion_get_edid(struct intel_connector *intel_connector) { struct drm_connector *connector = &intel_connector->base; - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); struct intel_opregion *opregion = &i915->display.opregion; const struct drm_edid *drm_edid; const void *edid; diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index 9232a305b1e6..172c78777130 100644 --- a/drivers/gpu/drm/i915/display/intel_panel.c +++ b/drivers/gpu/drm/i915/display/intel_panel.c @@ -175,7 +175,7 @@ int intel_panel_get_modes(struct intel_connector *connector) list_for_each_entry(fixed_mode, &connector->panel.fixed_modes, head) { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->base.dev, fixed_mode); + mode = drm_mode_duplicate(connector->base.drm, fixed_mode); if (mode) { drm_mode_probed_add(&connector->base, mode); num_modes++; @@ -235,7 +235,7 @@ int intel_panel_compute_config(struct intel_connector *connector, * off refresh rates. */ if (abs(vrefresh - fixed_mode_vrefresh) > 1) { - drm_dbg_kms(connector->base.dev, + drm_dbg_kms(connector->base.drm, "[CONNECTOR:%d:%s] Requested mode vrefresh (%d Hz) does not match fixed mode vrefresh (%d Hz)\n", connector->base.base.id, connector->base.name, vrefresh, fixed_mode_vrefresh); @@ -258,7 +258,7 @@ int intel_panel_compute_config(struct intel_connector *connector, static void intel_panel_add_edid_alt_fixed_modes(struct intel_connector *connector) { - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct drm_i915_private *dev_priv = to_i915(connector->base.drm); const struct drm_display_mode *preferred_mode = intel_panel_preferred_fixed_mode(connector); struct drm_display_mode *mode, *next; @@ -278,7 +278,7 @@ static void intel_panel_add_edid_alt_fixed_modes(struct intel_connector *connect static void intel_panel_add_edid_preferred_mode(struct intel_connector *connector) { - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct drm_i915_private *dev_priv = to_i915(connector->base.drm); struct drm_display_mode *scan, *fixed_mode = NULL; if (list_empty(&connector->base.probed_modes)) @@ -309,7 +309,7 @@ static void intel_panel_add_edid_preferred_mode(struct intel_connector *connecto static void intel_panel_destroy_probed_modes(struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct drm_display_mode *mode, *next; list_for_each_entry_safe(mode, next, &connector->base.probed_modes, head) { @@ -335,7 +335,7 @@ static void intel_panel_add_fixed_mode(struct intel_connector *connector, struct drm_display_mode *fixed_mode, const char *type) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct drm_display_info *info = &connector->base.display_info; if (!fixed_mode) @@ -355,7 +355,7 @@ static void intel_panel_add_fixed_mode(struct intel_connector *connector, void intel_panel_add_vbt_lfp_fixed_mode(struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); const struct drm_display_mode *mode; mode = connector->panel.vbt.lfp_lvds_vbt_mode; @@ -369,7 +369,7 @@ void intel_panel_add_vbt_lfp_fixed_mode(struct intel_connector *connector) void intel_panel_add_vbt_sdvo_fixed_mode(struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); const struct drm_display_mode *mode; mode = connector->panel.vbt.sdvo_lvds_vbt_mode; @@ -687,7 +687,7 @@ int intel_panel_fitting(struct intel_crtc_state *crtc_state, enum drm_connector_status intel_panel_detect(struct drm_connector *connector, bool force) { - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); if (!INTEL_DISPLAY_ENABLED(i915)) return connector_status_disconnected; @@ -738,7 +738,7 @@ int intel_panel_init(struct intel_connector *connector, if (!has_drrs_modes(connector)) connector->panel.vbt.drrs_type = DRRS_TYPE_NONE; - drm_dbg_kms(connector->base.dev, + drm_dbg_kms(connector->base.drm, "[CONNECTOR:%d:%s] DRRS type: %s\n", connector->base.base.id, connector->base.name, intel_drrs_type_str(intel_panel_drrs_type(connector))); @@ -760,6 +760,6 @@ void intel_panel_fini(struct intel_connector *connector) list_for_each_entry_safe(fixed_mode, next, &panel->fixed_modes, head) { list_del(&fixed_mode->head); - drm_mode_destroy(connector->base.dev, fixed_mode); + drm_mode_destroy(connector->base.drm, fixed_mode); } } diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c index 73f0f1714b37..efe52b20dea0 100644 --- a/drivers/gpu/drm/i915/display/intel_pps.c +++ b/drivers/gpu/drm/i915/display/intel_pps.c @@ -1087,7 +1087,7 @@ void intel_pps_backlight_off(struct intel_dp *intel_dp) */ void intel_pps_backlight_power(struct intel_connector *connector, bool enable) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_dp *intel_dp = intel_attached_dp(connector); intel_wakeref_t wakeref; bool is_enabled; diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 27bb8914a7ad..00b4d87e4d81 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -3066,7 +3066,7 @@ DEFINE_SHOW_ATTRIBUTE(i915_psr_status); void intel_psr_connector_debugfs_add(struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct dentry *root = connector->base.debugfs_entry; if (connector->base.connector_type != DRM_MODE_CONNECTOR_eDP) diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index 21f92123c844..92376afc503b 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -1909,7 +1909,7 @@ intel_sdvo_mode_valid(struct drm_connector *connector, struct intel_sdvo *intel_sdvo = intel_attached_sdvo(to_intel_connector(connector)); struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector); - int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; + int max_dotclk = to_i915(connector->drm)->max_dotclk_freq; bool has_hdmi_sink = intel_has_hdmi_sink(intel_sdvo_connector, connector->state); int clock = mode->clock; @@ -2047,7 +2047,7 @@ intel_sdvo_get_edid(struct drm_connector *connector) static const struct drm_edid * intel_sdvo_get_analog_edid(struct drm_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); struct i2c_adapter *i2c; i2c = intel_gmbus_get_adapter(i915, i915->display.vbt.crt_ddc_pin); @@ -2123,7 +2123,7 @@ intel_sdvo_connector_matches_edid(struct intel_sdvo_connector *sdvo, static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connector, bool force) { - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); struct intel_sdvo *intel_sdvo = intel_attached_sdvo(to_intel_connector(connector)); struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector); enum drm_connector_status ret; @@ -2307,7 +2307,7 @@ static int intel_sdvo_get_tv_modes(struct drm_connector *connector) for (i = 0; i < ARRAY_SIZE(sdvo_tv_modes); i++) { if (reply & (1 << i)) { struct drm_display_mode *nmode; - nmode = drm_mode_duplicate(connector->dev, + nmode = drm_mode_duplicate(connector->drm, &sdvo_tv_modes[i]); if (nmode) { drm_mode_probed_add(connector, nmode); @@ -2321,7 +2321,7 @@ static int intel_sdvo_get_tv_modes(struct drm_connector *connector) static int intel_sdvo_get_lvds_modes(struct drm_connector *connector) { - struct drm_i915_private *dev_priv = to_i915(connector->dev); + struct drm_i915_private *dev_priv = to_i915(connector->drm); drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s]\n", connector->base.id, connector->name); @@ -2360,7 +2360,7 @@ intel_sdvo_connector_atomic_get_property(struct drm_connector *connector, return 0; } - drm_WARN_ON(connector->dev, 1); + drm_WARN_ON(connector->drm, 1); *val = 0; } else if (property == intel_sdvo_connector->top || property == intel_sdvo_connector->bottom) diff --git a/drivers/gpu/drm/i915/display/intel_tv.c b/drivers/gpu/drm/i915/display/intel_tv.c index 36b479b46b60..5f2c9ba488d9 100644 --- a/drivers/gpu/drm/i915/display/intel_tv.c +++ b/drivers/gpu/drm/i915/display/intel_tv.c @@ -959,7 +959,7 @@ intel_tv_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { const struct tv_mode *tv_mode = intel_tv_mode_find(connector->state); - int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; + int max_dotclk = to_i915(connector->drm)->max_dotclk_freq; if (mode->flags & DRM_MODE_FLAG_DBLSCAN) return MODE_NO_DBLESCAN; @@ -1586,7 +1586,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv, struct drm_connector *connector) { struct intel_crtc *crtc = to_intel_crtc(connector->state->crtc); - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_i915_private *dev_priv = to_i915(dev); u32 tv_ctl, save_tv_ctl; u32 tv_dac, save_tv_dac; @@ -1712,7 +1712,7 @@ intel_tv_detect(struct drm_connector *connector, struct drm_modeset_acquire_ctx *ctx, bool force) { - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); struct intel_tv *intel_tv = intel_attached_tv(to_intel_connector(connector)); enum drm_connector_status status; int type; @@ -1789,7 +1789,7 @@ intel_tv_set_mode_type(struct drm_display_mode *mode, static int intel_tv_get_modes(struct drm_connector *connector) { - struct drm_i915_private *dev_priv = to_i915(connector->dev); + struct drm_i915_private *dev_priv = to_i915(connector->drm); const struct tv_mode *tv_mode = intel_tv_mode_find(connector->state); int i, count = 0; @@ -1807,7 +1807,7 @@ intel_tv_get_modes(struct drm_connector *connector) input->h > intel_tv_mode_vdisplay(tv_mode)) continue; - mode = drm_mode_create(connector->dev); + mode = drm_mode_create(connector->drm); if (!mode) continue; @@ -1885,7 +1885,7 @@ static const struct drm_encoder_funcs intel_tv_enc_funcs = { static void intel_tv_add_properties(struct drm_connector *connector) { - struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_i915_private *i915 = to_i915(connector->drm); struct drm_connector_state *conn_state = connector->state; const char *tv_format_names[ARRAY_SIZE(tv_modes)]; int i; diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c index 88e4759b538b..6361667d0eb1 100644 --- a/drivers/gpu/drm/i915/display/intel_vrr.c +++ b/drivers/gpu/drm/i915/display/intel_vrr.c @@ -13,7 +13,7 @@ bool intel_vrr_is_capable(struct intel_connector *connector) { const struct drm_display_info *info = &connector->base.display_info; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_i915_private *i915 = to_i915(connector->base.drm); struct intel_dp *intel_dp; /* diff --git a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c index c45fc8f4744d..78bf347837f8 100644 --- a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c +++ b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c @@ -152,7 +152,7 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector) if (imx_ldb_ch->mode_valid) { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &imx_ldb_ch->mode); + mode = drm_mode_duplicate(connector->drm, &imx_ldb_ch->mode); if (!mode) return -EINVAL; mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; diff --git a/drivers/gpu/drm/imx/ipuv3/parallel-display.c b/drivers/gpu/drm/imx/ipuv3/parallel-display.c index 0fa0b590830b..c5602b8debcf 100644 --- a/drivers/gpu/drm/imx/ipuv3/parallel-display.c +++ b/drivers/gpu/drm/imx/ipuv3/parallel-display.c @@ -68,7 +68,7 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector) } if (np) { - struct drm_display_mode *mode = drm_mode_create(connector->dev); + struct drm_display_mode *mode = drm_mode_create(connector->drm); int ret; if (!mode) @@ -78,7 +78,7 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector) &imxpd->bus_flags, OF_USE_NATIVE_MODE); if (ret) { - drm_mode_destroy(connector->dev, mode); + drm_mode_destroy(connector->drm, mode); return ret; } diff --git a/drivers/gpu/drm/loongson/lsdc_output_7a2000.c b/drivers/gpu/drm/loongson/lsdc_output_7a2000.c index ce3dabec887e..5ef9fe52bffc 100644 --- a/drivers/gpu/drm/loongson/lsdc_output_7a2000.c +++ b/drivers/gpu/drm/loongson/lsdc_output_7a2000.c @@ -141,7 +141,7 @@ static const struct drm_info_list ls7a2000_hdmi1_debugfs_files[] = { static void ls7a2000_hdmi0_late_register(struct drm_connector *connector, struct dentry *root) { - struct drm_device *ddev = connector->dev; + struct drm_device *ddev = connector->drm; struct drm_minor *minor = ddev->primary; drm_debugfs_create_files(ls7a2000_hdmi0_debugfs_files, @@ -152,7 +152,7 @@ static void ls7a2000_hdmi0_late_register(struct drm_connector *connector, static void ls7a2000_hdmi1_late_register(struct drm_connector *connector, struct dentry *root) { - struct drm_device *ddev = connector->dev; + struct drm_device *ddev = connector->drm; struct drm_minor *minor = ddev->primary; drm_debugfs_create_files(ls7a2000_hdmi1_debugfs_files, @@ -165,7 +165,7 @@ static void ls7a2000_hdmi1_late_register(struct drm_connector *connector, static enum drm_connector_status ls7a2000_hdmi0_vga_connector_detect(struct drm_connector *connector, bool force) { - struct drm_device *ddev = connector->dev; + struct drm_device *ddev = connector->drm; struct lsdc_device *ldev = to_lsdc(ddev); u32 val; @@ -187,7 +187,7 @@ ls7a2000_hdmi0_vga_connector_detect(struct drm_connector *connector, bool force) static enum drm_connector_status ls7a2000_hdmi1_connector_detect(struct drm_connector *connector, bool force) { - struct lsdc_device *ldev = to_lsdc(connector->dev); + struct lsdc_device *ldev = to_lsdc(connector->drm); u32 val; val = lsdc_rreg32(ldev, LSDC_HDMI_HPD_STATUS_REG); diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index 26301ccca2ff..b166e6fc1399 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -716,7 +716,7 @@ void mgag200_crtc_atomic_destroy_state(struct drm_crtc *crtc, struct drm_crtc_st int mgag200_vga_connector_helper_get_modes(struct drm_connector *connector) { - struct mga_device *mdev = to_mga_device(connector->dev); + struct mga_device *mdev = to_mga_device(connector->drm); int ret; /* diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c index 2a5a68366582..ddbc11d83027 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c @@ -9,7 +9,7 @@ static int dpu_wb_conn_get_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct msm_drm_private *priv = dev->dev_private; struct dpu_kms *dpu_kms = to_dpu_kms(priv->kms); diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 76f13954015b..84ab75196162 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -364,7 +364,7 @@ static void dp_display_send_hpd_event(struct msm_dp *dp_display) dp = container_of(dp_display, struct dp_display_private, dp_display); connector = dp->dp_display.connector; - drm_helper_hpd_irq_event(connector->dev); + drm_helper_hpd_irq_event(connector->drm); } diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c index 785d76639497..c24e3c45ef17 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.c +++ b/drivers/gpu/drm/msm/dp/dp_drm.c @@ -85,7 +85,7 @@ static int dp_bridge_get_modes(struct drm_bridge *bridge, struct drm_connector * return rc; } } else { - drm_dbg_dp(connector->dev, "No sink connected\n"); + drm_dbg_dp(connector->drm, "No sink connected\n"); } return rc; } diff --git a/drivers/gpu/drm/nouveau/dispnv04/dac.c b/drivers/gpu/drm/nouveau/dispnv04/dac.c index d6b8e0cce2ac..417de5d0b540 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/dac.c +++ b/drivers/gpu/drm/nouveau/dispnv04/dac.c @@ -529,7 +529,7 @@ nv04_dac_create(struct drm_connector *connector, struct dcb_output *entry) { const struct drm_encoder_helper_funcs *helper; struct nouveau_encoder *nv_encoder = NULL; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_encoder *encoder; nv_encoder = kzalloc(sizeof(*nv_encoder), GFP_KERNEL); diff --git a/drivers/gpu/drm/nouveau/dispnv04/dfp.c b/drivers/gpu/drm/nouveau/dispnv04/dfp.c index d5b129dc623b..4469e00f43ad 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/dfp.c +++ b/drivers/gpu/drm/nouveau/dispnv04/dfp.c @@ -708,7 +708,7 @@ nv04_dfp_create(struct drm_connector *connector, struct dcb_output *entry) nv_encoder->dcb = entry; nv_encoder->or = ffs(entry->or) - 1; - drm_encoder_init(connector->dev, encoder, &nv04_dfp_funcs, type, NULL); + drm_encoder_init(connector->drm, encoder, &nv04_dfp_funcs, type, NULL); drm_encoder_helper_add(encoder, helper); encoder->possible_crtcs = entry->heads; diff --git a/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c index de3ea731d6e6..ed989f19aba6 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c +++ b/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c @@ -203,7 +203,7 @@ nv04_tv_create(struct drm_connector *connector, struct dcb_output *entry) { struct nouveau_encoder *nv_encoder; struct drm_encoder *encoder; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device); struct nvkm_i2c_bus *bus = nvkm_i2c_bus_find(i2c, entry->i2c_index); diff --git a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c index 670c9739e5e1..315b30a3befc 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c +++ b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c @@ -787,7 +787,7 @@ static const struct drm_encoder_funcs nv17_tv_funcs = { int nv17_tv_create(struct drm_connector *connector, struct dcb_output *entry) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_encoder *encoder; struct nv17_tv_encoder *tv_enc = NULL; diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 02f51144d228..521bf7eeb558 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -555,8 +555,8 @@ nv50_dac_func = { static int nv50_dac_create(struct drm_connector *connector, struct dcb_output *dcbe) { - struct nouveau_drm *drm = nouveau_drm(connector->dev); - struct nv50_disp *disp = nv50_disp(connector->dev); + struct nouveau_drm *drm = nouveau_drm(connector->drm); + struct nv50_disp *disp = nv50_disp(connector->drm); struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device); struct nvkm_i2c_bus *bus; struct nouveau_encoder *nv_encoder; @@ -575,7 +575,7 @@ nv50_dac_create(struct drm_connector *connector, struct dcb_output *dcbe) encoder = to_drm_encoder(nv_encoder); encoder->possible_crtcs = dcbe->heads; encoder->possible_clones = 0; - drm_encoder_init(connector->dev, encoder, &nv50_dac_func, type, + drm_encoder_init(connector->drm, encoder, &nv50_dac_func, type, "dac-%04x-%04x", dcbe->hasht, dcbe->hashm); drm_encoder_helper_add(encoder, &nv50_dac_help); @@ -1151,7 +1151,7 @@ nv50_mstc_get_modes(struct drm_connector *connector) connector->display_info.bpc = 8; if (mstc->native) - drm_mode_destroy(mstc->connector.dev, mstc->native); + drm_mode_destroy(mstc->connector.drm, mstc->native); mstc->native = nouveau_conn_native_mode(&mstc->connector); return ret; } @@ -1176,9 +1176,9 @@ nv50_mstc_detect(struct drm_connector *connector, if (drm_connector_is_unregistered(connector)) return connector_status_disconnected; - ret = pm_runtime_get_sync(connector->dev->dev); + ret = pm_runtime_get_sync(connector->drm->dev); if (ret < 0 && ret != -EACCES) { - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_put_autosuspend(connector->drm->dev); return connector_status_disconnected; } @@ -1188,8 +1188,8 @@ nv50_mstc_detect(struct drm_connector *connector, goto out; out: - pm_runtime_mark_last_busy(connector->dev->dev); - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_mark_last_busy(connector->drm->dev); + pm_runtime_put_autosuspend(connector->drm->dev); return ret; } @@ -1717,11 +1717,11 @@ static int nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe) { struct nouveau_connector *nv_connector = nouveau_connector(connector); - struct nouveau_drm *drm = nouveau_drm(connector->dev); + struct nouveau_drm *drm = nouveau_drm(connector->drm); struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device); struct nouveau_encoder *nv_encoder; struct drm_encoder *encoder; - struct nv50_disp *disp = nv50_disp(connector->dev); + struct nv50_disp *disp = nv50_disp(connector->drm); int type, ret; switch (dcbe->type) { @@ -1742,7 +1742,7 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe) encoder = to_drm_encoder(nv_encoder); encoder->possible_crtcs = dcbe->heads; encoder->possible_clones = 0; - drm_encoder_init(connector->dev, encoder, &nv50_sor_func, type, + drm_encoder_init(connector->drm, encoder, &nv50_sor_func, type, "sor-%04x-%04x", dcbe->hasht, dcbe->hashm); drm_encoder_helper_add(encoder, &nv50_sor_help); @@ -1884,7 +1884,7 @@ nv50_pior_func = { static int nv50_pior_create(struct drm_connector *connector, struct dcb_output *dcbe) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nv50_disp *disp = nv50_disp(dev); struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device); @@ -1920,7 +1920,7 @@ nv50_pior_create(struct drm_connector *connector, struct dcb_output *dcbe) encoder = to_drm_encoder(nv_encoder); encoder->possible_crtcs = dcbe->heads; encoder->possible_clones = 0; - drm_encoder_init(connector->dev, encoder, &nv50_pior_func, type, + drm_encoder_init(connector->drm, encoder, &nv50_pior_func, type, "pior-%04x-%04x", dcbe->hasht, dcbe->hashm); drm_encoder_helper_add(encoder, &nv50_pior_help); diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c index 91b5ecc57538..13b40f0383f0 100644 --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c @@ -153,7 +153,7 @@ static int nv50_edp_get_brightness(struct backlight_device *bd) { struct drm_connector *connector = dev_get_drvdata(bd->dev.parent); - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_crtc *crtc; struct drm_modeset_acquire_ctx ctx; int ret = 0; @@ -195,7 +195,7 @@ nv50_edp_set_brightness(struct backlight_device *bd) { struct drm_connector *connector = dev_get_drvdata(bd->dev.parent); struct nouveau_connector *nv_connector = nouveau_connector(connector); - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_crtc *crtc; struct drm_dp_aux *aux = &nv_connector->aux; struct nouveau_backlight *nv_bl = nv_connector->backlight; @@ -361,7 +361,7 @@ nv50_backlight_init(struct nouveau_backlight *bl, int nouveau_backlight_init(struct drm_connector *connector) { - struct nouveau_drm *drm = nouveau_drm(connector->dev); + struct nouveau_drm *drm = nouveau_drm(connector->drm); struct nouveau_backlight *bl; struct nouveau_encoder *nv_encoder = NULL; struct nvif_device *device = &drm->client.device; diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 68b4fb4bec63..d4070be752f6 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -53,8 +53,8 @@ struct drm_display_mode * nouveau_conn_native_mode(struct drm_connector *connector) { const struct drm_connector_helper_funcs *helper = connector->helper_private; - struct nouveau_drm *drm = nouveau_drm(connector->dev); - struct drm_device *dev = connector->dev; + struct nouveau_drm *drm = nouveau_drm(connector->drm); + struct drm_device *dev = connector->drm; struct drm_display_mode *mode, *largest = NULL; int high_w = 0, high_h = 0, high_v = 0; @@ -99,8 +99,8 @@ nouveau_conn_atomic_get_property(struct drm_connector *connector, struct drm_property *property, u64 *val) { struct nouveau_conn_atom *asyc = nouveau_conn_atom(state); - struct nouveau_display *disp = nouveau_display(connector->dev); - struct drm_device *dev = connector->dev; + struct nouveau_display *disp = nouveau_display(connector->drm); + struct drm_device *dev = connector->drm; if (property == dev->mode_config.scaling_mode_property) *val = asyc->scaler.mode; @@ -129,7 +129,7 @@ nouveau_conn_atomic_set_property(struct drm_connector *connector, struct drm_connector_state *state, struct drm_property *property, u64 val) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct nouveau_conn_atom *asyc = nouveau_conn_atom(state); struct nouveau_display *disp = nouveau_display(dev); @@ -248,7 +248,7 @@ nouveau_conn_reset(struct drm_connector *connector) struct nouveau_connector *nv_connector = nouveau_connector(connector); struct nouveau_conn_atom *asyc; - if (drm_drv_uses_atomic_modeset(connector->dev)) { + if (drm_drv_uses_atomic_modeset(connector->drm)) { if (WARN_ON(!(asyc = kzalloc(sizeof(*asyc), GFP_KERNEL)))) return; @@ -268,7 +268,7 @@ nouveau_conn_reset(struct drm_connector *connector) asyc->procamp.color_vibrance = 150; asyc->procamp.vibrant_hue = 90; - if (nouveau_display(connector->dev)->disp.object.oclass < NV50_DISP) { + if (nouveau_display(connector->drm)->disp.object.oclass < NV50_DISP) { switch (connector->connector_type) { case DRM_MODE_CONNECTOR_LVDS: /* See note in nouveau_conn_atomic_set_property(). */ @@ -283,12 +283,12 @@ nouveau_conn_reset(struct drm_connector *connector) void nouveau_conn_attach_properties(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct nouveau_display *disp = nouveau_display(dev); struct nouveau_connector *nv_connector = nouveau_connector(connector); struct nouveau_conn_atom *armc; - if (drm_drv_uses_atomic_modeset(connector->dev)) + if (drm_drv_uses_atomic_modeset(connector->drm)) armc = nouveau_conn_atom(connector->state); else armc = &nv_connector->properties_state; @@ -411,7 +411,7 @@ nouveau_connector_destroy(struct drm_connector *connector) static struct nouveau_encoder * nouveau_connector_ddc_detect(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct pci_dev *pdev = to_pci_dev(dev->dev); struct nouveau_encoder *nv_encoder = NULL, *found = NULL; struct drm_encoder *encoder; @@ -459,7 +459,7 @@ static struct nouveau_encoder * nouveau_connector_of_detect(struct drm_connector *connector) { #ifdef __powerpc__ - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct nouveau_connector *nv_connector = nouveau_connector(connector); struct nouveau_encoder *nv_encoder; struct pci_dev *pdev = to_pci_dev(dev->dev); @@ -491,8 +491,8 @@ nouveau_connector_set_encoder(struct drm_connector *connector, struct nouveau_encoder *nv_encoder) { struct nouveau_connector *nv_connector = nouveau_connector(connector); - struct nouveau_drm *drm = nouveau_drm(connector->dev); - struct drm_device *dev = connector->dev; + struct nouveau_drm *drm = nouveau_drm(connector->drm); + struct drm_device *dev = connector->drm; struct pci_dev *pdev = to_pci_dev(dev->dev); if (nv_connector->detected_encoder == nv_encoder) @@ -549,7 +549,7 @@ nouveau_connector_set_edid(struct nouveau_connector *nv_connector, static enum drm_connector_status nouveau_connector_detect(struct drm_connector *connector, bool force) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_connector *nv_connector = nouveau_connector(connector); struct nouveau_encoder *nv_encoder = NULL; @@ -665,7 +665,7 @@ nouveau_connector_detect(struct drm_connector *connector, bool force) static enum drm_connector_status nouveau_connector_detect_lvds(struct drm_connector *connector, bool force) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_connector *nv_connector = nouveau_connector(connector); struct nouveau_encoder *nv_encoder = NULL; @@ -741,7 +741,7 @@ nouveau_connector_detect_lvds(struct drm_connector *connector, bool force) static void nouveau_connector_force(struct drm_connector *connector) { - struct nouveau_drm *drm = nouveau_drm(connector->dev); + struct nouveau_drm *drm = nouveau_drm(connector->drm); struct nouveau_connector *nv_connector = nouveau_connector(connector); struct nouveau_encoder *nv_encoder; int type; @@ -829,7 +829,7 @@ nouveau_connector_scaler_modes_add(struct drm_connector *connector) { struct nouveau_connector *nv_connector = nouveau_connector(connector); struct drm_display_mode *native = nv_connector->native_mode, *m; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct moderec *mode = &scaler_modes[0]; int modes = 0; @@ -860,7 +860,7 @@ nouveau_connector_scaler_modes_add(struct drm_connector *connector) static void nouveau_connector_detect_depth(struct drm_connector *connector) { - struct nouveau_drm *drm = nouveau_drm(connector->dev); + struct nouveau_drm *drm = nouveau_drm(connector->drm); struct nouveau_connector *nv_connector = nouveau_connector(connector); struct nouveau_encoder *nv_encoder = nv_connector->detected_encoder; struct nvbios *bios = &drm->vbios; @@ -941,7 +941,7 @@ nouveau_connector_early_unregister(struct drm_connector *connector) static int nouveau_connector_get_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_connector *nv_connector = nouveau_connector(connector); struct nouveau_encoder *nv_encoder = nv_connector->detected_encoder; @@ -1010,7 +1010,7 @@ get_tmds_link_bandwidth(struct drm_connector *connector) { struct nouveau_connector *nv_connector = nouveau_connector(connector); struct nouveau_encoder *nv_encoder = nv_connector->detected_encoder; - struct nouveau_drm *drm = nouveau_drm(connector->dev); + struct nouveau_drm *drm = nouveau_drm(connector->drm); struct dcb_output *dcb = nv_connector->detected_encoder->dcb; struct drm_display_info *info = NULL; unsigned duallink_scale = @@ -1117,7 +1117,7 @@ nouveau_connector_atomic_check(struct drm_connector *connector, struct drm_atomi struct drm_connector_state *conn_state = drm_atomic_get_new_connector_state(state, connector); - if (!nv_conn->dp_encoder || !nv50_has_mst(nouveau_drm(connector->dev))) + if (!nv_conn->dp_encoder || !nv50_has_mst(nouveau_drm(connector->drm))) return 0; return drm_dp_mst_root_conn_atomic_check(conn_state, &nv_conn->dp_encoder->dp.mstm->mgr); @@ -1168,7 +1168,7 @@ nouveau_connector_funcs_lvds = { void nouveau_connector_hpd(struct nouveau_connector *nv_connector, u64 bits) { - struct nouveau_drm *drm = nouveau_drm(nv_connector->base.dev); + struct nouveau_drm *drm = nouveau_drm(nv_connector->base.drm); u32 mask = drm_connector_mask(&nv_connector->base); unsigned long flags; diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c index f163d52a7c7d..7c93684b1124 100644 --- a/drivers/gpu/drm/omapdrm/dss/venc.c +++ b/drivers/gpu/drm/omapdrm/dss/venc.c @@ -639,7 +639,7 @@ static int venc_bridge_get_modes(struct drm_bridge *bridge, for (i = 0; i < ARRAY_SIZE(modes); ++i) { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, modes[i]); + mode = drm_mode_duplicate(connector->drm, modes[i]); if (!mode) return i; diff --git a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c index 1cc0f1d09684..b1451cad648b 100644 --- a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c +++ b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c @@ -232,7 +232,7 @@ static int y030xx067a_get_modes(struct drm_panel *panel, unsigned int i; for (i = 0; i < panel_info->num_modes; i++) { - mode = drm_mode_duplicate(connector->dev, + mode = drm_mode_duplicate(connector->drm, &panel_info->display_modes[i]); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-arm-versatile.c b/drivers/gpu/drm/panel/panel-arm-versatile.c index abb0788843c6..5bad5f77356f 100644 --- a/drivers/gpu/drm/panel/panel-arm-versatile.c +++ b/drivers/gpu/drm/panel/panel-arm-versatile.c @@ -266,7 +266,7 @@ static int versatile_panel_get_modes(struct drm_panel *panel, connector->display_info.height_mm = vpanel->panel_type->height_mm; connector->display_info.bus_flags = vpanel->panel_type->bus_flags; - mode = drm_mode_duplicate(connector->dev, &vpanel->panel_type->mode); + mode = drm_mode_duplicate(connector->drm, &vpanel->panel_type->mode); drm_mode_set_name(mode); mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; diff --git a/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c b/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c index 075a7af81eff..bbe3be54250f 100644 --- a/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c +++ b/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c @@ -176,7 +176,7 @@ static int tm5p5_nt35596_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &tm5p5_nt35596_mode); + mode = drm_mode_duplicate(connector->drm, &tm5p5_nt35596_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-auo-a030jtn01.c b/drivers/gpu/drm/panel/panel-auo-a030jtn01.c index 3c976a98de6a..ba269dd26381 100644 --- a/drivers/gpu/drm/panel/panel-auo-a030jtn01.c +++ b/drivers/gpu/drm/panel/panel-auo-a030jtn01.c @@ -143,7 +143,7 @@ static int a030jtn01_get_modes(struct drm_panel *panel, unsigned int i; for (i = 0; i < panel_info->num_modes; i++) { - mode = drm_mode_duplicate(connector->dev, + mode = drm_mode_duplicate(connector->drm, &panel_info->display_modes[i]); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c b/drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c index 90098b753e3b..0093c6a0f955 100644 --- a/drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c +++ b/drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c @@ -219,7 +219,7 @@ static int boe_bf060y8m_aj0_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &boe_bf060y8m_aj0_mode); + mode = drm_mode_duplicate(connector->drm, &boe_bf060y8m_aj0_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c b/drivers/gpu/drm/panel/panel-boe-himax8279d.c index d879b3b14c48..f087f398dba4 100644 --- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c +++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c @@ -218,7 +218,7 @@ static int boe_panel_get_modes(struct drm_panel *panel, const struct drm_display_mode *m = pinfo->desc->display_mode; struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, m); + mode = drm_mode_duplicate(connector->drm, m); if (!mode) { dev_err(pinfo->base.dev, "failed to add mode %ux%u@%u\n", m->hdisplay, m->vdisplay, drm_mode_vrefresh(m)); diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c index 3cc9fb0d4f5d..642b7e62c0bb 100644 --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -2171,7 +2171,7 @@ static int boe_panel_get_modes(struct drm_panel *panel, const struct drm_display_mode *m = boe->desc->modes; struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, m); + mode = drm_mode_duplicate(connector->drm, m); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", m->hdisplay, m->vdisplay, drm_mode_vrefresh(m)); diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c b/drivers/gpu/drm/panel/panel-dsi-cm.c index ba17bcc4461c..fc349928ffa0 100644 --- a/drivers/gpu/drm/panel/panel-dsi-cm.c +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c @@ -433,7 +433,7 @@ static int dsicm_get_modes(struct drm_panel *panel, struct panel_drv_data *ddata = panel_to_ddata(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &ddata->mode); + mode = drm_mode_duplicate(connector->drm, &ddata->mode); if (!mode) { dev_err(&ddata->dsi->dev, "failed to add mode %ux%ux@%u kHz\n", ddata->mode.hdisplay, ddata->mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-ebbg-ft8719.c b/drivers/gpu/drm/panel/panel-ebbg-ft8719.c index e85d63a176d0..52a248c0907f 100644 --- a/drivers/gpu/drm/panel/panel-ebbg-ft8719.c +++ b/drivers/gpu/drm/panel/panel-ebbg-ft8719.c @@ -172,7 +172,7 @@ static int ebbg_ft8719_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &ebbg_ft8719_mode); + mode = drm_mode_duplicate(connector->drm, &ebbg_ft8719_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index df7e3cff004c..3546c30cde9e 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -249,7 +249,7 @@ static unsigned int panel_edp_get_timings_modes(struct panel_edp *panel, struct videomode vm; videomode_from_timing(dt, &vm); - mode = drm_mode_create(connector->dev); + mode = drm_mode_create(connector->drm); if (!mode) { dev_err(panel->base.dev, "failed to add mode %ux%u\n", dt->hactive.typ, dt->vactive.typ); @@ -279,7 +279,7 @@ static unsigned int panel_edp_get_display_modes(struct panel_edp *panel, for (i = 0; i < panel->desc->num_modes; i++) { const struct drm_display_mode *m = &panel->desc->modes[i]; - mode = drm_mode_duplicate(connector->dev, m); + mode = drm_mode_duplicate(connector->drm, m); if (!mode) { dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n", m->hdisplay, m->vdisplay, @@ -312,7 +312,7 @@ static int panel_edp_get_non_edid_modes(struct panel_edp *panel, return 0; if (has_override) { - mode = drm_mode_duplicate(connector->dev, + mode = drm_mode_duplicate(connector->drm, &panel->override_mode); if (mode) { drm_mode_probed_add(connector, mode); diff --git a/drivers/gpu/drm/panel/panel-elida-kd35t133.c b/drivers/gpu/drm/panel/panel-elida-kd35t133.c index e7be15b68102..02cba816edae 100644 --- a/drivers/gpu/drm/panel/panel-elida-kd35t133.c +++ b/drivers/gpu/drm/panel/panel-elida-kd35t133.c @@ -195,7 +195,7 @@ static int kd35t133_get_modes(struct drm_panel *panel, struct kd35t133 *ctx = panel_to_kd35t133(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c b/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c index 76572c922983..8042dd29536a 100644 --- a/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c +++ b/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c @@ -411,7 +411,7 @@ static int k101_im2ba02_get_modes(struct drm_panel *panel, struct k101_im2ba02 *ctx = panel_to_k101_im2ba02(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &k101_im2ba02_default_mode); + mode = drm_mode_duplicate(connector->drm, &k101_im2ba02_default_mode); if (!mode) { dev_err(&ctx->dsi->dev, "failed to add mode %ux%u@%u\n", k101_im2ba02_default_mode.hdisplay, diff --git a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c index df493da50afe..d6cb463f08b0 100644 --- a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c +++ b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c @@ -160,7 +160,7 @@ static int feiyang_get_modes(struct drm_panel *panel, struct feiyang *ctx = panel_to_feiyang(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &feiyang_default_mode); + mode = drm_mode_duplicate(connector->drm, &feiyang_default_mode); if (!mode) { dev_err(&ctx->dsi->dev, "failed to add mode %ux%u@%u\n", feiyang_default_mode.hdisplay, diff --git a/drivers/gpu/drm/panel/panel-himax-hx8394.c b/drivers/gpu/drm/panel/panel-himax-hx8394.c index d4fb5d1b295b..46b40baa9851 100644 --- a/drivers/gpu/drm/panel/panel-himax-hx8394.c +++ b/drivers/gpu/drm/panel/panel-himax-hx8394.c @@ -317,7 +317,7 @@ static int hx8394_get_modes(struct drm_panel *panel, struct hx8394 *ctx = panel_to_hx8394(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); + mode = drm_mode_duplicate(connector->drm, ctx->desc->mode); if (!mode) { dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c index 3dfafa585127..825f4cae23ae 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c @@ -637,7 +637,7 @@ static int ili9322_get_modes(struct drm_panel *panel, struct drm_connector *connector) { struct ili9322 *ili = panel_to_ili9322(panel); - struct drm_device *drm = connector->dev; + struct drm_device *drm = connector->drm; struct drm_display_mode *mode; struct drm_display_info *info; diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9341.c b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c index 3fdf884b3257..9156a98a7218 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9341.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c @@ -436,7 +436,7 @@ static int ili9341_dpi_get_modes(struct drm_panel *panel, struct drm_connector *connector) { struct ili9341 *ili = panel_to_ili9341(panel); - struct drm_device *drm = connector->dev; + struct drm_device *drm = connector->drm; struct drm_display_mode *mode; struct drm_display_info *info; diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index 1ec696adf9de..f14cdbab1a39 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -835,7 +835,7 @@ static int ili9881c_get_modes(struct drm_panel *panel, struct ili9881c *ctx = panel_to_ili9881c(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); + mode = drm_mode_duplicate(connector->drm, ctx->desc->mode); if (!mode) { dev_err(&ctx->dsi->dev, "failed to add mode %ux%ux@%u\n", ctx->desc->mode->hdisplay, diff --git a/drivers/gpu/drm/panel/panel-innolux-ej030na.c b/drivers/gpu/drm/panel/panel-innolux-ej030na.c index b2b0ebc9e943..958fe6c7b2d4 100644 --- a/drivers/gpu/drm/panel/panel-innolux-ej030na.c +++ b/drivers/gpu/drm/panel/panel-innolux-ej030na.c @@ -158,7 +158,7 @@ static int ej030na_get_modes(struct drm_panel *panel, unsigned int i; for (i = 0; i < panel_info->num_modes; i++) { - mode = drm_mode_duplicate(connector->dev, + mode = drm_mode_duplicate(connector->drm, &panel_info->display_modes[i]); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c index 9992d0d4c0e5..99120a6b6a29 100644 --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c @@ -389,7 +389,7 @@ static int innolux_panel_get_modes(struct drm_panel *panel, const struct drm_display_mode *m = innolux->desc->mode; struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, m); + mode = drm_mode_duplicate(connector->drm, m); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", m->hdisplay, m->vdisplay, drm_mode_vrefresh(m)); diff --git a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c b/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c index 323c33c9c37a..c4717512f229 100644 --- a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c +++ b/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c @@ -142,7 +142,7 @@ static int jadard_get_modes(struct drm_panel *panel, const struct drm_display_mode *desc_mode = &jadard->desc->mode; struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, desc_mode); + mode = drm_mode_duplicate(connector->drm, desc_mode); if (!mode) { DRM_DEV_ERROR(&jadard->dsi->dev, "failed to add mode %ux%ux@%u\n", desc_mode->hdisplay, desc_mode->vdisplay, diff --git a/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c b/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c index 8912757a6f42..37aeaae785a0 100644 --- a/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c +++ b/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c @@ -211,7 +211,7 @@ static int jdi_fhd_r63452_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &jdi_fhd_r63452_mode); + mode = drm_mode_duplicate(connector->drm, &jdi_fhd_r63452_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c index 8f4f137a2af6..44a05119fcc5 100644 --- a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c @@ -306,7 +306,7 @@ static int jdi_panel_get_modes(struct drm_panel *panel, struct jdi_panel *jdi = to_jdi_panel(panel); struct device *dev = &jdi->dsi->dev; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(dev, "failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-khadas-ts050.c b/drivers/gpu/drm/panel/panel-khadas-ts050.c index b942a0162274..05974d3da8bd 100644 --- a/drivers/gpu/drm/panel/panel-khadas-ts050.c +++ b/drivers/gpu/drm/panel/panel-khadas-ts050.c @@ -734,7 +734,7 @@ static int khadas_ts050_panel_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c index 17f8d80cf2b3..cdcbd143955d 100644 --- a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c +++ b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c @@ -318,7 +318,7 @@ static int kingdisplay_panel_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c index d2efd887484b..d2f6390bd286 100644 --- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c @@ -522,7 +522,7 @@ static int ltk050h3146w_get_modes(struct drm_panel *panel, struct ltk050h3146w *ctx = panel_to_ltk050h3146w(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, ctx->panel_desc->mode); + mode = drm_mode_duplicate(connector->drm, ctx->panel_desc->mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c b/drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c index 39e408c9f762..ef24435f990c 100644 --- a/drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c @@ -379,7 +379,7 @@ static int ltk500hd1829_get_modes(struct drm_panel *panel, struct ltk500hd1829 *ctx = panel_to_ltk500hd1829(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(ctx->dev, "failed to add mode %ux%u@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-lg-lb035q02.c b/drivers/gpu/drm/panel/panel-lg-lb035q02.c index 9d0d4faa3f58..1393ec128d82 100644 --- a/drivers/gpu/drm/panel/panel-lg-lb035q02.c +++ b/drivers/gpu/drm/panel/panel-lg-lb035q02.c @@ -145,7 +145,7 @@ static int lb035q02_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &lb035q02_mode); + mode = drm_mode_duplicate(connector->drm, &lb035q02_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-lg-lg4573.c b/drivers/gpu/drm/panel/panel-lg-lg4573.c index cf246d15b7b6..263211f6c70e 100644 --- a/drivers/gpu/drm/panel/panel-lg-lg4573.c +++ b/drivers/gpu/drm/panel/panel-lg-lg4573.c @@ -213,7 +213,7 @@ static int lg4573_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c index b47c3a679be0..680b913a897d 100644 --- a/drivers/gpu/drm/panel/panel-lvds.c +++ b/drivers/gpu/drm/panel/panel-lvds.c @@ -87,7 +87,7 @@ static int panel_lvds_get_modes(struct drm_panel *panel, struct panel_lvds *lvds = to_panel_lvds(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &lvds->dmode); + mode = drm_mode_duplicate(connector->drm, &lvds->dmode); if (!mode) return 0; diff --git a/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c b/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c index 26d358b9b85a..8d50687f5a80 100644 --- a/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c +++ b/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c @@ -295,7 +295,7 @@ static int d53e6ea8966_get_modes(struct drm_panel *panel, unsigned int i; for (i = 0; i < panel_info->num_modes; i++) { - mode = drm_mode_duplicate(connector->dev, + mode = drm_mode_duplicate(connector->drm, &panel_info->display_modes[i]); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c index 9243b2ad828d..1d40ae7020fe 100644 --- a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c +++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c @@ -223,7 +223,7 @@ static int mantix_get_modes(struct drm_panel *panel, struct mantix *ctx = panel_to_mantix(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, ctx->default_mode); + mode = drm_mode_duplicate(connector->drm, ctx->default_mode); if (!mode) { dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", ctx->default_mode->hdisplay, ctx->default_mode->vdisplay, diff --git a/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c b/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c index 81c5c541a351..1b5ba997331b 100644 --- a/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c +++ b/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c @@ -127,7 +127,7 @@ static int nl8048_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &nl8048_mode); + mode = drm_mode_duplicate(connector->drm, &nl8048_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c index a07958038ffd..200b1a96540b 100644 --- a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c +++ b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c @@ -323,7 +323,7 @@ static int panel_nv3051d_get_modes(struct drm_panel *panel, unsigned int i; for (i = 0; i < panel_info->num_modes; i++) { - mode = drm_mode_duplicate(connector->dev, + mode = drm_mode_duplicate(connector->drm, &panel_info->display_modes[i]); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-newvision-nv3052c.c b/drivers/gpu/drm/panel/panel-newvision-nv3052c.c index cf078f0d3cd3..b37358c7210e 100644 --- a/drivers/gpu/drm/panel/panel-newvision-nv3052c.c +++ b/drivers/gpu/drm/panel/panel-newvision-nv3052c.c @@ -339,7 +339,7 @@ static int nv3052c_get_modes(struct drm_panel *panel, unsigned int i; for (i = 0; i < panel_info->num_modes; i++) { - mode = drm_mode_duplicate(connector->dev, + mode = drm_mode_duplicate(connector->drm, &panel_info->display_modes[i]); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35510.c b/drivers/gpu/drm/panel/panel-novatek-nt35510.c index 493c3c23f0d6..ee043fdbd316 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt35510.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt35510.c @@ -848,7 +848,7 @@ static int nt35510_get_modes(struct drm_panel *panel, info = &connector->display_info; info->width_mm = nt->conf->width_mm; info->height_mm = nt->conf->height_mm; - mode = drm_mode_duplicate(connector->dev, &nt->conf->mode); + mode = drm_mode_duplicate(connector->drm, &nt->conf->mode); if (!mode) { dev_err(panel->dev, "bad mode or failed to add mode\n"); return -EINVAL; diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35560.c b/drivers/gpu/drm/panel/panel-novatek-nt35560.c index cc7f96d70826..304fd6495adf 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt35560.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt35560.c @@ -425,10 +425,10 @@ static int nt35560_get_modes(struct drm_panel *panel, struct drm_display_mode *mode; if (nt->video_mode) - mode = drm_mode_duplicate(connector->dev, + mode = drm_mode_duplicate(connector->drm, conf->vid_mode); else - mode = drm_mode_duplicate(connector->dev, + mode = drm_mode_duplicate(connector->drm, conf->cmd_mode); if (!mode) { dev_err(panel->dev, "bad mode or failed to add mode\n"); diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c b/drivers/gpu/drm/panel/panel-novatek-nt35950.c index 8b108ac80b55..331dcaf9d805 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c @@ -500,7 +500,7 @@ static int nt35950_get_modes(struct drm_panel *panel, for (i = 0; i < nt->desc->num_modes; i++) { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, + mode = drm_mode_duplicate(connector->drm, &nt->desc->mode_data[i].mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36523.c b/drivers/gpu/drm/panel/panel-novatek-nt36523.c index c3befa7f253d..682490580bda 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt36523.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt36523.c @@ -1135,7 +1135,7 @@ static int nt36523_get_modes(struct drm_panel *panel, const struct drm_display_mode *m = &pinfo->desc->modes[i]; struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, m); + mode = drm_mode_duplicate(connector->drm, m); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", m->hdisplay, m->vdisplay, drm_mode_vrefresh(m)); diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c b/drivers/gpu/drm/panel/panel-novatek-nt36672a.c index 73bcffa1e0c1..b36fb62dd6bb 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt36672a.c @@ -238,7 +238,7 @@ static int nt36672a_panel_get_modes(struct drm_panel *panel, const struct drm_display_mode *m = pinfo->desc->display_mode; struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, m); + mode = drm_mode_duplicate(connector->drm, m); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", m->hdisplay, m->vdisplay, drm_mode_vrefresh(m)); diff --git a/drivers/gpu/drm/panel/panel-novatek-nt39016.c b/drivers/gpu/drm/panel/panel-novatek-nt39016.c index f58cfb10b58a..ef6f1deda453 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt39016.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt39016.c @@ -208,7 +208,7 @@ static int nt39016_get_modes(struct drm_panel *drm_panel, unsigned int i; for (i = 0; i < panel_info->num_modes; i++) { - mode = drm_mode_duplicate(connector->dev, + mode = drm_mode_duplicate(connector->drm, &panel_info->display_modes[i]); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c b/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c index 4819ada69482..9a048dbcca22 100644 --- a/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c +++ b/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c @@ -148,7 +148,7 @@ static int lcd_olinuxino_get_modes(struct drm_panel *panel, lcd_mode = (struct lcd_olinuxino_mode *) &lcd->eeprom.reserved[i * sizeof(*lcd_mode)]; - mode = drm_mode_create(connector->dev); + mode = drm_mode_create(connector->drm); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", lcd_mode->hactive, diff --git a/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c b/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c index e46be5014d42..b9d171e78be7 100644 --- a/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c +++ b/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c @@ -198,7 +198,7 @@ static int ota5601a_get_modes(struct drm_panel *drm_panel, unsigned int i; for (i = 0; i < panel_info->num_modes; i++) { - mode = drm_mode_duplicate(connector->dev, + mode = drm_mode_duplicate(connector->drm, &panel_info->display_modes[i]); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c index 898b892f1143..c7d35ad531ed 100644 --- a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c +++ b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c @@ -359,7 +359,7 @@ static int otm8009a_get_modes(struct drm_panel *panel, unsigned int i; for (i = 0; i < num_modes; i++) { - mode = drm_mode_duplicate(connector->dev, &modes[i]); + mode = drm_mode_duplicate(connector->drm, &modes[i]); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", modes[i].hdisplay, diff --git a/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c b/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c index 493e0504f6f7..ea05b4998c3d 100644 --- a/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c +++ b/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c @@ -111,7 +111,7 @@ static int osd101t2587_panel_get_modes(struct drm_panel *panel, struct osd101t2587_panel *osd101t2587 = ti_osd_panel(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, osd101t2587->default_mode); + mode = drm_mode_duplicate(connector->drm, osd101t2587->default_mode); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%ux@%u\n", osd101t2587->default_mode->hdisplay, diff --git a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c index 8ba6d8287938..e5985954bd49 100644 --- a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +++ b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c @@ -156,7 +156,7 @@ static int wuxga_nt_panel_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c index 90ea91e4311d..009e99620eb5 100644 --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c @@ -325,7 +325,7 @@ static int rpi_touchscreen_get_modes(struct drm_panel *panel, const struct drm_display_mode *m = &rpi_touchscreen_modes[i]; struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, m); + mode = drm_mode_duplicate(connector->drm, m); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", m->hdisplay, m->vdisplay, diff --git a/drivers/gpu/drm/panel/panel-raydium-rm67191.c b/drivers/gpu/drm/panel/panel-raydium-rm67191.c index dbb1ed4efbed..2005162167be 100644 --- a/drivers/gpu/drm/panel/panel-raydium-rm67191.c +++ b/drivers/gpu/drm/panel/panel-raydium-rm67191.c @@ -439,7 +439,7 @@ static int rad_panel_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-raydium-rm68200.c b/drivers/gpu/drm/panel/panel-raydium-rm68200.c index 5f9b340588fb..9550034a2a47 100644 --- a/drivers/gpu/drm/panel/panel-raydium-rm68200.c +++ b/drivers/gpu/drm/panel/panel-raydium-rm68200.c @@ -332,7 +332,7 @@ static int rm68200_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c b/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c index 2ef5ea5eaeeb..4a082d5f54f1 100644 --- a/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c +++ b/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c @@ -109,7 +109,7 @@ static int rb070d30_panel_get_modes(struct drm_panel *panel, struct drm_display_mode *mode; static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(&ctx->dsi->dev, "Failed to add mode " DRM_MODE_FMT "\n", DRM_MODE_ARG(&default_mode)); diff --git a/drivers/gpu/drm/panel/panel-samsung-db7430.c b/drivers/gpu/drm/panel/panel-samsung-db7430.c index 117b26845083..a8f36f175fe4 100644 --- a/drivers/gpu/drm/panel/panel-samsung-db7430.c +++ b/drivers/gpu/drm/panel/panel-samsung-db7430.c @@ -235,7 +235,7 @@ static int db7430_get_modes(struct drm_panel *panel, struct drm_display_mode *mode; static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; - mode = drm_mode_duplicate(connector->dev, &db7430_480_800_mode); + mode = drm_mode_duplicate(connector->drm, &db7430_480_800_mode); if (!mode) { dev_err(db->dev, "failed to add mode\n"); return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-samsung-ld9040.c b/drivers/gpu/drm/panel/panel-samsung-ld9040.c index 01eb211f32f7..c1eec8fc5be8 100644 --- a/drivers/gpu/drm/panel/panel-samsung-ld9040.c +++ b/drivers/gpu/drm/panel/panel-samsung-ld9040.c @@ -266,7 +266,7 @@ static int ld9040_get_modes(struct drm_panel *panel, struct ld9040 *ctx = panel_to_ld9040(panel); struct drm_display_mode *mode; - mode = drm_mode_create(connector->dev); + mode = drm_mode_create(connector->drm); if (!mode) { dev_err(panel->dev, "failed to create a new display mode\n"); return 0; diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c index 008e2b0d6652..3ef5eda5231e 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c @@ -136,7 +136,7 @@ static int s6d16d0_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &samsung_s6d16d0_mode); + mode = drm_mode_duplicate(connector->drm, &samsung_s6d16d0_mode); if (!mode) { dev_err(panel->dev, "bad mode or failed to add mode\n"); return -EINVAL; diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d27a1.c b/drivers/gpu/drm/panel/panel-samsung-s6d27a1.c index 2adb223a895c..a8cf94595c7a 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6d27a1.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6d27a1.c @@ -211,7 +211,7 @@ static int s6d27a1_get_modes(struct drm_panel *panel, struct drm_display_mode *mode; static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; - mode = drm_mode_duplicate(connector->dev, &s6d27a1_480_800_mode); + mode = drm_mode_duplicate(connector->drm, &s6d27a1_480_800_mode); if (!mode) { dev_err(ctx->dev, "failed to add mode\n"); return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c b/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c index fec0d014fd0e..70ec46d6e2c1 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c @@ -457,7 +457,7 @@ static int s6d7aa0_get_modes(struct drm_panel *panel, if (!ctx) return -EINVAL; - mode = drm_mode_duplicate(connector->dev, ctx->desc->drm_mode); + mode = drm_mode_duplicate(connector->drm, ctx->desc->drm_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c index 39eef3dce7c9..c3485190723d 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c @@ -648,7 +648,7 @@ static int s6e3ha2_get_modes(struct drm_panel *panel, struct s6e3ha2 *ctx = container_of(panel, struct s6e3ha2, panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); + mode = drm_mode_duplicate(connector->drm, ctx->desc->mode); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c b/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c index 46d6f4a87bf7..49c6baf9d795 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c @@ -403,7 +403,7 @@ static int s6e63j0x03_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c index b34fa4d5de07..76ab8364f61b 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c @@ -599,7 +599,7 @@ static int s6e63m0_get_modes(struct drm_panel *panel, struct drm_display_mode *mode; static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams452ef01.c b/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams452ef01.c index 7431cae7427e..3272a9c48501 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams452ef01.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams452ef01.c @@ -178,7 +178,7 @@ static int s6e88a0_ams452ef01_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &s6e88a0_ams452ef01_mode); + mode = drm_mode_duplicate(connector->drm, &s6e88a0_ams452ef01_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c b/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c index c51d07ec1529..63e4dfc8a337 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c @@ -925,7 +925,7 @@ static int s6e8aa0_get_modes(struct drm_panel *panel, struct s6e8aa0 *ctx = panel_to_s6e8aa0(panel); struct drm_display_mode *mode; - mode = drm_mode_create(connector->dev); + mode = drm_mode_create(connector->drm); if (!mode) { dev_err(panel->dev, "failed to create a new display mode\n"); return 0; diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef00.c b/drivers/gpu/drm/panel/panel-samsung-sofef00.c index 1ebb79e3103c..df6c7ae45ae1 100644 --- a/drivers/gpu/drm/panel/panel-samsung-sofef00.c +++ b/drivers/gpu/drm/panel/panel-samsung-sofef00.c @@ -188,7 +188,7 @@ static int sofef00_panel_get_modes(struct drm_panel *panel, struct drm_connector struct drm_display_mode *mode; struct sofef00_panel *ctx = to_sofef00_panel(panel); - mode = drm_mode_duplicate(connector->dev, ctx->mode); + mode = drm_mode_duplicate(connector->drm, ctx->mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c index 658c7c040570..d66e482e3604 100644 --- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c +++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c @@ -71,7 +71,7 @@ static int seiko_panel_get_fixed_modes(struct seiko_panel *panel, struct videomode vm; videomode_from_timing(dt, &vm); - mode = drm_mode_create(connector->dev); + mode = drm_mode_create(connector->drm); if (!mode) { dev_err(panel->base.dev, "failed to add mode %ux%u\n", dt->hactive.typ, dt->vactive.typ); @@ -92,7 +92,7 @@ static int seiko_panel_get_fixed_modes(struct seiko_panel *panel, for (i = 0; i < panel->desc->num_modes; i++) { const struct drm_display_mode *m = &panel->desc->modes[i]; - mode = drm_mode_duplicate(connector->dev, m); + mode = drm_mode_duplicate(connector->drm, m); if (!mode) { dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n", m->hdisplay, m->vdisplay, diff --git a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c index 14851408a5e1..f047fe41c0c8 100644 --- a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c +++ b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c @@ -276,7 +276,7 @@ static int sharp_panel_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c b/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c index 76bd9e810827..30d229b05b10 100644 --- a/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c +++ b/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c @@ -104,7 +104,7 @@ static int ls037v7dw01_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &ls037v7dw01_mode); + mode = drm_mode_duplicate(connector->drm, &ls037v7dw01_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c index 855e64444daa..47dccc8b2fad 100644 --- a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c +++ b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c @@ -180,7 +180,7 @@ static int sharp_nt_panel_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-sharp-ls060t1sx01.c b/drivers/gpu/drm/panel/panel-sharp-ls060t1sx01.c index 68f52eaaf4fa..3a533415654a 100644 --- a/drivers/gpu/drm/panel/panel-sharp-ls060t1sx01.c +++ b/drivers/gpu/drm/panel/panel-sharp-ls060t1sx01.c @@ -204,7 +204,7 @@ static int sharp_ls060_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &sharp_ls060_mode); + mode = drm_mode_duplicate(connector->drm, &sharp_ls060_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 241243447b3e..5ebeab192c7f 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -174,7 +174,7 @@ static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel, struct videomode vm; videomode_from_timing(dt, &vm); - mode = drm_mode_create(connector->dev); + mode = drm_mode_create(connector->drm); if (!mode) { dev_err(panel->base.dev, "failed to add mode %ux%u\n", dt->hactive.typ, dt->vactive.typ); @@ -204,7 +204,7 @@ static unsigned int panel_simple_get_display_modes(struct panel_simple *panel, for (i = 0; i < panel->desc->num_modes; i++) { const struct drm_display_mode *m = &panel->desc->modes[i]; - mode = drm_mode_duplicate(connector->dev, m); + mode = drm_mode_duplicate(connector->drm, m); if (!mode) { dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n", m->hdisplay, m->vdisplay, @@ -237,7 +237,7 @@ static int panel_simple_get_non_edid_modes(struct panel_simple *panel, return 0; if (has_override) { - mode = drm_mode_duplicate(connector->dev, + mode = drm_mode_duplicate(connector->drm, &panel->override_mode); if (mode) { drm_mode_probed_add(connector, mode); diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/drm/panel/panel-sitronix-st7701.c index 7eae83aa0ea1..5edad4a0fef5 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c @@ -501,7 +501,7 @@ static int st7701_get_modes(struct drm_panel *panel, const struct drm_display_mode *desc_mode = st7701->desc->mode; struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, desc_mode); + mode = drm_mode_duplicate(connector->drm, desc_mode); if (!mode) { dev_err(&st7701->dsi->dev, "failed to add mode %ux%u@%u\n", desc_mode->hdisplay, desc_mode->vdisplay, diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c index 3aa31f3d6157..0f72bd0908fe 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c @@ -541,7 +541,7 @@ static int st7703_get_modes(struct drm_panel *panel, struct st7703 *ctx = panel_to_st7703(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); + mode = drm_mode_duplicate(connector->drm, ctx->desc->mode); if (!mode) { dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index bbc4569cbcdc..d1866abfe511 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -172,7 +172,7 @@ static int st7789v_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%ux@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-sony-acx565akm.c b/drivers/gpu/drm/panel/panel-sony-acx565akm.c index 3d6a286056a0..1fe64e594811 100644 --- a/drivers/gpu/drm/panel/panel-sony-acx565akm.c +++ b/drivers/gpu/drm/panel/panel-sony-acx565akm.c @@ -517,7 +517,7 @@ static int acx565akm_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &acx565akm_mode); + mode = drm_mode_duplicate(connector->drm, &acx565akm_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c b/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c index 8d8813dbaa45..c083e5598337 100644 --- a/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c +++ b/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c @@ -217,7 +217,8 @@ static int sony_td4353_jdi_get_modes(struct drm_panel *panel, struct drm_display_mode *mode = NULL; if (ctx->type == TYPE_TAMA_60HZ) - mode = drm_mode_duplicate(connector->dev, &sony_td4353_jdi_mode_tama_60hz); + mode = drm_mode_duplicate(connector->drm, + &sony_td4353_jdi_mode_tama_60hz); else return -EINVAL; diff --git a/drivers/gpu/drm/panel/panel-sony-tulip-truly-nt35521.c b/drivers/gpu/drm/panel/panel-sony-tulip-truly-nt35521.c index ee5d20ecc577..190fc7fe7324 100644 --- a/drivers/gpu/drm/panel/panel-sony-tulip-truly-nt35521.c +++ b/drivers/gpu/drm/panel/panel-sony-tulip-truly-nt35521.c @@ -384,7 +384,7 @@ static int truly_nt35521_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &truly_nt35521_mode); + mode = drm_mode_duplicate(connector->drm, &truly_nt35521_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c index d8487bc6d611..5296b51c8756 100644 --- a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c +++ b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c @@ -126,7 +126,7 @@ static int tdo_tl070wsh30_panel_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(panel->dev, "failed to add mode %ux%u@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c b/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c index 4dbf8b88f264..6dc3dd650ba6 100644 --- a/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c +++ b/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c @@ -287,7 +287,7 @@ static int td028ttec1_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &td028ttec1_mode); + mode = drm_mode_duplicate(connector->drm, &td028ttec1_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c b/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c index cf4609bb9b1d..e475de08bd4e 100644 --- a/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c +++ b/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c @@ -350,7 +350,7 @@ static int td043mtea1_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &td043mtea1_mode); + mode = drm_mode_duplicate(connector->drm, &td043mtea1_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-tpo-tpg110.c b/drivers/gpu/drm/panel/panel-tpo-tpg110.c index 845304435e23..1bbde68b31a6 100644 --- a/drivers/gpu/drm/panel/panel-tpo-tpg110.c +++ b/drivers/gpu/drm/panel/panel-tpo-tpg110.c @@ -378,7 +378,7 @@ static int tpg110_get_modes(struct drm_panel *panel, connector->display_info.height_mm = tpg->height; connector->display_info.bus_flags = tpg->panel_mode->bus_flags; - mode = drm_mode_duplicate(connector->dev, &tpg->panel_mode->mode); + mode = drm_mode_duplicate(connector->drm, &tpg->panel_mode->mode); drm_mode_set_name(mode); mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; diff --git a/drivers/gpu/drm/panel/panel-truly-nt35597.c b/drivers/gpu/drm/panel/panel-truly-nt35597.c index b31cffb660a7..c2aacc58f867 100644 --- a/drivers/gpu/drm/panel/panel-truly-nt35597.c +++ b/drivers/gpu/drm/panel/panel-truly-nt35597.c @@ -446,7 +446,7 @@ static int truly_nt35597_get_modes(struct drm_panel *panel, const struct nt35597_config *config; config = ctx->config; - mode = drm_mode_duplicate(connector->dev, config->dm); + mode = drm_mode_duplicate(connector->drm, config->dm); if (!mode) { dev_err(ctx->dev, "failed to create a new display mode\n"); return 0; diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c b/drivers/gpu/drm/panel/panel-visionox-rm69299.c index ec228c269146..6d2c5607aa52 100644 --- a/drivers/gpu/drm/panel/panel-visionox-rm69299.c +++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c @@ -168,7 +168,7 @@ static int visionox_rm69299_get_modes(struct drm_panel *panel, struct visionox_rm69299 *ctx = panel_to_ctx(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, + mode = drm_mode_duplicate(connector->drm, &visionox_rm69299_1080x2248_60hz); if (!mode) { dev_err(ctx->panel.dev, "failed to create a new display mode\n"); diff --git a/drivers/gpu/drm/panel/panel-visionox-vtdr6130.c b/drivers/gpu/drm/panel/panel-visionox-vtdr6130.c index bb0dfd86ea67..d4ed70c44ddb 100644 --- a/drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +++ b/drivers/gpu/drm/panel/panel-visionox-vtdr6130.c @@ -219,7 +219,7 @@ static int visionox_vtdr6130_get_modes(struct drm_panel *panel, { struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &visionox_vtdr6130_mode); + mode = drm_mode_duplicate(connector->drm, &visionox_vtdr6130_mode); if (!mode) return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-widechips-ws2401.c b/drivers/gpu/drm/panel/panel-widechips-ws2401.c index 2591ff8f0d4e..c01f8ce30361 100644 --- a/drivers/gpu/drm/panel/panel-widechips-ws2401.c +++ b/drivers/gpu/drm/panel/panel-widechips-ws2401.c @@ -285,7 +285,7 @@ static int ws2401_get_modes(struct drm_panel *panel, * probably the custom DCS sequences needs to selected based on what * the target panel needs. */ - mode = drm_mode_duplicate(connector->dev, &lms380kf01_480_800_mode); + mode = drm_mode_duplicate(connector->drm, &lms380kf01_480_800_mode); if (!mode) { dev_err(ws->dev, "failed to add mode\n"); return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c b/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c index 8670386498a4..0f54aca15f28 100644 --- a/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c +++ b/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c @@ -240,7 +240,7 @@ static int xpp055c272_get_modes(struct drm_panel *panel, struct xpp055c272 *ctx = panel_to_xpp055c272(panel); struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, &default_mode); + mode = drm_mode_duplicate(connector->drm, &default_mode); if (!mode) { dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", default_mode.hdisplay, default_mode.vdisplay, diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 6492a70e3c39..a5e0bbb014ce 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -226,7 +226,7 @@ static int qxl_add_mode(struct drm_connector *connector, unsigned int height, bool preferred) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct qxl_device *qdev = to_qxl(dev); struct drm_display_mode *mode = NULL; int rc; @@ -247,7 +247,7 @@ static int qxl_add_mode(struct drm_connector *connector, static int qxl_add_monitors_config_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct qxl_device *qdev = to_qxl(dev); struct qxl_output *output = drm_connector_to_qxl_output(connector); int h = output->index; @@ -1019,7 +1019,7 @@ static int qdev_crtc_init(struct drm_device *dev, int crtc_id) static int qxl_conn_get_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct qxl_device *qdev = to_qxl(dev); struct qxl_output *output = drm_connector_to_qxl_output(connector); unsigned int pwidth = 1024; @@ -1045,7 +1045,7 @@ static int qxl_conn_get_modes(struct drm_connector *connector) static enum drm_mode_status qxl_conn_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - struct drm_device *ddev = connector->dev; + struct drm_device *ddev = connector->drm; struct qxl_device *qdev = to_qxl(ddev); if (qxl_check_mode(qdev, mode->hdisplay, mode->vdisplay) != 0) @@ -1075,7 +1075,7 @@ static enum drm_connector_status qxl_conn_detect( { struct qxl_output *output = drm_connector_to_qxl_output(connector); - struct drm_device *ddev = connector->dev; + struct drm_device *ddev = connector->drm; struct qxl_device *qdev = to_qxl(ddev); bool connected = false; diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c index 009333645438..3a3fc5eee5d9 100644 --- a/drivers/gpu/drm/radeon/atombios_dp.c +++ b/drivers/gpu/drm/radeon/atombios_dp.c @@ -226,13 +226,13 @@ radeon_dp_aux_transfer_atom(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg) void radeon_dp_aux_init(struct radeon_connector *radeon_connector) { - struct drm_device *dev = radeon_connector->base.dev; + struct drm_device *dev = radeon_connector->base.drm; struct radeon_device *rdev = dev->dev_private; int ret; radeon_connector->ddc_bus->rec.hpd = radeon_connector->hpd.hpd; radeon_connector->ddc_bus->aux.dev = radeon_connector->base.kdev; - radeon_connector->ddc_bus->aux.drm_dev = radeon_connector->base.dev; + radeon_connector->ddc_bus->aux.drm_dev = radeon_connector->base.drm; if (ASIC_IS_DCE5(rdev)) { if (radeon_auxch) radeon_connector->ddc_bus->aux.transfer = radeon_dp_aux_transfer_native; @@ -360,7 +360,7 @@ static u8 radeon_dp_encoder_service(struct radeon_device *rdev, u8 radeon_dp_getsinktype(struct radeon_connector *radeon_connector) { - struct drm_device *dev = radeon_connector->base.dev; + struct drm_device *dev = radeon_connector->base.drm; struct radeon_device *rdev = dev->dev_private; return radeon_dp_encoder_service(rdev, ATOM_DP_ACTION_GET_SINK_TYPE, 0, diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index 4aca09cab4b8..717cd6d71aff 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c @@ -1373,7 +1373,7 @@ bool atombios_set_edp_panel_power(struct drm_connector *connector, int action) { struct radeon_connector *radeon_connector = to_radeon_connector(connector); - struct drm_device *dev = radeon_connector->base.dev; + struct drm_device *dev = radeon_connector->base.drm; struct radeon_device *rdev = dev->dev_private; union dig_transmitter_control args; int index = GetIndexIntoMasterTable(COMMAND, UNIPHYTransmitterControl); diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 4ad5a328d920..96b5f55c908f 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c @@ -4160,7 +4160,7 @@ radeon_atombios_connected_scratch_regs(struct drm_connector *connector, struct drm_encoder *encoder, bool connected) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_connector *radeon_connector = to_radeon_connector(connector); diff --git a/drivers/gpu/drm/radeon/radeon_audio.c b/drivers/gpu/drm/radeon/radeon_audio.c index d6ccaf24ee0c..fbc2ea8bcae8 100644 --- a/drivers/gpu/drm/radeon/radeon_audio.c +++ b/drivers/gpu/drm/radeon/radeon_audio.c @@ -382,7 +382,7 @@ void radeon_audio_detect(struct drm_connector *connector, struct drm_encoder *encoder, enum drm_connector_status status) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig; diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 783a6b8802d5..9a0eb4130c3b 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c @@ -3458,7 +3458,7 @@ radeon_combios_connected_scratch_regs(struct drm_connector *connector, struct drm_encoder *encoder, bool connected) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_connector *radeon_connector = to_radeon_connector(connector); diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 07193cd0c417..0215f88b3b70 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -39,7 +39,7 @@ void radeon_connector_hotplug(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_connector *radeon_connector = to_radeon_connector(connector); @@ -98,7 +98,7 @@ static void radeon_property_change_mode(struct drm_encoder *encoder) int radeon_get_monitor_bpc(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_connector *radeon_connector = to_radeon_connector(connector); struct radeon_connector_atom_dig *dig_connector; @@ -222,7 +222,7 @@ int radeon_get_monitor_bpc(struct drm_connector *connector) static void radeon_connector_update_scratch_regs(struct drm_connector *connector, enum drm_connector_status status) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct drm_encoder *best_encoder; struct drm_encoder *encoder; @@ -273,7 +273,7 @@ struct edid *radeon_connector_edid(struct drm_connector *connector) static void radeon_connector_get_edid(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_connector *radeon_connector = to_radeon_connector(connector); @@ -398,7 +398,7 @@ radeon_connector_analog_encoder_conflict_solve(struct drm_connector *connector, enum drm_connector_status current_status, bool priority) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_connector *conflict; struct radeon_connector *radeon_conflict; @@ -530,7 +530,7 @@ static void radeon_add_common_modes(struct drm_encoder *encoder, struct drm_conn static int radeon_connector_set_property(struct drm_connector *connector, struct drm_property *property, uint64_t val) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct drm_encoder *encoder; struct radeon_encoder *radeon_encoder; @@ -853,7 +853,7 @@ static enum drm_mode_status radeon_lvds_mode_valid(struct drm_connector *connect static enum drm_connector_status radeon_lvds_detect(struct drm_connector *connector, bool force) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_connector *radeon_connector = to_radeon_connector(connector); struct drm_encoder *encoder = radeon_best_single_encoder(connector); @@ -861,9 +861,9 @@ radeon_lvds_detect(struct drm_connector *connector, bool force) int r; if (!drm_kms_helper_is_poll_worker()) { - r = pm_runtime_get_sync(connector->dev->dev); + r = pm_runtime_get_sync(connector->drm->dev); if (r < 0) { - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_put_autosuspend(connector->drm->dev); return connector_status_disconnected; } } @@ -891,8 +891,8 @@ radeon_lvds_detect(struct drm_connector *connector, bool force) radeon_connector_update_scratch_regs(connector, ret); if (!drm_kms_helper_is_poll_worker()) { - pm_runtime_mark_last_busy(connector->dev->dev); - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_mark_last_busy(connector->drm->dev); + pm_runtime_put_autosuspend(connector->drm->dev); } return ret; @@ -923,7 +923,7 @@ static int radeon_lvds_set_property(struct drm_connector *connector, struct drm_property *property, uint64_t value) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_encoder *radeon_encoder; enum radeon_rmx_type rmx_type; @@ -985,7 +985,7 @@ static int radeon_vga_get_modes(struct drm_connector *connector) static enum drm_mode_status radeon_vga_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; /* XXX check mode bandwidth */ @@ -999,7 +999,7 @@ static enum drm_mode_status radeon_vga_mode_valid(struct drm_connector *connecto static enum drm_connector_status radeon_vga_detect(struct drm_connector *connector, bool force) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_connector *radeon_connector = to_radeon_connector(connector); struct drm_encoder *encoder; @@ -1009,9 +1009,9 @@ radeon_vga_detect(struct drm_connector *connector, bool force) int r; if (!drm_kms_helper_is_poll_worker()) { - r = pm_runtime_get_sync(connector->dev->dev); + r = pm_runtime_get_sync(connector->drm->dev); if (r < 0) { - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_put_autosuspend(connector->drm->dev); return connector_status_disconnected; } } @@ -1082,8 +1082,8 @@ radeon_vga_detect(struct drm_connector *connector, bool force) out: if (!drm_kms_helper_is_poll_worker()) { - pm_runtime_mark_last_busy(connector->dev->dev); - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_mark_last_busy(connector->drm->dev); + pm_runtime_put_autosuspend(connector->drm->dev); } return ret; @@ -1106,7 +1106,7 @@ static const struct drm_connector_funcs radeon_vga_connector_funcs = { static int radeon_tv_get_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct drm_display_mode *tv_mode; struct drm_encoder *encoder; @@ -1149,9 +1149,9 @@ radeon_tv_detect(struct drm_connector *connector, bool force) return ret; if (!drm_kms_helper_is_poll_worker()) { - r = pm_runtime_get_sync(connector->dev->dev); + r = pm_runtime_get_sync(connector->drm->dev); if (r < 0) { - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_put_autosuspend(connector->drm->dev); return connector_status_disconnected; } } @@ -1168,8 +1168,8 @@ radeon_tv_detect(struct drm_connector *connector, bool force) radeon_connector_update_scratch_regs(connector, ret); if (!drm_kms_helper_is_poll_worker()) { - pm_runtime_mark_last_busy(connector->dev->dev); - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_mark_last_busy(connector->drm->dev); + pm_runtime_put_autosuspend(connector->drm->dev); } return ret; @@ -1192,7 +1192,7 @@ static const struct drm_connector_funcs radeon_tv_connector_funcs = { static bool radeon_check_hpd_status_unchanged(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_connector *radeon_connector = to_radeon_connector(connector); enum drm_connector_status status; @@ -1225,7 +1225,7 @@ static bool radeon_check_hpd_status_unchanged(struct drm_connector *connector) static enum drm_connector_status radeon_dvi_detect(struct drm_connector *connector, bool force) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_connector *radeon_connector = to_radeon_connector(connector); struct drm_encoder *encoder = NULL; @@ -1235,9 +1235,9 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) bool dret = false, broken_edid = false; if (!drm_kms_helper_is_poll_worker()) { - r = pm_runtime_get_sync(connector->dev->dev); + r = pm_runtime_get_sync(connector->drm->dev); if (r < 0) { - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_put_autosuspend(connector->drm->dev); return connector_status_disconnected; } } @@ -1416,8 +1416,8 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) exit: if (!drm_kms_helper_is_poll_worker()) { - pm_runtime_mark_last_busy(connector->dev->dev); - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_mark_last_busy(connector->drm->dev); + pm_runtime_put_autosuspend(connector->drm->dev); } return ret; @@ -1462,7 +1462,7 @@ static void radeon_dvi_force(struct drm_connector *connector) static enum drm_mode_status radeon_dvi_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_connector *radeon_connector = to_radeon_connector(connector); @@ -1620,7 +1620,7 @@ static bool radeon_connector_encoder_is_hbr2(struct drm_connector *connector) bool radeon_connector_is_dp12_capable(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; if (ASIC_IS_DCE5(rdev) && @@ -1635,7 +1635,7 @@ bool radeon_connector_is_dp12_capable(struct drm_connector *connector) static enum drm_connector_status radeon_dp_detect(struct drm_connector *connector, bool force) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_connector *radeon_connector = to_radeon_connector(connector); enum drm_connector_status ret = connector_status_disconnected; @@ -1644,9 +1644,9 @@ radeon_dp_detect(struct drm_connector *connector, bool force) int r; if (!drm_kms_helper_is_poll_worker()) { - r = pm_runtime_get_sync(connector->dev->dev); + r = pm_runtime_get_sync(connector->drm->dev); if (r < 0) { - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_put_autosuspend(connector->drm->dev); return connector_status_disconnected; } } @@ -1728,8 +1728,8 @@ radeon_dp_detect(struct drm_connector *connector, bool force) out: if (!drm_kms_helper_is_poll_worker()) { - pm_runtime_mark_last_busy(connector->dev->dev); - pm_runtime_put_autosuspend(connector->dev->dev); + pm_runtime_mark_last_busy(connector->drm->dev); + pm_runtime_put_autosuspend(connector->drm->dev); } return ret; @@ -1738,7 +1738,7 @@ radeon_dp_detect(struct drm_connector *connector, bool force) static enum drm_mode_status radeon_dp_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_connector *radeon_connector = to_radeon_connector(connector); struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c index 8cd37d7b8ae2..3ce190c67055 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c @@ -41,7 +41,7 @@ struct rcar_du_wb_job { static int rcar_du_wb_conn_get_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; return drm_add_modes_noedid(connector, dev->mode_config.max_width, dev->mode_config.max_height); diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_backlight.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_backlight.c index 794573badfe8..4c56524670bd 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_backlight.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_backlight.c @@ -16,7 +16,7 @@ static int shmob_drm_backlight_update(struct backlight_device *bdev) { struct shmob_drm_connector *scon = bl_get_data(bdev); - struct shmob_drm_device *sdev = scon->connector.dev->dev_private; + struct shmob_drm_device *sdev = scon->connector.drm->dev_private; const struct shmob_drm_backlight_data *bdata = &sdev->pdata->backlight; int brightness = backlight_get_brightness(bdev); @@ -26,7 +26,7 @@ static int shmob_drm_backlight_update(struct backlight_device *bdev) static int shmob_drm_backlight_get_brightness(struct backlight_device *bdev) { struct shmob_drm_connector *scon = bl_get_data(bdev); - struct shmob_drm_device *sdev = scon->connector.dev->dev_private; + struct shmob_drm_device *sdev = scon->connector.drm->dev_private; const struct shmob_drm_backlight_data *bdata = &sdev->pdata->backlight; return bdata->get_brightness(); @@ -50,10 +50,10 @@ void shmob_drm_backlight_dpms(struct shmob_drm_connector *scon, int mode) int shmob_drm_backlight_init(struct shmob_drm_connector *scon) { - struct shmob_drm_device *sdev = scon->connector.dev->dev_private; + struct shmob_drm_device *sdev = scon->connector.drm->dev_private; const struct shmob_drm_backlight_data *bdata = &sdev->pdata->backlight; struct drm_connector *connector = &scon->connector; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct backlight_device *backlight; if (!bdata->max_brightness) diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c index 11dd2bc803e7..ff1bdb1a3e54 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c @@ -616,10 +616,10 @@ int shmob_drm_encoder_create(struct shmob_drm_device *sdev) static int shmob_drm_connector_get_modes(struct drm_connector *connector) { - struct shmob_drm_device *sdev = connector->dev->dev_private; + struct shmob_drm_device *sdev = connector->drm->dev_private; struct drm_display_mode *mode; - mode = drm_mode_create(connector->dev); + mode = drm_mode_create(connector->drm); if (mode == NULL) return 0; diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 6a63952a6c84..1f38a4fffa3c 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -679,7 +679,7 @@ static irqreturn_t inno_hdmi_irq(int irq, void *dev_id) { struct inno_hdmi *hdmi = dev_id; - drm_helper_hpd_irq_event(hdmi->connector.dev); + drm_helper_hpd_irq_event(hdmi->connector.drm); return IRQ_HANDLED; } diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c index 5e6ac27ea155..810f170d8ba9 100644 --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c @@ -609,7 +609,7 @@ static irqreturn_t rk3066_hdmi_irq(int irq, void *dev_id) { struct rk3066_hdmi *hdmi = dev_id; - drm_helper_hpd_irq_event(hdmi->connector.dev); + drm_helper_hpd_irq_event(hdmi->connector.drm); return IRQ_HANDLED; } diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c index b3dc1ca9dc10..e34750187b58 100644 --- a/drivers/gpu/drm/solomon/ssd130x.c +++ b/drivers/gpu/drm/solomon/ssd130x.c @@ -760,11 +760,11 @@ static const struct drm_encoder_funcs ssd130x_encoder_funcs = { static int ssd130x_connector_helper_get_modes(struct drm_connector *connector) { - struct ssd130x_device *ssd130x = drm_to_ssd130x(connector->dev); + struct ssd130x_device *ssd130x = drm_to_ssd130x(connector->drm); struct drm_display_mode *mode; struct device *dev = ssd130x->dev; - mode = drm_mode_duplicate(connector->dev, &ssd130x->mode); + mode = drm_mode_duplicate(connector->drm, &ssd130x->mode); if (!mode) { dev_err(dev, "Failed to duplicated mode\n"); return 0; diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c index 4d2677dcd831..1818d4856f87 100644 --- a/drivers/gpu/drm/tegra/dpaux.c +++ b/drivers/gpu/drm/tegra/dpaux.c @@ -274,7 +274,7 @@ static void tegra_dpaux_hotplug(struct work_struct *work) struct tegra_dpaux *dpaux = work_to_dpaux(work); if (dpaux->output) - drm_helper_hpd_irq_event(dpaux->output->connector.dev); + drm_helper_hpd_irq_event(dpaux->output->connector.drm); } static irqreturn_t tegra_dpaux_irq(int irq, void *data) @@ -719,7 +719,7 @@ int drm_dp_aux_attach(struct drm_dp_aux *aux, struct tegra_output *output) unsigned long timeout; int err; - aux->drm_dev = output->connector.dev; + aux->drm_dev = output->connector.drm; err = drm_dp_aux_register(aux); if (err < 0) return err; diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index a9870c828374..467f797fa65a 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -232,7 +232,7 @@ static int tegra_dsi_late_register(struct drm_connector *connector) { struct tegra_output *output = connector_to_output(connector); unsigned int i, count = ARRAY_SIZE(debugfs_files); - struct drm_minor *minor = connector->dev->primary; + struct drm_minor *minor = connector->drm->primary; struct dentry *root = connector->debugfs_entry; struct tegra_dsi *dsi = to_dsi(output); @@ -256,7 +256,7 @@ static void tegra_dsi_early_unregister(struct drm_connector *connector) struct tegra_dsi *dsi = to_dsi(output); drm_debugfs_remove_files(dsi->debugfs_files, count, - connector->dev->primary); + connector->drm->primary); kfree(dsi->debugfs_files); dsi->debugfs_files = NULL; } @@ -1507,8 +1507,8 @@ static int tegra_dsi_host_attach(struct mipi_dsi_host *host, if (IS_ERR(output->panel)) output->panel = NULL; - if (output->panel && output->connector.dev) - drm_helper_hpd_irq_event(output->connector.dev); + if (output->panel && output->connector.drm) + drm_helper_hpd_irq_event(output->connector.drm); } return 0; @@ -1523,8 +1523,8 @@ static int tegra_dsi_host_detach(struct mipi_dsi_host *host, if (output->panel && &device->dev == output->panel->dev) { output->panel = NULL; - if (output->connector.dev) - drm_helper_hpd_irq_event(output->connector.dev); + if (output->connector.drm) + drm_helper_hpd_irq_event(output->connector.drm); } return 0; diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index 6eac54ae1205..7f994d79fd72 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -1090,7 +1090,7 @@ static int tegra_hdmi_late_register(struct drm_connector *connector) { struct tegra_output *output = connector_to_output(connector); unsigned int i, count = ARRAY_SIZE(debugfs_files); - struct drm_minor *minor = connector->dev->primary; + struct drm_minor *minor = connector->drm->primary; struct dentry *root = connector->debugfs_entry; struct tegra_hdmi *hdmi = to_hdmi(output); @@ -1110,7 +1110,7 @@ static int tegra_hdmi_late_register(struct drm_connector *connector) static void tegra_hdmi_early_unregister(struct drm_connector *connector) { struct tegra_output *output = connector_to_output(connector); - struct drm_minor *minor = connector->dev->primary; + struct drm_minor *minor = connector->drm->primary; unsigned int count = ARRAY_SIZE(debugfs_files); struct tegra_hdmi *hdmi = to_hdmi(output); diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c index dc2dcb5ca1c8..9ebb6a551331 100644 --- a/drivers/gpu/drm/tegra/output.c +++ b/drivers/gpu/drm/tegra/output.c @@ -88,8 +88,8 @@ static irqreturn_t hpd_irq(int irq, void *data) { struct tegra_output *output = data; - if (output->connector.dev) - drm_helper_hpd_irq_event(output->connector.dev); + if (output->connector.drm) + drm_helper_hpd_irq_event(output->connector.drm); return IRQ_HANDLED; } diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index fbb63d755496..2bc0f6668b30 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -1683,7 +1683,7 @@ static int tegra_sor_late_register(struct drm_connector *connector) { struct tegra_output *output = connector_to_output(connector); unsigned int i, count = ARRAY_SIZE(debugfs_files); - struct drm_minor *minor = connector->dev->primary; + struct drm_minor *minor = connector->drm->primary; struct dentry *root = connector->debugfs_entry; struct tegra_sor *sor = to_sor(output); @@ -1707,7 +1707,7 @@ static void tegra_sor_early_unregister(struct drm_connector *connector) struct tegra_sor *sor = to_sor(output); drm_debugfs_remove_files(sor->debugfs_files, count, - connector->dev->primary); + connector->drm->primary); kfree(sor->debugfs_files); sor->debugfs_files = NULL; } diff --git a/drivers/gpu/drm/tests/drm_client_modeset_test.c b/drivers/gpu/drm/tests/drm_client_modeset_test.c index 416a279b6dae..0d0ecd2a58eb 100644 --- a/drivers/gpu/drm/tests/drm_client_modeset_test.c +++ b/drivers/gpu/drm/tests/drm_client_modeset_test.c @@ -26,14 +26,14 @@ static int drm_client_modeset_connector_get_modes(struct drm_connector *connecto count = drm_add_modes_noedid(connector, 1920, 1200); - mode = drm_mode_analog_ntsc_480i(connector->dev); + mode = drm_mode_analog_ntsc_480i(connector->drm); if (!mode) return count; drm_mode_probed_add(connector, mode); count += 1; - mode = drm_mode_analog_pal_576i(connector->dev); + mode = drm_mode_analog_pal_576i(connector->drm); if (!mode) return count; diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c index 9aefd010acde..a46bfc968c74 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c @@ -134,7 +134,7 @@ static void panel_connector_destroy(struct drm_connector *connector) static int panel_connector_get_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct panel_connector *panel_connector = to_panel_connector(connector); struct display_timings *timings = panel_connector->mod->timings; int i; diff --git a/drivers/gpu/drm/tiny/cirrus.c b/drivers/gpu/drm/tiny/cirrus.c index 594bc472862f..3d3d6c8fd92e 100644 --- a/drivers/gpu/drm/tiny/cirrus.c +++ b/drivers/gpu/drm/tiny/cirrus.c @@ -537,8 +537,8 @@ static int cirrus_connector_helper_get_modes(struct drm_connector *connector) int count; count = drm_add_modes_noedid(connector, - connector->dev->mode_config.max_width, - connector->dev->mode_config.max_height); + connector->drm->mode_config.max_width, + connector->drm->mode_config.max_height); drm_set_preferred_mode(connector, 1024, 768); return count; } diff --git a/drivers/gpu/drm/tiny/ofdrm.c b/drivers/gpu/drm/tiny/ofdrm.c index 2d999a0facde..dbf053d603af 100644 --- a/drivers/gpu/drm/tiny/ofdrm.c +++ b/drivers/gpu/drm/tiny/ofdrm.c @@ -989,7 +989,7 @@ static const struct drm_crtc_funcs ofdrm_crtc_funcs = { static int ofdrm_connector_helper_get_modes(struct drm_connector *connector) { - struct ofdrm_device *odev = ofdrm_device_of_dev(connector->dev); + struct ofdrm_device *odev = ofdrm_device_of_dev(connector->drm); return drm_connector_helper_get_modes_fixed(connector, &odev->mode); } diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c index c2677d081a7b..f884b2712bde 100644 --- a/drivers/gpu/drm/tiny/repaper.c +++ b/drivers/gpu/drm/tiny/repaper.c @@ -848,7 +848,7 @@ static const struct drm_simple_display_pipe_funcs repaper_pipe_funcs = { static int repaper_connector_get_modes(struct drm_connector *connector) { - struct repaper_epd *epd = drm_to_epd(connector->dev); + struct repaper_epd *epd = drm_to_epd(connector->drm); return drm_connector_helper_get_modes_fixed(connector, epd->mode); } diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index ff86ba1ae1b8..fa511aff2545 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -578,7 +578,7 @@ static const struct drm_encoder_funcs simpledrm_encoder_funcs = { static int simpledrm_connector_helper_get_modes(struct drm_connector *connector) { - struct simpledrm_device *sdev = simpledrm_device_of_dev(connector->dev); + struct simpledrm_device *sdev = simpledrm_device_of_dev(connector->drm); return drm_connector_helper_get_modes_fixed(connector, &sdev->mode); } diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c index aa02fd2789c3..1c85223b4bdc 100644 --- a/drivers/gpu/drm/udl/udl_modeset.c +++ b/drivers/gpu/drm/udl/udl_modeset.c @@ -464,7 +464,7 @@ static int udl_get_edid_block(void *data, u8 *buf, unsigned int block, size_t le static enum drm_connector_status udl_connector_detect(struct drm_connector *connector, bool force) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct udl_device *udl = to_udl(dev); struct udl_connector *udl_connector = to_udl_connector(connector); enum drm_connector_status status = connector_status_disconnected; diff --git a/drivers/gpu/drm/vboxvideo/vbox_mode.c b/drivers/gpu/drm/vboxvideo/vbox_mode.c index 341edd982cb3..d7326d6b9062 100644 --- a/drivers/gpu/drm/vboxvideo/vbox_mode.c +++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c @@ -712,7 +712,7 @@ static int vbox_get_modes(struct drm_connector *connector) int preferred_width, preferred_height; vbox_connector = to_vbox_connector(connector); - vbox = to_vbox_dev(connector->dev); + vbox = to_vbox_dev(connector->drm); hgsmi_report_flags_location(vbox->guest_pool, GUEST_HEAP_OFFSET(vbox) + HOST_FLAGS_OFFSET); @@ -724,7 +724,7 @@ static int vbox_get_modes(struct drm_connector *connector) vbox_connector->mode_hint.width : 1024; preferred_height = vbox_connector->mode_hint.height ? vbox_connector->mode_hint.height : 768; - mode = drm_cvt_mode(connector->dev, preferred_width, preferred_height, + mode = drm_cvt_mode(connector->drm, preferred_width, preferred_height, 60, false, false, false); if (mode) { mode->type |= DRM_MODE_TYPE_PREFERRED; @@ -778,7 +778,7 @@ static int vbox_fill_modes(struct drm_connector *connector, u32 max_x, struct drm_display_mode *mode, *iterator; vbox_connector = to_vbox_connector(connector); - dev = vbox_connector->base.dev; + dev = vbox_connector->base.drm; list_for_each_entry_safe(mode, iterator, &connector->modes, head) { list_del(&mode->head); drm_mode_destroy(dev, mode); diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 56a950e6d777..5e53d4f8232d 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -172,7 +172,7 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) { struct drm_debugfs_entry *entry = m->private; struct vc4_hdmi *vc4_hdmi = entry->file.data; - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; struct drm_printer p = drm_seq_file_printer(m); int idx; @@ -195,7 +195,7 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) static void vc4_hdmi_reset(struct vc4_hdmi *vc4_hdmi) { - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; unsigned long flags; int idx; @@ -228,7 +228,7 @@ static void vc4_hdmi_reset(struct vc4_hdmi *vc4_hdmi) static void vc5_hdmi_reset(struct vc4_hdmi *vc4_hdmi) { - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; unsigned long flags; int idx; @@ -257,7 +257,7 @@ static void vc5_hdmi_reset(struct vc4_hdmi *vc4_hdmi) #ifdef CONFIG_DRM_VC4_HDMI_CEC static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi) { - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; unsigned long cec_rate; unsigned long flags; u16 clk_cnt; @@ -340,7 +340,7 @@ static int vc4_hdmi_reset_link(struct drm_connector *connector, if (!connector) return 0; - drm = connector->dev; + drm = connector->drm; ret = drm_modeset_lock(&drm->mode_config.connection_mutex, ctx); if (ret) return ret; @@ -490,7 +490,7 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector, static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) { struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); - struct vc4_dev *vc4 = to_vc4_dev(connector->dev); + struct vc4_dev *vc4 = to_vc4_dev(connector->drm); int ret = 0; struct edid *edid; @@ -515,7 +515,7 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) kfree(edid); if (!vc4->hvs->vc5_hdmi_enable_hdmi_20) { - struct drm_device *drm = connector->dev; + struct drm_device *drm = connector->drm; const struct drm_display_mode *mode; list_for_each_entry(mode, &connector->probed_modes, head) { @@ -591,7 +591,7 @@ static int vc4_hdmi_connector_get_property(struct drm_connector *connector, struct drm_property *property, uint64_t *val) { - struct drm_device *drm = connector->dev; + struct drm_device *drm = connector->drm; struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); const struct vc4_hdmi_connector_state *vc4_conn_state = @@ -613,7 +613,7 @@ static int vc4_hdmi_connector_set_property(struct drm_connector *connector, struct drm_property *property, uint64_t val) { - struct drm_device *drm = connector->dev; + struct drm_device *drm = connector->drm; struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); struct vc4_hdmi_connector_state *vc4_conn_state = @@ -772,7 +772,7 @@ static int vc4_hdmi_stop_packet(struct drm_encoder *encoder, bool poll) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; u32 packet_id = type - 0x80; unsigned long flags; int ret = 0; @@ -799,7 +799,7 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, union hdmi_infoframe *frame) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; u32 packet_id = frame->any.type - 0x80; const struct vc4_hdmi_register *ram_packet_start = &vc4_hdmi->variant->registers[HDMI_RAM_PACKET_START]; @@ -999,7 +999,7 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); struct drm_connector *connector = &vc4_hdmi->connector; - struct drm_device *drm = connector->dev; + struct drm_device *drm = connector->drm; const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; unsigned long flags; int idx; @@ -1037,7 +1037,7 @@ static void vc4_hdmi_disable_scrambling(struct drm_encoder *encoder) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); struct drm_connector *connector = &vc4_hdmi->connector; - struct drm_device *drm = connector->dev; + struct drm_device *drm = connector->drm; unsigned long flags; int idx; @@ -1086,7 +1086,7 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder, struct drm_atomic_state *state) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; unsigned long flags; int idx; @@ -1124,7 +1124,7 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder, struct drm_atomic_state *state) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; unsigned long flags; int ret; int idx; @@ -1161,7 +1161,7 @@ static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, { struct vc4_hdmi_connector_state *vc4_state = conn_state_to_vc4_hdmi_conn_state(state); - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; unsigned long flags; u32 csc_ctl; int idx; @@ -1396,7 +1396,7 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, struct drm_connector_state *state, const struct drm_display_mode *mode) { - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; struct vc4_hdmi_connector_state *vc4_state = conn_state_to_vc4_hdmi_conn_state(state); unsigned int lim_range = vc4_hdmi_is_full_range(vc4_hdmi, vc4_state) ? 0 : 1; @@ -1462,7 +1462,7 @@ static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, struct drm_connector_state *state, const struct drm_display_mode *mode) { - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; bool interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE; @@ -1526,7 +1526,7 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, struct drm_connector_state *state, const struct drm_display_mode *mode) { - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; const struct vc4_hdmi_connector_state *vc4_state = conn_state_to_vc4_hdmi_conn_state(state); bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; @@ -1633,7 +1633,7 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, static void vc4_hdmi_recenter_fifo(struct vc4_hdmi *vc4_hdmi) { - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; unsigned long flags; u32 drift; int ret; @@ -1677,7 +1677,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, struct drm_atomic_state *state) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; struct drm_connector *connector = &vc4_hdmi->connector; struct drm_connector_state *conn_state = drm_atomic_get_new_connector_state(state, connector); @@ -1796,7 +1796,7 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; struct drm_connector *connector = &vc4_hdmi->connector; const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; struct drm_connector_state *conn_state = @@ -1826,7 +1826,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; struct drm_display_info *display = &vc4_hdmi->connector.display_info; bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; @@ -1926,7 +1926,7 @@ vc4_hdmi_sink_supports_format_bpc(const struct vc4_hdmi *vc4_hdmi, const struct drm_display_mode *mode, unsigned int format, unsigned int bpc) { - struct drm_device *dev = vc4_hdmi->connector.dev; + struct drm_device *dev = vc4_hdmi->connector.drm; u8 vic = drm_match_cea_mode(mode); if (vic == 1 && bpc != 8) { @@ -2011,7 +2011,7 @@ vc4_hdmi_encoder_clock_valid(const struct vc4_hdmi *vc4_hdmi, { const struct drm_connector *connector = &vc4_hdmi->connector; const struct drm_display_info *info = &connector->display_info; - struct vc4_dev *vc4 = to_vc4_dev(connector->dev); + struct vc4_dev *vc4 = to_vc4_dev(connector->drm); if (clock > vc4_hdmi->variant->max_pixel_clock) return MODE_CLOCK_HIGH; @@ -2073,7 +2073,7 @@ vc4_hdmi_encoder_compute_format(const struct vc4_hdmi *vc4_hdmi, const struct drm_display_mode *mode, unsigned int bpc) { - struct drm_device *dev = vc4_hdmi->connector.dev; + struct drm_device *dev = vc4_hdmi->connector.drm; const struct drm_connector *connector = &vc4_hdmi->connector; const struct drm_display_info *info = &connector->display_info; unsigned int format; @@ -2116,7 +2116,7 @@ vc4_hdmi_encoder_compute_config(const struct vc4_hdmi *vc4_hdmi, struct vc4_hdmi_connector_state *vc4_state, const struct drm_display_mode *mode) { - struct drm_device *dev = vc4_hdmi->connector.dev; + struct drm_device *dev = vc4_hdmi->connector.drm; struct drm_connector_state *conn_state = &vc4_state->base; unsigned int max_bpc = clamp_t(unsigned int, conn_state->max_bpc, 8, 12); unsigned int bpc; @@ -2273,7 +2273,7 @@ static u32 vc5_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask) static bool vc5_hdmi_hp_detect(struct vc4_hdmi *vc4_hdmi) { - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; unsigned long flags; u32 hotplug; int idx; @@ -2294,7 +2294,7 @@ static bool vc5_hdmi_hp_detect(struct vc4_hdmi *vc4_hdmi) static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi, unsigned int samplerate) { - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; u32 hsm_clock; unsigned long flags; unsigned long n, m; @@ -2373,7 +2373,7 @@ static bool vc4_hdmi_audio_can_stream(struct vc4_hdmi *vc4_hdmi) static int vc4_hdmi_audio_startup(struct device *dev, void *data) { struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; unsigned long flags; int ret = 0; int idx; @@ -2438,7 +2438,7 @@ static void vc4_hdmi_audio_reset(struct vc4_hdmi *vc4_hdmi) static void vc4_hdmi_audio_shutdown(struct device *dev, void *data) { struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; unsigned long flags; int idx; @@ -2512,7 +2512,7 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, struct hdmi_codec_params *params) { struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; struct drm_encoder *encoder = &vc4_hdmi->encoder.base; unsigned int sample_rate = params->sample_rate; unsigned int channels = params->channels; @@ -2823,7 +2823,7 @@ static irqreturn_t vc4_hdmi_hpd_irq_thread(int irq, void *priv) { struct vc4_hdmi *vc4_hdmi = priv; struct drm_connector *connector = &vc4_hdmi->connector; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; if (dev && dev->registered) drm_connector_helper_hpd_irq_event(connector); @@ -2906,7 +2906,7 @@ static irqreturn_t vc4_cec_irq_handler_thread(int irq, void *priv) static void vc4_cec_read_msg(struct vc4_hdmi *vc4_hdmi, u32 cntrl1) { - struct drm_device *dev = vc4_hdmi->connector.dev; + struct drm_device *dev = vc4_hdmi->connector.drm; struct cec_msg *msg = &vc4_hdmi->cec_rx_msg; unsigned int i; @@ -3046,7 +3046,7 @@ static irqreturn_t vc4_cec_irq_handler(int irq, void *priv) static int vc4_hdmi_cec_enable(struct cec_adapter *adap) { struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; /* clock period in microseconds */ const u32 usecs = 1000000 / CEC_CLOCK_FREQ; unsigned long flags; @@ -3113,7 +3113,7 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) static int vc4_hdmi_cec_disable(struct cec_adapter *adap) { struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; unsigned long flags; int idx; @@ -3157,7 +3157,7 @@ static int vc4_hdmi_cec_adap_enable(struct cec_adapter *adap, bool enable) static int vc4_hdmi_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr) { struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); - struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_device *drm = vc4_hdmi->connector.drm; unsigned long flags; int idx; @@ -3186,7 +3186,7 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, u32 signal_free_time, struct cec_msg *msg) { struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); - struct drm_device *dev = vc4_hdmi->connector.dev; + struct drm_device *dev = vc4_hdmi->connector.drm; unsigned long flags; u32 val; unsigned int i; diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c index 6cdd97f364a8..4091fd872d65 100644 --- a/drivers/gpu/drm/vc4/vc4_txp.c +++ b/drivers/gpu/drm/vc4/vc4_txp.c @@ -184,7 +184,7 @@ static const struct debugfs_reg32 txp_regs[] = { static int vc4_txp_connector_get_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; return drm_add_modes_noedid(connector, dev->mode_config.max_width, dev->mode_config.max_height); @@ -194,7 +194,7 @@ static enum drm_mode_status vc4_txp_connector_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct drm_mode_config *mode_config = &dev->mode_config; int w = mode->hdisplay, h = mode->vdisplay; @@ -282,7 +282,7 @@ static int vc4_txp_connector_atomic_check(struct drm_connector *conn, static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, struct drm_atomic_state *state) { - struct drm_device *drm = conn->dev; + struct drm_device *drm = conn->drm; struct drm_connector_state *conn_state = drm_atomic_get_new_connector_state(state, conn); struct vc4_txp *txp = connector_to_vc4_txp(conn); diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index ad924a8502e9..6f9cc844412b 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -178,7 +178,7 @@ static int virtio_gpu_conn_get_modes(struct drm_connector *connector) drm_set_preferred_mode(connector, XRES_DEF, YRES_DEF); } else { DRM_DEBUG("add mode: %dx%d\n", width, height); - mode = drm_cvt_mode(connector->dev, width, height, 60, + mode = drm_cvt_mode(connector->drm, width, height, 60, false, false, false); if (!mode) return count; diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c b/drivers/gpu/drm/vkms/vkms_writeback.c index d7e63aa14663..9850ed02ac76 100644 --- a/drivers/gpu/drm/vkms/vkms_writeback.c +++ b/drivers/gpu/drm/vkms/vkms_writeback.c @@ -61,7 +61,7 @@ static const struct drm_encoder_helper_funcs vkms_wb_encoder_helper_funcs = { static int vkms_wb_connector_get_modes(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; return drm_add_modes_noedid(connector, dev->mode_config.max_width, dev->mode_config.max_height); @@ -121,7 +121,7 @@ static void vkms_wb_atomic_commit(struct drm_connector *conn, { struct drm_connector_state *connector_state = drm_atomic_get_new_connector_state(state, conn); - struct vkms_device *vkmsdev = drm_device_to_vkms_device(conn->dev); + struct vkms_device *vkmsdev = drm_device_to_vkms_device(conn->drm); struct vkms_output *output = &vkmsdev->output; struct drm_writeback_connector *wb_conn = &output->wb_connector; struct drm_connector_state *conn_state = wb_conn->base.state; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index b62207be3363..e7cad0200f9b 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -2263,7 +2263,7 @@ enum drm_connector_status vmw_du_connector_detect(struct drm_connector *connector, bool force) { uint32_t num_displays; - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct vmw_private *dev_priv = vmw_priv(dev); struct vmw_display_unit *du = vmw_connector_to_du(connector); @@ -2400,7 +2400,7 @@ int vmw_du_connector_fill_modes(struct drm_connector *connector, uint32_t max_width, uint32_t max_height) { struct vmw_display_unit *du = vmw_connector_to_du(connector); - struct drm_device *dev = connector->dev; + struct drm_device *dev = connector->drm; struct vmw_private *dev_priv = vmw_priv(dev); struct drm_display_mode *mode = NULL; struct drm_display_mode *bmode; diff --git a/drivers/gpu/drm/xen/xen_drm_front_conn.c b/drivers/gpu/drm/xen/xen_drm_front_conn.c index a1ba6d3d0568..e167d4496f9c 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_conn.c +++ b/drivers/gpu/drm/xen/xen_drm_front_conn.c @@ -50,7 +50,7 @@ static int connector_detect(struct drm_connector *connector, struct xen_drm_front_drm_pipeline *pipeline = to_xen_drm_pipeline(connector); - if (drm_dev_is_unplugged(connector->dev)) + if (drm_dev_is_unplugged(connector->drm)) pipeline->conn_connected = false; return pipeline->conn_connected ? connector_status_connected : @@ -67,7 +67,7 @@ static int connector_get_modes(struct drm_connector *connector) struct videomode videomode; int width, height; - mode = drm_mode_create(connector->dev); + mode = drm_mode_create(connector->drm); if (!mode) return 0; diff --git a/drivers/media/cec/core/cec-adap.c b/drivers/media/cec/core/cec-adap.c index 241b1621b197..31806ccc154a 100644 --- a/drivers/media/cec/core/cec-adap.c +++ b/drivers/media/cec/core/cec-adap.c @@ -62,7 +62,7 @@ void cec_fill_conn_info_from_drm(struct cec_connector_info *conn_info, { memset(conn_info, 0, sizeof(*conn_info)); conn_info->type = CEC_CONNECTOR_TYPE_DRM; - conn_info->drm.card_no = connector->dev->primary->index; + conn_info->drm.card_no = connector->drm->primary->index; conn_info->drm.connector_id = connector->base.id; } EXPORT_SYMBOL_GPL(cec_fill_conn_info_from_drm); diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index d300fde6c1a4..e622de54461a 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1492,8 +1492,8 @@ struct drm_cmdline_mode { * span multiple monitors). */ struct drm_connector { - /** @dev: parent DRM device */ - struct drm_device *dev; + /** @drm: parent DRM device */ + struct drm_device *drm; /** @kdev: kernel device for sysfs attributes */ struct device *kdev; /** @attr: sysfs attributes */ @@ -2114,7 +2114,7 @@ const char *drm_get_colorspace_name(enum drm_colorspace colorspace); * @encoder: &struct drm_encoder pointer used as cursor */ #define drm_connector_for_each_possible_encoder(connector, encoder) \ - drm_for_each_encoder_mask(encoder, (connector)->dev, \ + drm_for_each_encoder_mask(encoder, (connector)->drm, \ (connector)->possible_encoders) #endif From patchwork Thu Jul 13 08:23:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311992 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A913AEB64DD for ; Thu, 13 Jul 2023 12:54:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 86D8610E6A3; Thu, 13 Jul 2023 12:54:19 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id EFBD110E631 for ; Thu, 13 Jul 2023 08:26:34 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrcd-0005qj-GN; Thu, 13 Jul 2023 10:24:23 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrcc-00E4jL-Qy; Thu, 13 Jul 2023 10:24:22 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrcb-004Vh1-PK; Thu, 13 Jul 2023 10:24:22 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 05/17] drm/crtc: Rename struct drm_crtc::dev to drm Date: Thu, 13 Jul 2023 10:23:56 +0200 Message-Id: <20230713082408.2266984-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=517799; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Upvl9tgr9qvbHcPWL5LKX2nGt5NiwNRJw75bqrqvp0g=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7SL9Ge1qnCb2j6ahUkyqJ3FRrP2b4sjst6RN V+9JnSo3bOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0iwAKCRCPgPtYfRL+ TkRkB/sEco3Sf0VIRUYhqYkDh+E6Zp0cwz8RaUq9DYk8uUFkbENGYLj5TkKeR3WnDF49p2WuVbc 4FCsXM2/+Ju1tYLkv7PJNTVwKhXYxio8UO04O3Ulwf9Hxo17i9Co6TCN1UC6ZX+9vkYu7Un4Rgh rpvWjd9vAUrPzS4JkbCWbkbRX3CYy4xSPEuudbe9GlExGf13F0awMWiNDdkxuk+zvkGhUae1Fzm oqmvy/wm2sdchlaUMOejDSEBvjN4C1Yxg/L2A25p6aDuxCgdQ8NPwVjbB9l1FKLw5rJxJzSJgKe raPLT+Vn6VOCl1cw6eShgTfoswJhNAbOlM7JqHaD6IRe6e2i X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-Mailman-Approved-At: Thu, 13 Jul 2023 12:53:45 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 18 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 8 +- drivers/gpu/drm/amd/amdgpu/atombios_crtc.c | 22 +-- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 26 +-- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 28 ++-- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 26 +-- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 26 +-- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 26 +-- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 20 +-- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 8 +- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 22 +-- .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 2 +- .../gpu/drm/arm/display/komeda/komeda_crtc.c | 24 +-- .../gpu/drm/arm/display/komeda/komeda_kms.c | 2 +- drivers/gpu/drm/arm/hdlcd_crtc.c | 4 +- drivers/gpu/drm/arm/malidp_crtc.c | 6 +- drivers/gpu/drm/armada/armada_crtc.c | 10 +- drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c | 6 +- drivers/gpu/drm/ast/ast_dp.c | 2 +- drivers/gpu/drm/ast/ast_mode.c | 26 +-- .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 10 +- drivers/gpu/drm/drm_atomic.c | 22 +-- drivers/gpu/drm/drm_atomic_helper.c | 19 ++- drivers/gpu/drm/drm_atomic_state_helper.c | 2 +- drivers/gpu/drm/drm_atomic_uapi.c | 22 +-- drivers/gpu/drm/drm_blend.c | 2 +- drivers/gpu/drm/drm_color_mgmt.c | 10 +- drivers/gpu/drm/drm_crtc.c | 18 +- drivers/gpu/drm/drm_crtc_helper.c | 10 +- drivers/gpu/drm/drm_debugfs.c | 2 +- drivers/gpu/drm/drm_debugfs_crc.c | 2 +- drivers/gpu/drm/drm_fb_helper.c | 6 +- drivers/gpu/drm/drm_mipi_dbi.c | 4 +- drivers/gpu/drm/drm_plane.c | 2 +- drivers/gpu/drm/drm_plane_helper.c | 2 +- drivers/gpu/drm/drm_self_refresh_helper.c | 2 +- drivers/gpu/drm/drm_vblank.c | 40 ++--- drivers/gpu/drm/drm_vblank_work.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 8 +- drivers/gpu/drm/exynos/exynos_drm_plane.c | 4 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 16 +- drivers/gpu/drm/gma500/cdv_intel_display.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_dp.c | 2 +- drivers/gpu/drm/gma500/gma_display.c | 20 +-- drivers/gpu/drm/gma500/oaktrail_crtc.c | 8 +- drivers/gpu/drm/gma500/oaktrail_hdmi.c | 4 +- drivers/gpu/drm/gma500/psb_intel_display.c | 2 +- drivers/gpu/drm/gma500/psb_irq.c | 6 +- drivers/gpu/drm/gud/gud_pipe.c | 6 +- .../gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 20 +-- .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 4 +- drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 6 +- drivers/gpu/drm/i915/display/g4x_dp.c | 4 +- drivers/gpu/drm/i915/display/hsw_ips.c | 16 +- drivers/gpu/drm/i915/display/i9xx_plane.c | 4 +- drivers/gpu/drm/i915/display/i9xx_wm.c | 40 ++--- drivers/gpu/drm/i915/display/icl_dsi.c | 2 +- drivers/gpu/drm/i915/display/intel_atomic.c | 2 +- .../gpu/drm/i915/display/intel_atomic_plane.c | 4 +- drivers/gpu/drm/i915/display/intel_audio.c | 2 +- drivers/gpu/drm/i915/display/intel_bw.c | 10 +- drivers/gpu/drm/i915/display/intel_cdclk.c | 6 +- drivers/gpu/drm/i915/display/intel_color.c | 124 +++++++------- drivers/gpu/drm/i915/display/intel_crtc.c | 20 +-- .../drm/i915/display/intel_crtc_state_dump.c | 4 +- drivers/gpu/drm/i915/display/intel_cursor.c | 2 +- drivers/gpu/drm/i915/display/intel_ddi.c | 28 ++-- drivers/gpu/drm/i915/display/intel_display.c | 154 +++++++++--------- .../gpu/drm/i915/display/intel_display_irq.c | 22 +-- .../gpu/drm/i915/display/intel_display_rps.c | 2 +- .../drm/i915/display/intel_display_trace.h | 12 +- drivers/gpu/drm/i915/display/intel_dp.c | 2 +- drivers/gpu/drm/i915/display/intel_dpll.c | 38 ++--- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 44 ++--- drivers/gpu/drm/i915/display/intel_dpt.c | 2 +- drivers/gpu/drm/i915/display/intel_drrs.c | 10 +- drivers/gpu/drm/i915/display/intel_dsb.c | 8 +- drivers/gpu/drm/i915/display/intel_fbc.c | 2 +- drivers/gpu/drm/i915/display/intel_fdi.c | 22 +-- .../drm/i915/display/intel_fifo_underrun.c | 6 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 2 +- .../drm/i915/display/intel_modeset_setup.c | 22 +-- .../drm/i915/display/intel_modeset_verify.c | 2 +- drivers/gpu/drm/i915/display/intel_panel.c | 4 +- .../gpu/drm/i915/display/intel_pch_display.c | 32 ++-- .../gpu/drm/i915/display/intel_pch_refclk.c | 2 +- drivers/gpu/drm/i915/display/intel_pipe_crc.c | 10 +- .../drm/i915/display/intel_plane_initial.c | 6 +- drivers/gpu/drm/i915/display/intel_psr.c | 14 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 2 +- drivers/gpu/drm/i915/display/intel_vblank.c | 24 +-- drivers/gpu/drm/i915/display/intel_vdsc.c | 18 +- drivers/gpu/drm/i915/display/intel_vrr.c | 18 +- drivers/gpu/drm/i915/display/skl_scaler.c | 10 +- .../drm/i915/display/skl_universal_plane.c | 6 +- drivers/gpu/drm/i915/display/skl_watermark.c | 42 ++--- drivers/gpu/drm/i915/display/vlv_dsi.c | 2 +- drivers/gpu/drm/imx/dcss/dcss-crtc.c | 20 +-- drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c | 14 +- drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 19 ++- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 +- drivers/gpu/drm/kmb/kmb_crtc.c | 16 +- drivers/gpu/drm/logicvc/logicvc_crtc.c | 14 +- drivers/gpu/drm/loongson/lsdc_crtc.c | 12 +- drivers/gpu/drm/mcde/mcde_display.c | 18 +- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 22 +-- drivers/gpu/drm/meson/meson_crtc.c | 12 +- drivers/gpu/drm/mgag200/mgag200_g200.c | 4 +- drivers/gpu/drm/mgag200/mgag200_g200eh.c | 2 +- drivers/gpu/drm/mgag200/mgag200_g200er.c | 4 +- drivers/gpu/drm/mgag200/mgag200_g200ev.c | 4 +- drivers/gpu/drm/mgag200/mgag200_g200se.c | 6 +- drivers/gpu/drm/mgag200/mgag200_g200wb.c | 2 +- drivers/gpu/drm/mgag200/mgag200_mode.c | 10 +- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 6 +- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 68 ++++---- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 +- drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c | 12 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 20 +-- drivers/gpu/drm/msm/msm_drv.c | 4 +- drivers/gpu/drm/mxsfb/lcdif_kms.c | 18 +- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 16 +- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 57 +++---- drivers/gpu/drm/nouveau/dispnv04/cursor.c | 10 +- drivers/gpu/drm/nouveau/dispnv50/atom.h | 2 +- drivers/gpu/drm/nouveau/dispnv50/crc.c | 30 ++-- drivers/gpu/drm/nouveau/dispnv50/crc907d.c | 6 +- drivers/gpu/drm/nouveau/dispnv50/crcc37d.c | 6 +- drivers/gpu/drm/nouveau/dispnv50/crcc57d.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +- drivers/gpu/drm/nouveau/dispnv50/head.c | 4 +- drivers/gpu/drm/nouveau/dispnv50/head507d.c | 26 +-- drivers/gpu/drm/nouveau/dispnv50/head827d.c | 10 +- drivers/gpu/drm/nouveau/dispnv50/head907d.c | 26 +-- drivers/gpu/drm/nouveau/dispnv50/head917d.c | 6 +- drivers/gpu/drm/nouveau/dispnv50/headc37d.c | 18 +- drivers/gpu/drm/nouveau/dispnv50/headc57d.c | 10 +- drivers/gpu/drm/nouveau/nouveau_connector.h | 2 +- drivers/gpu/drm/nouveau/nouveau_display.c | 2 +- drivers/gpu/drm/omapdrm/omap_crtc.c | 56 +++---- drivers/gpu/drm/omapdrm/omap_irq.c | 6 +- drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 4 +- drivers/gpu/drm/pl111/pl111_display.c | 16 +- drivers/gpu/drm/qxl/qxl_display.c | 2 +- drivers/gpu/drm/radeon/atombios_crtc.c | 54 +++--- drivers/gpu/drm/radeon/radeon_cursor.c | 13 +- drivers/gpu/drm/radeon/radeon_display.c | 28 ++-- drivers/gpu/drm/radeon/radeon_kms.c | 6 +- drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 16 +- .../gpu/drm/renesas/rcar-du/rcar_du_crtc.c | 14 +- .../gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 20 +-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 8 +- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 15 +- drivers/gpu/drm/solomon/ssd130x.c | 2 +- drivers/gpu/drm/sprd/sprd_dpu.c | 6 +- drivers/gpu/drm/sti/sti_crtc.c | 14 +- drivers/gpu/drm/stm/ltdc.c | 12 +- drivers/gpu/drm/sun4i/sun4i_crtc.c | 12 +- drivers/gpu/drm/tegra/dc.c | 12 +- drivers/gpu/drm/tidss/tidss_crtc.c | 18 +- drivers/gpu/drm/tidss/tidss_irq.c | 4 +- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 42 ++--- drivers/gpu/drm/tiny/bochs.c | 6 +- drivers/gpu/drm/tiny/cirrus.c | 2 +- drivers/gpu/drm/tiny/gm12u320.c | 4 +- drivers/gpu/drm/tiny/hx8357d.c | 4 +- drivers/gpu/drm/tiny/ili9163.c | 4 +- drivers/gpu/drm/tiny/ili9225.c | 8 +- drivers/gpu/drm/tiny/ili9341.c | 4 +- drivers/gpu/drm/tiny/ili9486.c | 4 +- drivers/gpu/drm/tiny/mi0283qt.c | 4 +- drivers/gpu/drm/tiny/ofdrm.c | 8 +- drivers/gpu/drm/tiny/panel-mipi-dbi.c | 6 +- drivers/gpu/drm/tiny/repaper.c | 8 +- drivers/gpu/drm/tiny/simpledrm.c | 2 +- drivers/gpu/drm/tiny/st7586.c | 6 +- drivers/gpu/drm/tiny/st7735r.c | 4 +- drivers/gpu/drm/tve200/tve200_display.c | 14 +- drivers/gpu/drm/udl/udl_modeset.c | 4 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 6 +- drivers/gpu/drm/vc4/vc4_crtc.c | 38 ++--- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- drivers/gpu/drm/vc4/vc4_hvs.c | 12 +- drivers/gpu/drm/vc4/vc4_txp.c | 2 +- drivers/gpu/drm/virtio/virtgpu_display.c | 4 +- drivers/gpu/drm/vkms/vkms_crtc.c | 12 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 10 +- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 8 +- drivers/gpu/drm/xen/xen_drm_front_kms.c | 10 +- drivers/gpu/drm/xlnx/zynqmp_kms.c | 8 +- include/drm/drm_atomic_helper.h | 2 +- include/drm/drm_crtc.h | 4 +- 195 files changed, 1291 insertions(+), 1270 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index b702f499f5fb..f28090ecc603 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -147,14 +147,14 @@ static void amdgpu_display_flip_work_func(struct work_struct *__work) } /* We borrow the event spin lock for protecting flip_status */ - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); /* Do the flip (mmio) */ adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base, work->async); /* Set the flip status */ amdgpu_crtc->pflip_status = AMDGPU_FLIP_SUBMITTED; - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); drm_dbg_vbl(adev_to_drm(adev), @@ -191,7 +191,7 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, uint32_t page_flip_flags, uint32_t target, struct drm_modeset_acquire_ctx *ctx) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); struct drm_gem_object *obj; @@ -262,10 +262,10 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, amdgpu_get_vblank_counter_kms(crtc); /* we borrow the event spin lock for protecting flip_wrok */ - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); if (amdgpu_crtc->pflip_status != AMDGPU_FLIP_NONE) { DRM_DEBUG_DRIVER("flip queue: crtc already busy\n"); - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); r = -EBUSY; goto pflip_cleanup; } @@ -278,7 +278,7 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, amdgpu_crtc->crtc_id, amdgpu_crtc, work); /* update crtc fb */ crtc->primary->fb = fb; - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); amdgpu_display_flip_work_func(&work->flip_work.work); return 0; @@ -316,7 +316,7 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set, if (!set || !set->crtc) return -EINVAL; - dev = set->crtc->dev; + dev = set->crtc->drm; ret = pm_runtime_get_sync(dev->dev); if (ret < 0) @@ -1353,7 +1353,7 @@ bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc *crtc, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_encoder *encoder; struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); struct amdgpu_encoder *amdgpu_encoder; @@ -1587,7 +1587,7 @@ bool amdgpu_crtc_get_scanout_position(struct drm_crtc *crtc, int *hpos, ktime_t *stime, ktime_t *etime, const struct drm_display_mode *mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; return amdgpu_display_get_crtc_scanoutpos(dev, pipe, 0, vpos, hpos, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index e3531aa3c8bd..26b75d05e703 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -1368,7 +1368,7 @@ void amdgpu_driver_release_kms(struct drm_device *dev) */ u32 amdgpu_get_vblank_counter_kms(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; struct amdgpu_device *adev = drm_to_adev(dev); int vpos, hpos, stat; @@ -1436,7 +1436,7 @@ u32 amdgpu_get_vblank_counter_kms(struct drm_crtc *crtc) */ int amdgpu_enable_vblank_kms(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; struct amdgpu_device *adev = drm_to_adev(dev); int idx = amdgpu_display_crtc_idx_to_irq_type(adev, pipe); @@ -1453,7 +1453,7 @@ int amdgpu_enable_vblank_kms(struct drm_crtc *crtc) */ void amdgpu_disable_vblank_kms(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; struct amdgpu_device *adev = drm_to_adev(dev); int idx = amdgpu_display_crtc_idx_to_irq_type(adev, pipe); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c index 0bb2466d539a..fb340f9a628b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c @@ -268,7 +268,7 @@ void amdgpu_pll_compute(struct amdgpu_device *adev, */ u32 amdgpu_pll_get_use_mask(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_crtc *test_crtc; struct amdgpu_crtc *test_amdgpu_crtc; u32 pll_in_use = 0; @@ -295,7 +295,7 @@ u32 amdgpu_pll_get_use_mask(struct drm_crtc *crtc) */ int amdgpu_pll_get_shared_dp_ppll(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_crtc *test_crtc; struct amdgpu_crtc *test_amdgpu_crtc; @@ -324,7 +324,7 @@ int amdgpu_pll_get_shared_dp_ppll(struct drm_crtc *crtc) int amdgpu_pll_get_shared_nondp_ppll(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_crtc *test_crtc; struct amdgpu_crtc *test_amdgpu_crtc; u32 adjusted_clock, test_adjusted_clock; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c index 5ba42af8202a..af21096696db 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c @@ -63,7 +63,7 @@ static enum hrtimer_restart amdgpu_vkms_vblank_simulate(struct hrtimer *timer) static int amdgpu_vkms_enable_vblank(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = drm_crtc_index(crtc); struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; struct amdgpu_vkms_output *out = drm_crtc_to_amdgpu_vkms_output(crtc); @@ -89,7 +89,7 @@ static bool amdgpu_vkms_get_vblank_timestamp(struct drm_crtc *crtc, ktime_t *vblank_time, bool in_vblank_irq) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; struct amdgpu_vkms_output *output = drm_crtc_to_amdgpu_vkms_output(crtc); struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; @@ -146,14 +146,14 @@ static void amdgpu_vkms_crtc_atomic_flush(struct drm_crtc *crtc, { unsigned long flags; if (crtc->state->event) { - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); if (drm_crtc_vblank_get(crtc) != 0) drm_crtc_send_vblank_event(crtc, crtc->state->event); else drm_crtc_arm_vblank_event(crtc, crtc->state->event); - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); crtc->state->event = NULL; } diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c b/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c index 10098fdd33fc..96400e5f1fb8 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c @@ -39,7 +39,7 @@ void amdgpu_atombios_crtc_overscan_setup(struct drm_crtc *crtc, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); SET_CRTC_OVERSCAN_PS_ALLOCATION args; @@ -82,7 +82,7 @@ void amdgpu_atombios_crtc_overscan_setup(struct drm_crtc *crtc, void amdgpu_atombios_crtc_scaler_setup(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); ENABLE_SCALER_PS_ALLOCATION args; @@ -112,7 +112,7 @@ void amdgpu_atombios_crtc_scaler_setup(struct drm_crtc *crtc) void amdgpu_atombios_crtc_lock(struct drm_crtc *crtc, int lock) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); int index = GetIndexIntoMasterTable(COMMAND, UpdateCRTC_DoubleBufferRegisters); @@ -129,7 +129,7 @@ void amdgpu_atombios_crtc_lock(struct drm_crtc *crtc, int lock) void amdgpu_atombios_crtc_enable(struct drm_crtc *crtc, int state) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); int index = GetIndexIntoMasterTable(COMMAND, EnableCRTC); ENABLE_CRTC_PS_ALLOCATION args; @@ -145,7 +145,7 @@ void amdgpu_atombios_crtc_enable(struct drm_crtc *crtc, int state) void amdgpu_atombios_crtc_blank(struct drm_crtc *crtc, int state) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); int index = GetIndexIntoMasterTable(COMMAND, BlankCRTC); BLANK_CRTC_PS_ALLOCATION args; @@ -161,7 +161,7 @@ void amdgpu_atombios_crtc_blank(struct drm_crtc *crtc, int state) void amdgpu_atombios_crtc_powergate(struct drm_crtc *crtc, int state) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); int index = GetIndexIntoMasterTable(COMMAND, EnableDispPowerGating); ENABLE_DISP_POWER_GATING_PS_ALLOCATION args; @@ -190,7 +190,7 @@ void amdgpu_atombios_crtc_set_dtd_timing(struct drm_crtc *crtc, struct drm_display_mode *mode) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); SET_CRTC_USING_DTD_TIMING_PARAMETERS args; int index = GetIndexIntoMasterTable(COMMAND, SetCRTC_UsingDTDTiming); @@ -305,7 +305,7 @@ static u32 amdgpu_atombios_crtc_adjust_pll(struct drm_crtc *crtc, struct drm_display_mode *mode) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct drm_encoder *encoder = amdgpu_crtc->encoder; struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); @@ -586,7 +586,7 @@ void amdgpu_atombios_crtc_program_pll(struct drm_crtc *crtc, bool ss_enabled, struct amdgpu_atom_ss *ss) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); u8 frev, crev; int index = GetIndexIntoMasterTable(COMMAND, SetPixelClock); @@ -747,7 +747,7 @@ int amdgpu_atombios_crtc_prepare_pll(struct drm_crtc *crtc, struct drm_display_mode *mode) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(amdgpu_crtc->encoder); @@ -816,7 +816,7 @@ int amdgpu_atombios_crtc_prepare_pll(struct drm_crtc *crtc, void amdgpu_atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(amdgpu_crtc->encoder); diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c index 9a24ed463abd..1c745d8adb63 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c @@ -1824,7 +1824,7 @@ static const u32 vga_control_regs[6] = static void dce_v10_0_vga_enable(struct drm_crtc *crtc, bool enable) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); u32 vga_control; @@ -1838,7 +1838,7 @@ static void dce_v10_0_vga_enable(struct drm_crtc *crtc, bool enable) static void dce_v10_0_grph_enable(struct drm_crtc *crtc, bool enable) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); if (enable) @@ -1852,7 +1852,7 @@ static int dce_v10_0_crtc_do_set_base(struct drm_crtc *crtc, int x, int y, int atomic) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct drm_framebuffer *target_fb; struct drm_gem_object *obj; @@ -2096,7 +2096,7 @@ static int dce_v10_0_crtc_do_set_base(struct drm_crtc *crtc, static void dce_v10_0_set_interleave(struct drm_crtc *crtc, struct drm_display_mode *mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); u32 tmp; @@ -2112,7 +2112,7 @@ static void dce_v10_0_set_interleave(struct drm_crtc *crtc, static void dce_v10_0_crtc_load_lut(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); u16 *r, *g, *b; int i; @@ -2247,7 +2247,7 @@ static int dce_v10_0_pick_dig_encoder(struct drm_encoder *encoder) static u32 dce_v10_0_pick_pll(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); u32 pll_in_use; int pll; @@ -2283,7 +2283,7 @@ static u32 dce_v10_0_pick_pll(struct drm_crtc *crtc) static void dce_v10_0_lock_cursor(struct drm_crtc *crtc, bool lock) { - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); uint32_t cur_lock; @@ -2298,7 +2298,7 @@ static void dce_v10_0_lock_cursor(struct drm_crtc *crtc, bool lock) static void dce_v10_0_hide_cursor(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); u32 tmp; tmp = RREG32(mmCUR_CONTROL + amdgpu_crtc->crtc_offset); @@ -2309,7 +2309,7 @@ static void dce_v10_0_hide_cursor(struct drm_crtc *crtc) static void dce_v10_0_show_cursor(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); u32 tmp; WREG32(mmCUR_SURFACE_ADDRESS_HIGH + amdgpu_crtc->crtc_offset, @@ -2327,7 +2327,7 @@ static int dce_v10_0_cursor_move_locked(struct drm_crtc *crtc, int x, int y) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); int xorigin = 0, yorigin = 0; amdgpu_crtc->cursor_x = x; @@ -2500,7 +2500,7 @@ static const struct drm_crtc_funcs dce_v10_0_crtc_funcs = { static void dce_v10_0_crtc_dpms(struct drm_crtc *crtc, int mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); unsigned type; @@ -2554,7 +2554,7 @@ static void dce_v10_0_crtc_commit(struct drm_crtc *crtc) static void dce_v10_0_crtc_disable(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_atom_ss ss; int i; @@ -2635,7 +2635,7 @@ static bool dce_v10_0_crtc_mode_fixup(struct drm_crtc *crtc, struct drm_display_mode *adjusted_mode) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_encoder *encoder; /* assign the encoder to the amdgpu crtc to avoid repeated lookups later */ diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c index c14b70350a51..e9d97d7f3c38 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c @@ -1866,7 +1866,7 @@ static const u32 vga_control_regs[6] = static void dce_v11_0_vga_enable(struct drm_crtc *crtc, bool enable) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); u32 vga_control; @@ -1880,7 +1880,7 @@ static void dce_v11_0_vga_enable(struct drm_crtc *crtc, bool enable) static void dce_v11_0_grph_enable(struct drm_crtc *crtc, bool enable) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); if (enable) @@ -1894,7 +1894,7 @@ static int dce_v11_0_crtc_do_set_base(struct drm_crtc *crtc, int x, int y, int atomic) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct drm_framebuffer *target_fb; struct drm_gem_object *obj; @@ -2138,7 +2138,7 @@ static int dce_v11_0_crtc_do_set_base(struct drm_crtc *crtc, static void dce_v11_0_set_interleave(struct drm_crtc *crtc, struct drm_display_mode *mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); u32 tmp; @@ -2154,7 +2154,7 @@ static void dce_v11_0_set_interleave(struct drm_crtc *crtc, static void dce_v11_0_crtc_load_lut(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); u16 *r, *g, *b; int i; @@ -2280,7 +2280,7 @@ static int dce_v11_0_pick_dig_encoder(struct drm_encoder *encoder) static u32 dce_v11_0_pick_pll(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); u32 pll_in_use; int pll; @@ -2359,7 +2359,7 @@ static u32 dce_v11_0_pick_pll(struct drm_crtc *crtc) static void dce_v11_0_lock_cursor(struct drm_crtc *crtc, bool lock) { - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); uint32_t cur_lock; @@ -2374,7 +2374,7 @@ static void dce_v11_0_lock_cursor(struct drm_crtc *crtc, bool lock) static void dce_v11_0_hide_cursor(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); u32 tmp; tmp = RREG32(mmCUR_CONTROL + amdgpu_crtc->crtc_offset); @@ -2385,7 +2385,7 @@ static void dce_v11_0_hide_cursor(struct drm_crtc *crtc) static void dce_v11_0_show_cursor(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); u32 tmp; WREG32(mmCUR_SURFACE_ADDRESS_HIGH + amdgpu_crtc->crtc_offset, @@ -2403,7 +2403,7 @@ static int dce_v11_0_cursor_move_locked(struct drm_crtc *crtc, int x, int y) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); int xorigin = 0, yorigin = 0; amdgpu_crtc->cursor_x = x; @@ -2576,7 +2576,7 @@ static const struct drm_crtc_funcs dce_v11_0_crtc_funcs = { static void dce_v11_0_crtc_dpms(struct drm_crtc *crtc, int mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); unsigned type; @@ -2630,7 +2630,7 @@ static void dce_v11_0_crtc_commit(struct drm_crtc *crtc) static void dce_v11_0_crtc_disable(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_atom_ss ss; int i; @@ -2700,7 +2700,7 @@ static int dce_v11_0_crtc_mode_set(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *old_fb) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); if (!amdgpu_crtc->adjusted_clock) @@ -2740,7 +2740,7 @@ static bool dce_v11_0_crtc_mode_fixup(struct drm_crtc *crtc, struct drm_display_mode *adjusted_mode) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_encoder *encoder; /* assign the encoder to the amdgpu crtc to avoid repeated lookups later */ diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c index 7f85ba5b726f..e226b57b8ef8 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c @@ -1789,7 +1789,7 @@ static const u32 vga_control_regs[6] = static void dce_v6_0_vga_enable(struct drm_crtc *crtc, bool enable) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); u32 vga_control; @@ -1800,7 +1800,7 @@ static void dce_v6_0_vga_enable(struct drm_crtc *crtc, bool enable) static void dce_v6_0_grph_enable(struct drm_crtc *crtc, bool enable) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); WREG32(mmGRPH_ENABLE + amdgpu_crtc->crtc_offset, enable ? 1 : 0); @@ -1811,7 +1811,7 @@ static int dce_v6_0_crtc_do_set_base(struct drm_crtc *crtc, int x, int y, int atomic) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct drm_framebuffer *target_fb; struct drm_gem_object *obj; @@ -2033,7 +2033,7 @@ static int dce_v6_0_crtc_do_set_base(struct drm_crtc *crtc, static void dce_v6_0_set_interleave(struct drm_crtc *crtc, struct drm_display_mode *mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); @@ -2048,7 +2048,7 @@ static void dce_v6_0_crtc_load_lut(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); u16 *r, *g, *b; int i; @@ -2148,7 +2148,7 @@ static int dce_v6_0_pick_dig_encoder(struct drm_encoder *encoder) static u32 dce_v6_0_pick_pll(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); u32 pll_in_use; int pll; @@ -2178,7 +2178,7 @@ static u32 dce_v6_0_pick_pll(struct drm_crtc *crtc) static void dce_v6_0_lock_cursor(struct drm_crtc *crtc, bool lock) { - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); uint32_t cur_lock; @@ -2193,7 +2193,7 @@ static void dce_v6_0_lock_cursor(struct drm_crtc *crtc, bool lock) static void dce_v6_0_hide_cursor(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); WREG32(mmCUR_CONTROL + amdgpu_crtc->crtc_offset, (CURSOR_24_8_PRE_MULT << CUR_CONTROL__CURSOR_MODE__SHIFT) | @@ -2205,7 +2205,7 @@ static void dce_v6_0_hide_cursor(struct drm_crtc *crtc) static void dce_v6_0_show_cursor(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); WREG32(mmCUR_SURFACE_ADDRESS_HIGH + amdgpu_crtc->crtc_offset, upper_32_bits(amdgpu_crtc->cursor_addr)); @@ -2223,7 +2223,7 @@ static int dce_v6_0_cursor_move_locked(struct drm_crtc *crtc, int x, int y) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); int xorigin = 0, yorigin = 0; int w = amdgpu_crtc->cursor_width; @@ -2397,7 +2397,7 @@ static const struct drm_crtc_funcs dce_v6_0_crtc_funcs = { static void dce_v6_0_crtc_dpms(struct drm_crtc *crtc, int mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); unsigned type; @@ -2447,7 +2447,7 @@ static void dce_v6_0_crtc_disable(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_atom_ss ss; int i; @@ -2528,7 +2528,7 @@ static bool dce_v6_0_crtc_mode_fixup(struct drm_crtc *crtc, { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_encoder *encoder; /* assign the encoder to the amdgpu crtc to avoid repeated lookups later */ diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c index d421a268c9ff..e17b9e3a21fc 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c @@ -1753,7 +1753,7 @@ static const u32 vga_control_regs[6] = static void dce_v8_0_vga_enable(struct drm_crtc *crtc, bool enable) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); u32 vga_control; @@ -1767,7 +1767,7 @@ static void dce_v8_0_vga_enable(struct drm_crtc *crtc, bool enable) static void dce_v8_0_grph_enable(struct drm_crtc *crtc, bool enable) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); if (enable) @@ -1781,7 +1781,7 @@ static int dce_v8_0_crtc_do_set_base(struct drm_crtc *crtc, int x, int y, int atomic) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct drm_framebuffer *target_fb; struct drm_gem_object *obj; @@ -2005,7 +2005,7 @@ static int dce_v8_0_crtc_do_set_base(struct drm_crtc *crtc, static void dce_v8_0_set_interleave(struct drm_crtc *crtc, struct drm_display_mode *mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); @@ -2019,7 +2019,7 @@ static void dce_v8_0_set_interleave(struct drm_crtc *crtc, static void dce_v8_0_crtc_load_lut(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); u16 *r, *g, *b; int i; @@ -2137,7 +2137,7 @@ static int dce_v8_0_pick_dig_encoder(struct drm_encoder *encoder) static u32 dce_v8_0_pick_pll(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); u32 pll_in_use; int pll; @@ -2186,7 +2186,7 @@ static u32 dce_v8_0_pick_pll(struct drm_crtc *crtc) static void dce_v8_0_lock_cursor(struct drm_crtc *crtc, bool lock) { - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); uint32_t cur_lock; @@ -2201,7 +2201,7 @@ static void dce_v8_0_lock_cursor(struct drm_crtc *crtc, bool lock) static void dce_v8_0_hide_cursor(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); WREG32(mmCUR_CONTROL + amdgpu_crtc->crtc_offset, (CURSOR_24_8_PRE_MULT << CUR_CONTROL__CURSOR_MODE__SHIFT) | @@ -2211,7 +2211,7 @@ static void dce_v8_0_hide_cursor(struct drm_crtc *crtc) static void dce_v8_0_show_cursor(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); WREG32(mmCUR_SURFACE_ADDRESS_HIGH + amdgpu_crtc->crtc_offset, upper_32_bits(amdgpu_crtc->cursor_addr)); @@ -2228,7 +2228,7 @@ static int dce_v8_0_cursor_move_locked(struct drm_crtc *crtc, int x, int y) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); int xorigin = 0, yorigin = 0; amdgpu_crtc->cursor_x = x; @@ -2401,7 +2401,7 @@ static const struct drm_crtc_funcs dce_v8_0_crtc_funcs = { static void dce_v8_0_crtc_dpms(struct drm_crtc *crtc, int mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); unsigned type; @@ -2455,7 +2455,7 @@ static void dce_v8_0_crtc_commit(struct drm_crtc *crtc) static void dce_v8_0_crtc_disable(struct drm_crtc *crtc) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_atom_ss ss; int i; @@ -2543,7 +2543,7 @@ static bool dce_v8_0_crtc_mode_fixup(struct drm_crtc *crtc, struct drm_display_mode *adjusted_mode) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_encoder *encoder; /* assign the encoder to the amdgpu crtc to avoid repeated lookups later */ diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 7d48fcddb6da..485a3991820f 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -515,7 +515,7 @@ static void dm_vupdate_high_irq(void *interrupt_params) if (acrtc) { vrr_active = amdgpu_dm_crtc_vrr_active_irq(acrtc); - drm_dev = acrtc->base.dev; + drm_dev = acrtc->base.drm; vblank = &drm_dev->vblank[acrtc->base.index]; previous_timestamp = atomic64_read(&irq_params->previous_timestamp); frame_duration_ns = vblank->time - previous_timestamp; @@ -7771,7 +7771,7 @@ static void remove_stream(struct amdgpu_device *adev, static void prepare_flip_isr(struct amdgpu_crtc *acrtc) { - assert_spin_locked(&acrtc->base.dev->event_lock); + assert_spin_locked(&acrtc->base.drm->event_lock); WARN_ON(acrtc->event); acrtc->event = acrtc->base.state->event; @@ -8190,9 +8190,9 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, * timing control and more opportunity to avoid stutter * on late submission of flips. */ - spin_lock_irqsave(&pcrtc->dev->event_lock, flags); + spin_lock_irqsave(&pcrtc->drm->event_lock, flags); last_flip_vblank = acrtc_attach->dm_irq_params.last_flip_vblank; - spin_unlock_irqrestore(&pcrtc->dev->event_lock, flags); + spin_unlock_irqrestore(&pcrtc->drm->event_lock, flags); } target_vblank = last_flip_vblank + wait_for_vblank; @@ -8224,12 +8224,12 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, acrtc_state->active_planes > 0) { drm_crtc_vblank_get(pcrtc); - spin_lock_irqsave(&pcrtc->dev->event_lock, flags); + spin_lock_irqsave(&pcrtc->drm->event_lock, flags); WARN_ON(acrtc_attach->pflip_status != AMDGPU_FLIP_NONE); prepare_flip_isr(acrtc_attach); - spin_unlock_irqrestore(&pcrtc->dev->event_lock, flags); + spin_unlock_irqrestore(&pcrtc->drm->event_lock, flags); } if (acrtc_state->stream) { @@ -8241,12 +8241,12 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, acrtc_attach->base.state->event) { drm_crtc_vblank_get(pcrtc); - spin_lock_irqsave(&pcrtc->dev->event_lock, flags); + spin_lock_irqsave(&pcrtc->drm->event_lock, flags); acrtc_attach->event = acrtc_attach->base.state->event; acrtc_attach->base.state->event = NULL; - spin_unlock_irqrestore(&pcrtc->dev->event_lock, flags); + spin_unlock_irqrestore(&pcrtc->drm->event_lock, flags); } /* Update the planes if changed or disable if we don't have any. */ @@ -8294,11 +8294,11 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, * as part of commit. */ if (is_dc_timing_adjust_needed(dm_old_crtc_state, acrtc_state)) { - spin_lock_irqsave(&pcrtc->dev->event_lock, flags); + spin_lock_irqsave(&pcrtc->drm->event_lock, flags); dc_stream_adjust_vmin_vmax( dm->dc, acrtc_state->stream, &acrtc_attach->dm_irq_params.vrr_params.adjust); - spin_unlock_irqrestore(&pcrtc->dev->event_lock, flags); + spin_unlock_irqrestore(&pcrtc->drm->event_lock, flags); } mutex_lock(&dm->dc_lock); update_planes_and_stream_adapter(dm->dc, @@ -9597,7 +9597,7 @@ static int dm_check_cursor_fb(struct amdgpu_crtc *new_acrtc, struct drm_plane_state *new_plane_state, struct drm_framebuffer *fb) { - struct amdgpu_device *adev = drm_to_adev(new_acrtc->base.dev); + struct amdgpu_device *adev = drm_to_adev(new_acrtc->base.drm); struct amdgpu_framebuffer *afb = to_amdgpu_framebuffer(fb); unsigned int pitch; bool linear; @@ -9782,7 +9782,7 @@ static int dm_update_plane_state(struct dc *dc, plane->base.id, new_plane_crtc->base.id); ret = fill_dc_plane_attributes( - drm_to_adev(new_plane_crtc->dev), + drm_to_adev(new_plane_crtc->drm), dc_new_plane_state, new_plane_state, new_crtc_state); @@ -9889,7 +9889,7 @@ static int dm_check_crtc_cursor(struct drm_atomic_state *state, if (cursor_scale_w != underlying_scale_w || cursor_scale_h != underlying_scale_h) { - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "Cursor [PLANE:%d:%s] scaling doesn't match underlying [PLANE:%d:%s]\n", cursor->base.id, cursor->name, underlying->base.id, underlying->name); return -EINVAL; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c index 0802f8e8fac5..e073ce7b0a2b 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c @@ -85,7 +85,7 @@ const char *const *amdgpu_dm_crtc_get_crc_sources(struct drm_crtc *crtc, #ifdef CONFIG_DRM_AMD_SECURE_DISPLAY static void amdgpu_dm_set_crc_window_default(struct drm_crtc *crtc, struct dc_stream_state *stream) { - struct drm_device *drm_dev = crtc->dev; + struct drm_device *drm_dev = crtc->drm; struct amdgpu_display_manager *dm = &drm_to_adev(drm_dev)->dm; struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); bool was_activated; @@ -127,7 +127,7 @@ static void amdgpu_dm_crtc_notify_ta_to_read(struct work_struct *work) return; } - psp = &drm_to_adev(crtc->dev)->psp; + psp = &drm_to_adev(crtc->drm)->psp; if (!psp->securedisplay_context.context.initialized) { DRM_DEBUG_DRIVER("Secure Display fails to notify PSP TA\n"); @@ -173,7 +173,7 @@ amdgpu_dm_forward_crc_window(struct work_struct *work) if (!crtc) return; - dm = &drm_to_adev(crtc->dev)->dm; + dm = &drm_to_adev(crtc->drm)->dm; stream = to_amdgpu_crtc(crtc)->dm_irq_params.stream; mutex_lock(&dm->dc_lock); @@ -183,7 +183,7 @@ amdgpu_dm_forward_crc_window(struct work_struct *work) bool amdgpu_dm_crc_window_is_activated(struct drm_crtc *crtc) { - struct drm_device *drm_dev = crtc->dev; + struct drm_device *drm_dev = crtc->drm; struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); bool ret = false; @@ -215,7 +215,7 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc, struct dm_crtc_state *dm_crtc_state, enum amdgpu_dm_pipe_crc_source source) { - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); struct dc_stream_state *stream_state = dm_crtc_state->stream; bool enable = amdgpu_dm_is_valid_crc_source(source); int ret = 0; @@ -259,7 +259,7 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name) enum amdgpu_dm_pipe_crc_source cur_crc_src; struct drm_crtc_commit *commit; struct dm_crtc_state *crtc_state; - struct drm_device *drm_dev = crtc->dev; + struct drm_device *drm_dev = crtc->drm; struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); struct drm_dp_aux *aux = NULL; bool enable = false; @@ -323,7 +323,7 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name) struct drm_connector *connector; struct drm_connector_list_iter conn_iter; - drm_connector_list_iter_begin(crtc->dev, &conn_iter); + drm_connector_list_iter_begin(crtc->drm, &conn_iter); drm_for_each_connector_iter(connector, &conn_iter) { if (!connector->state || connector->state->crtc != crtc) continue; @@ -433,7 +433,7 @@ void amdgpu_dm_crtc_handle_crc_irq(struct drm_crtc *crtc) crtc_state = to_dm_crtc_state(crtc->state); stream_state = crtc_state->stream; acrtc = to_amdgpu_crtc(crtc); - drm_dev = crtc->dev; + drm_dev = crtc->drm; spin_lock_irqsave(&drm_dev->event_lock, flags); cur_crc_src = acrtc->dm_irq_params.crc_src; @@ -478,8 +478,8 @@ void amdgpu_dm_crtc_handle_crc_window_irq(struct drm_crtc *crtc) return; acrtc = to_amdgpu_crtc(crtc); - adev = drm_to_adev(crtc->dev); - drm_dev = crtc->dev; + adev = drm_to_adev(crtc->drm); + drm_dev = crtc->drm; spin_lock_irqsave(&drm_dev->event_lock, flags1); cur_crc_src = acrtc->dm_irq_params.crc_src; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c index 80684dea114e..8bf3172496c1 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c @@ -37,7 +37,7 @@ void amdgpu_dm_crtc_handle_vblank(struct amdgpu_crtc *acrtc) { struct drm_crtc *crtc = &acrtc->base; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned long flags; drm_crtc_handle_vblank(crtc); @@ -74,7 +74,7 @@ int amdgpu_dm_crtc_set_vupdate_irq(struct drm_crtc *crtc, bool enable) { enum dc_irq_source irq_source; struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); int rc; if (acrtc->otg_inst == -1) @@ -147,7 +147,7 @@ static void vblank_control_worker(struct work_struct *work) static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable) { struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); struct dm_crtc_state *acrtc_state = to_dm_crtc_state(crtc->state); struct amdgpu_display_manager *dm = &adev->dm; struct vblank_control_work *work; @@ -372,7 +372,7 @@ static int dm_crtc_helper_atomic_check(struct drm_crtc *crtc, { struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); struct dc *dc = adev->dm.dc; struct dm_crtc_state *dm_crtc_state = to_dm_crtc_state(crtc_state); int ret = -EINVAL; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c index 3b27f3c445a4..8b9b3fff74c7 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c @@ -861,7 +861,7 @@ static int psr_capability_show(struct seq_file *m, void *data) static int amdgpu_current_bpc_show(struct seq_file *m, void *data) { struct drm_crtc *crtc = m->private; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct dm_crtc_state *dm_crtc_state = NULL; int res = -ENODEV; unsigned int bpc; @@ -913,7 +913,7 @@ DEFINE_SHOW_ATTRIBUTE(amdgpu_current_bpc); static int amdgpu_current_colorspace_show(struct seq_file *m, void *data) { struct drm_crtc *crtc = m->private; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct dm_crtc_state *dm_crtc_state = NULL; int res = -ENODEV; @@ -3024,7 +3024,7 @@ void connector_debugfs_init(struct amdgpu_dm_connector *connector) static int crc_win_x_start_set(void *data, u64 val) { struct drm_crtc *crtc = data; - struct drm_device *drm_dev = crtc->dev; + struct drm_device *drm_dev = crtc->drm; struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); spin_lock_irq(&drm_dev->event_lock); @@ -3041,7 +3041,7 @@ static int crc_win_x_start_set(void *data, u64 val) static int crc_win_x_start_get(void *data, u64 *val) { struct drm_crtc *crtc = data; - struct drm_device *drm_dev = crtc->dev; + struct drm_device *drm_dev = crtc->drm; struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); spin_lock_irq(&drm_dev->event_lock); @@ -3061,7 +3061,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(crc_win_x_start_fops, crc_win_x_start_get, static int crc_win_y_start_set(void *data, u64 val) { struct drm_crtc *crtc = data; - struct drm_device *drm_dev = crtc->dev; + struct drm_device *drm_dev = crtc->drm; struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); spin_lock_irq(&drm_dev->event_lock); @@ -3078,7 +3078,7 @@ static int crc_win_y_start_set(void *data, u64 val) static int crc_win_y_start_get(void *data, u64 *val) { struct drm_crtc *crtc = data; - struct drm_device *drm_dev = crtc->dev; + struct drm_device *drm_dev = crtc->drm; struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); spin_lock_irq(&drm_dev->event_lock); @@ -3097,7 +3097,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(crc_win_y_start_fops, crc_win_y_start_get, static int crc_win_x_end_set(void *data, u64 val) { struct drm_crtc *crtc = data; - struct drm_device *drm_dev = crtc->dev; + struct drm_device *drm_dev = crtc->drm; struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); spin_lock_irq(&drm_dev->event_lock); @@ -3114,7 +3114,7 @@ static int crc_win_x_end_set(void *data, u64 val) static int crc_win_x_end_get(void *data, u64 *val) { struct drm_crtc *crtc = data; - struct drm_device *drm_dev = crtc->dev; + struct drm_device *drm_dev = crtc->drm; struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); spin_lock_irq(&drm_dev->event_lock); @@ -3133,7 +3133,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(crc_win_x_end_fops, crc_win_x_end_get, static int crc_win_y_end_set(void *data, u64 val) { struct drm_crtc *crtc = data; - struct drm_device *drm_dev = crtc->dev; + struct drm_device *drm_dev = crtc->drm; struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); spin_lock_irq(&drm_dev->event_lock); @@ -3150,7 +3150,7 @@ static int crc_win_y_end_set(void *data, u64 val) static int crc_win_y_end_get(void *data, u64 *val) { struct drm_crtc *crtc = data; - struct drm_device *drm_dev = crtc->dev; + struct drm_device *drm_dev = crtc->drm; struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); spin_lock_irq(&drm_dev->event_lock); @@ -3169,7 +3169,7 @@ static int crc_win_update_set(void *data, u64 val) { struct drm_crtc *crtc = data; struct amdgpu_crtc *acrtc; - struct amdgpu_device *adev = drm_to_adev(crtc->dev); + struct amdgpu_device *adev = drm_to_adev(crtc->drm); if (val) { acrtc = to_amdgpu_crtc(crtc); diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c index 322668973747..7ea95dfde4e3 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c @@ -1020,7 +1020,7 @@ int amdgpu_dm_plane_helper_check_state(struct drm_plane_state *state, } /* Get min/max allowed scaling factors from plane caps. */ - get_min_max_dc_plane_scaling(state->crtc->dev, fb, + get_min_max_dc_plane_scaling(state->crtc->drm, fb, &min_downscale, &max_upscale); /* * Convert to drm convention: 16.16 fixed point, instead of dc's diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c index cea3fd5772b5..a86286035662 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c @@ -108,7 +108,7 @@ komeda_crtc_atomic_check(struct drm_crtc *crtc, static int komeda_crtc_prepare(struct komeda_crtc *kcrtc) { - struct komeda_dev *mdev = kcrtc->base.dev->dev_private; + struct komeda_dev *mdev = kcrtc->base.drm->dev_private; struct komeda_pipeline *master = kcrtc->master; struct komeda_crtc_state *kcrtc_st = to_kcrtc_st(kcrtc->base.state); struct drm_display_mode *mode = &kcrtc_st->base.adjusted_mode; @@ -161,7 +161,7 @@ komeda_crtc_prepare(struct komeda_crtc *kcrtc) static int komeda_crtc_unprepare(struct komeda_crtc *kcrtc) { - struct komeda_dev *mdev = kcrtc->base.dev->dev_private; + struct komeda_dev *mdev = kcrtc->base.drm->dev_private; struct komeda_pipeline *master = kcrtc->master; u32 new_mode; int err; @@ -220,7 +220,7 @@ void komeda_crtc_handle_event(struct komeda_crtc *kcrtc, unsigned long flags; struct drm_pending_vblank_event *event; - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); if (kcrtc->disable_done) { complete_all(kcrtc->disable_done); kcrtc->disable_done = NULL; @@ -236,7 +236,7 @@ void komeda_crtc_handle_event(struct komeda_crtc *kcrtc, DRM_WARN("CRTC[%d]: FLIP happened but no pending commit.\n", drm_crtc_index(&kcrtc->base)); } - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); } } @@ -246,7 +246,7 @@ komeda_crtc_do_flush(struct drm_crtc *crtc, { struct komeda_crtc *kcrtc = to_kcrtc(crtc); struct komeda_crtc_state *kcrtc_st = to_kcrtc_st(crtc->state); - struct komeda_dev *mdev = kcrtc->base.dev->dev_private; + struct komeda_dev *mdev = kcrtc->base.drm->dev_private; struct komeda_pipeline *master = kcrtc->master; struct komeda_pipeline *slave = kcrtc->slave; struct komeda_wb_connector *wb_conn = kcrtc->wb_conn; @@ -277,7 +277,7 @@ komeda_crtc_atomic_enable(struct drm_crtc *crtc, { struct drm_crtc_state *old = drm_atomic_get_old_crtc_state(state, crtc); - pm_runtime_get_sync(crtc->dev->dev); + pm_runtime_get_sync(crtc->drm->dev); komeda_crtc_prepare(to_kcrtc(crtc)); drm_crtc_vblank_on(crtc); WARN_ON(drm_crtc_vblank_get(crtc)); @@ -288,7 +288,7 @@ void komeda_crtc_flush_and_wait_for_flip_done(struct komeda_crtc *kcrtc, struct completion *input_flip_done) { - struct drm_device *drm = kcrtc->base.dev; + struct drm_device *drm = kcrtc->base.drm; struct komeda_dev *mdev = kcrtc->master->mdev; struct completion *flip_done; struct completion temp; @@ -378,7 +378,7 @@ komeda_crtc_atomic_disable(struct drm_crtc *crtc, drm_crtc_vblank_put(crtc); drm_crtc_vblank_off(crtc); komeda_crtc_unprepare(kcrtc); - pm_runtime_put(crtc->dev->dev); + pm_runtime_put(crtc->drm->dev); } static void @@ -414,7 +414,7 @@ komeda_calc_min_aclk_rate(struct komeda_crtc *kcrtc, unsigned long komeda_crtc_get_aclk(struct komeda_crtc_state *kcrtc_st) { struct drm_crtc *crtc = kcrtc_st->base.crtc; - struct komeda_dev *mdev = crtc->dev->dev_private; + struct komeda_dev *mdev = crtc->drm->dev_private; unsigned long pxlclk = kcrtc_st->base.adjusted_mode.crtc_clock * 1000; unsigned long min_aclk; @@ -426,7 +426,7 @@ unsigned long komeda_crtc_get_aclk(struct komeda_crtc_state *kcrtc_st) static enum drm_mode_status komeda_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *m) { - struct komeda_dev *mdev = crtc->dev->dev_private; + struct komeda_dev *mdev = crtc->drm->dev_private; struct komeda_crtc *kcrtc = to_kcrtc(crtc); struct komeda_pipeline *master = kcrtc->master; unsigned long min_pxlclk, min_aclk; @@ -532,7 +532,7 @@ static void komeda_crtc_atomic_destroy_state(struct drm_crtc *crtc, static int komeda_crtc_vblank_enable(struct drm_crtc *crtc) { - struct komeda_dev *mdev = crtc->dev->dev_private; + struct komeda_dev *mdev = crtc->drm->dev_private; struct komeda_crtc *kcrtc = to_kcrtc(crtc); mdev->funcs->on_off_vblank(mdev, kcrtc->master->id, true); @@ -541,7 +541,7 @@ static int komeda_crtc_vblank_enable(struct drm_crtc *crtc) static void komeda_crtc_vblank_disable(struct drm_crtc *crtc) { - struct komeda_dev *mdev = crtc->dev->dev_private; + struct komeda_dev *mdev = crtc->drm->dev_private; struct komeda_crtc *kcrtc = to_kcrtc(crtc); mdev->funcs->on_off_vblank(mdev, kcrtc->master->id, false); diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c index dd3c455bb1bb..669d11ac34f0 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c @@ -168,7 +168,7 @@ static int komeda_crtc_normalize_zpos(struct drm_crtc *crtc, INIT_LIST_HEAD(&zorder_list); /* This loop also added all effected planes into the new state */ - drm_for_each_plane_mask(plane, crtc->dev, crtc_st->plane_mask) { + drm_for_each_plane_mask(plane, crtc->drm, crtc_st->plane_mask) { plane_st = drm_atomic_get_plane_state(state, plane); if (IS_ERR(plane_st)) return PTR_ERR(plane_st); diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index 3cfefadc7c9d..f7f2d101d476 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -211,12 +211,12 @@ static void hdlcd_crtc_atomic_begin(struct drm_crtc *crtc, if (event) { crtc->state->event = NULL; - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (drm_crtc_vblank_get(crtc) == 0) drm_crtc_arm_vblank_event(crtc, event); else drm_crtc_send_vblank_event(crtc, event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } } diff --git a/drivers/gpu/drm/arm/malidp_crtc.c b/drivers/gpu/drm/arm/malidp_crtc.c index dc01c43f6193..f09de55d8a20 100644 --- a/drivers/gpu/drm/arm/malidp_crtc.c +++ b/drivers/gpu/drm/arm/malidp_crtc.c @@ -52,7 +52,7 @@ static void malidp_crtc_atomic_enable(struct drm_crtc *crtc, struct malidp_drm *malidp = crtc_to_malidp_device(crtc); struct malidp_hw_device *hwdev = malidp->dev; struct videomode vm; - int err = pm_runtime_get_sync(crtc->dev->dev); + int err = pm_runtime_get_sync(crtc->drm->dev); if (err < 0) { DRM_DEBUG_DRIVER("Failed to enable runtime power management: %d\n", err); @@ -87,7 +87,7 @@ static void malidp_crtc_atomic_disable(struct drm_crtc *crtc, clk_disable_unprepare(hwdev->pxlclk); - err = pm_runtime_put(crtc->dev->dev); + err = pm_runtime_put(crtc->drm->dev); if (err < 0) { DRM_DEBUG_DRIVER("Failed to disable runtime power management: %d\n", err); } @@ -186,7 +186,7 @@ static int malidp_crtc_atomic_check_gamma(struct drm_crtc *crtc, * changing the gamma LUT doesn't depend on any external * resources, it is safe to call it only once. */ - ret = drm_atomic_helper_check_modeset(crtc->dev, state->state); + ret = drm_atomic_helper_check_modeset(crtc->drm, state->state); if (ret) return ret; } diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index 15dd667aa2e7..6ae3e1c2f677 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c @@ -293,9 +293,9 @@ static void armada_drm_crtc_irq(struct armada_crtc *dcrtc, u32 stat) if (stat & VSYNC_IRQ && !dcrtc->update_pending) { event = xchg(&dcrtc->event, NULL); if (event) { - spin_lock(&dcrtc->crtc.dev->event_lock); + spin_lock(&dcrtc->crtc.drm->event_lock); drm_crtc_send_vblank_event(&dcrtc->crtc, event); - spin_unlock(&dcrtc->crtc.dev->event_lock); + spin_unlock(&dcrtc->crtc.drm->event_lock); drm_crtc_vblank_put(&dcrtc->crtc); } } @@ -502,9 +502,9 @@ static void armada_drm_crtc_atomic_disable(struct drm_crtc *crtc, event = crtc->state->event; crtc->state->event = NULL; if (event) { - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); drm_crtc_send_vblank_event(crtc, event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } } } @@ -766,7 +766,7 @@ static int armada_drm_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) static void armada_drm_crtc_destroy(struct drm_crtc *crtc) { struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc); - struct armada_private *priv = drm_to_armada_dev(crtc->dev); + struct armada_private *priv = drm_to_armada_dev(crtc->drm); if (dcrtc->cursor_obj) drm_gem_object_put(&dcrtc->cursor_obj->obj); diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c b/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c index 7877a57b8e26..41f6454d15bf 100644 --- a/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c @@ -26,7 +26,7 @@ drm_pipe_to_aspeed_gfx(struct drm_simple_display_pipe *pipe) static int aspeed_gfx_set_pixel_fmt(struct aspeed_gfx *priv, u32 *bpp) { struct drm_crtc *crtc = &priv->pipe.crtc; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; const u32 format = crtc->primary->state->fb->format->format; u32 ctrl1; @@ -169,7 +169,7 @@ static void aspeed_gfx_pipe_update(struct drm_simple_display_pipe *pipe, struct drm_pending_vblank_event *event; struct drm_gem_dma_object *gem; - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); event = crtc->state->event; if (event) { crtc->state->event = NULL; @@ -179,7 +179,7 @@ static void aspeed_gfx_pipe_update(struct drm_simple_display_pipe *pipe, else drm_crtc_send_vblank_event(crtc, event); } - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); if (!fb) return; diff --git a/drivers/gpu/drm/ast/ast_dp.c b/drivers/gpu/drm/ast/ast_dp.c index 6dc1a09504e1..460b560ccb0f 100644 --- a/drivers/gpu/drm/ast/ast_dp.c +++ b/drivers/gpu/drm/ast/ast_dp.c @@ -187,7 +187,7 @@ void ast_dp_set_on_off(struct drm_device *dev, bool on) void ast_dp_set_mode(struct drm_crtc *crtc, struct ast_vbios_mode_info *vbios_mode) { - struct ast_device *ast = to_ast_device(crtc->dev); + struct ast_device *ast = to_ast_device(crtc->drm); u32 ulRefreshRateIndex; u8 ModeIdx; diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index 31a3e590395e..bfbdc03c1ac9 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -1003,7 +1003,7 @@ static int ast_cursor_plane_init(struct ast_device *ast) static void ast_crtc_dpms(struct drm_crtc *crtc, int mode) { - struct ast_device *ast = to_ast_device(crtc->dev); + struct ast_device *ast = to_ast_device(crtc->drm); u8 ch = AST_DPMS_VSYNC_OFF | AST_DPMS_HSYNC_OFF; struct ast_crtc_state *ast_state; const struct drm_format_info *format; @@ -1017,12 +1017,12 @@ static void ast_crtc_dpms(struct drm_crtc *crtc, int mode) ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x01, 0xdf, 0); ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb6, 0xfc, 0); if (ast->tx_chip_types & AST_TX_DP501_BIT) - ast_set_dp501_video_output(crtc->dev, 1); + ast_set_dp501_video_output(crtc->drm, 1); if (ast->tx_chip_types & AST_TX_ASTDP_BIT) { - ast_dp_power_on_off(crtc->dev, AST_DP_POWER_ON); + ast_dp_power_on_off(crtc->drm, AST_DP_POWER_ON); ast_wait_for_vretrace(ast); - ast_dp_set_on_off(crtc->dev, 1); + ast_dp_set_on_off(crtc->drm, 1); } ast_state = to_ast_crtc_state(crtc->state); @@ -1044,11 +1044,11 @@ static void ast_crtc_dpms(struct drm_crtc *crtc, int mode) case DRM_MODE_DPMS_OFF: ch = mode; if (ast->tx_chip_types & AST_TX_DP501_BIT) - ast_set_dp501_video_output(crtc->dev, 0); + ast_set_dp501_video_output(crtc->drm, 0); if (ast->tx_chip_types & AST_TX_ASTDP_BIT) { - ast_dp_set_on_off(crtc->dev, 0); - ast_dp_power_on_off(crtc->dev, AST_DP_POWER_OFF); + ast_dp_set_on_off(crtc->drm, 0); + ast_dp_power_on_off(crtc->drm, AST_DP_POWER_OFF); } ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x01, 0xdf, 0x20); @@ -1060,7 +1060,7 @@ static void ast_crtc_dpms(struct drm_crtc *crtc, int mode) static enum drm_mode_status ast_crtc_helper_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode) { - struct ast_device *ast = to_ast_device(crtc->dev); + struct ast_device *ast = to_ast_device(crtc->drm); enum drm_mode_status status; uint32_t jtemp; @@ -1135,7 +1135,7 @@ static int ast_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc); struct ast_crtc_state *old_ast_crtc_state = to_ast_crtc_state(old_crtc_state); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct ast_crtc_state *ast_state; const struct drm_format_info *format; bool succ; @@ -1185,7 +1185,7 @@ ast_crtc_helper_atomic_flush(struct drm_crtc *crtc, { struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct ast_device *ast = to_ast_device(dev); struct ast_crtc_state *ast_crtc_state = to_ast_crtc_state(crtc_state); struct ast_vbios_mode_info *vbios_mode_info = &ast_crtc_state->vbios_mode_info; @@ -1210,7 +1210,7 @@ ast_crtc_helper_atomic_flush(struct drm_crtc *crtc, static void ast_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct ast_device *ast = to_ast_device(dev); struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); struct ast_crtc_state *ast_crtc_state = to_ast_crtc_state(crtc_state); @@ -1232,7 +1232,7 @@ static void ast_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atom static void ast_crtc_helper_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state) { struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct ast_device *ast = to_ast_device(dev); ast_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); @@ -1282,7 +1282,7 @@ static struct drm_crtc_state * ast_crtc_atomic_duplicate_state(struct drm_crtc *crtc) { struct ast_crtc_state *new_ast_state, *ast_state; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; if (drm_WARN_ON(dev, !crtc->state)) return NULL; diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index 58184cd6ab0b..2dbdf16e4b9d 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@ -168,7 +168,7 @@ atmel_hlcdc_crtc_mode_valid(struct drm_crtc *c, static void atmel_hlcdc_crtc_atomic_disable(struct drm_crtc *c, struct drm_atomic_state *state) { - struct drm_device *dev = c->dev; + struct drm_device *dev = c->drm; struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); struct regmap *regmap = crtc->dc->hlcdc->regmap; unsigned int status; @@ -203,7 +203,7 @@ static void atmel_hlcdc_crtc_atomic_disable(struct drm_crtc *c, static void atmel_hlcdc_crtc_atomic_enable(struct drm_crtc *c, struct drm_atomic_state *state) { - struct drm_device *dev = c->dev; + struct drm_device *dev = c->drm; struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); struct regmap *regmap = crtc->dc->hlcdc->regmap; unsigned int status; @@ -353,7 +353,7 @@ static void atmel_hlcdc_crtc_atomic_flush(struct drm_crtc *c, struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); unsigned long flags; - spin_lock_irqsave(&c->dev->event_lock, flags); + spin_lock_irqsave(&c->drm->event_lock, flags); if (c->state->event) { c->state->event->pipe = drm_crtc_index(c); @@ -363,7 +363,7 @@ static void atmel_hlcdc_crtc_atomic_flush(struct drm_crtc *c, crtc->event = c->state->event; c->state->event = NULL; } - spin_unlock_irqrestore(&c->dev->event_lock, flags); + spin_unlock_irqrestore(&c->drm->event_lock, flags); } static const struct drm_crtc_helper_funcs lcdc_crtc_helper_funcs = { @@ -386,7 +386,7 @@ static void atmel_hlcdc_crtc_destroy(struct drm_crtc *c) static void atmel_hlcdc_crtc_finish_page_flip(struct atmel_hlcdc_crtc *crtc) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; unsigned long flags; spin_lock_irqsave(&dev->event_lock, flags); diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index f473848d5ecb..8c2ebb982972 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -76,7 +76,7 @@ int drm_crtc_commit_wait(struct drm_crtc_commit *commit) ret = wait_for_completion_timeout(&commit->hw_done, timeout); if (!ret) { - drm_err(commit->crtc->dev, "hw_done timed out\n"); + drm_err(commit->crtc->drm, "hw_done timed out\n"); return -ETIMEDOUT; } @@ -86,7 +86,7 @@ int drm_crtc_commit_wait(struct drm_crtc_commit *commit) */ ret = wait_for_completion_timeout(&commit->flip_done, timeout); if (!ret) { - drm_err(commit->crtc->dev, "flip_done timed out\n"); + drm_err(commit->crtc->drm, "flip_done timed out\n"); return -ETIMEDOUT; } @@ -381,7 +381,7 @@ static int drm_atomic_crtc_check(const struct drm_crtc_state *old_crtc_state, */ if (new_crtc_state->active && !new_crtc_state->enable) { - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "[CRTC:%d:%s] active without enabled\n", crtc->base.id, crtc->name); return -EINVAL; @@ -391,17 +391,17 @@ static int drm_atomic_crtc_check(const struct drm_crtc_state *old_crtc_state, * as this is a kernel-internal detail that userspace should never * be able to trigger. */ - if (drm_core_check_feature(crtc->dev, DRIVER_ATOMIC) && + if (drm_core_check_feature(crtc->drm, DRIVER_ATOMIC) && WARN_ON(new_crtc_state->enable && !new_crtc_state->mode_blob)) { - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "[CRTC:%d:%s] enabled without mode blob\n", crtc->base.id, crtc->name); return -EINVAL; } - if (drm_core_check_feature(crtc->dev, DRIVER_ATOMIC) && + if (drm_core_check_feature(crtc->drm, DRIVER_ATOMIC) && WARN_ON(!new_crtc_state->enable && new_crtc_state->mode_blob)) { - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "[CRTC:%d:%s] disabled with mode blob\n", crtc->base.id, crtc->name); return -EINVAL; @@ -419,7 +419,7 @@ static int drm_atomic_crtc_check(const struct drm_crtc_state *old_crtc_state, */ if (new_crtc_state->event && !new_crtc_state->active && !old_crtc_state->active) { - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "[CRTC:%d:%s] requesting event but off\n", crtc->base.id, crtc->name); return -EINVAL; @@ -1295,7 +1295,7 @@ drm_atomic_add_affected_connectors(struct drm_atomic_state *state, if (ret) return ret; - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "Adding all current connectors for [CRTC:%d:%s] to %p\n", crtc->base.id, crtc->name, state); @@ -1350,7 +1350,7 @@ drm_atomic_add_affected_planes(struct drm_atomic_state *state, WARN_ON(!drm_atomic_get_new_crtc_state(state, crtc)); - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "Adding all current planes for [CRTC:%d:%s] to %p\n", crtc->base.id, crtc->name, state); @@ -1562,7 +1562,7 @@ EXPORT_SYMBOL(__drm_atomic_helper_disable_plane); static int update_output_state(struct drm_atomic_state *state, struct drm_mode_set *set) { - struct drm_device *dev = set->crtc->dev; + struct drm_device *dev = set->crtc->drm; struct drm_crtc *crtc; struct drm_crtc_state *new_crtc_state; struct drm_connector *connector; diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 98c9377aeef5..9828f630fdd2 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -494,7 +494,8 @@ mode_fixup(struct drm_atomic_state *state) ret = funcs->mode_fixup(crtc, &new_crtc_state->mode, &new_crtc_state->adjusted_mode); if (!ret) { - drm_dbg_atomic(crtc->dev, "[CRTC:%d:%s] fixup failed\n", + drm_dbg_atomic(crtc->drm, + "[CRTC:%d:%s] fixup failed\n", crtc->base.id, crtc->name); return -EINVAL; } @@ -941,7 +942,7 @@ EXPORT_SYMBOL(drm_atomic_helper_check_plane_state); int drm_atomic_helper_check_crtc_primary_plane(struct drm_crtc_state *crtc_state) { struct drm_crtc *crtc = crtc_state->crtc; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_plane *plane; /* needs at least one primary plane to be enabled */ @@ -1015,7 +1016,7 @@ drm_atomic_helper_check_planes(struct drm_device *dev, ret = funcs->atomic_check(crtc, state); if (ret) { - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "[CRTC:%d:%s] atomic driver check failed\n", crtc->base.id, crtc->name); return ret; @@ -2141,7 +2142,7 @@ static int stall_checks(struct drm_crtc *crtc, bool nonblock) */ if (!completed && nonblock) { spin_unlock(&crtc->commit_lock); - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "[CRTC:%d:%s] busy with a previous commit\n", crtc->base.id, crtc->name); @@ -2165,7 +2166,7 @@ static int stall_checks(struct drm_crtc *crtc, bool nonblock) ret = wait_for_completion_interruptible_timeout(&stall_commit->cleanup_done, 10*HZ); if (ret == 0) - drm_err(crtc->dev, "[CRTC:%d:%s] cleanup_done timed out\n", + drm_err(crtc->drm, "[CRTC:%d:%s] cleanup_done timed out\n", crtc->base.id, crtc->name); drm_crtc_commit_put(stall_commit); @@ -2400,7 +2401,7 @@ void drm_atomic_helper_wait_for_dependencies(struct drm_atomic_state *old_state) for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) { ret = drm_crtc_commit_wait(old_crtc_state->commit); if (ret) - drm_err(crtc->dev, + drm_err(crtc->drm, "[CRTC:%d:%s] commit wait timed out\n", crtc->base.id, crtc->name); } @@ -2815,7 +2816,7 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state) if (crtc_funcs && crtc_funcs->atomic_begin) crtc_funcs->atomic_begin(crtc, old_state); - drm_for_each_plane_mask(plane, crtc->dev, plane_mask) { + drm_for_each_plane_mask(plane, crtc->drm, plane_mask) { struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(old_state, plane); struct drm_plane_state *new_plane_state = @@ -3220,7 +3221,7 @@ int drm_atomic_helper_set_config(struct drm_mode_set *set, struct drm_crtc *crtc = set->crtc; int ret = 0; - state = drm_atomic_state_alloc(crtc->dev); + state = drm_atomic_state_alloc(crtc->drm); if (!state) return -ENOMEM; @@ -3607,7 +3608,7 @@ static int page_flip_common(struct drm_atomic_state *state, /* Make sure we don't accidentally do a full modeset. */ state->allow_modeset = false; if (!crtc_state->active) { - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "[CRTC:%d:%s] disabled, rejecting legacy flip\n", crtc->base.id, crtc->name); return -EINVAL; diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c index c551dad67694..38ad8c8e6216 100644 --- a/drivers/gpu/drm/drm_atomic_state_helper.c +++ b/drivers/gpu/drm/drm_atomic_state_helper.c @@ -96,7 +96,7 @@ __drm_atomic_helper_crtc_reset(struct drm_crtc *crtc, if (crtc_state) __drm_atomic_helper_crtc_state_reset(crtc_state, crtc); - if (drm_dev_has_vblank(crtc->dev)) + if (drm_dev_has_vblank(crtc->drm)) drm_crtc_vblank_reset(crtc); crtc->state = crtc_state; diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index 84133002e46c..38a5f69f0c9c 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -80,7 +80,7 @@ int drm_atomic_set_mode_for_crtc(struct drm_crtc_state *state, struct drm_property_blob *blob; drm_mode_convert_to_umode(&umode, mode); - blob = drm_property_create_blob(crtc->dev, + blob = drm_property_create_blob(crtc->drm, sizeof(umode), &umode); if (IS_ERR(blob)) return PTR_ERR(blob); @@ -89,13 +89,13 @@ int drm_atomic_set_mode_for_crtc(struct drm_crtc_state *state, state->mode_blob = blob; state->enable = true; - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "Set [MODE:%s] for [CRTC:%d:%s] state %p\n", mode->name, crtc->base.id, crtc->name, state); } else { memset(&state->mode, 0, sizeof(state->mode)); state->enable = false; - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "Set [NOMODE] for [CRTC:%d:%s] state %p\n", crtc->base.id, crtc->name, state); } @@ -134,17 +134,17 @@ int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *state, int ret; if (blob->length != sizeof(struct drm_mode_modeinfo)) { - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "[CRTC:%d:%s] bad mode blob length: %zu\n", crtc->base.id, crtc->name, blob->length); return -EINVAL; } - ret = drm_mode_convert_umode(crtc->dev, + ret = drm_mode_convert_umode(crtc->drm, &state->mode, blob->data); if (ret) { - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "[CRTC:%d:%s] invalid mode (ret=%d, status=%s):\n", crtc->base.id, crtc->name, ret, drm_get_mode_status_name(state->mode.status)); @@ -154,13 +154,13 @@ int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *state, state->mode_blob = drm_property_blob_get(blob); state->enable = true; - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "Set [MODE:%s] for [CRTC:%d:%s] state %p\n", state->mode.name, crtc->base.id, crtc->name, state); } else { state->enable = false; - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "Set [NOMODE] for [CRTC:%d:%s] state %p\n", crtc->base.id, crtc->name, state); } @@ -408,7 +408,7 @@ static int drm_atomic_crtc_set_property(struct drm_crtc *crtc, struct drm_crtc_state *state, struct drm_property *property, uint64_t val) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_mode_config *config = &dev->mode_config; bool replaced = false; int ret; @@ -462,7 +462,7 @@ static int drm_atomic_crtc_set_property(struct drm_crtc *crtc, } else if (crtc->funcs->atomic_set_property) { return crtc->funcs->atomic_set_property(crtc, state, property, val); } else { - drm_dbg_atomic(crtc->dev, + drm_dbg_atomic(crtc->drm, "[CRTC:%d:%s] unknown property [PROP:%d:%s]\n", crtc->base.id, crtc->name, property->base.id, property->name); @@ -477,7 +477,7 @@ drm_atomic_crtc_get_property(struct drm_crtc *crtc, const struct drm_crtc_state *state, struct drm_property *property, uint64_t *val) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_mode_config *config = &dev->mode_config; if (property == config->prop_active) diff --git a/drivers/gpu/drm/drm_blend.c b/drivers/gpu/drm/drm_blend.c index 6e74de833466..c390b8924e95 100644 --- a/drivers/gpu/drm/drm_blend.c +++ b/drivers/gpu/drm/drm_blend.c @@ -443,7 +443,7 @@ static int drm_atomic_helper_crtc_normalize_zpos(struct drm_crtc *crtc, struct drm_crtc_state *crtc_state) { struct drm_atomic_state *state = crtc_state->state; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; int total_planes = dev->mode_config.num_total_plane; struct drm_plane_state **states; struct drm_plane *plane; diff --git a/drivers/gpu/drm/drm_color_mgmt.c b/drivers/gpu/drm/drm_color_mgmt.c index d021497841b8..2a437d84e531 100644 --- a/drivers/gpu/drm/drm_color_mgmt.c +++ b/drivers/gpu/drm/drm_color_mgmt.c @@ -166,7 +166,7 @@ void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc, bool has_ctm, uint gamma_lut_size) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_mode_config *config = &dev->mode_config; if (degamma_lut_size) { @@ -241,8 +241,8 @@ EXPORT_SYMBOL(drm_mode_crtc_set_gamma_size); */ static bool drm_crtc_supports_legacy_gamma(struct drm_crtc *crtc) { - u32 gamma_id = crtc->dev->mode_config.gamma_lut_property->base.id; - u32 degamma_id = crtc->dev->mode_config.degamma_lut_property->base.id; + u32 gamma_id = crtc->drm->mode_config.gamma_lut_property->base.id; + u32 degamma_id = crtc->drm->mode_config.degamma_lut_property->base.id; if (!crtc->gamma_size) return false; @@ -277,7 +277,7 @@ static int drm_crtc_legacy_gamma_set(struct drm_crtc *crtc, u32 size, struct drm_modeset_acquire_ctx *ctx) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_atomic_state *state; struct drm_crtc_state *crtc_state; struct drm_property_blob *blob; @@ -298,7 +298,7 @@ static int drm_crtc_legacy_gamma_set(struct drm_crtc *crtc, else return -ENODEV; - state = drm_atomic_state_alloc(crtc->dev); + state = drm_atomic_state_alloc(crtc->drm); if (!state) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index df9bf3c9206e..9a590b13a5cc 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -102,7 +102,7 @@ int drm_crtc_force_disable(struct drm_crtc *crtc) .crtc = crtc, }; - WARN_ON(drm_drv_uses_atomic_modeset(crtc->dev)); + WARN_ON(drm_drv_uses_atomic_modeset(crtc->drm)); return drm_mode_set_config_internal(&set); } @@ -178,7 +178,7 @@ static const char *drm_crtc_fence_get_driver_name(struct dma_fence *fence) { struct drm_crtc *crtc = fence_to_crtc(fence); - return crtc->dev->driver->name; + return crtc->drm->driver->name; } static const char *drm_crtc_fence_get_timeline_name(struct dma_fence *fence) @@ -264,7 +264,7 @@ static int __drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc * (!funcs->atomic_destroy_state || !funcs->atomic_duplicate_state)); - crtc->dev = dev; + crtc->drm = dev; crtc->funcs = funcs; INIT_LIST_HEAD(&crtc->commit_list); @@ -495,7 +495,7 @@ EXPORT_SYMBOL(__drmm_crtc_alloc_with_planes); */ void drm_crtc_cleanup(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; /* Note that the crtc_list is considered to be static; should we * remove the drm_crtc at runtime we would have to decrement all @@ -603,14 +603,14 @@ static int __drm_mode_set_config_internal(struct drm_mode_set *set, struct drm_crtc *tmp; int ret; - WARN_ON(drm_drv_uses_atomic_modeset(crtc->dev)); + WARN_ON(drm_drv_uses_atomic_modeset(crtc->drm)); /* * NOTE: ->set_config can also disable other crtcs (if we steal all * connectors from it), hence we need to refcount the fbs across all * crtcs. Atomic modeset will have saner semantics ... */ - drm_for_each_crtc(tmp, crtc->dev) { + drm_for_each_crtc(tmp, crtc->drm) { struct drm_plane *plane = tmp->primary; plane->old_fb = plane->fb; @@ -626,7 +626,7 @@ static int __drm_mode_set_config_internal(struct drm_mode_set *set, plane->fb = fb; } - drm_for_each_crtc(tmp, crtc->dev) { + drm_for_each_crtc(tmp, crtc->drm) { struct drm_plane *plane = tmp->primary; if (plane->fb) @@ -654,7 +654,7 @@ static int __drm_mode_set_config_internal(struct drm_mode_set *set, */ int drm_mode_set_config_internal(struct drm_mode_set *set) { - WARN_ON(drm_drv_uses_atomic_modeset(set->crtc->dev)); + WARN_ON(drm_drv_uses_atomic_modeset(set->crtc->drm)); return __drm_mode_set_config_internal(set, NULL); } @@ -943,7 +943,7 @@ int drm_crtc_create_scaling_filter_property(struct drm_crtc *crtc, unsigned int supported_filters) { struct drm_property *prop = - drm_create_scaling_filter_prop(crtc->dev, supported_filters); + drm_create_scaling_filter_prop(crtc->drm, supported_filters); if (IS_ERR(prop)) return PTR_ERR(prop); diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 320c3f8690cb..d610c9e740d0 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -148,7 +148,7 @@ EXPORT_SYMBOL(drm_helper_encoder_in_use); bool drm_helper_crtc_in_use(struct drm_crtc *crtc) { struct drm_encoder *encoder; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; WARN_ON(drm_drv_uses_atomic_modeset(dev)); @@ -285,7 +285,7 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *old_fb) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_display_mode *adjusted_mode, saved_mode, saved_hwmode; const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; const struct drm_encoder_helper_funcs *encoder_funcs; @@ -462,7 +462,7 @@ EXPORT_SYMBOL(drm_crtc_helper_atomic_check); static void drm_crtc_helper_disable(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_connector *connector; struct drm_encoder *encoder; @@ -579,7 +579,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, crtc_funcs = set->crtc->helper_private; - dev = set->crtc->dev; + dev = set->crtc->drm; WARN_ON(drm_drv_uses_atomic_modeset(dev)); if (!set->mode) @@ -869,7 +869,7 @@ static int drm_helper_choose_crtc_dpms(struct drm_crtc *crtc) int dpms = DRM_MODE_DPMS_OFF; struct drm_connector *connector; struct drm_connector_list_iter conn_iter; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; drm_connector_list_iter_begin(dev, &conn_iter); drm_for_each_connector_iter(connector, &conn_iter) diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index f18d2af96db7..3a70ac678e8f 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -539,7 +539,7 @@ void drm_debugfs_connector_remove(struct drm_connector *connector) void drm_debugfs_crtc_add(struct drm_crtc *crtc) { - struct drm_minor *minor = crtc->dev->primary; + struct drm_minor *minor = crtc->drm->primary; struct dentry *root; char *name; diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c index bbc3bc4ba844..1a6bb8d6240f 100644 --- a/drivers/gpu/drm/drm_debugfs_crc.c +++ b/drivers/gpu/drm/drm_debugfs_crc.c @@ -200,7 +200,7 @@ static int crtc_crc_open(struct inode *inode, struct file *filep) size_t values_cnt; int ret = 0; - if (drm_drv_uses_atomic_modeset(crtc->dev)) { + if (drm_drv_uses_atomic_modeset(crtc->drm)) { ret = drm_modeset_lock_single_interruptible(&crtc->mutex); if (ret) return ret; diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 61a5d450cc20..a8a307c1f40d 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -166,7 +166,7 @@ int drm_fb_helper_debug_enter(struct fb_info *info) if (funcs->mode_set_base_atomic == NULL) continue; - if (drm_drv_uses_atomic_modeset(mode_set->crtc->dev)) + if (drm_drv_uses_atomic_modeset(mode_set->crtc->drm)) continue; funcs->mode_set_base_atomic(mode_set->crtc, @@ -199,7 +199,7 @@ int drm_fb_helper_debug_leave(struct fb_info *info) mutex_lock(&client->modeset_mutex); drm_client_for_each_modeset(mode_set, client) { crtc = mode_set->crtc; - if (drm_drv_uses_atomic_modeset(crtc->dev)) + if (drm_drv_uses_atomic_modeset(crtc->drm)) continue; funcs = crtc->helper_private; @@ -873,7 +873,7 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info) static struct drm_property_blob *setcmap_new_gamma_lut(struct drm_crtc *crtc, struct fb_cmap *cmap) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_property_blob *gamma_lut; struct drm_color_lut *lut; int size = crtc->gamma_size; diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index e13461bdb562..bd8a3802583f 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -299,7 +299,7 @@ static void mipi_dbi_fb_dirty(struct iosys_map *src, struct drm_framebuffer *fb, enum drm_mode_status mipi_dbi_pipe_mode_valid(struct drm_simple_display_pipe *pipe, const struct drm_display_mode *mode) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.drm); return drm_crtc_helper_mode_valid_fixed(&pipe->crtc, mode, &dbidev->mode); } @@ -406,7 +406,7 @@ static void mipi_dbi_blank(struct mipi_dbi_dev *dbidev) */ void mipi_dbi_pipe_disable(struct drm_simple_display_pipe *pipe) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.drm); DRM_DEBUG_KMS("\n"); diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index 24e7998d1731..1cff3c23c2a1 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -1021,7 +1021,7 @@ static int drm_mode_cursor_universal(struct drm_crtc *crtc, struct drm_file *file_priv, struct drm_modeset_acquire_ctx *ctx) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_plane *plane = crtc->cursor; struct drm_framebuffer *fb = NULL; struct drm_mode_fb_cmd2 fbreq = { diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c index c91e454eba09..d26c99fa7aee 100644 --- a/drivers/gpu/drm/drm_plane_helper.c +++ b/drivers/gpu/drm/drm_plane_helper.c @@ -73,7 +73,7 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc, struct drm_connector **connector_list, int num_connectors) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_connector *connector; struct drm_connector_list_iter conn_iter; int count = 0; diff --git a/drivers/gpu/drm/drm_self_refresh_helper.c b/drivers/gpu/drm/drm_self_refresh_helper.c index dd33fec5aabd..383488c3a4b7 100644 --- a/drivers/gpu/drm/drm_self_refresh_helper.c +++ b/drivers/gpu/drm/drm_self_refresh_helper.c @@ -70,7 +70,7 @@ static void drm_self_refresh_helper_entry_work(struct work_struct *work) to_delayed_work(work), struct drm_self_refresh_data, entry_work); struct drm_crtc *crtc = sr_data->crtc; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_modeset_acquire_ctx ctx; struct drm_atomic_state *state; struct drm_connector *conn; diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c index 877e2067534f..87e305c8f7f6 100644 --- a/drivers/gpu/drm/drm_vblank.c +++ b/drivers/gpu/drm/drm_vblank.c @@ -402,7 +402,7 @@ u64 drm_vblank_count(struct drm_device *dev, unsigned int pipe) */ u64 drm_crtc_accurate_vblank_count(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = drm_crtc_index(crtc); u64 vblank; unsigned long flags; @@ -589,7 +589,7 @@ EXPORT_SYMBOL(drm_dev_has_vblank); */ wait_queue_head_t *drm_crtc_vblank_waitqueue(struct drm_crtc *crtc) { - return &crtc->dev->vblank[drm_crtc_index(crtc)].queue; + return &crtc->drm->vblank[drm_crtc_index(crtc)].queue; } EXPORT_SYMBOL(drm_crtc_vblank_waitqueue); @@ -608,7 +608,7 @@ EXPORT_SYMBOL(drm_crtc_vblank_waitqueue); void drm_calc_timestamping_constants(struct drm_crtc *crtc, const struct drm_display_mode *mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = drm_crtc_index(crtc); struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; int linedur_ns = 0, framedur_ns = 0; @@ -693,7 +693,7 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal( bool in_vblank_irq, drm_vblank_get_scanout_position_func get_scanout_position) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; struct timespec64 ts_etime, ts_vblank_time; @@ -919,7 +919,7 @@ drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe, */ u64 drm_crtc_vblank_count(struct drm_crtc *crtc) { - return drm_vblank_count(crtc->dev, drm_crtc_index(crtc)); + return drm_vblank_count(crtc->drm, drm_crtc_index(crtc)); } EXPORT_SYMBOL(drm_crtc_vblank_count); @@ -980,7 +980,7 @@ static u64 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe, u64 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc, ktime_t *vblanktime) { - return drm_vblank_count_and_time(crtc->dev, drm_crtc_index(crtc), + return drm_vblank_count_and_time(crtc->drm, drm_crtc_index(crtc), vblanktime); } EXPORT_SYMBOL(drm_crtc_vblank_count_and_time); @@ -1000,10 +1000,10 @@ int drm_crtc_next_vblank_start(struct drm_crtc *crtc, ktime_t *vblanktime) struct drm_display_mode *mode; u64 vblank_start; - if (!drm_dev_has_vblank(crtc->dev)) + if (!drm_dev_has_vblank(crtc->drm)) return -EINVAL; - vblank = &crtc->dev->vblank[pipe]; + vblank = &crtc->drm->vblank[pipe]; mode = &vblank->hwmode; if (!vblank->framedur_ns || !vblank->linedur_ns) @@ -1098,7 +1098,7 @@ static void send_vblank_event(struct drm_device *dev, void drm_crtc_arm_vblank_event(struct drm_crtc *crtc, struct drm_pending_vblank_event *e) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = drm_crtc_index(crtc); assert_spin_locked(&dev->event_lock); @@ -1123,7 +1123,7 @@ EXPORT_SYMBOL(drm_crtc_arm_vblank_event); void drm_crtc_send_vblank_event(struct drm_crtc *crtc, struct drm_pending_vblank_event *e) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; u64 seq; unsigned int pipe = drm_crtc_index(crtc); ktime_t now; @@ -1237,7 +1237,7 @@ int drm_vblank_get(struct drm_device *dev, unsigned int pipe) */ int drm_crtc_vblank_get(struct drm_crtc *crtc) { - return drm_vblank_get(crtc->dev, drm_crtc_index(crtc)); + return drm_vblank_get(crtc->drm, drm_crtc_index(crtc)); } EXPORT_SYMBOL(drm_crtc_vblank_get); @@ -1272,7 +1272,7 @@ void drm_vblank_put(struct drm_device *dev, unsigned int pipe) */ void drm_crtc_vblank_put(struct drm_crtc *crtc) { - drm_vblank_put(crtc->dev, drm_crtc_index(crtc)); + drm_vblank_put(crtc->drm, drm_crtc_index(crtc)); } EXPORT_SYMBOL(drm_crtc_vblank_put); @@ -1323,7 +1323,7 @@ EXPORT_SYMBOL(drm_wait_one_vblank); */ void drm_crtc_wait_one_vblank(struct drm_crtc *crtc) { - drm_wait_one_vblank(crtc->dev, drm_crtc_index(crtc)); + drm_wait_one_vblank(crtc->drm, drm_crtc_index(crtc)); } EXPORT_SYMBOL(drm_crtc_wait_one_vblank); @@ -1340,7 +1340,7 @@ EXPORT_SYMBOL(drm_crtc_wait_one_vblank); */ void drm_crtc_vblank_off(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = drm_crtc_index(crtc); struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; struct drm_pending_vblank_event *e, *t; @@ -1419,7 +1419,7 @@ EXPORT_SYMBOL(drm_crtc_vblank_off); */ void drm_crtc_vblank_reset(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = drm_crtc_index(crtc); struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; @@ -1459,7 +1459,7 @@ EXPORT_SYMBOL(drm_crtc_vblank_reset); void drm_crtc_set_max_vblank_count(struct drm_crtc *crtc, u32 max_vblank_count) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = drm_crtc_index(crtc); struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; @@ -1482,7 +1482,7 @@ EXPORT_SYMBOL(drm_crtc_set_max_vblank_count); */ void drm_crtc_vblank_on(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = drm_crtc_index(crtc); struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; @@ -1568,9 +1568,9 @@ static void drm_vblank_restore(struct drm_device *dev, unsigned int pipe) void drm_crtc_vblank_restore(struct drm_crtc *crtc) { WARN_ON_ONCE(!crtc->funcs->get_vblank_timestamp); - WARN_ON_ONCE(!crtc->dev->vblank_disable_immediate); + WARN_ON_ONCE(!crtc->drm->vblank_disable_immediate); - drm_vblank_restore(crtc->dev, drm_crtc_index(crtc)); + drm_vblank_restore(crtc->drm, drm_crtc_index(crtc)); } EXPORT_SYMBOL(drm_crtc_vblank_restore); @@ -2047,7 +2047,7 @@ EXPORT_SYMBOL(drm_handle_vblank); */ bool drm_crtc_handle_vblank(struct drm_crtc *crtc) { - return drm_handle_vblank(crtc->dev, drm_crtc_index(crtc)); + return drm_handle_vblank(crtc->drm, drm_crtc_index(crtc)); } EXPORT_SYMBOL(drm_crtc_handle_vblank); diff --git a/drivers/gpu/drm/drm_vblank_work.c b/drivers/gpu/drm/drm_vblank_work.c index bd481fdd6b87..f6e024bed6b5 100644 --- a/drivers/gpu/drm/drm_vblank_work.c +++ b/drivers/gpu/drm/drm_vblank_work.c @@ -242,7 +242,7 @@ void drm_vblank_work_init(struct drm_vblank_work *work, struct drm_crtc *crtc, { kthread_init_work(&work->base, func); INIT_LIST_HEAD(&work->node); - work->vblank = &crtc->dev->vblank[drm_crtc_index(crtc)]; + work->vblank = &crtc->drm->vblank[drm_crtc_index(crtc)]; } EXPORT_SYMBOL(drm_vblank_work_init); diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 4153f302de7c..395c79eb438f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -40,9 +40,9 @@ static void exynos_drm_crtc_atomic_disable(struct drm_crtc *crtc, exynos_crtc->ops->atomic_disable(exynos_crtc); if (crtc->state->event && !crtc->state->active) { - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); drm_crtc_send_vblank_event(crtc, crtc->state->event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); crtc->state->event = NULL; } @@ -129,9 +129,9 @@ void exynos_crtc_handle_event(struct exynos_drm_crtc *exynos_crtc) WARN_ON(drm_crtc_vblank_get(crtc) != 0); - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); drm_crtc_arm_vblank_event(crtc, event); - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); } static void exynos_drm_crtc_destroy(struct drm_crtc *crtc) diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 7c3aa77186d3..31955e948ea2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -115,7 +115,7 @@ static void exynos_plane_mode_set(struct exynos_drm_plane_state *exynos_state) exynos_state->crtc.w = actual_w; exynos_state->crtc.h = actual_h; - DRM_DEV_DEBUG_KMS(crtc->dev->dev, + DRM_DEV_DEBUG_KMS(crtc->drm->dev, "plane : offset_x/y(%d,%d), width/height(%d,%d)", exynos_state->crtc.x, exynos_state->crtc.y, exynos_state->crtc.w, exynos_state->crtc.h); @@ -224,7 +224,7 @@ exynos_drm_plane_check_size(const struct exynos_drm_plane_config *config, if (width_ok && height_ok) return 0; - DRM_DEV_DEBUG_KMS(crtc->dev->dev, "scaling mode is not supported"); + DRM_DEV_DEBUG_KMS(crtc->drm->dev, "scaling mode is not supported"); return -ENOTSUPP; } diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c index 2af60d98f48f..b765a0cfcded 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c @@ -23,7 +23,7 @@ static void fsl_dcu_drm_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; struct drm_pending_vblank_event *event = crtc->state->event; @@ -33,12 +33,12 @@ static void fsl_dcu_drm_crtc_atomic_flush(struct drm_crtc *crtc, if (event) { crtc->state->event = NULL; - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (drm_crtc_vblank_get(crtc) == 0) drm_crtc_arm_vblank_event(crtc, event); else drm_crtc_send_vblank_event(crtc, event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } } @@ -47,7 +47,7 @@ static void fsl_dcu_drm_crtc_atomic_disable(struct drm_crtc *crtc, { struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; /* always disable planes on the CRTC */ @@ -66,7 +66,7 @@ static void fsl_dcu_drm_crtc_atomic_disable(struct drm_crtc *crtc, static void fsl_dcu_drm_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; clk_prepare_enable(fsl_dev->pix_clk); @@ -81,7 +81,7 @@ static void fsl_dcu_drm_crtc_atomic_enable(struct drm_crtc *crtc, static void fsl_dcu_drm_crtc_mode_set_nofb(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; struct drm_connector *con = &fsl_dev->connector.base; struct drm_display_mode *mode = &crtc->state->mode; @@ -134,7 +134,7 @@ static const struct drm_crtc_helper_funcs fsl_dcu_drm_crtc_helper_funcs = { static int fsl_dcu_drm_crtc_enable_vblank(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; unsigned int value; @@ -147,7 +147,7 @@ static int fsl_dcu_drm_crtc_enable_vblank(struct drm_crtc *crtc) static void fsl_dcu_drm_crtc_disable_vblank(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; unsigned int value; diff --git a/drivers/gpu/drm/gma500/cdv_intel_display.c b/drivers/gpu/drm/gma500/cdv_intel_display.c index bbd0abdd8382..a2093eeedf2a 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_display.c +++ b/drivers/gpu/drm/gma500/cdv_intel_display.c @@ -574,7 +574,7 @@ static int cdv_intel_crtc_mode_set(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *old_fb) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct gma_crtc *gma_crtc = to_gma_crtc(crtc); int pipe = gma_crtc->pipe; diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c index 578d179a6017..e525a6782245 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c @@ -983,7 +983,7 @@ void cdv_intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct drm_mode_config *mode_config = &dev->mode_config; struct drm_encoder *encoder; diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c index f65e90d890f4..f20c6599bf51 100644 --- a/drivers/gpu/drm/gma500/gma_display.c +++ b/drivers/gpu/drm/gma500/gma_display.c @@ -29,7 +29,7 @@ */ bool gma_pipe_has_type(struct drm_crtc *crtc, int type) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_connector_list_iter conn_iter; struct drm_connector *connector; @@ -58,7 +58,7 @@ void gma_wait_for_vblank(struct drm_device *dev) int gma_pipe_set_base(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *old_fb) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct drm_framebuffer *fb = crtc->primary->fb; @@ -143,7 +143,7 @@ int gma_pipe_set_base(struct drm_crtc *crtc, int x, int y, /* Loads the palette/gamma unit for the CRTC with the prepared values */ void gma_crtc_load_lut(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct gma_crtc *gma_crtc = to_gma_crtc(crtc); const struct psb_offset *map = &dev_priv->regmap[gma_crtc->pipe]; @@ -196,7 +196,7 @@ static int gma_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, */ void gma_crtc_dpms(struct drm_crtc *crtc, int mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct gma_crtc *gma_crtc = to_gma_crtc(crtc); int pipe = gma_crtc->pipe; @@ -330,7 +330,7 @@ static int gma_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, uint32_t handle, uint32_t width, uint32_t height) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct gma_crtc *gma_crtc = to_gma_crtc(crtc); int pipe = gma_crtc->pipe; @@ -443,7 +443,7 @@ static int gma_crtc_cursor_set(struct drm_crtc *crtc, static int gma_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct gma_crtc *gma_crtc = to_gma_crtc(crtc); int pipe = gma_crtc->pipe; uint32_t temp = 0; @@ -518,7 +518,7 @@ int gma_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *current_fb = crtc->primary->fb; struct drm_framebuffer *old_fb = crtc->primary->old_fb; const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned long flags; int ret; @@ -574,7 +574,7 @@ const struct drm_crtc_funcs gma_crtc_funcs = { */ void gma_crtc_save(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct psb_intel_crtc_state *crtc_state = gma_crtc->crtc_state; @@ -617,7 +617,7 @@ void gma_crtc_save(struct drm_crtc *crtc) */ void gma_crtc_restore(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct psb_intel_crtc_state *crtc_state = gma_crtc->crtc_state; @@ -751,7 +751,7 @@ bool gma_find_best_pll(const struct gma_limit_t *limit, struct drm_crtc *crtc, int target, int refclk, struct gma_clock_t *best_clock) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; const struct gma_clock_funcs *clock_funcs = to_gma_crtc(crtc)->clock_funcs; struct gma_clock_t clock; diff --git a/drivers/gpu/drm/gma500/oaktrail_crtc.c b/drivers/gpu/drm/gma500/oaktrail_crtc.c index de8ccfe9890f..d0629dc277af 100644 --- a/drivers/gpu/drm/gma500/oaktrail_crtc.c +++ b/drivers/gpu/drm/gma500/oaktrail_crtc.c @@ -84,7 +84,7 @@ static const struct gma_limit_t *mrst_limit(struct drm_crtc *crtc, int refclk) { const struct gma_limit_t *limit = NULL; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); if (gma_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) @@ -216,7 +216,7 @@ static bool mrst_lvds_find_best_pll(const struct gma_limit_t *limit, */ static void oaktrail_crtc_dpms(struct drm_crtc *crtc, int mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct gma_crtc *gma_crtc = to_gma_crtc(crtc); int pipe = gma_crtc->pipe; @@ -362,7 +362,7 @@ static int oaktrail_crtc_mode_set(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *old_fb) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct drm_psb_private *dev_priv = to_drm_psb_private(dev); int pipe = gma_crtc->pipe; @@ -592,7 +592,7 @@ static int oaktrail_crtc_mode_set(struct drm_crtc *crtc, static int oaktrail_pipe_set_base(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *old_fb) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct drm_framebuffer *fb = crtc->primary->fb; diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c index c9d1ad4c0a27..e0ac4c88c762 100644 --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c @@ -266,7 +266,7 @@ int oaktrail_crtc_hdmi_mode_set(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *old_fb) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; int pipe = 1; @@ -382,7 +382,7 @@ int oaktrail_crtc_hdmi_mode_set(struct drm_crtc *crtc, void oaktrail_crtc_hdmi_dpms(struct drm_crtc *crtc, int mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; u32 temp; DRM_DEBUG_KMS("%s %d\n", __func__, mode); diff --git a/drivers/gpu/drm/gma500/psb_intel_display.c b/drivers/gpu/drm/gma500/psb_intel_display.c index ff46e88c4768..41472e51a16d 100644 --- a/drivers/gpu/drm/gma500/psb_intel_display.c +++ b/drivers/gpu/drm/gma500/psb_intel_display.c @@ -96,7 +96,7 @@ static int psb_intel_crtc_mode_set(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *old_fb) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct gma_crtc *gma_crtc = to_gma_crtc(crtc); const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; diff --git a/drivers/gpu/drm/gma500/psb_irq.c b/drivers/gpu/drm/gma500/psb_irq.c index 343c51250207..23fb075ab487 100644 --- a/drivers/gpu/drm/gma500/psb_irq.c +++ b/drivers/gpu/drm/gma500/psb_irq.c @@ -370,7 +370,7 @@ void gma_irq_uninstall(struct drm_device *dev) int gma_crtc_enable_vblank(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); unsigned long irqflags; @@ -403,7 +403,7 @@ int gma_crtc_enable_vblank(struct drm_crtc *crtc) void gma_crtc_disable_vblank(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); unsigned long irqflags; @@ -427,7 +427,7 @@ void gma_crtc_disable_vblank(struct drm_crtc *crtc) */ u32 gma_crtc_get_vblank_counter(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; uint32_t high_frame = PIPEAFRAMEHIGH; uint32_t low_frame = PIPEAFRAMEPIXEL; diff --git a/drivers/gpu/drm/gud/gud_pipe.c b/drivers/gpu/drm/gud/gud_pipe.c index d2f199ea3c11..a87997c2c043 100644 --- a/drivers/gpu/drm/gud/gud_pipe.c +++ b/drivers/gpu/drm/gud/gud_pipe.c @@ -444,7 +444,7 @@ int gud_pipe_check(struct drm_simple_display_pipe *pipe, struct drm_plane_state *new_plane_state, struct drm_crtc_state *new_crtc_state) { - struct gud_device *gdrm = to_gud_device(pipe->crtc.dev); + struct gud_device *gdrm = to_gud_device(pipe->crtc.drm); struct drm_plane_state *old_plane_state = pipe->plane.state; const struct drm_display_mode *mode = &new_crtc_state->mode; struct drm_atomic_state *state = new_plane_state->state; @@ -489,7 +489,7 @@ int gud_pipe_check(struct drm_simple_display_pipe *pipe, if (!connector_state) { struct drm_connector_list_iter conn_iter; - drm_connector_list_iter_begin(pipe->crtc.dev, &conn_iter); + drm_connector_list_iter_begin(pipe->crtc.drm, &conn_iter); drm_for_each_connector_iter(connector, &conn_iter) { if (connector->state->crtc) { connector_state = connector->state; @@ -559,7 +559,7 @@ int gud_pipe_check(struct drm_simple_display_pipe *pipe, void gud_pipe_update(struct drm_simple_display_pipe *pipe, struct drm_plane_state *old_state) { - struct drm_device *drm = pipe->crtc.dev; + struct drm_device *drm = pipe->crtc.drm; struct gud_device *gdrm = to_gud_device(drm); struct drm_plane_state *state = pipe->plane.state; struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(state); diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c index 89bed78f1466..42b54119c57b 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c @@ -159,7 +159,7 @@ static const struct drm_plane_helper_funcs hibmc_plane_helper_funcs = { static void hibmc_crtc_dpms(struct drm_crtc *crtc, u32 dpms) { - struct hibmc_drm_private *priv = to_hibmc_drm_private(crtc->dev); + struct hibmc_drm_private *priv = to_hibmc_drm_private(crtc->drm); u32 reg; reg = readl(priv->mmio + HIBMC_CRT_DISP_CTL); @@ -175,7 +175,7 @@ static void hibmc_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state) { u32 reg; - struct hibmc_drm_private *priv = to_hibmc_drm_private(crtc->dev); + struct hibmc_drm_private *priv = to_hibmc_drm_private(crtc->drm); hibmc_set_power_mode(priv, HIBMC_PW_MODE_CTL_MODE_MODE0); @@ -194,7 +194,7 @@ static void hibmc_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state) { u32 reg; - struct hibmc_drm_private *priv = to_hibmc_drm_private(crtc->dev); + struct hibmc_drm_private *priv = to_hibmc_drm_private(crtc->drm); hibmc_crtc_dpms(crtc, HIBMC_CRT_DPMS_OFF); drm_crtc_vblank_off(crtc); @@ -361,7 +361,7 @@ static void hibmc_crtc_mode_set_nofb(struct drm_crtc *crtc) { u32 val; struct drm_display_mode *mode = &crtc->state->mode; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct hibmc_drm_private *priv = to_hibmc_drm_private(dev); u32 width = mode->hsync_end - mode->hsync_start; u32 height = mode->vsync_end - mode->vsync_start; @@ -395,7 +395,7 @@ static void hibmc_crtc_atomic_begin(struct drm_crtc *crtc, struct drm_atomic_state *state) { u32 reg; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct hibmc_drm_private *priv = to_hibmc_drm_private(dev); hibmc_set_power_mode(priv, HIBMC_PW_MODE_CTL_MODE_MODE0); @@ -417,16 +417,16 @@ static void hibmc_crtc_atomic_flush(struct drm_crtc *crtc, { unsigned long flags; - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); if (crtc->state->event) drm_crtc_send_vblank_event(crtc, crtc->state->event); crtc->state->event = NULL; - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); } static int hibmc_crtc_enable_vblank(struct drm_crtc *crtc) { - struct hibmc_drm_private *priv = to_hibmc_drm_private(crtc->dev); + struct hibmc_drm_private *priv = to_hibmc_drm_private(crtc->drm); writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(1), priv->mmio + HIBMC_RAW_INTERRUPT_EN); @@ -436,7 +436,7 @@ static int hibmc_crtc_enable_vblank(struct drm_crtc *crtc) static void hibmc_crtc_disable_vblank(struct drm_crtc *crtc) { - struct hibmc_drm_private *priv = to_hibmc_drm_private(crtc->dev); + struct hibmc_drm_private *priv = to_hibmc_drm_private(crtc->drm); writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(0), priv->mmio + HIBMC_RAW_INTERRUPT_EN); @@ -444,7 +444,7 @@ static void hibmc_crtc_disable_vblank(struct drm_crtc *crtc) static void hibmc_crtc_load_lut(struct drm_crtc *crtc) { - struct hibmc_drm_private *priv = to_hibmc_drm_private(crtc->dev); + struct hibmc_drm_private *priv = to_hibmc_drm_private(crtc->drm); void __iomem *mmio = priv->mmio; u16 *r, *g, *b; u32 reg; diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index 871f79a6b17e..53f8ab3bc58a 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -516,12 +516,12 @@ static void ade_crtc_atomic_flush(struct drm_crtc *crtc, if (event) { crtc->state->event = NULL; - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (drm_crtc_vblank_get(crtc) == 0) drm_crtc_arm_vblank_event(crtc, event); else drm_crtc_send_vblank_event(crtc, event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } } diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c index c61f811b74f5..3b614baf835f 100644 --- a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +++ b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c @@ -102,7 +102,7 @@ static void hyperv_pipe_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct hyperv_drm_device *hv = to_hv(pipe->crtc.dev); + struct hyperv_drm_device *hv = to_hv(pipe->crtc.drm); struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state); hyperv_hide_hw_ptr(hv->hdev); @@ -117,7 +117,7 @@ static int hyperv_pipe_check(struct drm_simple_display_pipe *pipe, struct drm_plane_state *plane_state, struct drm_crtc_state *crtc_state) { - struct hyperv_drm_device *hv = to_hv(pipe->crtc.dev); + struct hyperv_drm_device *hv = to_hv(pipe->crtc.drm); struct drm_framebuffer *fb = plane_state->fb; if (fb->format->format != DRM_FORMAT_XRGB8888) @@ -135,7 +135,7 @@ static int hyperv_pipe_check(struct drm_simple_display_pipe *pipe, static void hyperv_pipe_update(struct drm_simple_display_pipe *pipe, struct drm_plane_state *old_state) { - struct hyperv_drm_device *hv = to_hv(pipe->crtc.dev); + struct hyperv_drm_device *hv = to_hv(pipe->crtc.drm); struct drm_plane_state *state = pipe->plane.state; struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(state); struct drm_rect rect; diff --git a/drivers/gpu/drm/i915/display/g4x_dp.c b/drivers/gpu/drm/i915/display/g4x_dp.c index 112d91d81fdc..85ad8466bc81 100644 --- a/drivers/gpu/drm/i915/display/g4x_dp.c +++ b/drivers/gpu/drm/i915/display/g4x_dp.c @@ -191,7 +191,7 @@ static void ilk_edp_pll_on(struct intel_dp *intel_dp, const struct intel_crtc_state *pipe_config) { struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); assert_transcoder_disabled(dev_priv, pipe_config->cpu_transcoder); assert_dp_port_disabled(intel_dp); @@ -231,7 +231,7 @@ static void ilk_edp_pll_off(struct intel_dp *intel_dp, const struct intel_crtc_state *old_crtc_state) { struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); assert_transcoder_disabled(dev_priv, old_crtc_state->cpu_transcoder); assert_dp_port_disabled(intel_dp); diff --git a/drivers/gpu/drm/i915/display/hsw_ips.c b/drivers/gpu/drm/i915/display/hsw_ips.c index b052dfa21690..9e8f5e6d5766 100644 --- a/drivers/gpu/drm/i915/display/hsw_ips.c +++ b/drivers/gpu/drm/i915/display/hsw_ips.c @@ -13,7 +13,7 @@ static void hsw_ips_enable(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); u32 val; if (!crtc_state->ips_enabled) @@ -60,7 +60,7 @@ static void hsw_ips_enable(const struct intel_crtc_state *crtc_state) bool hsw_ips_disable(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); bool need_vblank_wait = false; if (!crtc_state->ips_enabled) @@ -180,13 +180,13 @@ void hsw_ips_post_update(struct intel_atomic_state *state, /* IPS only exists on ULT machines and is tied to pipe A. */ bool hsw_crtc_supports_ips(struct intel_crtc *crtc) { - return HAS_IPS(to_i915(crtc->base.dev)) && crtc->pipe == PIPE_A; + return HAS_IPS(to_i915(crtc->base.drm)) && crtc->pipe == PIPE_A; } bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); /* IPS only exists on ULT machines and is tied to pipe A. */ if (!hsw_crtc_supports_ips(crtc)) @@ -257,7 +257,7 @@ int hsw_ips_compute_config(struct intel_atomic_state *state, void hsw_ips_get_config(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); if (!hsw_crtc_supports_ips(crtc)) return; @@ -277,7 +277,7 @@ void hsw_ips_get_config(struct intel_crtc_state *crtc_state) static int hsw_ips_debugfs_false_color_get(void *data, u64 *val) { struct intel_crtc *crtc = data; - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); *val = i915->display.ips.false_color; @@ -287,7 +287,7 @@ static int hsw_ips_debugfs_false_color_get(void *data, u64 *val) static int hsw_ips_debugfs_false_color_set(void *data, u64 val) { struct intel_crtc *crtc = data; - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_crtc_state *crtc_state; int ret; @@ -322,7 +322,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(hsw_ips_debugfs_false_color_fops, static int hsw_ips_debugfs_status_show(struct seq_file *m, void *unused) { struct intel_crtc *crtc = m->private; - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); intel_wakeref_t wakeref; wakeref = intel_runtime_pm_get(&i915->runtime_pm); diff --git a/drivers/gpu/drm/i915/display/i9xx_plane.c b/drivers/gpu/drm/i915/display/i9xx_plane.c index b10488324457..d43430c4d539 100644 --- a/drivers/gpu/drm/i915/display/i9xx_plane.c +++ b/drivers/gpu/drm/i915/display/i9xx_plane.c @@ -352,7 +352,7 @@ i9xx_plane_check(struct intel_crtc_state *crtc_state, static u32 i9xx_plane_ctl_crtc(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 dspcntr = 0; if (crtc_state->gamma_enable) @@ -975,7 +975,7 @@ void i9xx_get_initial_plane_config(struct intel_crtc *crtc, struct intel_initial_plane_config *plane_config) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_plane *plane = to_intel_plane(crtc->base.primary); enum i9xx_plane_id i9xx_plane = plane->i9xx_plane; diff --git a/drivers/gpu/drm/i915/display/i9xx_wm.c b/drivers/gpu/drm/i915/display/i9xx_wm.c index 51a896bbebc4..876ce49a3c75 100644 --- a/drivers/gpu/drm/i915/display/i9xx_wm.c +++ b/drivers/gpu/drm/i915/display/i9xx_wm.c @@ -262,7 +262,7 @@ static const int pessimal_latency_ns = 5000; static void vlv_get_fifo_size(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct vlv_fifo_state *fifo_state = &crtc_state->wm.vlv.fifo_state; enum pipe pipe = crtc->pipe; int sprite0_start, sprite1_start; @@ -929,7 +929,7 @@ static u16 g4x_compute_wm(const struct intel_crtc_state *crtc_state, static bool g4x_raw_plane_wm_set(struct intel_crtc_state *crtc_state, int level, enum plane_id plane_id, u16 value) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); bool dirty = false; for (; level < dev_priv->display.wm.num_levels; level++) { @@ -945,7 +945,7 @@ static bool g4x_raw_plane_wm_set(struct intel_crtc_state *crtc_state, static bool g4x_raw_fbc_wm_set(struct intel_crtc_state *crtc_state, int level, u16 value) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); bool dirty = false; /* NORMAL level doesn't have an FBC watermark */ @@ -969,7 +969,7 @@ static bool g4x_raw_plane_wm_compute(struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); enum plane_id plane_id = plane->id; bool dirty = false; int level; @@ -1049,7 +1049,7 @@ static bool g4x_raw_plane_wm_is_valid(const struct intel_crtc_state *crtc_state, static bool g4x_raw_crtc_wm_is_valid(const struct intel_crtc_state *crtc_state, int level) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); if (level >= dev_priv->display.wm.num_levels) return false; @@ -1193,7 +1193,7 @@ static int g4x_compute_pipe_wm(struct intel_atomic_state *state, static int g4x_compute_intermediate_wm(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_crtc_state *new_crtc_state = intel_atomic_get_new_crtc_state(state, crtc); const struct intel_crtc_state *old_crtc_state = @@ -1340,7 +1340,7 @@ static void g4x_program_watermarks(struct drm_i915_private *dev_priv) static void g4x_initial_watermarks(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); @@ -1353,7 +1353,7 @@ static void g4x_initial_watermarks(struct intel_atomic_state *state, static void g4x_optimize_watermarks(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); @@ -1443,7 +1443,7 @@ static bool vlv_need_sprite0_fifo_workaround(unsigned int active_planes) static int vlv_compute_fifo(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct g4x_pipe_wm *raw = &crtc_state->wm.vlv.raw[VLV_WM_LEVEL_PM2]; struct vlv_fifo_state *fifo_state = &crtc_state->wm.vlv.fifo_state; @@ -1527,7 +1527,7 @@ static int vlv_compute_fifo(struct intel_crtc_state *crtc_state) static void vlv_invalidate_wms(struct intel_crtc *crtc, struct vlv_wm_state *wm_state, int level) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); for (; level < dev_priv->display.wm.num_levels; level++) { enum plane_id plane_id; @@ -1555,7 +1555,7 @@ static u16 vlv_invert_wm_value(u16 wm, u16 fifo_size) static bool vlv_raw_plane_wm_set(struct intel_crtc_state *crtc_state, int level, enum plane_id plane_id, u16 value) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); bool dirty = false; for (; level < dev_priv->display.wm.num_levels; level++) { @@ -1572,7 +1572,7 @@ static bool vlv_raw_plane_wm_compute(struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); enum plane_id plane_id = plane->id; int level; bool dirty = false; @@ -1631,7 +1631,7 @@ static bool vlv_raw_crtc_wm_is_valid(const struct intel_crtc_state *crtc_state, static int _vlv_compute_pipe_wm(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct vlv_wm_state *wm_state = &crtc_state->wm.vlv.optimal; const struct vlv_fifo_state *fifo_state = &crtc_state->wm.vlv.fifo_state; @@ -1751,7 +1751,7 @@ static int vlv_compute_pipe_wm(struct intel_atomic_state *state, static void vlv_atomic_update_fifo(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_uncore *uncore = &dev_priv->uncore; const struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); @@ -1977,7 +1977,7 @@ static void vlv_program_watermarks(struct drm_i915_private *dev_priv) static void vlv_initial_watermarks(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); @@ -1990,7 +1990,7 @@ static void vlv_initial_watermarks(struct intel_atomic_state *state, static void vlv_optimize_watermarks(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); @@ -2862,7 +2862,7 @@ static int ilk_compute_pipe_wm(struct intel_atomic_state *state, static int ilk_compute_intermediate_wm(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_crtc_state *new_crtc_state = intel_atomic_get_new_crtc_state(state, crtc); const struct intel_crtc_state *old_crtc_state = @@ -3312,7 +3312,7 @@ static void ilk_program_watermarks(struct drm_i915_private *dev_priv) static void ilk_initial_watermarks(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); @@ -3325,7 +3325,7 @@ static void ilk_initial_watermarks(struct intel_atomic_state *state, static void ilk_optimize_watermarks(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); @@ -3340,7 +3340,7 @@ static void ilk_optimize_watermarks(struct intel_atomic_state *state, static void ilk_pipe_wm_get_hw_state(struct intel_crtc *crtc) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct ilk_wm_values *hw = &dev_priv->display.wm.hw; struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state); diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index 74f2e2ed5c19..995ba2ed1e87 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -207,7 +207,7 @@ static int dsi_send_pkt_hdr(struct intel_dsi_host *host, void icl_dsi_frame_update(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 mode_flags; enum port port; diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index fe573d1d520c..e5cac79cc211 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -303,7 +303,7 @@ intel_crtc_destroy_state(struct drm_crtc *crtc, { struct intel_crtc_state *crtc_state = to_intel_crtc_state(state); - drm_WARN_ON(crtc->dev, crtc_state->dsb); + drm_WARN_ON(crtc->drm, crtc_state->dsb); __drm_atomic_helper_crtc_destroy_state(&crtc_state->uapi); intel_crtc_free_hw_state(crtc_state); diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 5f4ff7c19452..e66f45e25201 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -475,7 +475,7 @@ static int intel_plane_atomic_calc_changes(const struct intel_crtc_state *old_cr { struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc); struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); bool mode_changed = intel_crtc_needs_modeset(new_crtc_state); bool was_crtc_enabled = old_crtc_state->hw.active; bool is_crtc_enabled = new_crtc_state->hw.active; @@ -661,7 +661,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ static struct intel_plane * intel_crtc_get_plane(struct intel_crtc *crtc, enum plane_id plane_id) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_plane *plane; for_each_intel_plane_on_crtc(&i915->drm, crtc, plane) { diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index 3d9c9b4f27f8..82fb23692c15 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -252,7 +252,7 @@ static const struct hdmi_aud_ncts hdmi_aud_ncts_36bpp[] = { /* get AUD_CONFIG_PIXEL_CLOCK_HDMI_* value for mode */ static u32 audio_config_hdmi_pixel_clock(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; int i; diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c index aee6d03eb322..7aa23b258e40 100644 --- a/drivers/gpu/drm/i915/display/intel_bw.c +++ b/drivers/gpu/drm/i915/display/intel_bw.c @@ -691,7 +691,7 @@ static unsigned int intel_bw_crtc_num_active_planes(const struct intel_crtc_stat static unsigned int intel_bw_crtc_data_rate(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); unsigned int data_rate = 0; enum plane_id plane_id; @@ -716,7 +716,7 @@ static unsigned int intel_bw_crtc_data_rate(const struct intel_crtc_state *crtc_ static int intel_bw_crtc_min_cdclk(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); if (DISPLAY_VER(i915) < 12) return 0; @@ -728,7 +728,7 @@ void intel_bw_crtc_update(struct intel_bw_state *bw_state, const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); bw_state->data_rate[crtc->pipe] = intel_bw_crtc_data_rate(crtc_state); @@ -1039,7 +1039,7 @@ static void skl_plane_calc_dbuf_bw(struct intel_bw_state *bw_state, const struct skl_ddb_entry *ddb, unsigned int data_rate) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_dbuf_bw *crtc_bw = &bw_state->dbuf_bw[crtc->pipe]; unsigned int dbuf_mask = skl_ddb_dbuf_slice_mask(i915, ddb); enum dbuf_slice slice; @@ -1058,7 +1058,7 @@ static void skl_crtc_calc_dbuf_bw(struct intel_bw_state *bw_state, const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_dbuf_bw *crtc_bw = &bw_state->dbuf_bw[crtc->pipe]; enum plane_id plane_id; diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c index 92a5cea8fa7f..110b0c0ac66b 100644 --- a/drivers/gpu/drm/i915/display/intel_cdclk.c +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c @@ -2503,7 +2503,7 @@ intel_set_cdclk_post_plane_update(struct intel_atomic_state *state) static int intel_pixel_rate_to_cdclk(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); int pixel_rate = crtc_state->pixel_rate; if (DISPLAY_VER(dev_priv) >= 10) @@ -2522,7 +2522,7 @@ static int intel_pixel_rate_to_cdclk(const struct intel_crtc_state *crtc_state) static int intel_planes_min_cdclk(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_plane *plane; int min_cdclk = 0; @@ -2535,7 +2535,7 @@ static int intel_planes_min_cdclk(const struct intel_crtc_state *crtc_state) int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state) { struct drm_i915_private *dev_priv = - to_i915(crtc_state->uapi.crtc->dev); + to_i915(crtc_state->uapi.crtc->drm); int min_cdclk; if (!crtc_state->hw.enable) diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c index 8966e6560516..72b840e374e0 100644 --- a/drivers/gpu/drm/i915/display/intel_color.c +++ b/drivers/gpu/drm/i915/display/intel_color.c @@ -202,7 +202,7 @@ static u64 *ctm_mult_by_limited(u64 *result, const u64 *input) static void ilk_update_pipe_csc(struct intel_crtc *crtc, const struct intel_csc_matrix *csc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; intel_de_write_fw(i915, PIPE_CSC_PREOFF_HI(pipe), csc->preoff[0]); @@ -235,7 +235,7 @@ static void ilk_update_pipe_csc(struct intel_crtc *crtc, static void ilk_read_pipe_csc(struct intel_crtc *crtc, struct intel_csc_matrix *csc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; u32 tmp; @@ -301,7 +301,7 @@ static void skl_read_csc(struct intel_crtc_state *crtc_state) static void icl_update_output_csc(struct intel_crtc *crtc, const struct intel_csc_matrix *csc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; intel_de_write_fw(i915, PIPE_CSC_OUTPUT_PREOFF_HI(pipe), csc->preoff[0]); @@ -331,7 +331,7 @@ static void icl_update_output_csc(struct intel_crtc *crtc, static void icl_read_output_csc(struct intel_crtc *crtc, struct intel_csc_matrix *csc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; u32 tmp; @@ -380,7 +380,7 @@ static void icl_read_csc(struct intel_crtc_state *crtc_state) static bool ilk_limited_range(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); /* icl+ have dedicated output CSC */ if (DISPLAY_VER(i915) >= 11) @@ -395,7 +395,7 @@ static bool ilk_limited_range(const struct intel_crtc_state *crtc_state) static bool ilk_lut_limited_range(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); if (!ilk_limited_range(crtc_state)) return false; @@ -432,7 +432,7 @@ static void ilk_csc_convert_ctm(const struct intel_crtc_state *crtc_state, struct intel_csc_matrix *csc, bool limited_color_range) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); const struct drm_color_ctm *ctm = crtc_state->hw.ctm->data; const u64 *input; u64 temp[9]; @@ -490,7 +490,7 @@ static void ilk_csc_convert_ctm(const struct intel_crtc_state *crtc_state, static void ilk_assign_csc(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); bool limited_color_range = ilk_csc_limited_range(crtc_state); if (crtc_state->hw.ctm) { @@ -530,7 +530,7 @@ static void ilk_load_csc_matrix(const struct intel_crtc_state *crtc_state) static void icl_assign_csc(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); if (crtc_state->hw.ctm) { drm_WARN_ON(&i915->drm, (crtc_state->csc_mode & ICL_CSC_ENABLE) == 0); @@ -608,7 +608,7 @@ static void vlv_wgc_csc_convert_ctm(const struct intel_crtc_state *crtc_state, static void vlv_load_wgc_csc(struct intel_crtc *crtc, const struct intel_csc_matrix *csc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; intel_de_write_fw(dev_priv, PIPE_WGC_C01_C00(pipe), @@ -630,7 +630,7 @@ static void vlv_load_wgc_csc(struct intel_crtc *crtc, static void vlv_read_wgc_csc(struct intel_crtc *crtc, struct intel_csc_matrix *csc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; u32 tmp; @@ -666,7 +666,7 @@ static void vlv_read_csc(struct intel_crtc_state *crtc_state) static void vlv_assign_csc(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); if (crtc_state->hw.ctm) { drm_WARN_ON(&i915->drm, !crtc_state->wgc_enable); @@ -710,7 +710,7 @@ static const struct intel_csc_matrix chv_cgm_csc_matrix_identity = { static void chv_load_cgm_csc(struct intel_crtc *crtc, const struct intel_csc_matrix *csc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; intel_de_write_fw(i915, CGM_PIPE_CSC_COEFF01(pipe), @@ -728,7 +728,7 @@ static void chv_load_cgm_csc(struct intel_crtc *crtc, static void chv_read_cgm_csc(struct intel_crtc *crtc, struct intel_csc_matrix *csc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; u32 tmp; @@ -762,7 +762,7 @@ static void chv_read_csc(struct intel_crtc_state *crtc_state) static void chv_assign_csc(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); drm_WARN_ON(&i915->drm, crtc_state->wgc_enable); @@ -992,7 +992,7 @@ static void i9xx_color_commit_arm(const struct intel_crtc_state *crtc_state) static void ilk_color_commit_arm(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); /* update TRANSCONF GAMMA_MODE */ ilk_set_pipeconf(crtc_state); @@ -1004,7 +1004,7 @@ static void ilk_color_commit_arm(const struct intel_crtc_state *crtc_state) static void hsw_color_commit_arm(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); intel_de_write(i915, GAMMA_MODE(crtc->pipe), crtc_state->gamma_mode); @@ -1016,7 +1016,7 @@ static void hsw_color_commit_arm(const struct intel_crtc_state *crtc_state) static void skl_color_commit_arm(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; u32 val = 0; @@ -1044,7 +1044,7 @@ static void skl_color_commit_arm(const struct intel_crtc_state *crtc_state) static void icl_color_commit_arm(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; /* @@ -1063,7 +1063,7 @@ static void icl_color_commit_arm(const struct intel_crtc_state *crtc_state) static void icl_color_post_update(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); /* * Despite Wa_1406463849, ICL CSC is no longer disarmed by @@ -1154,7 +1154,7 @@ create_resized_lut(struct drm_i915_private *i915, static void i9xx_load_lut_8(struct intel_crtc *crtc, const struct drm_property_blob *blob) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct drm_color_lut *lut; enum pipe pipe = crtc->pipe; int i; @@ -1172,7 +1172,7 @@ static void i9xx_load_lut_8(struct intel_crtc *crtc, static void i9xx_load_lut_10(struct intel_crtc *crtc, const struct drm_property_blob *blob) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct drm_color_lut *lut = blob->data; int i, lut_size = drm_color_lut_size(blob); enum pipe pipe = crtc->pipe; @@ -1206,7 +1206,7 @@ static void i9xx_load_luts(const struct intel_crtc_state *crtc_state) static void i965_load_lut_10p6(struct intel_crtc *crtc, const struct drm_property_blob *blob) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct drm_color_lut *lut = blob->data; int i, lut_size = drm_color_lut_size(blob); enum pipe pipe = crtc->pipe; @@ -1244,7 +1244,7 @@ static void i965_load_luts(const struct intel_crtc_state *crtc_state) static void ilk_lut_write(const struct intel_crtc_state *crtc_state, i915_reg_t reg, u32 val) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); if (crtc_state->dsb) intel_dsb_reg_write(crtc_state->dsb, reg, val); @@ -1457,7 +1457,7 @@ static void glk_load_degamma_lut(const struct intel_crtc_state *crtc_state, const struct drm_property_blob *blob) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); const struct drm_color_lut *lut = blob->data; int i, lut_size = drm_color_lut_size(blob); enum pipe pipe = crtc->pipe; @@ -1699,7 +1699,7 @@ static void chv_cgm_degamma_pack(struct drm_color_lut *entry, u32 ldw, u32 udw) static void chv_load_cgm_degamma(struct intel_crtc *crtc, const struct drm_property_blob *blob) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); const struct drm_color_lut *lut = blob->data; int i, lut_size = drm_color_lut_size(blob); enum pipe pipe = crtc->pipe; @@ -1733,7 +1733,7 @@ static void chv_cgm_gamma_pack(struct drm_color_lut *entry, u32 ldw, u32 udw) static void chv_load_cgm_gamma(struct intel_crtc *crtc, const struct drm_property_blob *blob) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); const struct drm_color_lut *lut = blob->data; int i, lut_size = drm_color_lut_size(blob); enum pipe pipe = crtc->pipe; @@ -1749,7 +1749,7 @@ static void chv_load_cgm_gamma(struct intel_crtc *crtc, static void chv_load_luts(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); const struct drm_property_blob *pre_csc_lut = crtc_state->pre_csc_lut; const struct drm_property_blob *post_csc_lut = crtc_state->post_csc_lut; @@ -1770,14 +1770,14 @@ static void chv_load_luts(const struct intel_crtc_state *crtc_state) void intel_color_load_luts(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); i915->display.funcs.color->load_luts(crtc_state); } void intel_color_commit_noarm(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); if (i915->display.funcs.color->color_commit_noarm) i915->display.funcs.color->color_commit_noarm(crtc_state); @@ -1785,14 +1785,14 @@ void intel_color_commit_noarm(const struct intel_crtc_state *crtc_state) void intel_color_commit_arm(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); i915->display.funcs.color->color_commit_arm(crtc_state); } void intel_color_post_update(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); if (i915->display.funcs.color->color_post_update) i915->display.funcs.color->color_post_update(crtc_state); @@ -1865,14 +1865,14 @@ static bool chv_can_preload_luts(const struct intel_crtc_state *new_crtc_state) int intel_color_check(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); return i915->display.funcs.color->color_check(crtc_state); } void intel_color_get_config(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); i915->display.funcs.color->read_luts(crtc_state); @@ -1885,7 +1885,7 @@ bool intel_color_lut_equal(const struct intel_crtc_state *crtc_state, const struct drm_property_blob *blob2, bool is_pre_csc_lut) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); /* * FIXME c8_planes readout missing thus @@ -1917,7 +1917,7 @@ static int intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state) { struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_atomic_state *state = to_intel_atomic_state(new_crtc_state->uapi.state); const struct intel_crtc_state *old_crtc_state = @@ -1956,7 +1956,7 @@ intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state) static u32 intel_gamma_lut_tests(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); const struct drm_property_blob *gamma_lut = crtc_state->hw.gamma_lut; if (lut_is_legacy(gamma_lut)) @@ -1967,14 +1967,14 @@ static u32 intel_gamma_lut_tests(const struct intel_crtc_state *crtc_state) static u32 intel_degamma_lut_tests(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); return DISPLAY_INFO(i915)->color.degamma_lut_tests; } static int intel_gamma_lut_size(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); const struct drm_property_blob *gamma_lut = crtc_state->hw.gamma_lut; if (lut_is_legacy(gamma_lut)) @@ -1985,7 +1985,7 @@ static int intel_gamma_lut_size(const struct intel_crtc_state *crtc_state) static u32 intel_degamma_lut_size(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); return DISPLAY_INFO(i915)->color.degamma_lut_size; } @@ -2010,7 +2010,7 @@ static int check_lut_size(const struct drm_property_blob *lut, int expected) static int _check_luts(const struct intel_crtc_state *crtc_state, u32 degamma_tests, u32 gamma_tests) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); const struct drm_property_blob *gamma_lut = crtc_state->hw.gamma_lut; const struct drm_property_blob *degamma_lut = crtc_state->hw.degamma_lut; int gamma_length, degamma_length; @@ -2078,7 +2078,7 @@ static int i9xx_check_lut_10(struct drm_i915_private *dev_priv, void intel_color_assert_luts(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); /* make sure {pre,post}_csc_lut were correctly assigned */ if (DISPLAY_VER(i915) >= 11 || HAS_GMCH(i915)) { @@ -2116,7 +2116,7 @@ static void intel_assign_luts(struct intel_crtc_state *crtc_state) static int i9xx_color_check(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); int ret; ret = check_luts(crtc_state); @@ -2292,7 +2292,7 @@ static u32 ilk_csc_mode(const struct intel_crtc_state *crtc_state) static int ilk_assign_luts(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); if (ilk_lut_limited_range(crtc_state)) { struct drm_property_blob *gamma_lut; @@ -2330,7 +2330,7 @@ static int ilk_assign_luts(struct intel_crtc_state *crtc_state) static int ilk_color_check(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); int ret; ret = check_luts(crtc_state); @@ -2399,7 +2399,7 @@ static u32 ivb_csc_mode(const struct intel_crtc_state *crtc_state) static int ivb_assign_luts(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); struct drm_property_blob *degamma_lut, *gamma_lut; if (crtc_state->gamma_mode != GAMMA_MODE_MODE_SPLIT) @@ -2431,7 +2431,7 @@ static int ivb_assign_luts(struct intel_crtc_state *crtc_state) static int ivb_color_check(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); int ret; ret = check_luts(crtc_state); @@ -2499,7 +2499,7 @@ static bool glk_use_pre_csc_lut_for_gamma(const struct intel_crtc_state *crtc_st static int glk_assign_luts(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); if (glk_use_pre_csc_lut_for_gamma(crtc_state)) { struct drm_property_blob *gamma_lut; @@ -2562,7 +2562,7 @@ static int glk_check_luts(const struct intel_crtc_state *crtc_state) static int glk_color_check(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); int ret; ret = glk_check_luts(crtc_state); @@ -2617,7 +2617,7 @@ static int glk_color_check(struct intel_crtc_state *crtc_state) static u32 icl_gamma_mode(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); u32 gamma_mode = 0; if (crtc_state->hw.degamma_lut) @@ -3013,7 +3013,7 @@ static bool icl_lut_equal(const struct intel_crtc_state *crtc_state, static struct drm_property_blob *i9xx_read_lut_8(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; struct drm_property_blob *blob; struct drm_color_lut *lut; @@ -3038,7 +3038,7 @@ static struct drm_property_blob *i9xx_read_lut_8(struct intel_crtc *crtc) static struct drm_property_blob *i9xx_read_lut_10(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 lut_size = DISPLAY_INFO(dev_priv)->color.gamma_lut_size; enum pipe pipe = crtc->pipe; struct drm_property_blob *blob; @@ -3087,7 +3087,7 @@ static void i9xx_read_luts(struct intel_crtc_state *crtc_state) static struct drm_property_blob *i965_read_lut_10p6(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); int i, lut_size = DISPLAY_INFO(dev_priv)->color.gamma_lut_size; enum pipe pipe = crtc->pipe; struct drm_property_blob *blob; @@ -3137,7 +3137,7 @@ static void i965_read_luts(struct intel_crtc_state *crtc_state) static struct drm_property_blob *chv_read_cgm_degamma(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); int i, lut_size = DISPLAY_INFO(dev_priv)->color.degamma_lut_size; enum pipe pipe = crtc->pipe; struct drm_property_blob *blob; @@ -3163,7 +3163,7 @@ static struct drm_property_blob *chv_read_cgm_degamma(struct intel_crtc *crtc) static struct drm_property_blob *chv_read_cgm_gamma(struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); int i, lut_size = DISPLAY_INFO(i915)->color.gamma_lut_size; enum pipe pipe = crtc->pipe; struct drm_property_blob *blob; @@ -3202,7 +3202,7 @@ static void chv_read_luts(struct intel_crtc_state *crtc_state) static struct drm_property_blob *ilk_read_lut_8(struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; struct drm_property_blob *blob; struct drm_color_lut *lut; @@ -3227,7 +3227,7 @@ static struct drm_property_blob *ilk_read_lut_8(struct intel_crtc *crtc) static struct drm_property_blob *ilk_read_lut_10(struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); int i, lut_size = DISPLAY_INFO(i915)->color.gamma_lut_size; enum pipe pipe = crtc->pipe; struct drm_property_blob *blob; @@ -3281,7 +3281,7 @@ static void ilk_read_luts(struct intel_crtc_state *crtc_state) static struct drm_property_blob *ivb_read_lut_10(struct intel_crtc *crtc, u32 prec_index) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); int i, lut_size = ivb_lut_10_size(prec_index); enum pipe pipe = crtc->pipe; struct drm_property_blob *blob; @@ -3346,7 +3346,7 @@ static void ivb_read_luts(struct intel_crtc_state *crtc_state) static struct drm_property_blob *bdw_read_lut_10(struct intel_crtc *crtc, u32 prec_index) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); int i, lut_size = ivb_lut_10_size(prec_index); enum pipe pipe = crtc->pipe; struct drm_property_blob *blob; @@ -3411,7 +3411,7 @@ static void bdw_read_luts(struct intel_crtc_state *crtc_state) static struct drm_property_blob *glk_read_degamma_lut(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); int i, lut_size = DISPLAY_INFO(dev_priv)->color.degamma_lut_size; enum pipe pipe = crtc->pipe; struct drm_property_blob *blob; @@ -3476,7 +3476,7 @@ static void glk_read_luts(struct intel_crtc_state *crtc_state) static struct drm_property_blob * icl_read_lut_multi_segment(struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); int i, lut_size = DISPLAY_INFO(i915)->color.gamma_lut_size; enum pipe pipe = crtc->pipe; struct drm_property_blob *blob; @@ -3658,7 +3658,7 @@ static const struct intel_color_funcs ilk_color_funcs = { void intel_color_crtc_init(struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); int degamma_lut_size, gamma_lut_size; bool has_ctm; diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c index 182c6dd64f47..5540e5d2853a 100644 --- a/drivers/gpu/drm/i915/display/intel_crtc.c +++ b/drivers/gpu/drm/i915/display/intel_crtc.c @@ -35,7 +35,7 @@ static void assert_vblank_disabled(struct drm_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc->drm); if (I915_STATE_WARN(i915, drm_crtc_vblank_get(crtc) == 0, "[CRTC:%d:%s] vblank assertion failure (expected off, current on)\n", @@ -77,7 +77,7 @@ void intel_wait_for_vblank_if_active(struct drm_i915_private *i915, u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_vblank_crtc *vblank = &dev->vblank[drm_crtc_index(&crtc->base)]; if (!crtc->active) @@ -91,7 +91,7 @@ u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc) u32 intel_crtc_max_vblank_count(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); /* * From Gen 11, In case of dsi cmd mode, frame counter wouldnt @@ -409,10 +409,10 @@ static void intel_crtc_vblank_work(struct kthread_work *base) intel_color_load_luts(crtc_state); if (crtc_state->uapi.event) { - spin_lock_irq(&crtc->base.dev->event_lock); + spin_lock_irq(&crtc->base.drm->event_lock); drm_crtc_send_vblank_event(&crtc->base, crtc_state->uapi.event); crtc_state->uapi.event = NULL; - spin_unlock_irq(&crtc->base.dev->event_lock); + spin_unlock_irq(&crtc->base.drm->event_lock); } trace_intel_crtc_vblank_work_end(crtc); @@ -483,7 +483,7 @@ static int intel_mode_vblank_start(const struct drm_display_mode *mode) void intel_pipe_update_start(struct intel_crtc_state *new_crtc_state) { struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct drm_display_mode *adjusted_mode = &new_crtc_state->hw.adjusted_mode; long timeout = msecs_to_jiffies_timeout(1); int scanline, min, max, vblank_start; @@ -617,7 +617,7 @@ static void dbg_vblank_evade(struct intel_crtc *crtc, ktime_t end) crtc->debug.vbl.max = delta; if (delta > 1000 * VBLANK_EVASION_TIME_US) { - drm_dbg_kms(crtc->base.dev, + drm_dbg_kms(crtc->base.drm, "Atomic update on pipe (%c) took %lld us, max time under evasion is %u us\n", pipe_name(crtc->pipe), div_u64(delta, 1000), @@ -644,7 +644,7 @@ void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state) int scanline_end = intel_get_crtc_scanline(crtc); u32 end_vbl_count = intel_crtc_get_vblank_counter(crtc); ktime_t end_vbl_time = ktime_get(); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); intel_psr_unlock(new_crtc_state); @@ -673,10 +673,10 @@ void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state) drm_WARN_ON(&dev_priv->drm, drm_crtc_vblank_get(&crtc->base) != 0); - spin_lock(&crtc->base.dev->event_lock); + spin_lock(&crtc->base.drm->event_lock); drm_crtc_arm_vblank_event(&crtc->base, new_crtc_state->uapi.event); - spin_unlock(&crtc->base.dev->event_lock); + spin_unlock(&crtc->base.drm->event_lock); new_crtc_state->uapi.event = NULL; } diff --git a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c index 8d4640d0fd34..b3eb7c38acd9 100644 --- a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c +++ b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c @@ -31,7 +31,7 @@ intel_dump_m_n_config(const struct intel_crtc_state *pipe_config, const char *id, unsigned int lane_count, const struct intel_link_m_n *m_n) { - struct drm_i915_private *i915 = to_i915(pipe_config->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(pipe_config->uapi.crtc->drm); drm_dbg_kms(&i915->drm, "%s: lanes: %i; data_m: %u, data_n: %u, link_m: %u, link_n: %u, tu: %u\n", @@ -202,7 +202,7 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config, const char *context) { struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); const struct intel_plane_state *plane_state; struct intel_plane *plane; char buf[64]; diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c b/drivers/gpu/drm/i915/display/intel_cursor.c index b342fad180ca..b095fd85717f 100644 --- a/drivers/gpu/drm/i915/display/intel_cursor.c +++ b/drivers/gpu/drm/i915/display/intel_cursor.c @@ -333,7 +333,7 @@ i9xx_cursor_max_stride(struct intel_plane *plane, static u32 i9xx_cursor_ctl_crtc(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 cntl = 0; if (DISPLAY_VER(dev_priv) >= 11) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index 7ada98354b17..26955a3efb3e 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -383,7 +383,7 @@ void intel_ddi_set_dp_msa(const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; u32 temp; @@ -472,7 +472,7 @@ intel_ddi_transcoder_func_reg_val_get(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; enum port port = encoder->port; @@ -583,7 +583,7 @@ void intel_ddi_enable_transcoder_func(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; if (DISPLAY_VER(dev_priv) >= 11) { @@ -616,7 +616,7 @@ intel_ddi_config_transcoder_func(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; u32 ctl; @@ -628,7 +628,7 @@ intel_ddi_config_transcoder_func(struct intel_encoder *encoder, void intel_ddi_disable_transcoder_func(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; u32 ctl; @@ -638,7 +638,7 @@ void intel_ddi_disable_transcoder_func(const struct intel_crtc_state *crtc_state ctl = intel_de_read(dev_priv, TRANS_DDI_FUNC_CTL(cpu_transcoder)); - drm_WARN_ON(crtc->base.dev, ctl & TRANS_DDI_HDCP_SIGNALLING); + drm_WARN_ON(crtc->base.drm, ctl & TRANS_DDI_HDCP_SIGNALLING); ctl &= ~TRANS_DDI_FUNC_ENABLE; @@ -977,7 +977,7 @@ void intel_ddi_enable_transcoder_clock(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; enum phy phy = intel_port_to_phy(dev_priv, encoder->port); u32 val; @@ -997,7 +997,7 @@ void intel_ddi_enable_transcoder_clock(struct intel_encoder *encoder, void intel_ddi_disable_transcoder_clock(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; u32 val; @@ -2276,7 +2276,7 @@ static void intel_ddi_mso_get_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) { struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; u32 dss1; @@ -2313,7 +2313,7 @@ static void intel_ddi_mso_get_config(struct intel_encoder *encoder, static void intel_ddi_mso_configure(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; u32 dss1 = 0; @@ -2766,7 +2766,7 @@ static void intel_ddi_pre_enable(struct intel_atomic_state *state, const struct drm_connector_state *conn_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; /* @@ -3617,7 +3617,7 @@ static enum transcoder bdw_transcoder_master_readout(struct drm_i915_private *de static void bdw_get_trans_port_sync_config(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); u32 transcoders = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | BIT(TRANSCODER_C) | BIT(TRANSCODER_D); enum transcoder cpu_transcoder; @@ -4125,7 +4125,7 @@ intel_ddi_port_sync_transcoders(const struct intel_crtc_state *ref_crtc_state, { struct drm_connector *connector; const struct drm_connector_state *conn_state; - struct drm_i915_private *dev_priv = to_i915(ref_crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(ref_crtc_state->uapi.crtc->drm); struct intel_atomic_state *state = to_intel_atomic_state(ref_crtc_state->uapi.state); u8 transcoders = 0; @@ -4293,7 +4293,7 @@ static int modeset_pipe(struct drm_crtc *crtc, struct drm_crtc_state *crtc_state; int ret; - state = drm_atomic_state_alloc(crtc->dev); + state = drm_atomic_state_alloc(crtc->drm); if (!state) return -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 0a9774eaf9f1..5d381ca03aa2 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -275,7 +275,7 @@ static int intel_bigjoiner_num_pipes(const struct intel_crtc_state *crtc_state) struct intel_crtc *intel_master_crtc(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); if (intel_crtc_is_bigjoiner_slave(crtc_state)) return intel_crtc_for_pipe(i915, bigjoiner_master_pipe(crtc_state)); @@ -287,7 +287,7 @@ static void intel_wait_for_pipe_off(const struct intel_crtc_state *old_crtc_state) { struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); if (DISPLAY_VER(dev_priv) >= 4) { enum transcoder cpu_transcoder = old_crtc_state->cpu_transcoder; @@ -348,7 +348,7 @@ static void assert_plane(struct intel_plane *plane, bool state) static void assert_planes_disabled(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_plane *plane; for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, plane) @@ -393,7 +393,7 @@ void vlv_wait_port_ready(struct drm_i915_private *dev_priv, void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state) { struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = new_crtc_state->cpu_transcoder; enum pipe pipe = crtc->pipe; i915_reg_t reg; @@ -454,7 +454,7 @@ void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state) void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state) { struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = old_crtc_state->cpu_transcoder; enum pipe pipe = crtc->pipe; i915_reg_t reg; @@ -613,7 +613,7 @@ void intel_set_plane_visible(struct intel_crtc_state *crtc_state, void intel_plane_fixup_bitmasks(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); struct drm_plane *plane; /* @@ -634,7 +634,7 @@ void intel_plane_fixup_bitmasks(struct intel_crtc_state *crtc_state) void intel_plane_disable_noatomic(struct intel_crtc *crtc, struct intel_plane *plane) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state); struct intel_plane_state *plane_state = @@ -697,7 +697,7 @@ intel_plane_fence_y_offset(const struct intel_plane_state *plane_state) static void icl_set_pipe_chicken(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; u32 tmp; @@ -793,7 +793,7 @@ intel_get_crtc_new_encoder(const struct intel_atomic_state *state, static void ilk_pfit_enable(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct drm_rect *dst = &crtc_state->pch_pfit.dst; enum pipe pipe = crtc->pipe; int width = drm_rect_width(dst); @@ -832,7 +832,7 @@ static void intel_crtc_dpms_overlay_disable(struct intel_crtc *crtc) static bool needs_nv12_wa(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); if (!crtc_state->nv12_planes) return false; @@ -846,7 +846,7 @@ static bool needs_nv12_wa(const struct intel_crtc_state *crtc_state) static bool needs_scalerclk_wa(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); /* Wa_2006604312:icl,ehl */ if (crtc_state->scaler_state.scaler_users > 0 && DISPLAY_VER(dev_priv) == 11) @@ -857,7 +857,7 @@ static bool needs_scalerclk_wa(const struct intel_crtc_state *crtc_state) static bool needs_cursorclk_wa(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); /* Wa_1604331009:icl,jsl,ehl */ if (is_hdr_mode(crtc_state) && @@ -889,7 +889,7 @@ static void intel_async_flip_vtd_wa(struct drm_i915_private *i915, static bool needs_async_flip_vtd_wa(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); return crtc_state->uapi.async_flip && i915_vtd_active(i915) && (DISPLAY_VER(i915) == 9 || IS_BROADWELL(i915) || IS_HASWELL(i915)); @@ -1146,7 +1146,7 @@ static void intel_pre_plane_update(struct intel_atomic_state *state, static void intel_crtc_disable_planes(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct intel_crtc_state *new_crtc_state = intel_atomic_get_new_crtc_state(state, crtc); unsigned int update_mask = new_crtc_state->update_planes; @@ -1382,7 +1382,7 @@ static void ilk_crtc_enable(struct intel_atomic_state *state, { const struct intel_crtc_state *new_crtc_state = intel_atomic_get_new_crtc_state(state, crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; if (drm_WARN_ON(&dev_priv->drm, crtc->active)) @@ -1472,7 +1472,7 @@ static void glk_pipe_scaler_clock_gating_wa(struct drm_i915_private *dev_priv, static void hsw_set_linetime_wm(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); intel_de_write(dev_priv, WM_LINETIME(crtc->pipe), HSW_LINETIME(crtc_state->linetime) | @@ -1482,7 +1482,7 @@ static void hsw_set_linetime_wm(const struct intel_crtc_state *crtc_state) static void hsw_set_frame_start_delay(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder transcoder = crtc_state->cpu_transcoder; i915_reg_t reg = DISPLAY_VER(dev_priv) >= 14 ? MTL_CHICKEN_TRANS(transcoder) : CHICKEN_TRANS(transcoder); @@ -1513,7 +1513,7 @@ static void icl_ddi_bigjoiner_pre_enable(struct intel_atomic_state *state, static void hsw_configure_cpu_transcoder(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; if (crtc_state->has_pch_encoder) { @@ -1544,7 +1544,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state, { const struct intel_crtc_state *new_crtc_state = intel_atomic_get_new_crtc_state(state, crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe, hsw_workaround_pipe; enum transcoder cpu_transcoder = new_crtc_state->cpu_transcoder; bool psl_clkgate_wa; @@ -1635,7 +1635,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state, void ilk_pfit_disable(const struct intel_crtc_state *old_crtc_state) { struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; /* To avoid upsetting the power well on haswell only disable the pfit if @@ -1653,7 +1653,7 @@ static void ilk_crtc_disable(struct intel_atomic_state *state, { const struct intel_crtc_state *old_crtc_state = intel_atomic_get_old_crtc_state(state, crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; /* @@ -1691,7 +1691,7 @@ static void hsw_crtc_disable(struct intel_atomic_state *state, { const struct intel_crtc_state *old_crtc_state = intel_atomic_get_old_crtc_state(state, crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); /* * FIXME collapse everything to one hook. @@ -1720,7 +1720,7 @@ static void hsw_crtc_disable(struct intel_atomic_state *state, static void i9xx_pfit_enable(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); if (!crtc_state->gmch_pfit.control) return; @@ -1834,7 +1834,7 @@ static void get_crtc_power_domains(struct intel_crtc_state *crtc_state, struct intel_power_domain_mask *mask) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; struct drm_encoder *encoder; enum pipe pipe = crtc->pipe; @@ -1871,7 +1871,7 @@ void intel_modeset_get_crtc_power_domains(struct intel_crtc_state *crtc_state, struct intel_power_domain_mask *old_domains) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum intel_display_power_domain domain; struct intel_power_domain_mask domains, new_domains; @@ -1895,7 +1895,7 @@ void intel_modeset_get_crtc_power_domains(struct intel_crtc_state *crtc_state, void intel_modeset_put_crtc_power_domains(struct intel_crtc *crtc, struct intel_power_domain_mask *domains) { - intel_display_power_put_mask_in_set(to_i915(crtc->base.dev), + intel_display_power_put_mask_in_set(to_i915(crtc->base.drm), &crtc->enabled_power_domains, domains); } @@ -1922,7 +1922,7 @@ static void valleyview_crtc_enable(struct intel_atomic_state *state, { const struct intel_crtc_state *new_crtc_state = intel_atomic_get_new_crtc_state(state, crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; if (drm_WARN_ON(&dev_priv->drm, crtc->active)) @@ -1973,7 +1973,7 @@ static void i9xx_crtc_enable(struct intel_atomic_state *state, { const struct intel_crtc_state *new_crtc_state = intel_atomic_get_new_crtc_state(state, crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; if (drm_WARN_ON(&dev_priv->drm, crtc->active)) @@ -2016,7 +2016,7 @@ static void i9xx_crtc_enable(struct intel_atomic_state *state, static void i9xx_pfit_disable(const struct intel_crtc_state *old_crtc_state) { struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); if (!old_crtc_state->gmch_pfit.control) return; @@ -2033,7 +2033,7 @@ static void i9xx_crtc_disable(struct intel_atomic_state *state, { struct intel_crtc_state *old_crtc_state = intel_atomic_get_old_crtc_state(state, crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; /* @@ -2085,7 +2085,7 @@ void intel_encoder_destroy(struct drm_encoder *encoder) static bool intel_crtc_supports_double_wide(const struct intel_crtc *crtc) { - const struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + const struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); /* GDG double wide on either pipe, otherwise pipe A only */ return DISPLAY_VER(dev_priv) < 4 && @@ -2136,7 +2136,7 @@ static void intel_mode_from_crtc_timings(struct drm_display_mode *mode, static void intel_crtc_compute_pixel_rate(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); if (HAS_GMCH(dev_priv)) /* FIXME calculate proper pipe pixel rate for GMCH pfit */ @@ -2250,7 +2250,7 @@ static void intel_bigjoiner_compute_pipe_src(struct intel_crtc_state *crtc_state static int intel_crtc_compute_pipe_src(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); intel_bigjoiner_compute_pipe_src(crtc_state); @@ -2283,7 +2283,7 @@ static int intel_crtc_compute_pipe_src(struct intel_crtc_state *crtc_state) static int intel_crtc_compute_pipe_mode(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode; int clock_limit = i915->max_dotclk_freq; @@ -2462,7 +2462,7 @@ void intel_cpu_transcoder_set_m1_n1(struct intel_crtc *crtc, enum transcoder transcoder, const struct intel_link_m_n *m_n) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; if (DISPLAY_VER(dev_priv) >= 5) @@ -2479,7 +2479,7 @@ void intel_cpu_transcoder_set_m2_n2(struct intel_crtc *crtc, enum transcoder transcoder, const struct intel_link_m_n *m_n) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); if (!intel_cpu_transcoder_has_m2_n2(dev_priv, transcoder)) return; @@ -2492,7 +2492,7 @@ void intel_cpu_transcoder_set_m2_n2(struct intel_crtc *crtc, static void intel_set_transcoder_timings(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; @@ -2573,7 +2573,7 @@ static void intel_set_transcoder_timings(const struct intel_crtc_state *crtc_sta static void intel_set_pipe_src_size(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); int width = drm_rect_width(&crtc_state->pipe_src); int height = drm_rect_height(&crtc_state->pipe_src); enum pipe pipe = crtc->pipe; @@ -2587,7 +2587,7 @@ static void intel_set_pipe_src_size(const struct intel_crtc_state *crtc_state) static bool intel_pipe_is_interlaced(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; if (DISPLAY_VER(dev_priv) == 2) @@ -2603,7 +2603,7 @@ static bool intel_pipe_is_interlaced(const struct intel_crtc_state *crtc_state) static void intel_get_transcoder_timings(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; @@ -2669,7 +2669,7 @@ static void intel_bigjoiner_adjust_pipe_src(struct intel_crtc_state *crtc_state) static void intel_get_pipe_src_size(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); u32 tmp; @@ -2685,7 +2685,7 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc, void i9xx_set_pipeconf(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; u32 val = 0; @@ -2762,7 +2762,7 @@ static bool i9xx_has_pfit(struct drm_i915_private *dev_priv) static void i9xx_get_pfit_config(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe; u32 tmp; @@ -2790,7 +2790,7 @@ static void i9xx_get_pfit_config(struct intel_crtc_state *crtc_state) static void vlv_crtc_clock_get(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); enum pipe pipe = crtc->pipe; struct dpll clock; @@ -2817,7 +2817,7 @@ static void vlv_crtc_clock_get(struct intel_crtc *crtc, static void chv_crtc_clock_get(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); enum pipe pipe = crtc->pipe; enum dpio_channel port = vlv_pipe_to_channel(pipe); @@ -2851,7 +2851,7 @@ static void chv_crtc_clock_get(struct intel_crtc *crtc, static enum intel_output_format bdw_get_pipe_misc_output_format(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 tmp; tmp = intel_de_read(dev_priv, PIPE_MISC(crtc->pipe)); @@ -2873,7 +2873,7 @@ static void i9xx_get_pipe_color_config(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); struct intel_plane *plane = to_intel_plane(crtc->base.primary); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum i9xx_plane_id i9xx_plane = plane->i9xx_plane; u32 tmp; @@ -2890,7 +2890,7 @@ static void i9xx_get_pipe_color_config(struct intel_crtc_state *crtc_state) static bool i9xx_get_pipe_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum intel_display_power_domain power_domain; intel_wakeref_t wakeref; u32 tmp; @@ -3019,7 +3019,7 @@ static bool i9xx_get_pipe_config(struct intel_crtc *crtc, void ilk_set_pipeconf(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; u32 val = 0; @@ -3083,7 +3083,7 @@ void ilk_set_pipeconf(const struct intel_crtc_state *crtc_state) static void hsw_set_transconf(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; u32 val = 0; @@ -3113,7 +3113,7 @@ static void hsw_set_transconf(const struct intel_crtc_state *crtc_state) static void bdw_set_pipe_misc(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 val = 0; switch (crtc_state->pipe_bpp) { @@ -3158,7 +3158,7 @@ static void bdw_set_pipe_misc(const struct intel_crtc_state *crtc_state) int bdw_get_pipe_misc_bpp(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 tmp; tmp = intel_de_read(dev_priv, PIPE_MISC(crtc->pipe)); @@ -3217,7 +3217,7 @@ void intel_cpu_transcoder_get_m1_n1(struct intel_crtc *crtc, enum transcoder transcoder, struct intel_link_m_n *m_n) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; if (DISPLAY_VER(dev_priv) >= 5) @@ -3234,7 +3234,7 @@ void intel_cpu_transcoder_get_m2_n2(struct intel_crtc *crtc, enum transcoder transcoder, struct intel_link_m_n *m_n) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); if (!intel_cpu_transcoder_has_m2_n2(dev_priv, transcoder)) return; @@ -3247,7 +3247,7 @@ void intel_cpu_transcoder_get_m2_n2(struct intel_crtc *crtc, static void ilk_get_pfit_config(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 ctl, pos, size; enum pipe pipe; @@ -3282,7 +3282,7 @@ static void ilk_get_pfit_config(struct intel_crtc_state *crtc_state) static bool ilk_get_pipe_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); enum intel_display_power_domain power_domain; intel_wakeref_t wakeref; @@ -3482,7 +3482,7 @@ static u8 hsw_panel_transcoders(struct drm_i915_private *i915) static u8 hsw_enabled_transcoders(struct intel_crtc *crtc) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); u8 panel_transcoder_mask = hsw_panel_transcoders(dev_priv); enum transcoder cpu_transcoder; @@ -3586,7 +3586,7 @@ static bool hsw_get_transcoder_state(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config, struct intel_display_power_domain_set *power_domain_set) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); unsigned long enabled_transcoders; u32 tmp; @@ -3624,7 +3624,7 @@ static bool bxt_get_dsi_transcoder_state(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config, struct intel_display_power_domain_set *power_domain_set) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); enum transcoder cpu_transcoder; enum port port; @@ -3669,7 +3669,7 @@ static bool bxt_get_dsi_transcoder_state(struct intel_crtc *crtc, static void intel_bigjoiner_get_config(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); u8 master_pipes, slave_pipes; enum pipe pipe = crtc->pipe; @@ -3686,7 +3686,7 @@ static void intel_bigjoiner_get_config(struct intel_crtc_state *crtc_state) static bool hsw_get_pipe_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); bool active; u32 tmp; @@ -3799,7 +3799,7 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc, bool intel_crtc_get_pipe_config(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); if (!i915->display.funcs.display->get_pipe_config(crtc, crtc_state)) return false; @@ -3831,7 +3831,7 @@ static int i9xx_pll_refclk(struct drm_device *dev, void i9xx_crtc_clock_get(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); u32 dpll = pipe_config->dpll_hw_state.dpll; u32 fp; @@ -4061,7 +4061,7 @@ static int icl_add_linked_planes(struct intel_atomic_state *state) static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_atomic_state *state = to_intel_atomic_state(crtc_state->uapi.state); struct intel_plane *plane, *linked; struct intel_plane_state *plane_state; @@ -4208,7 +4208,7 @@ static u16 hsw_ips_linetime_wm(const struct intel_crtc_state *crtc_state, static u16 skl_linetime_wm(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode; int linetime_wm; @@ -4230,7 +4230,7 @@ static u16 skl_linetime_wm(const struct intel_crtc_state *crtc_state) static int hsw_compute_linetime_wm(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); const struct intel_cdclk_state *cdclk_state; @@ -4256,7 +4256,7 @@ static int hsw_compute_linetime_wm(struct intel_atomic_state *state, static int intel_crtc_atomic_check(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); int ret; @@ -4343,7 +4343,7 @@ compute_sink_pipe_bpp(const struct drm_connector_state *conn_state, struct intel_crtc_state *crtc_state) { struct drm_connector *connector = conn_state->connector; - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); const struct drm_display_info *info = &connector->display_info; int bpp; @@ -4384,7 +4384,7 @@ static int compute_baseline_pipe_bpp(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); struct drm_connector *connector; @@ -4601,7 +4601,7 @@ intel_crtc_prepare_cleared_state(struct intel_atomic_state *state, { struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_crtc_state *saved_state; saved_state = intel_crtc_state_alloc(crtc); @@ -4640,7 +4640,7 @@ static int intel_modeset_pipe_config(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); struct drm_connector *connector; @@ -4960,7 +4960,7 @@ static void __printf(4, 5) pipe_config_mismatch(bool fastset, const struct intel_crtc *crtc, const char *name, const char *format, ...) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct va_format vaf; va_list args; @@ -5001,7 +5001,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, const struct intel_crtc_state *pipe_config, bool fastset) { - struct drm_i915_private *dev_priv = to_i915(current_config->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(current_config->uapi.crtc->drm); struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); bool ret = true; bool fixup_inherited = fastset && @@ -5559,7 +5559,7 @@ static int intel_modeset_checks(struct intel_atomic_state *state) static void intel_crtc_check_fastset(const struct intel_crtc_state *old_crtc_state, struct intel_crtc_state *new_crtc_state) { - struct drm_i915_private *i915 = to_i915(old_crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(old_crtc_state->uapi.crtc->drm); if (!intel_pipe_config_compare(old_crtc_state, new_crtc_state, true)) { drm_dbg_kms(&i915->drm, "fastset requirement not met, forcing full modeset\n"); @@ -5721,7 +5721,7 @@ static int intel_atomic_check_crtcs(struct intel_atomic_state *state) int i; for_each_new_intel_crtc_in_state(state, crtc, crtc_state, i) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); int ret; ret = intel_crtc_atomic_check(state, crtc); @@ -6427,7 +6427,7 @@ static int intel_atomic_prepare_commit(struct intel_atomic_state *state) void intel_crtc_arm_fifo_underrun(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); if (DISPLAY_VER(dev_priv) != 2 || crtc_state->active_planes) intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe, true); @@ -6444,7 +6444,7 @@ static void intel_pipe_fastset(const struct intel_crtc_state *old_crtc_state, const struct intel_crtc_state *new_crtc_state) { struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); /* * Update pipe size and adjust fitter if needed: the reason for this is diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c b/drivers/gpu/drm/i915/display/intel_display_irq.c index ae2578741dfe..f5b127a58d12 100644 --- a/drivers/gpu/drm/i915/display/intel_display_irq.c +++ b/drivers/gpu/drm/i915/display/intel_display_irq.c @@ -1177,7 +1177,7 @@ void gen11_display_irq_handler(struct drm_i915_private *i915) */ int i8xx_enable_vblank(struct drm_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc->drm); enum pipe pipe = to_intel_crtc(crtc)->pipe; unsigned long irqflags; @@ -1190,7 +1190,7 @@ int i8xx_enable_vblank(struct drm_crtc *crtc) int i915gm_enable_vblank(struct drm_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc->drm); /* * Vblank interrupts fail to wake the device up from C2+. @@ -1206,7 +1206,7 @@ int i915gm_enable_vblank(struct drm_crtc *crtc) int i965_enable_vblank(struct drm_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc->drm); enum pipe pipe = to_intel_crtc(crtc)->pipe; unsigned long irqflags; @@ -1220,7 +1220,7 @@ int i965_enable_vblank(struct drm_crtc *crtc) int ilk_enable_vblank(struct drm_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc->drm); enum pipe pipe = to_intel_crtc(crtc)->pipe; unsigned long irqflags; u32 bit = DISPLAY_VER(dev_priv) >= 7 ? @@ -1242,7 +1242,7 @@ int ilk_enable_vblank(struct drm_crtc *crtc) static bool gen11_dsi_configure_te(struct intel_crtc *intel_crtc, bool enable) { - struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.drm); enum port port; if (!(intel_crtc->mode_flags & @@ -1266,7 +1266,7 @@ static bool gen11_dsi_configure_te(struct intel_crtc *intel_crtc, int bdw_enable_vblank(struct drm_crtc *_crtc) { struct intel_crtc *crtc = to_intel_crtc(_crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; unsigned long irqflags; @@ -1291,7 +1291,7 @@ int bdw_enable_vblank(struct drm_crtc *_crtc) */ void i8xx_disable_vblank(struct drm_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc->drm); enum pipe pipe = to_intel_crtc(crtc)->pipe; unsigned long irqflags; @@ -1302,7 +1302,7 @@ void i8xx_disable_vblank(struct drm_crtc *crtc) void i915gm_disable_vblank(struct drm_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc->drm); i8xx_disable_vblank(crtc); @@ -1312,7 +1312,7 @@ void i915gm_disable_vblank(struct drm_crtc *crtc) void i965_disable_vblank(struct drm_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc->drm); enum pipe pipe = to_intel_crtc(crtc)->pipe; unsigned long irqflags; @@ -1324,7 +1324,7 @@ void i965_disable_vblank(struct drm_crtc *crtc) void ilk_disable_vblank(struct drm_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc->drm); enum pipe pipe = to_intel_crtc(crtc)->pipe; unsigned long irqflags; u32 bit = DISPLAY_VER(dev_priv) >= 7 ? @@ -1338,7 +1338,7 @@ void ilk_disable_vblank(struct drm_crtc *crtc) void bdw_disable_vblank(struct drm_crtc *_crtc) { struct intel_crtc *crtc = to_intel_crtc(_crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; unsigned long irqflags; diff --git a/drivers/gpu/drm/i915/display/intel_display_rps.c b/drivers/gpu/drm/i915/display/intel_display_rps.c index 918d0327169a..9d01d6542e14 100644 --- a/drivers/gpu/drm/i915/display/intel_display_rps.c +++ b/drivers/gpu/drm/i915/display/intel_display_rps.c @@ -48,7 +48,7 @@ void intel_display_rps_boost_after_vblank(struct drm_crtc *crtc, if (!dma_fence_is_i915(fence)) return; - if (DISPLAY_VER(to_i915(crtc->dev)) < 6) + if (DISPLAY_VER(to_i915(crtc->drm)) < 6) return; if (drm_crtc_vblank_get(crtc)) diff --git a/drivers/gpu/drm/i915/display/intel_display_trace.h b/drivers/gpu/drm/i915/display/intel_display_trace.h index 99bdb833591c..dd5008dcf2fb 100644 --- a/drivers/gpu/drm/i915/display/intel_display_trace.h +++ b/drivers/gpu/drm/i915/display/intel_display_trace.h @@ -19,7 +19,7 @@ #include "intel_vblank.h" #define __dev_name_i915(i915) dev_name((i915)->drm.dev) -#define __dev_name_kms(obj) dev_name((obj)->base.dev->dev) +#define __dev_name_kms(obj) dev_name((obj)->base.drm->dev) TRACE_EVENT(intel_pipe_enable, TP_PROTO(struct intel_crtc *crtc), @@ -32,7 +32,7 @@ TRACE_EVENT(intel_pipe_enable, __field(enum pipe, pipe) ), TP_fast_assign( - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_crtc *it__; __assign_str(dev, __dev_name_kms(crtc)); for_each_intel_crtc(&dev_priv->drm, it__) { @@ -61,7 +61,7 @@ TRACE_EVENT(intel_pipe_disable, ), TP_fast_assign( - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_crtc *it__; __assign_str(dev, __dev_name_kms(crtc)); for_each_intel_crtc(&dev_priv->drm, it__) { @@ -308,6 +308,9 @@ TRACE_EVENT(vlv_fifo_size, __entry->sprite0_start, __entry->sprite1_start, __entry->fifo_size) ); +#undef __dev_name_kms +#define __dev_name_kms(obj) dev_name((obj)->base.dev->dev) + TRACE_EVENT(intel_plane_update_noarm, TP_PROTO(struct intel_plane *plane, struct intel_crtc *crtc), TP_ARGS(plane, crtc), @@ -476,6 +479,9 @@ TRACE_EVENT(intel_fbc_nuke, __entry->frame, __entry->scanline) ); +#undef __dev_name_kms +#define __dev_name_kms(obj) dev_name((obj)->base.drm->dev) + TRACE_EVENT(intel_crtc_vblank_work_start, TP_PROTO(struct intel_crtc *crtc), TP_ARGS(crtc), diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 0cd561603ee1..79d0e99a9a76 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -1935,7 +1935,7 @@ static void intel_dp_compute_vsc_colorimetry(const struct intel_crtc_state *crtc struct drm_dp_vsc_sdp *vsc) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); /* * Prepare VSC Header for SU as per DP 1.4 spec, Table 2-118 diff --git a/drivers/gpu/drm/i915/display/intel_dpll.c b/drivers/gpu/drm/i915/display/intel_dpll.c index b0fb96717932..8db5d959cb18 100644 --- a/drivers/gpu/drm/i915/display/intel_dpll.c +++ b/drivers/gpu/drm/i915/display/intel_dpll.c @@ -408,7 +408,7 @@ i9xx_select_p2_div(const struct intel_limit *limit, const struct intel_crtc_state *crtc_state, int target) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_LVDS)) { /* @@ -444,7 +444,7 @@ i9xx_find_best_dpll(const struct intel_limit *limit, const struct dpll *match_clock, struct dpll *best_clock) { - struct drm_device *dev = crtc_state->uapi.crtc->dev; + struct drm_device *dev = crtc_state->uapi.crtc->drm; struct dpll clock; int err = target; @@ -502,7 +502,7 @@ pnv_find_best_dpll(const struct intel_limit *limit, const struct dpll *match_clock, struct dpll *best_clock) { - struct drm_device *dev = crtc_state->uapi.crtc->dev; + struct drm_device *dev = crtc_state->uapi.crtc->drm; struct dpll clock; int err = target; @@ -558,7 +558,7 @@ g4x_find_best_dpll(const struct intel_limit *limit, const struct dpll *match_clock, struct dpll *best_clock) { - struct drm_device *dev = crtc_state->uapi.crtc->dev; + struct drm_device *dev = crtc_state->uapi.crtc->drm; struct dpll clock; int max_n; bool found = false; @@ -653,7 +653,7 @@ vlv_find_best_dpll(const struct intel_limit *limit, struct dpll *best_clock) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct dpll clock; unsigned int bestppm = 1000000; /* min update 19.2 MHz */ @@ -711,7 +711,7 @@ chv_find_best_dpll(const struct intel_limit *limit, struct dpll *best_clock) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; unsigned int best_error_ppm; struct dpll clock; u64 m2; @@ -788,7 +788,7 @@ static void i9xx_update_pll_dividers(struct intel_crtc_state *crtc_state, const struct dpll *reduced_clock) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 fp, fp2; if (IS_PINEVIEW(dev_priv)) { @@ -808,7 +808,7 @@ static void i9xx_compute_dpll(struct intel_crtc_state *crtc_state, const struct dpll *reduced_clock) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 dpll; i9xx_update_pll_dividers(crtc_state, clock, reduced_clock); @@ -887,7 +887,7 @@ static void i8xx_compute_dpll(struct intel_crtc_state *crtc_state, const struct dpll *reduced_clock) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 dpll; i9xx_update_pll_dividers(crtc_state, clock, reduced_clock); @@ -1032,7 +1032,7 @@ static void ilk_update_pll_dividers(struct intel_crtc_state *crtc_state, const struct dpll *reduced_clock) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 fp, fp2; int factor; @@ -1065,7 +1065,7 @@ static void ilk_compute_dpll(struct intel_crtc_state *crtc_state, const struct dpll *reduced_clock) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 dpll; ilk_update_pll_dividers(crtc_state, clock, reduced_clock); @@ -1581,7 +1581,7 @@ static bool i9xx_has_pps(struct drm_i915_private *dev_priv) void i9xx_enable_pll(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 dpll = crtc_state->dpll_hw_state.dpll; enum pipe pipe = crtc->pipe; int i; @@ -1659,7 +1659,7 @@ static void vlv_pllb_recal_opamp(struct drm_i915_private *dev_priv, static void vlv_prepare_pll(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; u32 mdiv; u32 bestn, bestm1, bestm2, bestp1, bestp2; @@ -1749,7 +1749,7 @@ static void vlv_prepare_pll(const struct intel_crtc_state *crtc_state) static void _vlv_enable_pll(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; intel_de_write(dev_priv, DPLL(pipe), crtc_state->dpll_hw_state.dpll); @@ -1763,7 +1763,7 @@ static void _vlv_enable_pll(const struct intel_crtc_state *crtc_state) void vlv_enable_pll(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; assert_transcoder_disabled(dev_priv, crtc_state->cpu_transcoder); @@ -1789,7 +1789,7 @@ void vlv_enable_pll(const struct intel_crtc_state *crtc_state) static void chv_prepare_pll(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; enum dpio_channel port = vlv_pipe_to_channel(pipe); u32 loopfilter, tribuf_calcntr; @@ -1883,7 +1883,7 @@ static void chv_prepare_pll(const struct intel_crtc_state *crtc_state) static void _chv_enable_pll(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; enum dpio_channel port = vlv_pipe_to_channel(pipe); u32 tmp; @@ -1913,7 +1913,7 @@ static void _chv_enable_pll(const struct intel_crtc_state *crtc_state) void chv_enable_pll(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; assert_transcoder_disabled(dev_priv, crtc_state->cpu_transcoder); @@ -2040,7 +2040,7 @@ void chv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe) void i9xx_disable_pll(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; /* Don't disable pipe or pipe PLLs if needed */ diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c index ef039b1b34eb..ca96d98ac285 100644 --- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c +++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c @@ -220,7 +220,7 @@ intel_tc_pll_enable_reg(struct drm_i915_private *i915, void intel_enable_shared_dpll(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_shared_dpll *pll = crtc_state->shared_dpll; unsigned int pipe_mask = BIT(crtc->pipe); unsigned int old_mask; @@ -266,7 +266,7 @@ void intel_enable_shared_dpll(const struct intel_crtc_state *crtc_state) void intel_disable_shared_dpll(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_shared_dpll *pll = crtc_state->shared_dpll; unsigned int pipe_mask = BIT(crtc->pipe); @@ -309,7 +309,7 @@ intel_find_shared_dpll(struct intel_atomic_state *state, const struct intel_dpll_hw_state *pll_state, unsigned long dpll_mask) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_shared_dpll *pll, *unused_pll = NULL; struct intel_shared_dpll_state *shared_dpll; enum intel_dpll_id i; @@ -365,7 +365,7 @@ intel_reference_shared_dpll_crtc(const struct intel_crtc *crtc, const struct intel_shared_dpll *pll, struct intel_shared_dpll_state *shared_dpll_state) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); drm_WARN_ON(&i915->drm, (shared_dpll_state->pipe_mask & BIT(crtc->pipe)) != 0); @@ -405,7 +405,7 @@ intel_unreference_shared_dpll_crtc(const struct intel_crtc *crtc, const struct intel_shared_dpll *pll, struct intel_shared_dpll_state *shared_dpll_state) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); drm_WARN_ON(&i915->drm, (shared_dpll_state->pipe_mask & BIT(crtc->pipe)) == 0); @@ -556,7 +556,7 @@ static int ibx_get_dpll(struct intel_atomic_state *state, { struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_shared_dpll *pll; enum intel_dpll_id i; @@ -995,7 +995,7 @@ hsw_ddi_wrpll_get_dpll(struct intel_atomic_state *state, static int hsw_ddi_lcpll_compute_dpll(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); int clock = crtc_state->port_clock; switch (clock / 2) { @@ -1013,7 +1013,7 @@ hsw_ddi_lcpll_compute_dpll(struct intel_crtc_state *crtc_state) static struct intel_shared_dpll * hsw_ddi_lcpll_get_dpll(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); struct intel_shared_dpll *pll; enum intel_dpll_id pll_id; int clock = crtc_state->port_clock; @@ -1072,7 +1072,7 @@ hsw_ddi_spll_compute_dpll(struct intel_atomic_state *state, struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); - if (drm_WARN_ON(crtc->base.dev, crtc_state->port_clock / 2 != 135000)) + if (drm_WARN_ON(crtc->base.drm, crtc_state->port_clock / 2 != 135000)) return -EINVAL; crtc_state->dpll_hw_state.spll = @@ -1699,7 +1699,7 @@ static int skl_ddi_wrpll_get_freq(struct drm_i915_private *i915, static int skl_ddi_hdmi_pll_dividers(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); struct skl_wrpll_params wrpll_params = {}; u32 ctrl1, cfgcr1, cfgcr2; int ret; @@ -2129,7 +2129,7 @@ static int bxt_ddi_hdmi_pll_dividers(struct intel_crtc_state *crtc_state, struct dpll *clk_div) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); /* Calculate HDMI div */ /* @@ -2147,7 +2147,7 @@ bxt_ddi_hdmi_pll_dividers(struct intel_crtc_state *crtc_state, static void bxt_ddi_dp_pll_dividers(struct intel_crtc_state *crtc_state, struct dpll *clk_div) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); int i; *clk_div = bxt_dp_clk_val[0]; @@ -2167,7 +2167,7 @@ static void bxt_ddi_dp_pll_dividers(struct intel_crtc_state *crtc_state, static int bxt_ddi_set_dpll_hw_state(struct intel_crtc_state *crtc_state, const struct dpll *clk_div) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); struct intel_dpll_hw_state *dpll_hw_state = &crtc_state->dpll_hw_state; int clock = crtc_state->port_clock; int vco = clk_div->vco; @@ -2262,7 +2262,7 @@ bxt_ddi_dp_set_dpll_hw_state(struct intel_crtc_state *crtc_state) static int bxt_ddi_hdmi_set_dpll_hw_state(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); struct dpll clk_div = {}; int ret; @@ -2299,7 +2299,7 @@ static int bxt_get_dpll(struct intel_atomic_state *state, { struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_shared_dpll *pll; enum intel_dpll_id id; @@ -2556,7 +2556,7 @@ static const struct skl_wrpll_params tgl_tbt_pll_24MHz_values = { static int icl_calc_dp_combo_pll(struct intel_crtc_state *crtc_state, struct skl_wrpll_params *pll_params) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); const struct icl_combo_pll_params *params = dev_priv->display.dpll.ref_clks.nssc == 24000 ? icl_dp_combo_pll_24MHz_values : @@ -2578,7 +2578,7 @@ static int icl_calc_dp_combo_pll(struct intel_crtc_state *crtc_state, static int icl_calc_tbt_pll(struct intel_crtc_state *crtc_state, struct skl_wrpll_params *pll_params) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); if (DISPLAY_VER(dev_priv) >= 12) { switch (dev_priv->display.dpll.ref_clks.nssc) { @@ -2642,7 +2642,7 @@ static int icl_calc_wrpll(struct intel_crtc_state *crtc_state, struct skl_wrpll_params *wrpll_params) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); int ref_clock = icl_wrpll_ref_clock(i915); u32 afe_clock = crtc_state->port_clock * 5; u32 dco_min = 7998000; @@ -2852,7 +2852,7 @@ static int icl_mg_pll_find_divisors(int clock_khz, bool is_dp, bool use_ssc, static int icl_calc_mg_pll_state(struct intel_crtc_state *crtc_state, struct intel_dpll_hw_state *pll_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); int refclk_khz = dev_priv->display.dpll.ref_clks.nssc; int clock = crtc_state->port_clock; u32 dco_khz, m1div, m2div_int, m2div_rem, m2div_frac; @@ -3166,7 +3166,7 @@ static void icl_update_active_dpll(struct intel_atomic_state *state, static int icl_compute_combo_phy_dpll(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); struct icl_port_dpll *port_dpll = @@ -3198,7 +3198,7 @@ static int icl_get_combo_phy_dpll(struct intel_atomic_state *state, struct intel_crtc *crtc, struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); struct icl_port_dpll *port_dpll = @@ -4484,7 +4484,7 @@ void intel_shared_dpll_state_verify(struct intel_crtc *crtc, struct intel_crtc_state *old_crtc_state, struct intel_crtc_state *new_crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); if (new_crtc_state->shared_dpll) verify_single_dpll_state(dev_priv, new_crtc_state->shared_dpll, diff --git a/drivers/gpu/drm/i915/display/intel_dpt.c b/drivers/gpu/drm/i915/display/intel_dpt.c index 7c5fddb203ba..b70dd87ab7fb 100644 --- a/drivers/gpu/drm/i915/display/intel_dpt.c +++ b/drivers/gpu/drm/i915/display/intel_dpt.c @@ -318,7 +318,7 @@ void intel_dpt_destroy(struct i915_address_space *vm) void intel_dpt_configure(struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); if (DISPLAY_VER(i915) == 14) { enum pipe pipe = crtc->pipe; diff --git a/drivers/gpu/drm/i915/display/intel_drrs.c b/drivers/gpu/drm/i915/display/intel_drrs.c index 0d35b6be5b6a..c74dd3f95c68 100644 --- a/drivers/gpu/drm/i915/display/intel_drrs.c +++ b/drivers/gpu/drm/i915/display/intel_drrs.c @@ -66,7 +66,7 @@ static void intel_drrs_set_refresh_rate_pipeconf(struct intel_crtc *crtc, enum drrs_refresh_rate refresh_rate) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc->drrs.cpu_transcoder; u32 bit; @@ -96,7 +96,7 @@ bool intel_drrs_is_active(struct intel_crtc *crtc) static void intel_drrs_set_state(struct intel_crtc *crtc, enum drrs_refresh_rate refresh_rate) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); if (refresh_rate == crtc->drrs.refresh_rate) return; @@ -111,7 +111,7 @@ static void intel_drrs_set_state(struct intel_crtc *crtc, static void intel_drrs_schedule_work(struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); mod_delayed_work(i915->unordered_wq, &crtc->drrs.work, msecs_to_jiffies(1000)); } @@ -119,7 +119,7 @@ static void intel_drrs_schedule_work(struct intel_crtc *crtc) static unsigned int intel_drrs_frontbuffer_bits(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); unsigned int frontbuffer_bits; frontbuffer_bits = INTEL_FRONTBUFFER_ALL_MASK(crtc->pipe); @@ -334,7 +334,7 @@ DEFINE_SHOW_ATTRIBUTE(intel_drrs_debugfs_status); static int intel_drrs_debugfs_ctl_set(void *data, u64 val) { struct intel_crtc *crtc = data; - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_crtc_state *crtc_state; struct drm_crtc_commit *commit; int ret; diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c index bed058d2c3ac..b99384437ea0 100644 --- a/drivers/gpu/drm/i915/display/intel_dsb.c +++ b/drivers/gpu/drm/i915/display/intel_dsb.c @@ -85,7 +85,7 @@ struct intel_dsb { static bool assert_dsb_has_room(struct intel_dsb *dsb) { struct intel_crtc *crtc = dsb->crtc; - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); /* each instruction is 2 dwords */ return !drm_WARN(&i915->drm, dsb->free_pos > dsb->size - 2, @@ -229,7 +229,7 @@ void intel_dsb_finish(struct intel_dsb *dsb) void intel_dsb_commit(struct intel_dsb *dsb, bool wait_for_vblank) { struct intel_crtc *crtc = dsb->crtc; - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; u32 tail; @@ -255,7 +255,7 @@ void intel_dsb_commit(struct intel_dsb *dsb, bool wait_for_vblank) void intel_dsb_wait(struct intel_dsb *dsb) { struct intel_crtc *crtc = dsb->crtc; - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; if (wait_for(!is_dsb_busy(dev_priv, pipe, dsb->id), 1)) @@ -283,7 +283,7 @@ void intel_dsb_wait(struct intel_dsb *dsb) struct intel_dsb *intel_dsb_prepare(struct intel_crtc *crtc, unsigned int max_cmds) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct drm_i915_gem_object *obj; intel_wakeref_t wakeref; struct intel_dsb *dsb; diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c index 3e43e15d50ce..851654891e19 100644 --- a/drivers/gpu/drm/i915/display/intel_fbc.c +++ b/drivers/gpu/drm/i915/display/intel_fbc.c @@ -1486,7 +1486,7 @@ static void __intel_fbc_enable(struct intel_atomic_state *state, */ void intel_fbc_disable(struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_plane *plane; for_each_intel_plane(&i915->drm, plane) { diff --git a/drivers/gpu/drm/i915/display/intel_fdi.c b/drivers/gpu/drm/i915/display/intel_fdi.c index e12b46a84fa1..1f89020787fc 100644 --- a/drivers/gpu/drm/i915/display/intel_fdi.c +++ b/drivers/gpu/drm/i915/display/intel_fdi.c @@ -114,7 +114,7 @@ void assert_fdi_rx_pll_disabled(struct drm_i915_private *i915, enum pipe pipe) void intel_fdi_link_train(struct intel_crtc *crtc, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); dev_priv->display.funcs.fdi->fdi_link_train(crtc, crtc_state); } @@ -235,7 +235,7 @@ int intel_fdi_link_freq(struct drm_i915_private *i915, int ilk_fdi_compute_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *i915 = to_i915(dev); const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; int lane, link_bw, fdi_dotclock, ret; @@ -310,7 +310,7 @@ static void cpt_set_fdi_bc_bifurcation(struct drm_i915_private *dev_priv, bool e static void ivb_update_fdi_bc_bifurcation(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); switch (crtc->pipe) { case PIPE_A: @@ -333,7 +333,7 @@ static void ivb_update_fdi_bc_bifurcation(const struct intel_crtc_state *crtc_st void intel_fdi_normal_train(struct intel_crtc *crtc) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); enum pipe pipe = crtc->pipe; i915_reg_t reg; @@ -375,7 +375,7 @@ void intel_fdi_normal_train(struct intel_crtc *crtc) static void ilk_fdi_link_train(struct intel_crtc *crtc, const struct intel_crtc_state *crtc_state) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); enum pipe pipe = crtc->pipe; i915_reg_t reg; @@ -477,7 +477,7 @@ static const int snb_b_fdi_train_param[] = { static void gen6_fdi_link_train(struct intel_crtc *crtc, const struct intel_crtc_state *crtc_state) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); enum pipe pipe = crtc->pipe; i915_reg_t reg; @@ -613,7 +613,7 @@ static void gen6_fdi_link_train(struct intel_crtc *crtc, static void ivb_manual_fdi_link_train(struct intel_crtc *crtc, const struct intel_crtc_state *crtc_state) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); enum pipe pipe = crtc->pipe; i915_reg_t reg; @@ -750,7 +750,7 @@ void hsw_fdi_link_train(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 temp, i, rx_ctl_val; int n_entries; @@ -891,7 +891,7 @@ void hsw_fdi_disable(struct intel_encoder *encoder) void ilk_fdi_pll_enable(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; i915_reg_t reg; u32 temp; @@ -925,7 +925,7 @@ void ilk_fdi_pll_enable(const struct intel_crtc_state *crtc_state) void ilk_fdi_pll_disable(struct intel_crtc *crtc) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); enum pipe pipe = crtc->pipe; @@ -945,7 +945,7 @@ void ilk_fdi_pll_disable(struct intel_crtc *crtc) void ilk_fdi_disable(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; i915_reg_t reg; u32 temp; diff --git a/drivers/gpu/drm/i915/display/intel_fifo_underrun.c b/drivers/gpu/drm/i915/display/intel_fifo_underrun.c index 09a7fa6c0c37..c2f451b67f36 100644 --- a/drivers/gpu/drm/i915/display/intel_fifo_underrun.c +++ b/drivers/gpu/drm/i915/display/intel_fifo_underrun.c @@ -93,7 +93,7 @@ static bool cpt_can_enable_serr_int(struct drm_device *dev) static void i9xx_check_fifo_underruns(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); i915_reg_t reg = PIPESTAT(crtc->pipe); u32 enable_mask; @@ -147,7 +147,7 @@ static void ilk_set_fifo_underrun_reporting(struct drm_device *dev, static void ivb_check_fifo_underruns(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; u32 err_int = intel_de_read(dev_priv, GEN7_ERR_INT); @@ -234,7 +234,7 @@ static void ibx_set_fifo_underrun_reporting(struct drm_device *dev, static void cpt_check_pch_fifo_underruns(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pch_transcoder = crtc->pipe; u32 serr_int = intel_de_read(dev_priv, SERR_INT); diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index f2d0f223ffc3..2c819d1b191b 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -2053,7 +2053,7 @@ bool intel_hdmi_bpc_possible(const struct intel_crtc_state *crtc_state, static bool hdmi_bpc_possible(const struct intel_crtc_state *crtc_state, int bpc) { struct drm_i915_private *dev_priv = - to_i915(crtc_state->uapi.crtc->dev); + to_i915(crtc_state->uapi.crtc->drm); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; diff --git a/drivers/gpu/drm/i915/display/intel_modeset_setup.c b/drivers/gpu/drm/i915/display/intel_modeset_setup.c index b8f43efb0ab5..508ca534ab04 100644 --- a/drivers/gpu/drm/i915/display/intel_modeset_setup.c +++ b/drivers/gpu/drm/i915/display/intel_modeset_setup.c @@ -35,7 +35,7 @@ static void intel_crtc_disable_noatomic_begin(struct intel_crtc *crtc, struct drm_modeset_acquire_ctx *ctx) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state); struct intel_plane *plane; @@ -140,7 +140,7 @@ static void reset_encoder_connector_state(struct intel_encoder *encoder) static void reset_crtc_encoder_state(struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_encoder *encoder; for_each_encoder_on_crtc(&i915->drm, &crtc->base, encoder) { @@ -151,7 +151,7 @@ static void reset_crtc_encoder_state(struct intel_crtc *crtc) static void intel_crtc_disable_noatomic_complete(struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_bw_state *bw_state = to_intel_bw_state(i915->display.bw.obj.state); struct intel_cdclk_state *cdclk_state = @@ -221,7 +221,7 @@ static u8 get_transcoder_pipes(struct drm_i915_private *i915, static void get_portsync_pipes(struct intel_crtc *crtc, u8 *master_pipe_mask, u8 *slave_pipes_mask) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state); struct intel_crtc *master_crtc; @@ -266,7 +266,7 @@ static u8 get_bigjoiner_slave_pipes(struct drm_i915_private *i915, u8 master_pip static void intel_crtc_disable_noatomic(struct intel_crtc *crtc, struct drm_modeset_acquire_ctx *ctx) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); u8 portsync_master_mask; u8 portsync_slaves_mask; u8 bigjoiner_slaves_mask; @@ -331,7 +331,7 @@ static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state crtc_state->uapi.enable = crtc_state->hw.enable; crtc_state->uapi.active = crtc_state->hw.active; - drm_WARN_ON(crtc_state->uapi.crtc->dev, + drm_WARN_ON(crtc_state->uapi.crtc->drm, drm_atomic_set_mode_for_crtc(&crtc_state->uapi, &crtc_state->hw.mode) < 0); crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode; @@ -382,7 +382,7 @@ intel_sanitize_plane_mapping(struct drm_i915_private *i915) static bool intel_crtc_has_encoders(struct intel_crtc *crtc) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct intel_encoder *encoder; for_each_encoder_on_crtc(dev, &crtc->base, encoder) @@ -393,7 +393,7 @@ static bool intel_crtc_has_encoders(struct intel_crtc *crtc) static bool intel_crtc_needs_link_reset(struct intel_crtc *crtc) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct intel_encoder *encoder; for_each_encoder_on_crtc(dev, &crtc->base, encoder) { @@ -428,7 +428,7 @@ static struct intel_connector *intel_encoder_find_connector(struct intel_encoder static void intel_sanitize_fifo_underrun_reporting(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); /* * We start out with underrun reporting disabled on active @@ -451,7 +451,7 @@ static void intel_sanitize_fifo_underrun_reporting(const struct intel_crtc_state static bool intel_sanitize_crtc(struct intel_crtc *crtc, struct drm_modeset_acquire_ctx *ctx) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state); bool needs_link_reset; @@ -538,7 +538,7 @@ static void intel_sanitize_all_crtcs(struct drm_i915_private *i915, static bool has_bogus_dpll_config(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); /* * Some SNB BIOSen (eg. ASUS K53SV) are known to misprogram diff --git a/drivers/gpu/drm/i915/display/intel_modeset_verify.c b/drivers/gpu/drm/i915/display/intel_modeset_verify.c index 418b8526a081..e9e87262c872 100644 --- a/drivers/gpu/drm/i915/display/intel_modeset_verify.c +++ b/drivers/gpu/drm/i915/display/intel_modeset_verify.c @@ -161,7 +161,7 @@ verify_crtc_state(struct intel_crtc *crtc, struct intel_crtc_state *old_crtc_state, struct intel_crtc_state *new_crtc_state) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_encoder *encoder; struct intel_crtc_state *pipe_config = old_crtc_state; diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index 172c78777130..486f9916e8f4 100644 --- a/drivers/gpu/drm/i915/display/intel_panel.c +++ b/drivers/gpu/drm/i915/display/intel_panel.c @@ -599,7 +599,7 @@ static int gmch_panel_fitting(struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 pfit_control = 0, pfit_pgm_ratios = 0, border = 0; struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; int pipe_src_w = drm_rect_width(&crtc_state->pipe_src); @@ -676,7 +676,7 @@ int intel_panel_fitting(struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); if (HAS_GMCH(i915)) return gmch_panel_fitting(crtc_state, conn_state); diff --git a/drivers/gpu/drm/i915/display/intel_pch_display.c b/drivers/gpu/drm/i915/display/intel_pch_display.c index 866786e6b32f..79e1183a3908 100644 --- a/drivers/gpu/drm/i915/display/intel_pch_display.c +++ b/drivers/gpu/drm/i915/display/intel_pch_display.c @@ -26,7 +26,7 @@ bool intel_has_pch_trancoder(struct drm_i915_private *i915, enum pipe intel_crtc_pch_transcoder(struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); if (HAS_PCH_LPT(i915)) return PIPE_A; @@ -174,7 +174,7 @@ static void ibx_sanitize_pch_ports(struct drm_i915_private *dev_priv) static void intel_pch_transcoder_set_m1_n1(struct intel_crtc *crtc, const struct intel_link_m_n *m_n) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; intel_set_m_n(dev_priv, m_n, @@ -185,7 +185,7 @@ static void intel_pch_transcoder_set_m1_n1(struct intel_crtc *crtc, static void intel_pch_transcoder_set_m2_n2(struct intel_crtc *crtc, const struct intel_link_m_n *m_n) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; intel_set_m_n(dev_priv, m_n, @@ -196,7 +196,7 @@ static void intel_pch_transcoder_set_m2_n2(struct intel_crtc *crtc, void intel_pch_transcoder_get_m1_n1(struct intel_crtc *crtc, struct intel_link_m_n *m_n) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; intel_get_m_n(dev_priv, m_n, @@ -207,7 +207,7 @@ void intel_pch_transcoder_get_m1_n1(struct intel_crtc *crtc, void intel_pch_transcoder_get_m2_n2(struct intel_crtc *crtc, struct intel_link_m_n *m_n) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; intel_get_m_n(dev_priv, m_n, @@ -219,7 +219,7 @@ static void ilk_pch_transcoder_set_timings(const struct intel_crtc_state *crtc_s enum pipe pch_transcoder) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; intel_de_write(dev_priv, PCH_TRANS_HTOTAL(pch_transcoder), @@ -242,7 +242,7 @@ static void ilk_pch_transcoder_set_timings(const struct intel_crtc_state *crtc_s static void ilk_enable_pch_transcoder(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; i915_reg_t reg; u32 val, pipeconf_val; @@ -308,7 +308,7 @@ static void ilk_enable_pch_transcoder(const struct intel_crtc_state *crtc_state) static void ilk_disable_pch_transcoder(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; i915_reg_t reg; @@ -357,7 +357,7 @@ void ilk_pch_pre_enable(struct intel_atomic_state *state, void ilk_pch_enable(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); enum pipe pipe = crtc->pipe; @@ -448,7 +448,7 @@ void ilk_pch_disable(struct intel_atomic_state *state, void ilk_pch_post_disable(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; ilk_disable_pch_transcoder(crtc); @@ -470,7 +470,7 @@ void ilk_pch_post_disable(struct intel_atomic_state *state, static void ilk_pch_clock_get(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); /* read out port_clock from the DPLL */ i9xx_crtc_clock_get(crtc, crtc_state); @@ -488,7 +488,7 @@ static void ilk_pch_clock_get(struct intel_crtc_state *crtc_state) void ilk_pch_get_config(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_shared_dpll *pll; enum pipe pipe = crtc->pipe; enum intel_dpll_id pll_id; @@ -539,7 +539,7 @@ void ilk_pch_get_config(struct intel_crtc_state *crtc_state) static void lpt_enable_pch_transcoder(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; u32 val, pipeconf_val; @@ -584,7 +584,7 @@ static void lpt_disable_pch_transcoder(struct drm_i915_private *dev_priv) void lpt_pch_enable(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); @@ -601,7 +601,7 @@ void lpt_pch_enable(struct intel_atomic_state *state, void lpt_pch_disable(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); lpt_disable_pch_transcoder(dev_priv); @@ -611,7 +611,7 @@ void lpt_pch_disable(struct intel_atomic_state *state, void lpt_pch_get_config(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 tmp; if ((intel_de_read(dev_priv, LPT_TRANSCONF) & TRANS_ENABLE) == 0) diff --git a/drivers/gpu/drm/i915/display/intel_pch_refclk.c b/drivers/gpu/drm/i915/display/intel_pch_refclk.c index f4c09cc37a5e..5415241716b8 100644 --- a/drivers/gpu/drm/i915/display/intel_pch_refclk.c +++ b/drivers/gpu/drm/i915/display/intel_pch_refclk.c @@ -175,7 +175,7 @@ int lpt_iclkip(const struct intel_crtc_state *crtc_state) void lpt_program_iclkip(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); int clock = crtc_state->hw.adjusted_mode.crtc_clock; struct iclkip_params p; u32 temp; diff --git a/drivers/gpu/drm/i915/display/intel_pipe_crc.c b/drivers/gpu/drm/i915/display/intel_pipe_crc.c index 5a468ed6e26c..24593bfe6d31 100644 --- a/drivers/gpu/drm/i915/display/intel_pipe_crc.c +++ b/drivers/gpu/drm/i915/display/intel_pipe_crc.c @@ -278,7 +278,7 @@ static int ilk_pipe_crc_ctl_reg(enum intel_pipe_crc_source *source, static void intel_crtc_crc_setup_workarounds(struct intel_crtc *crtc, bool enable) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_crtc_state *pipe_config; struct drm_atomic_state *state; struct drm_modeset_acquire_ctx ctx; @@ -556,7 +556,7 @@ const char *const *intel_crtc_get_crc_sources(struct drm_crtc *crtc, int intel_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name, size_t *values_cnt) { - struct drm_i915_private *dev_priv = to_i915(crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc->drm); enum intel_pipe_crc_source source; if (display_crc_ctl_parse_source(source_name, &source) < 0) { @@ -576,7 +576,7 @@ int intel_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name, int intel_crtc_set_crc_source(struct drm_crtc *_crtc, const char *source_name) { struct intel_crtc *crtc = to_intel_crtc(_crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_pipe_crc *pipe_crc = &crtc->pipe_crc; enum intel_display_power_domain power_domain; enum intel_pipe_crc_source source; @@ -629,7 +629,7 @@ int intel_crtc_set_crc_source(struct drm_crtc *_crtc, const char *source_name) void intel_crtc_enable_pipe_crc(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_pipe_crc *pipe_crc = &crtc->pipe_crc; enum pipe pipe = crtc->pipe; u32 val = 0; @@ -649,7 +649,7 @@ void intel_crtc_enable_pipe_crc(struct intel_crtc *crtc) void intel_crtc_disable_pipe_crc(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_pipe_crc *pipe_crc = &crtc->pipe_crc; enum pipe pipe = crtc->pipe; diff --git a/drivers/gpu/drm/i915/display/intel_plane_initial.c b/drivers/gpu/drm/i915/display/intel_plane_initial.c index 736072a8b2b0..cc6b1c5e7fa9 100644 --- a/drivers/gpu/drm/i915/display/intel_plane_initial.c +++ b/drivers/gpu/drm/i915/display/intel_plane_initial.c @@ -163,7 +163,7 @@ static bool intel_alloc_initial_plane_obj(struct intel_crtc *crtc, struct intel_initial_plane_config *plane_config) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct drm_mode_fb_cmd2 mode_cmd = { 0 }; struct drm_framebuffer *fb = &plane_config->fb->base; @@ -211,7 +211,7 @@ static void intel_find_initial_plane_obj(struct intel_crtc *crtc, struct intel_initial_plane_config *plane_config) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_plane *plane = to_intel_plane(crtc->base.primary); @@ -303,7 +303,7 @@ static void plane_config_fini(struct intel_initial_plane_config *plane_config) void intel_crtc_initial_plane_config(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_initial_plane_config plane_config = {}; /* diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 00b4d87e4d81..f91e4f2f926a 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -1731,7 +1731,7 @@ void intel_psr2_program_plane_sel_fetch_noarm(struct intel_plane *plane, void intel_psr2_program_trans_man_trk_ctl(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; struct intel_encoder *encoder; @@ -1756,7 +1756,7 @@ static void psr2_man_trk_ctl_calc(struct intel_crtc_state *crtc_state, struct drm_rect *clip, bool full_update) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 val = man_trk_ctl_enable_bit_get(dev_priv); /* SF partial frame enable has to be set even on full update */ @@ -1775,7 +1775,7 @@ static void psr2_man_trk_ctl_calc(struct intel_crtc_state *crtc_state, val |= ADLP_PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR(clip->y1); val |= ADLP_PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR(clip->y2 - 1); } else { - drm_WARN_ON(crtc_state->uapi.crtc->dev, clip->y1 % 4 || clip->y2 % 4); + drm_WARN_ON(crtc_state->uapi.crtc->drm, clip->y1 % 4 || clip->y2 % 4); val |= PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR(clip->y1 / 4 + 1); val |= PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR(clip->y2 / 4 + 1); @@ -1807,7 +1807,7 @@ static void clip_area_update(struct drm_rect *overlap_damage_area, static void intel_psr2_sel_fetch_pipe_alignment(const struct intel_crtc_state *crtc_state, struct drm_rect *pipe_clip) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); const struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; u16 y_alignment; @@ -2164,7 +2164,7 @@ static int _psr1_ready_for_pipe_update_locked(struct intel_dp *intel_dp) */ void intel_psr_wait_for_idle_locked(const struct intel_crtc_state *new_crtc_state) { - struct drm_i915_private *dev_priv = to_i915(new_crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(new_crtc_state->uapi.crtc->drm); struct intel_encoder *encoder; if (!new_crtc_state->has_psr) @@ -2750,7 +2750,7 @@ bool intel_psr_enabled(struct intel_dp *intel_dp) */ void intel_psr_lock(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); struct intel_encoder *encoder; if (!crtc_state->has_psr) @@ -2773,7 +2773,7 @@ void intel_psr_lock(const struct intel_crtc_state *crtc_state) */ void intel_psr_unlock(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); struct intel_encoder *encoder; if (!crtc_state->has_psr) diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index 92376afc503b..28d9f3654dfb 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -1272,7 +1272,7 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo, static void i9xx_adjust_sdvo_tv_clock(struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(pipe_config->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(pipe_config->uapi.crtc->drm); unsigned dotclock = pipe_config->port_clock; struct dpll *clock = &pipe_config->dpll; diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c b/drivers/gpu/drm/i915/display/intel_vblank.c index f5659ebd08eb..5eed99dae178 100644 --- a/drivers/gpu/drm/i915/display/intel_vblank.c +++ b/drivers/gpu/drm/i915/display/intel_vblank.c @@ -65,7 +65,7 @@ */ u32 i915_get_vblank_counter(struct drm_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc->drm); struct drm_vblank_crtc *vblank = &dev_priv->drm.vblank[drm_crtc_index(crtc)]; const struct drm_display_mode *mode = &vblank->hwmode; enum pipe pipe = to_intel_crtc(crtc)->pipe; @@ -118,7 +118,7 @@ u32 i915_get_vblank_counter(struct drm_crtc *crtc) u32 g4x_get_vblank_counter(struct drm_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc->drm); struct drm_vblank_crtc *vblank = &dev_priv->drm.vblank[drm_crtc_index(crtc)]; enum pipe pipe = to_intel_crtc(crtc)->pipe; @@ -130,9 +130,9 @@ u32 g4x_get_vblank_counter(struct drm_crtc *crtc) static u32 intel_crtc_scanlines_since_frame_timestamp(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct drm_vblank_crtc *vblank = - &crtc->base.dev->vblank[drm_crtc_index(&crtc->base)]; + &crtc->base.drm->vblank[drm_crtc_index(&crtc->base)]; const struct drm_display_mode *mode = &vblank->hwmode; u32 htotal = mode->crtc_htotal; u32 clock = mode->crtc_clock; @@ -178,7 +178,7 @@ static u32 intel_crtc_scanlines_since_frame_timestamp(struct intel_crtc *crtc) static u32 __intel_get_crtc_scanline_from_timestamp(struct intel_crtc *crtc) { struct drm_vblank_crtc *vblank = - &crtc->base.dev->vblank[drm_crtc_index(&crtc->base)]; + &crtc->base.drm->vblank[drm_crtc_index(&crtc->base)]; const struct drm_display_mode *mode = &vblank->hwmode; u32 vblank_start = mode->crtc_vblank_start; u32 vtotal = mode->crtc_vtotal; @@ -197,7 +197,7 @@ static u32 __intel_get_crtc_scanline_from_timestamp(struct intel_crtc *crtc) */ static int __intel_get_crtc_scanline(struct intel_crtc *crtc) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); const struct drm_display_mode *mode; struct drm_vblank_crtc *vblank; @@ -207,7 +207,7 @@ static int __intel_get_crtc_scanline(struct intel_crtc *crtc) if (!crtc->active) return 0; - vblank = &crtc->base.dev->vblank[drm_crtc_index(&crtc->base)]; + vblank = &crtc->base.drm->vblank[drm_crtc_index(&crtc->base)]; mode = &vblank->hwmode; if (crtc->mode_flags & I915_MODE_FLAG_GET_SCANLINE_FROM_TIMESTAMP) @@ -257,7 +257,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_crtc *_crtc, ktime_t *stime, ktime_t *etime, const struct drm_display_mode *mode) { - struct drm_device *dev = _crtc->dev; + struct drm_device *dev = _crtc->drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_crtc *crtc = to_intel_crtc(_crtc); enum pipe pipe = crtc->pipe; @@ -394,7 +394,7 @@ bool intel_crtc_get_vblank_timestamp(struct drm_crtc *crtc, int *max_error, int intel_get_crtc_scanline(struct intel_crtc *crtc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); unsigned long irqflags; int position; @@ -420,7 +420,7 @@ static bool pipe_scanline_is_moving(struct drm_i915_private *dev_priv, static void wait_for_pipe_scanline_moving(struct intel_crtc *crtc, bool state) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; /* Wait for the display line to settle/start moving */ @@ -442,7 +442,7 @@ void intel_wait_for_pipe_scanline_moving(struct intel_crtc *crtc) static int intel_crtc_scanline_offset(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; /* @@ -491,7 +491,7 @@ void intel_crtc_update_active_timings(const struct intel_crtc_state *crtc_state, bool vrr_enable) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); u8 mode_flags = crtc_state->mode_flags; struct drm_display_mode adjusted_mode; int vmax_vblank_start = 0; diff --git a/drivers/gpu/drm/i915/display/intel_vdsc.c b/drivers/gpu/drm/i915/display/intel_vdsc.c index bd9116d2cd76..695ec9fc6cb2 100644 --- a/drivers/gpu/drm/i915/display/intel_vdsc.c +++ b/drivers/gpu/drm/i915/display/intel_vdsc.c @@ -22,7 +22,7 @@ bool intel_dsc_source_support(const struct intel_crtc_state *crtc_state) { const struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; if (!HAS_DSC(i915)) @@ -36,7 +36,7 @@ bool intel_dsc_source_support(const struct intel_crtc_state *crtc_state) static bool is_pipe_dsc(struct intel_crtc *crtc, enum transcoder cpu_transcoder) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); if (DISPLAY_VER(i915) >= 12) return true; @@ -153,7 +153,7 @@ static int intel_dsc_slice_dimensions_valid(struct intel_crtc_state *pipe_config int intel_dsc_compute_params(struct intel_crtc_state *pipe_config) { struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct drm_dsc_config *vdsc_cfg = &pipe_config->dsc.config; u16 compressed_bpp = pipe_config->dsc.compressed_bpp; int err; @@ -271,7 +271,7 @@ int intel_dsc_compute_params(struct intel_crtc_state *pipe_config) enum intel_display_power_domain intel_dsc_power_domain(struct intel_crtc *crtc, enum transcoder cpu_transcoder) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; /* @@ -296,7 +296,7 @@ intel_dsc_power_domain(struct intel_crtc *crtc, enum transcoder cpu_transcoder) static void intel_dsc_pps_configure(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; enum pipe pipe = crtc->pipe; @@ -871,7 +871,7 @@ static i915_reg_t dss_ctl2_reg(struct intel_crtc *crtc, enum transcoder cpu_tran void intel_uncompressed_joiner_enable(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 dss_ctl1_val = 0; if (crtc_state->bigjoiner_pipes && !crtc_state->dsc.compression_enable) { @@ -887,7 +887,7 @@ void intel_uncompressed_joiner_enable(const struct intel_crtc_state *crtc_state) void intel_dsc_enable(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); u32 dss_ctl1_val = 0; u32 dss_ctl2_val = 0; @@ -913,7 +913,7 @@ void intel_dsc_enable(const struct intel_crtc_state *crtc_state) void intel_dsc_disable(const struct intel_crtc_state *old_crtc_state) { struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); /* Disable only if either of them is enabled */ if (old_crtc_state->dsc.compression_enable || @@ -926,7 +926,7 @@ void intel_dsc_disable(const struct intel_crtc_state *old_crtc_state) void intel_dsc_get_config(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; enum pipe pipe = crtc->pipe; diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c index 6361667d0eb1..60722c452071 100644 --- a/drivers/gpu/drm/i915/display/intel_vrr.c +++ b/drivers/gpu/drm/i915/display/intel_vrr.c @@ -76,7 +76,7 @@ intel_vrr_check_modeset(struct intel_atomic_state *state) static int intel_vrr_vblank_exit_length(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); if (DISPLAY_VER(i915) >= 13) return crtc_state->vrr.guardband; @@ -101,7 +101,7 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state, struct drm_connector_state *conn_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_connector *connector = to_intel_connector(conn_state->connector); struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; @@ -156,7 +156,7 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state, static u32 trans_vrr_ctl(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); if (DISPLAY_VER(i915) >= 13) return VRR_CTL_IGN_MAX_SHIFT | VRR_CTL_FLIP_LINE_EN | @@ -169,7 +169,7 @@ static u32 trans_vrr_ctl(const struct intel_crtc_state *crtc_state) void intel_vrr_set_transcoder_timings(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; /* @@ -194,7 +194,7 @@ void intel_vrr_set_transcoder_timings(const struct intel_crtc_state *crtc_state) void intel_vrr_send_push(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; if (!crtc_state->vrr.enable) @@ -207,7 +207,7 @@ void intel_vrr_send_push(const struct intel_crtc_state *crtc_state) bool intel_vrr_is_push_sent(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; if (!crtc_state->vrr.enable) @@ -218,7 +218,7 @@ bool intel_vrr_is_push_sent(const struct intel_crtc_state *crtc_state) void intel_vrr_enable(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; if (!crtc_state->vrr.enable) @@ -232,7 +232,7 @@ void intel_vrr_enable(const struct intel_crtc_state *crtc_state) void intel_vrr_disable(const struct intel_crtc_state *old_crtc_state) { struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum transcoder cpu_transcoder = old_crtc_state->cpu_transcoder; if (!old_crtc_state->vrr.enable) @@ -247,7 +247,7 @@ void intel_vrr_disable(const struct intel_crtc_state *old_crtc_state) void intel_vrr_get_config(struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; u32 trans_vrr_ctl; diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c index 1e7c97243fcf..0d6c26d4453d 100644 --- a/drivers/gpu/drm/i915/display/skl_scaler.c +++ b/drivers/gpu/drm/i915/display/skl_scaler.c @@ -108,7 +108,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, struct intel_crtc_scaler_state *scaler_state = &crtc_state->scaler_state; struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; int pipe_src_w = drm_rect_width(&crtc_state->pipe_src); @@ -354,7 +354,7 @@ static int intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_stat struct intel_plane_state *plane_state, int *scaler_id) { - struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.drm); int j; u32 mode; @@ -707,7 +707,7 @@ static void skl_scaler_setup_filter(struct drm_i915_private *dev_priv, enum pipe void skl_pfit_enable(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); const struct intel_crtc_scaler_state *scaler_state = &crtc_state->scaler_state; const struct drm_rect *dst = &crtc_state->pch_pfit.dst; @@ -823,7 +823,7 @@ skl_program_plane_scaler(struct intel_plane *plane, static void skl_detach_scaler(struct intel_crtc *crtc, int id) { - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); intel_de_write_fw(dev_priv, SKL_PS_CTRL(crtc->pipe, id), 0); @@ -860,7 +860,7 @@ void skl_scaler_disable(const struct intel_crtc_state *old_crtc_state) void skl_scaler_get_config(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); struct intel_crtc_scaler_state *scaler_state = &crtc_state->scaler_state; int id = -1; int i; diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c index 6b01a0b68b97..f60e17d3e019 100644 --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c @@ -879,7 +879,7 @@ static u32 adlp_plane_ctl_arb_slots(const struct intel_plane_state *plane_state) static u32 skl_plane_ctl_crtc(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); u32 plane_ctl = 0; if (DISPLAY_VER(dev_priv) >= 10) @@ -939,7 +939,7 @@ static u32 skl_plane_ctl(const struct intel_crtc_state *crtc_state, static u32 glk_plane_color_ctl_crtc(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->drm); u32 plane_color_ctl = 0; if (DISPLAY_VER(dev_priv) >= 11) @@ -2389,7 +2389,7 @@ skl_get_initial_plane_config(struct intel_crtc *crtc, struct intel_initial_plane_config *plane_config) { struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state); - struct drm_device *dev = crtc->base.dev; + struct drm_device *dev = crtc->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_plane *plane = to_intel_plane(crtc->base.primary); enum plane_id plane_id = plane->id; diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c index 2e56ddd408ea..ecbf118ed0b0 100644 --- a/drivers/gpu/drm/i915/display/skl_watermark.c +++ b/drivers/gpu/drm/i915/display/skl_watermark.c @@ -338,7 +338,7 @@ void intel_sagv_post_plane_update(struct intel_atomic_state *state) static bool skl_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum plane_id plane_id; int max_level = INT_MAX; @@ -410,7 +410,7 @@ static bool tgl_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state) static bool intel_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); if (!i915->params.enable_sagv) return false; @@ -627,7 +627,7 @@ static void intel_crtc_dbuf_weights(const struct intel_dbuf_state *dbuf_state, static int skl_crtc_allocate_ddb(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); unsigned int weight_total, weight_start, weight_end; const struct intel_dbuf_state *old_dbuf_state = intel_atomic_get_old_dbuf_state(state); @@ -736,7 +736,7 @@ skl_cursor_allocation(const struct intel_crtc_state *crtc_state, int num_active) { struct intel_plane *plane = to_intel_plane(crtc_state->uapi.crtc->cursor); - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); struct skl_wm_level wm = {}; int ret, min_ddb_alloc = 0; struct skl_wm_params wp; @@ -801,7 +801,7 @@ static void skl_pipe_ddb_get_hw_state(struct intel_crtc *crtc, struct skl_ddb_entry *ddb, struct skl_ddb_entry *ddb_y) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum intel_display_power_domain power_domain; enum pipe pipe = crtc->pipe; intel_wakeref_t wakeref; @@ -1329,7 +1329,7 @@ static u8 dg2_compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbu static u8 skl_compute_dbuf_slices(struct intel_crtc *crtc, u8 active_pipes, bool join_mbus) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; if (IS_DG2(i915)) @@ -1362,7 +1362,7 @@ static u64 skl_total_relative_data_rate(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum plane_id plane_id; u64 data_rate = 0; @@ -1488,7 +1488,7 @@ static int skl_crtc_allocate_plane_ddb(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); const struct intel_dbuf_state *dbuf_state = @@ -1699,7 +1699,7 @@ skl_wm_method2(u32 pixel_rate, u32 pipe_htotal, u32 latency, static uint_fixed_16_16_t intel_get_linetime_us(const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); u32 pixel_rate; u32 crtc_htotal; uint_fixed_16_16_t linetime_us; @@ -1726,7 +1726,7 @@ skl_compute_wm_params(const struct intel_crtc_state *crtc_state, int color_plane) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); u32 interm_pbpl; /* only planar format has two planes */ @@ -1854,7 +1854,7 @@ static void skl_compute_plane_wm(const struct intel_crtc_state *crtc_state, const struct skl_wm_level *result_prev, struct skl_wm_level *result /* out */) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); uint_fixed_16_16_t method1, method2; uint_fixed_16_16_t selected_result; u32 blocks, lines, min_ddb_alloc = 0; @@ -1986,7 +1986,7 @@ skl_compute_wm_levels(const struct intel_crtc_state *crtc_state, const struct skl_wm_params *wm_params, struct skl_wm_level *levels) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); struct skl_wm_level *result_prev = &levels[0]; int level; @@ -2006,7 +2006,7 @@ static void tgl_compute_sagv_wm(const struct intel_crtc_state *crtc_state, const struct skl_wm_params *wm_params, struct skl_plane_wm *plane_wm) { - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->drm); struct skl_wm_level *sagv_wm = &plane_wm->sagv.wm0; struct skl_wm_level *levels = plane_wm->wm; unsigned int latency = 0; @@ -2088,7 +2088,7 @@ static int skl_build_plane_wm_single(struct intel_crtc_state *crtc_state, struct intel_plane *plane, int color_plane) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct skl_plane_wm *wm = &crtc_state->wm.skl.raw.planes[plane->id]; struct skl_wm_params wm_params; int ret; @@ -2239,7 +2239,7 @@ static int skl_max_wm_level_for_vblank(struct intel_crtc_state *crtc_state, int wm0_lines) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); int level; for (level = i915->display.wm.num_levels - 1; level >= 0; level--) { @@ -2264,7 +2264,7 @@ static int skl_max_wm_level_for_vblank(struct intel_crtc_state *crtc_state, static int skl_wm_check_vblank(struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); int wm0_lines, level; if (!crtc_state->hw.active) @@ -2319,7 +2319,7 @@ static int skl_wm_check_vblank(struct intel_crtc_state *crtc_state) static int skl_build_pipe_wm(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); const struct intel_plane_state *plane_state; @@ -2512,7 +2512,7 @@ skl_ddb_add_affected_planes(const struct intel_crtc_state *old_crtc_state, { struct intel_atomic_state *state = to_intel_atomic_state(new_crtc_state->uapi.state); struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct intel_plane *plane; for_each_intel_plane_on_crtc(&i915->drm, crtc, plane) { @@ -2859,7 +2859,7 @@ static bool skl_plane_selected_wm_equals(struct intel_plane *plane, static int skl_wm_add_affected_planes(struct intel_atomic_state *state, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); const struct intel_crtc_state *old_crtc_state = intel_atomic_get_old_crtc_state(state, crtc); struct intel_crtc_state *new_crtc_state = @@ -2944,7 +2944,7 @@ static void skl_wm_level_from_reg_val(u32 val, struct skl_wm_level *level) static void skl_pipe_wm_get_hw_state(struct intel_crtc *crtc, struct skl_pipe_wm *out) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; enum plane_id plane_id; int level; @@ -3135,7 +3135,7 @@ static void skl_wm_get_hw_state_and_sanitize(struct drm_i915_private *i915) void intel_wm_state_verify(struct intel_crtc *crtc, struct intel_crtc_state *new_crtc_state) { - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + struct drm_i915_private *i915 = to_i915(crtc->base.drm); struct skl_hw_state { struct skl_ddb_entry ddb[I915_MAX_PLANES]; struct skl_ddb_entry ddb_y[I915_MAX_PLANES]; diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c index 8067c814aa66..129e00578a28 100644 --- a/drivers/gpu/drm/i915/display/vlv_dsi.c +++ b/drivers/gpu/drm/i915/display/vlv_dsi.c @@ -737,7 +737,7 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state, { struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + struct drm_i915_private *dev_priv = to_i915(crtc->base.drm); enum pipe pipe = crtc->pipe; enum port port; bool glk_cold_boot = false; diff --git a/drivers/gpu/drm/imx/dcss/dcss-crtc.c b/drivers/gpu/drm/imx/dcss/dcss-crtc.c index 31267c00782f..5cff376df4ac 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-crtc.c +++ b/drivers/gpu/drm/imx/dcss/dcss-crtc.c @@ -16,7 +16,7 @@ static int dcss_enable_vblank(struct drm_crtc *crtc) { struct dcss_crtc *dcss_crtc = container_of(crtc, struct dcss_crtc, base); - struct dcss_dev *dcss = crtc->dev->dev_private; + struct dcss_dev *dcss = crtc->drm->dev_private; dcss_dtg_vblank_irq_enable(dcss->dtg, true); @@ -31,7 +31,7 @@ static void dcss_disable_vblank(struct drm_crtc *crtc) { struct dcss_crtc *dcss_crtc = container_of(crtc, struct dcss_crtc, base); - struct dcss_dev *dcss = dcss_crtc->base.dev->dev_private; + struct dcss_dev *dcss = dcss_crtc->base.drm->dev_private; disable_irq_nosync(dcss_crtc->irq); @@ -63,15 +63,15 @@ static void dcss_crtc_atomic_flush(struct drm_crtc *crtc, { struct dcss_crtc *dcss_crtc = container_of(crtc, struct dcss_crtc, base); - struct dcss_dev *dcss = dcss_crtc->base.dev->dev_private; + struct dcss_dev *dcss = dcss_crtc->base.drm->dev_private; - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->event) { WARN_ON(drm_crtc_vblank_get(crtc)); drm_crtc_arm_vblank_event(crtc, crtc->state->event); crtc->state->event = NULL; } - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); if (dcss_dtg_is_enabled(dcss->dtg)) dcss_ctxld_enable(dcss->ctxld); @@ -84,7 +84,7 @@ static void dcss_crtc_atomic_enable(struct drm_crtc *crtc, crtc); struct dcss_crtc *dcss_crtc = container_of(crtc, struct dcss_crtc, base); - struct dcss_dev *dcss = dcss_crtc->base.dev->dev_private; + struct dcss_dev *dcss = dcss_crtc->base.drm->dev_private; struct drm_display_mode *mode = &crtc->state->adjusted_mode; struct drm_display_mode *old_mode = &old_crtc_state->adjusted_mode; struct videomode vm; @@ -120,18 +120,18 @@ static void dcss_crtc_atomic_disable(struct drm_crtc *crtc, crtc); struct dcss_crtc *dcss_crtc = container_of(crtc, struct dcss_crtc, base); - struct dcss_dev *dcss = dcss_crtc->base.dev->dev_private; + struct dcss_dev *dcss = dcss_crtc->base.drm->dev_private; struct drm_display_mode *mode = &crtc->state->adjusted_mode; struct drm_display_mode *old_mode = &old_crtc_state->adjusted_mode; drm_atomic_helper_disable_planes_on_crtc(old_crtc_state, false); - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->event) { drm_crtc_send_vblank_event(crtc, crtc->state->event); crtc->state->event = NULL; } - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); dcss_dtg_ctxld_kick_irq_enable(dcss->dtg, true); @@ -168,7 +168,7 @@ static const struct drm_crtc_helper_funcs dcss_helper_funcs = { static irqreturn_t dcss_crtc_irq_handler(int irq, void *dev_id) { struct dcss_crtc *dcss_crtc = dev_id; - struct dcss_dev *dcss = dcss_crtc->base.dev->dev_private; + struct dcss_dev *dcss = dcss_crtc->base.drm->dev_private; if (!dcss_dtg_vblank_irq_valid(dcss->dtg)) return IRQ_NONE; diff --git a/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c index 5f26090b0c98..d196abb42659 100644 --- a/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c @@ -99,12 +99,12 @@ static void ipu_crtc_atomic_disable(struct drm_crtc *crtc, drm_crtc_vblank_off(crtc); - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->event && !crtc->state->active) { drm_crtc_send_vblank_event(crtc, crtc->state->event); crtc->state->event = NULL; } - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } static void imx_drm_crtc_reset(struct drm_crtc *crtc) @@ -192,11 +192,11 @@ static irqreturn_t ipu_irq_handler(int irq, void *dev_id) } if (i == ARRAY_SIZE(ipu_crtc->plane)) { - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); drm_crtc_send_vblank_event(crtc, ipu_crtc->event); ipu_crtc->event = NULL; drm_crtc_vblank_put(crtc); - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); } } @@ -247,7 +247,7 @@ static void ipu_crtc_atomic_begin(struct drm_crtc *crtc, static void ipu_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) { - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->event) { struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); @@ -255,12 +255,12 @@ static void ipu_crtc_atomic_flush(struct drm_crtc *crtc, ipu_crtc->event = crtc->state->event; crtc->state->event = NULL; } - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } static void ipu_crtc_mode_set_nofb(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_encoder *encoder; struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); struct drm_display_mode *mode = &crtc->state->adjusted_mode; diff --git a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c index 277ead6a459a..2a5d324269af 100644 --- a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c +++ b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c @@ -140,7 +140,7 @@ static void imx_lcdc_update_hw_registers(struct drm_simple_display_pipe *pipe, struct drm_crtc *crtc = &pipe->crtc; struct drm_plane_state *new_state = pipe->plane.state; struct drm_framebuffer *fb = new_state->fb; - struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.dev); + struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.drm); u32 lpcr, lvcr, lhcr; u32 framesize; dma_addr_t addr; @@ -193,7 +193,7 @@ static void imx_lcdc_pipe_enable(struct drm_simple_display_pipe *pipe, int ret; int clk_div; int bpp; - struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.dev); + struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.drm); struct drm_display_mode *mode = &pipe->crtc.mode; struct drm_display_info *disp_info = &lcdc->connector->display_info; const int hsync_pol = (mode->flags & DRM_MODE_FLAG_PHSYNC) ? 0 : 1; @@ -229,12 +229,14 @@ static void imx_lcdc_pipe_enable(struct drm_simple_display_pipe *pipe, ret = clk_prepare_enable(lcdc->clk_ipg); if (ret) { - dev_err(pipe->crtc.dev->dev, "Cannot enable ipg clock: %pe\n", ERR_PTR(ret)); + dev_err(pipe->crtc.drm->dev, "Cannot enable ipg clock: %pe\n", + ERR_PTR(ret)); return; } ret = clk_prepare_enable(lcdc->clk_ahb); if (ret) { - dev_err(pipe->crtc.dev->dev, "Cannot enable ahb clock: %pe\n", ERR_PTR(ret)); + dev_err(pipe->crtc.drm->dev, "Cannot enable ahb clock: %pe\n", + ERR_PTR(ret)); clk_disable_unprepare(lcdc->clk_ipg); @@ -249,7 +251,7 @@ static void imx_lcdc_pipe_enable(struct drm_simple_display_pipe *pipe, static void imx_lcdc_pipe_disable(struct drm_simple_display_pipe *pipe) { - struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.dev); + struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.drm); struct drm_crtc *crtc = &lcdc->pipe.crtc; struct drm_pending_vblank_event *event; @@ -281,7 +283,8 @@ static int imx_lcdc_pipe_check(struct drm_simple_display_pipe *pipe, if (mode->hdisplay < LCDC_MIN_XRES || mode->hdisplay > LCDC_MAX_XRES || mode->vdisplay < LCDC_MIN_YRES || mode->vdisplay > LCDC_MAX_YRES || mode->hdisplay % 0x10) { /* must be multiple of 16 */ - drm_err(pipe->crtc.dev, "unsupported display mode (%u x %u)\n", + drm_err(pipe->crtc.drm, + "unsupported display mode (%u x %u)\n", mode->hdisplay, mode->vdisplay); return -EINVAL; } @@ -314,14 +317,14 @@ static void imx_lcdc_pipe_update(struct drm_simple_display_pipe *pipe, if (event) { crtc->state->event = NULL; - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->active && drm_crtc_vblank_get(crtc) == 0) drm_crtc_arm_vblank_event(crtc, event); else drm_crtc_send_vblank_event(crtc, event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } } diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index e74f946c7e4e..868d4979e464 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -442,12 +442,12 @@ static void ingenic_drm_crtc_atomic_flush(struct drm_crtc *crtc, if (event) { crtc_state->event = NULL; - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (drm_crtc_vblank_get(crtc) == 0) drm_crtc_arm_vblank_event(crtc, event); else drm_crtc_send_vblank_event(crtc, event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } } diff --git a/drivers/gpu/drm/kmb/kmb_crtc.c b/drivers/gpu/drm/kmb/kmb_crtc.c index 647872f65bff..75a41b005f0c 100644 --- a/drivers/gpu/drm/kmb/kmb_crtc.c +++ b/drivers/gpu/drm/kmb/kmb_crtc.c @@ -28,7 +28,7 @@ struct kmb_crtc_timing { static int kmb_crtc_enable_vblank(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct kmb_drm_private *kmb = to_kmb(dev); /* Clear interrupt */ @@ -44,7 +44,7 @@ static int kmb_crtc_enable_vblank(struct drm_crtc *crtc) static void kmb_crtc_disable_vblank(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct kmb_drm_private *kmb = to_kmb(dev); /* Clear interrupt */ @@ -68,7 +68,7 @@ static const struct drm_crtc_funcs kmb_crtc_funcs = { static void kmb_crtc_set_mode(struct drm_crtc *crtc, struct drm_atomic_state *old_state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_display_mode *m = &crtc->state->adjusted_mode; struct kmb_crtc_timing vm; struct kmb_drm_private *kmb = to_kmb(dev); @@ -158,7 +158,7 @@ static void kmb_crtc_atomic_disable(struct drm_crtc *crtc, static void kmb_crtc_atomic_begin(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct kmb_drm_private *kmb = to_kmb(dev); kmb_clr_bitmask_lcd(kmb, LCD_INT_ENABLE, @@ -168,13 +168,13 @@ static void kmb_crtc_atomic_begin(struct drm_crtc *crtc, static void kmb_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct kmb_drm_private *kmb = to_kmb(dev); kmb_set_bitmask_lcd(kmb, LCD_INT_ENABLE, LCD_INT_VERT_COMP); - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->event) { if (drm_crtc_vblank_get(crtc) == 0) drm_crtc_arm_vblank_event(crtc, crtc->state->event); @@ -182,7 +182,7 @@ static void kmb_crtc_atomic_flush(struct drm_crtc *crtc, drm_crtc_send_vblank_event(crtc, crtc->state->event); } crtc->state->event = NULL; - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } static enum drm_mode_status @@ -190,7 +190,7 @@ static enum drm_mode_status const struct drm_display_mode *mode) { int refresh; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; int vfp = mode->vsync_start - mode->vdisplay; if (mode->vdisplay < KMB_CRTC_MAX_HEIGHT) { diff --git a/drivers/gpu/drm/logicvc/logicvc_crtc.c b/drivers/gpu/drm/logicvc/logicvc_crtc.c index 43a675d03808..1175ff904560 100644 --- a/drivers/gpu/drm/logicvc/logicvc_crtc.c +++ b/drivers/gpu/drm/logicvc/logicvc_crtc.c @@ -41,7 +41,7 @@ static void logicvc_crtc_atomic_begin(struct drm_crtc *drm_crtc, struct logicvc_crtc *crtc = logicvc_crtc(drm_crtc); struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, drm_crtc); - struct drm_device *drm_dev = drm_crtc->dev; + struct drm_device *drm_dev = drm_crtc->drm; unsigned long flags; /* @@ -63,14 +63,14 @@ static void logicvc_crtc_atomic_enable(struct drm_crtc *drm_crtc, struct drm_atomic_state *state) { struct logicvc_crtc *crtc = logicvc_crtc(drm_crtc); - struct logicvc_drm *logicvc = logicvc_drm(drm_crtc->dev); + struct logicvc_drm *logicvc = logicvc_drm(drm_crtc->drm); struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, drm_crtc); struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state, drm_crtc); struct drm_display_mode *mode = &new_state->adjusted_mode; - struct drm_device *drm_dev = drm_crtc->dev; + struct drm_device *drm_dev = drm_crtc->drm; unsigned int hact, hfp, hsl, hbp; unsigned int vact, vfp, vsl, vbp; unsigned long flags; @@ -152,8 +152,8 @@ static void logicvc_crtc_atomic_enable(struct drm_crtc *drm_crtc, static void logicvc_crtc_atomic_disable(struct drm_crtc *drm_crtc, struct drm_atomic_state *state) { - struct logicvc_drm *logicvc = logicvc_drm(drm_crtc->dev); - struct drm_device *drm_dev = drm_crtc->dev; + struct logicvc_drm *logicvc = logicvc_drm(drm_crtc->drm); + struct drm_device *drm_dev = drm_crtc->drm; drm_crtc_vblank_off(drm_crtc); @@ -190,7 +190,7 @@ static const struct drm_crtc_helper_funcs logicvc_crtc_helper_funcs = { static int logicvc_crtc_enable_vblank(struct drm_crtc *drm_crtc) { - struct logicvc_drm *logicvc = logicvc_drm(drm_crtc->dev); + struct logicvc_drm *logicvc = logicvc_drm(drm_crtc->drm); /* Clear any pending V_SYNC interrupt. */ regmap_write_bits(logicvc->regmap, LOGICVC_INT_STAT_REG, @@ -205,7 +205,7 @@ static int logicvc_crtc_enable_vblank(struct drm_crtc *drm_crtc) static void logicvc_crtc_disable_vblank(struct drm_crtc *drm_crtc) { - struct logicvc_drm *logicvc = logicvc_drm(drm_crtc->dev); + struct logicvc_drm *logicvc = logicvc_drm(drm_crtc->drm); /* Mask V_SYNC interrupt. */ regmap_write_bits(logicvc->regmap, LOGICVC_INT_MASK_REG, diff --git a/drivers/gpu/drm/loongson/lsdc_crtc.c b/drivers/gpu/drm/loongson/lsdc_crtc.c index 827acab580fa..c7c683685c0c 100644 --- a/drivers/gpu/drm/loongson/lsdc_crtc.c +++ b/drivers/gpu/drm/loongson/lsdc_crtc.c @@ -673,7 +673,7 @@ static int lsdc_crtc_late_register(struct drm_crtc *crtc) { struct lsdc_display_pipe *dispipe = crtc_to_display_pipe(crtc); struct lsdc_crtc *lcrtc = to_lsdc_crtc(crtc); - struct drm_minor *minor = crtc->dev->primary; + struct drm_minor *minor = crtc->drm->primary; unsigned int index = dispipe->index; unsigned int i; @@ -741,7 +741,7 @@ static const struct drm_crtc_funcs ls7a2000_crtc_funcs = { static enum drm_mode_status lsdc_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode) { - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; struct lsdc_device *ldev = to_lsdc(ddev); const struct lsdc_desc *descp = ldev->descp; unsigned int pitch; @@ -782,7 +782,7 @@ static int lsdc_pixpll_atomic_check(struct drm_crtc *crtc, ret = pfuncs->compute(pixpll, clock, &priv_state->pparms); if (ret) { - drm_warn(crtc->dev, "Failed to find PLL params for %ukHz\n", + drm_warn(crtc->drm, "Failed to find PLL params for %ukHz\n", clock); return -EINVAL; } @@ -838,7 +838,7 @@ static void lsdc_crtc_mode_set_nofb(struct drm_crtc *crtc) static void lsdc_crtc_send_vblank(struct drm_crtc *crtc) { - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; unsigned long flags; if (!crtc->state || !crtc->state->event) @@ -883,7 +883,7 @@ static void lsdc_crtc_atomic_disable(struct drm_crtc *crtc, static void lsdc_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) { - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->event) { if (drm_crtc_vblank_get(crtc) == 0) drm_crtc_arm_vblank_event(crtc, crtc->state->event); @@ -891,7 +891,7 @@ static void lsdc_crtc_atomic_flush(struct drm_crtc *crtc, drm_crtc_send_vblank_event(crtc, crtc->state->event); crtc->state->event = NULL; } - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } static bool lsdc_crtc_get_scanout_position(struct drm_crtc *crtc, diff --git a/drivers/gpu/drm/mcde/mcde_display.c b/drivers/gpu/drm/mcde/mcde_display.c index 52043a12a2e8..ec56aeaa65cc 100644 --- a/drivers/gpu/drm/mcde/mcde_display.c +++ b/drivers/gpu/drm/mcde/mcde_display.c @@ -1154,7 +1154,7 @@ static void mcde_display_enable(struct drm_simple_display_pipe *pipe, { struct drm_crtc *crtc = &pipe->crtc; struct drm_plane *plane = &pipe->plane; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct mcde *mcde = to_mcde(drm); const struct drm_display_mode *mode = &cstate->mode; struct drm_framebuffer *fb = plane->state->fb; @@ -1300,7 +1300,7 @@ static void mcde_display_enable(struct drm_simple_display_pipe *pipe, static void mcde_display_disable(struct drm_simple_display_pipe *pipe) { struct drm_crtc *crtc = &pipe->crtc; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct mcde *mcde = to_mcde(drm); struct drm_pending_vblank_event *event; int ret; @@ -1321,9 +1321,9 @@ static void mcde_display_disable(struct drm_simple_display_pipe *pipe) if (event) { crtc->state->event = NULL; - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); drm_crtc_send_vblank_event(crtc, event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } ret = regulator_disable(mcde->epod); @@ -1384,7 +1384,7 @@ static void mcde_display_update(struct drm_simple_display_pipe *pipe, struct drm_plane_state *old_pstate) { struct drm_crtc *crtc = &pipe->crtc; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct mcde *mcde = to_mcde(drm); struct drm_pending_vblank_event *event = crtc->state->event; struct drm_plane *plane = &pipe->plane; @@ -1399,7 +1399,7 @@ static void mcde_display_update(struct drm_simple_display_pipe *pipe, if (event) { crtc->state->event = NULL; - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); /* * Hardware must be on before we can arm any vblank event, * this is not a scanout controller where there is always @@ -1415,7 +1415,7 @@ static void mcde_display_update(struct drm_simple_display_pipe *pipe, drm_crtc_send_vblank_event(crtc, event); } - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } /* @@ -1445,7 +1445,7 @@ static void mcde_display_update(struct drm_simple_display_pipe *pipe, static int mcde_display_enable_vblank(struct drm_simple_display_pipe *pipe) { struct drm_crtc *crtc = &pipe->crtc; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct mcde *mcde = to_mcde(drm); u32 val; @@ -1464,7 +1464,7 @@ static int mcde_display_enable_vblank(struct drm_simple_display_pipe *pipe) static void mcde_display_disable_vblank(struct drm_simple_display_pipe *pipe) { struct drm_crtc *crtc = &pipe->crtc; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct mcde *mcde = to_mcde(drm); /* Disable all VBLANK IRQs */ diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c index d40142842f85..f831e7a0c142 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -92,11 +92,11 @@ static void mtk_drm_crtc_finish_page_flip(struct mtk_drm_crtc *mtk_crtc) struct drm_crtc *crtc = &mtk_crtc->base; unsigned long flags; - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); drm_crtc_send_vblank_event(crtc, mtk_crtc->event); drm_crtc_vblank_put(crtc); mtk_crtc->event = NULL; - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); } static void mtk_drm_finish_page_flip(struct mtk_drm_crtc *mtk_crtc) @@ -345,11 +345,11 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc) height = crtc->state->adjusted_mode.vdisplay; vrefresh = drm_mode_vrefresh(&crtc->state->adjusted_mode); - drm_for_each_encoder(encoder, crtc->dev) { + drm_for_each_encoder(encoder, crtc->drm) { if (encoder->crtc != crtc) continue; - drm_connector_list_iter_begin(crtc->dev, &conn_iter); + drm_connector_list_iter_begin(crtc->drm, &conn_iter); drm_for_each_connector_iter(connector, &conn_iter) { if (connector->encoder != encoder) continue; @@ -360,7 +360,7 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc) drm_connector_list_iter_end(&conn_iter); } - ret = pm_runtime_resume_and_get(crtc->dev->dev); + ret = pm_runtime_resume_and_get(crtc->drm->dev); if (ret < 0) { DRM_ERROR("Failed to enable power domain: %d\n", ret); return ret; @@ -421,13 +421,13 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc) err_mutex_unprepare: mtk_mutex_unprepare(mtk_crtc->mutex); err_pm_runtime_put: - pm_runtime_put(crtc->dev->dev); + pm_runtime_put(crtc->drm->dev); return ret; } static void mtk_crtc_ddp_hw_fini(struct mtk_drm_crtc *mtk_crtc) { - struct drm_device *drm = mtk_crtc->base.dev; + struct drm_device *drm = mtk_crtc->base.drm; struct drm_crtc *crtc = &mtk_crtc->base; int i; @@ -460,10 +460,10 @@ static void mtk_crtc_ddp_hw_fini(struct mtk_drm_crtc *mtk_crtc) pm_runtime_put(drm->dev); if (crtc->state->event && !crtc->state->active) { - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); drm_crtc_send_vblank_event(crtc, crtc->state->event); crtc->state->event = NULL; - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } } @@ -549,7 +549,7 @@ static void mtk_drm_crtc_update_config(struct mtk_drm_crtc *mtk_crtc, struct cmdq_pkt *cmdq_handle = &mtk_crtc->cmdq_handle; #endif struct drm_crtc *crtc = &mtk_crtc->base; - struct mtk_drm_private *priv = crtc->dev->dev_private; + struct mtk_drm_private *priv = crtc->drm->dev_private; unsigned int pending_planes = 0, pending_async_planes = 0; int i; @@ -616,7 +616,7 @@ static void mtk_crtc_ddp_irq(void *data) { struct drm_crtc *crtc = data; struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc); - struct mtk_drm_private *priv = crtc->dev->dev_private; + struct mtk_drm_private *priv = crtc->drm->dev_private; #if IS_REACHABLE(CONFIG_MTK_CMDQ) if (!priv->data->shadow_register && !mtk_crtc->cmdq_client.chan) diff --git a/drivers/gpu/drm/meson/meson_crtc.c b/drivers/gpu/drm/meson/meson_crtc.c index d70616da8ce2..765f47ee4d73 100644 --- a/drivers/gpu/drm/meson/meson_crtc.c +++ b/drivers/gpu/drm/meson/meson_crtc.c @@ -162,9 +162,9 @@ static void meson_g12a_crtc_atomic_disable(struct drm_crtc *crtc, priv->viu.vd1_commit = false; if (crtc->state->event && !crtc->state->active) { - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); drm_crtc_send_vblank_event(crtc, crtc->state->event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); crtc->state->event = NULL; } @@ -192,9 +192,9 @@ static void meson_crtc_atomic_disable(struct drm_crtc *crtc, priv->io_base + _REG(VPP_MISC)); if (crtc->state->event && !crtc->state->active) { - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); drm_crtc_send_vblank_event(crtc, crtc->state->event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); crtc->state->event = NULL; } @@ -209,9 +209,9 @@ static void meson_crtc_atomic_begin(struct drm_crtc *crtc, if (crtc->state->event) { WARN_ON(drm_crtc_vblank_get(crtc) != 0); - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); meson_crtc->event = crtc->state->event; - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); crtc->state->event = NULL; } } diff --git a/drivers/gpu/drm/mgag200/mgag200_g200.c b/drivers/gpu/drm/mgag200/mgag200_g200.c index bf5d7fe525a3..f04f6ff94f04 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200.c @@ -69,7 +69,7 @@ static int mgag200_g200_pixpllc_atomic_check(struct drm_crtc *crtc, struct drm_a static const int feed_div_min = 7; static const int feed_div_max = 127; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mgag200_g200_device *g200 = to_mgag200_g200_device(dev); struct drm_crtc_state *new_crtc_state = drm_atomic_get_new_crtc_state(new_state, crtc); struct mgag200_crtc_state *new_mgag200_crtc_state = to_mgag200_crtc_state(new_crtc_state); @@ -139,7 +139,7 @@ static int mgag200_g200_pixpllc_atomic_check(struct drm_crtc *crtc, struct drm_a static void mgag200_g200_pixpllc_atomic_update(struct drm_crtc *crtc, struct drm_atomic_state *old_state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mga_device *mdev = to_mga_device(dev); struct drm_crtc_state *crtc_state = crtc->state; struct mgag200_crtc_state *mgag200_crtc_state = to_mgag200_crtc_state(crtc_state); diff --git a/drivers/gpu/drm/mgag200/mgag200_g200eh.c b/drivers/gpu/drm/mgag200/mgag200_g200eh.c index fad62453a91d..92894defcf60 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200eh.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200eh.c @@ -92,7 +92,7 @@ static int mgag200_g200eh_pixpllc_atomic_check(struct drm_crtc *crtc, void mgag200_g200eh_pixpllc_atomic_update(struct drm_crtc *crtc, struct drm_atomic_state *old_state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mga_device *mdev = to_mga_device(dev); struct drm_crtc_state *crtc_state = crtc->state; struct mgag200_crtc_state *mgag200_crtc_state = to_mgag200_crtc_state(crtc_state); diff --git a/drivers/gpu/drm/mgag200/mgag200_g200er.c b/drivers/gpu/drm/mgag200/mgag200_g200er.c index bce267e0f7de..68437e4c03cc 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200er.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200er.c @@ -120,7 +120,7 @@ static int mgag200_g200er_pixpllc_atomic_check(struct drm_crtc *crtc, static void mgag200_g200er_pixpllc_atomic_update(struct drm_crtc *crtc, struct drm_atomic_state *old_state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mga_device *mdev = to_mga_device(dev); struct drm_crtc_state *crtc_state = crtc->state; struct mgag200_crtc_state *mgag200_crtc_state = to_mgag200_crtc_state(crtc_state); @@ -183,7 +183,7 @@ static const struct drm_plane_funcs mgag200_g200er_primary_plane_funcs = { static void mgag200_g200er_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *old_state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mga_device *mdev = to_mga_device(dev); const struct mgag200_device_funcs *funcs = mdev->funcs; struct drm_crtc_state *crtc_state = crtc->state; diff --git a/drivers/gpu/drm/mgag200/mgag200_g200ev.c b/drivers/gpu/drm/mgag200/mgag200_g200ev.c index ac957f42abe1..911f2d936d39 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200ev.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200ev.c @@ -99,7 +99,7 @@ static int mgag200_g200ev_pixpllc_atomic_check(struct drm_crtc *crtc, static void mgag200_g200ev_pixpllc_atomic_update(struct drm_crtc *crtc, struct drm_atomic_state *old_state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mga_device *mdev = to_mga_device(dev); struct drm_crtc_state *crtc_state = crtc->state; struct mgag200_crtc_state *mgag200_crtc_state = to_mgag200_crtc_state(crtc_state); @@ -184,7 +184,7 @@ static const struct drm_plane_funcs mgag200_g200ev_primary_plane_funcs = { static void mgag200_g200ev_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *old_state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mga_device *mdev = to_mga_device(dev); const struct mgag200_device_funcs *funcs = mdev->funcs; struct drm_crtc_state *crtc_state = crtc->state; diff --git a/drivers/gpu/drm/mgag200/mgag200_g200se.c b/drivers/gpu/drm/mgag200/mgag200_g200se.c index bd6e573c9a1a..c465c7f4da29 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200se.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200se.c @@ -170,7 +170,7 @@ static int mgag200_g200se_00_pixpllc_atomic_check(struct drm_crtc *crtc, static void mgag200_g200se_00_pixpllc_atomic_update(struct drm_crtc *crtc, struct drm_atomic_state *old_state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mga_device *mdev = to_mga_device(dev); struct drm_crtc_state *crtc_state = crtc->state; struct mgag200_crtc_state *mgag200_crtc_state = to_mgag200_crtc_state(crtc_state); @@ -271,7 +271,7 @@ static int mgag200_g200se_04_pixpllc_atomic_check(struct drm_crtc *crtc, static void mgag200_g200se_04_pixpllc_atomic_update(struct drm_crtc *crtc, struct drm_atomic_state *old_state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mga_device *mdev = to_mga_device(dev); struct drm_crtc_state *crtc_state = crtc->state; struct mgag200_crtc_state *mgag200_crtc_state = to_mgag200_crtc_state(crtc_state); @@ -315,7 +315,7 @@ static const struct drm_plane_funcs mgag200_g200se_primary_plane_funcs = { static void mgag200_g200se_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *old_state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mga_device *mdev = to_mga_device(dev); const struct mgag200_device_funcs *funcs = mdev->funcs; struct drm_crtc_state *crtc_state = crtc->state; diff --git a/drivers/gpu/drm/mgag200/mgag200_g200wb.c b/drivers/gpu/drm/mgag200/mgag200_g200wb.c index 9baa727ac6f9..0fcc88c3f8b9 100644 --- a/drivers/gpu/drm/mgag200/mgag200_g200wb.c +++ b/drivers/gpu/drm/mgag200/mgag200_g200wb.c @@ -91,7 +91,7 @@ static int mgag200_g200wb_pixpllc_atomic_check(struct drm_crtc *crtc, void mgag200_g200wb_pixpllc_atomic_update(struct drm_crtc *crtc, struct drm_atomic_state *old_state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mga_device *mdev = to_mga_device(dev); struct drm_crtc_state *crtc_state = crtc->state; struct mgag200_crtc_state *mgag200_crtc_state = to_mgag200_crtc_state(crtc_state); diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index b166e6fc1399..f3c089b183eb 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -545,7 +545,7 @@ void mgag200_primary_plane_helper_atomic_disable(struct drm_plane *plane, enum drm_mode_status mgag200_crtc_helper_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode) { - struct mga_device *mdev = to_mga_device(crtc->dev); + struct mga_device *mdev = to_mga_device(crtc->drm); const struct mgag200_device_info *info = mdev->info; /* @@ -574,7 +574,7 @@ enum drm_mode_status mgag200_crtc_helper_mode_valid(struct drm_crtc *crtc, int mgag200_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *new_state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mga_device *mdev = to_mga_device(dev); const struct mgag200_device_funcs *funcs = mdev->funcs; struct drm_crtc_state *new_crtc_state = drm_atomic_get_new_crtc_state(new_state, crtc); @@ -610,7 +610,7 @@ void mgag200_crtc_helper_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_s { struct drm_crtc_state *crtc_state = crtc->state; struct mgag200_crtc_state *mgag200_crtc_state = to_mgag200_crtc_state(crtc_state); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mga_device *mdev = to_mga_device(dev); if (crtc_state->enable && crtc_state->color_mgmt_changed) { @@ -625,7 +625,7 @@ void mgag200_crtc_helper_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_s void mgag200_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *old_state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mga_device *mdev = to_mga_device(dev); const struct mgag200_device_funcs *funcs = mdev->funcs; struct drm_crtc_state *crtc_state = crtc->state; @@ -655,7 +655,7 @@ void mgag200_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_ void mgag200_crtc_helper_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *old_state) { - struct mga_device *mdev = to_mga_device(crtc->dev); + struct mga_device *mdev = to_mga_device(crtc->drm); const struct mgag200_device_funcs *funcs = mdev->funcs; if (funcs->disable_vidrst) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c index 1d9d83d7b99e..3133135f5b3d 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -102,7 +102,7 @@ static u64 _dpu_core_perf_calc_clk(struct dpu_kms *kms, static struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc) { struct msm_drm_private *priv; - priv = crtc->dev->dev_private; + priv = crtc->drm->dev_private; return to_dpu_kms(priv->kms); } @@ -171,7 +171,7 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc, bw_sum_of_intfs = dpu_cstate->new_perf.bw_ctl; curr_client_type = dpu_crtc_get_client_type(crtc); - drm_for_each_crtc(tmp_crtc, crtc->dev) { + drm_for_each_crtc(tmp_crtc, crtc->drm) { if (tmp_crtc->enabled && (dpu_crtc_get_client_type(tmp_crtc) == curr_client_type) && (tmp_crtc != crtc)) { @@ -217,7 +217,7 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms, int i, ret = 0; u64 avg_bw; - drm_for_each_crtc(tmp_crtc, crtc->dev) { + drm_for_each_crtc(tmp_crtc, crtc->drm) { if (tmp_crtc->enabled && curr_client_type == dpu_crtc_get_client_type(tmp_crtc)) { diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 1edf2b6b0a26..6bb56b89ff5d 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -46,7 +46,7 @@ static struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc) { - struct msm_drm_private *priv = crtc->dev->dev_private; + struct msm_drm_private *priv = crtc->drm->dev_private; return to_dpu_kms(priv->kms); } @@ -64,7 +64,7 @@ static void dpu_crtc_destroy(struct drm_crtc *crtc) static struct drm_encoder *get_encoder_from_crtc(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_encoder *encoder; drm_for_each_encoder(encoder, dev) @@ -106,7 +106,7 @@ static int dpu_crtc_verify_crc_source(struct drm_crtc *crtc, *values_cnt = 0; - drm_for_each_encoder_mask(drm_enc, crtc->dev, crtc->state->encoder_mask) + drm_for_each_encoder_mask(drm_enc, crtc->drm, crtc->state->encoder_mask) *values_cnt += dpu_encoder_get_crc_values_cnt(drm_enc); } @@ -133,7 +133,8 @@ static void dpu_crtc_setup_encoder_misr(struct drm_crtc *crtc) { struct drm_encoder *drm_enc; - drm_for_each_encoder_mask(drm_enc, crtc->dev, crtc->state->encoder_mask) + drm_for_each_encoder_mask(drm_enc, crtc->drm, + crtc->state->encoder_mask) dpu_encoder_setup_misr(drm_enc); } @@ -142,7 +143,7 @@ static int dpu_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name) enum dpu_crtc_crc_source source = dpu_crtc_parse_crc_source(src_name); enum dpu_crtc_crc_source current_source; struct dpu_crtc_state *crtc_state; - struct drm_device *drm_dev = crtc->dev; + struct drm_device *drm_dev = crtc->drm; bool was_enabled; bool enable = false; @@ -244,7 +245,8 @@ static int dpu_crtc_get_encoder_crc(struct drm_crtc *crtc) int rc, pos = 0; u32 crcs[INTF_MAX]; - drm_for_each_encoder_mask(drm_enc, crtc->dev, crtc->state->encoder_mask) { + drm_for_each_encoder_mask(drm_enc, crtc->drm, + crtc->state->encoder_mask) { rc = dpu_encoder_get_crc(drm_enc, crcs, pos); if (rc < 0) { if (rc != -ENODATA) @@ -569,7 +571,7 @@ static void _dpu_crtc_blend_setup(struct drm_crtc *crtc) static void _dpu_crtc_complete_flip(struct drm_crtc *crtc) { struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned long flags; spin_lock_irqsave(&dev->event_lock, flags); @@ -599,7 +601,8 @@ enum dpu_intf_mode dpu_crtc_get_intf_mode(struct drm_crtc *crtc) WARN_ON(!drm_modeset_is_locked(&crtc->mutex)); /* TODO: Returns the first INTF_MODE, could there be multiple values? */ - drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask) + drm_for_each_encoder_mask(encoder, crtc->drm, + crtc->state->encoder_mask) return dpu_encoder_get_intf_mode(encoder); return INTF_MODE_NONE; @@ -692,7 +695,7 @@ static void dpu_crtc_frame_event_cb(void *data, u32 event) return; dpu_crtc = to_dpu_crtc(crtc); - priv = crtc->dev->dev_private; + priv = crtc->drm->dev_private; crtc_id = drm_crtc_index(crtc); trace_dpu_crtc_frame_event_cb(DRMID(crtc), event); @@ -817,7 +820,8 @@ static void dpu_crtc_atomic_begin(struct drm_crtc *crtc, _dpu_crtc_setup_lm_bounds(crtc, crtc->state); /* encoder will trigger pending mask now */ - drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask) + drm_for_each_encoder_mask(encoder, crtc->drm, + crtc->state->encoder_mask) dpu_encoder_trigger_kickoff_pending(encoder); /* @@ -861,7 +865,7 @@ static void dpu_crtc_atomic_flush(struct drm_crtc *crtc, dpu_crtc = to_dpu_crtc(crtc); cstate = to_dpu_crtc_state(crtc->state); - dev = crtc->dev; + dev = crtc->drm; priv = dev->dev_private; if (crtc->index >= ARRAY_SIZE(priv->event_thread)) { @@ -956,8 +960,8 @@ void dpu_crtc_commit_kickoff(struct drm_crtc *crtc) DPU_ATRACE_BEGIN("crtc_commit"); - drm_for_each_encoder_mask(encoder, crtc->dev, - crtc->state->encoder_mask) { + drm_for_each_encoder_mask(encoder, crtc->drm, + crtc->state->encoder_mask) { if (!dpu_encoder_is_valid_for_commit(encoder)) { DRM_DEBUG_ATOMIC("invalid FB not kicking off crtc\n"); goto end; @@ -967,7 +971,7 @@ void dpu_crtc_commit_kickoff(struct drm_crtc *crtc) * Encoder will flush/start now, unless it has a tx pending. If so, it * may delay and flush at an irq event (e.g. ppdone) */ - drm_for_each_encoder_mask(encoder, crtc->dev, + drm_for_each_encoder_mask(encoder, crtc->drm, crtc->state->encoder_mask) dpu_encoder_prepare_for_kickoff(encoder); @@ -981,7 +985,8 @@ void dpu_crtc_commit_kickoff(struct drm_crtc *crtc) dpu_vbif_clear_errors(dpu_kms); - drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask) + drm_for_each_encoder_mask(encoder, crtc->drm, + crtc->state->encoder_mask) dpu_encoder_kickoff(encoder); reinit_completion(&dpu_crtc->frame_done_comp); @@ -1055,8 +1060,8 @@ static void dpu_crtc_disable(struct drm_crtc *crtc, * it won't trigger a warn while assigning crtc. */ if (old_crtc_state->self_refresh_active) { - drm_for_each_encoder_mask(encoder, crtc->dev, - old_crtc_state->encoder_mask) { + drm_for_each_encoder_mask(encoder, crtc->drm, + old_crtc_state->encoder_mask) { dpu_encoder_assign_crtc(encoder, NULL); } return; @@ -1065,7 +1070,7 @@ static void dpu_crtc_disable(struct drm_crtc *crtc, /* Disable/save vblank irq handling */ drm_crtc_vblank_off(crtc); - drm_for_each_encoder_mask(encoder, crtc->dev, + drm_for_each_encoder_mask(encoder, crtc->drm, old_crtc_state->encoder_mask) { /* in video mode, we hold an extra bandwidth reference * as we cannot drop bandwidth at frame-done if any @@ -1102,7 +1107,8 @@ static void dpu_crtc_disable(struct drm_crtc *crtc, dpu_core_perf_crtc_update(crtc, 0, true); - drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask) + drm_for_each_encoder_mask(encoder, crtc->drm, + crtc->state->encoder_mask) dpu_encoder_register_frame_event_callback(encoder, NULL, NULL); memset(cstate->mixers, 0, sizeof(cstate->mixers)); @@ -1113,13 +1119,13 @@ static void dpu_crtc_disable(struct drm_crtc *crtc, cstate->bw_split_vote = false; if (crtc->state->event && !crtc->state->active) { - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); drm_crtc_send_vblank_event(crtc, crtc->state->event); crtc->state->event = NULL; - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); } - pm_runtime_put_sync(crtc->dev->dev); + pm_runtime_put_sync(crtc->drm->dev); } static void dpu_crtc_enable(struct drm_crtc *crtc, @@ -1132,11 +1138,12 @@ static void dpu_crtc_enable(struct drm_crtc *crtc, old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc); - pm_runtime_get_sync(crtc->dev->dev); + pm_runtime_get_sync(crtc->drm->dev); DRM_DEBUG_KMS("crtc%d\n", crtc->base.id); - drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask) { + drm_for_each_encoder_mask(encoder, crtc->drm, + crtc->state->encoder_mask) { /* in video mode, we hold an extra bandwidth reference * as we cannot drop bandwidth at frame-done if any * crtc is being used in video mode. @@ -1154,7 +1161,8 @@ static void dpu_crtc_enable(struct drm_crtc *crtc, dpu_crtc->enabled = true; if (!old_crtc_state->self_refresh_active) { - drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask) + drm_for_each_encoder_mask(encoder, crtc->drm, + crtc->state->encoder_mask) dpu_encoder_assign_crtc(encoder, crtc); } @@ -1170,7 +1178,7 @@ static bool dpu_crtc_needs_dirtyfb(struct drm_crtc_state *cstate) if (cstate->self_refresh_active) return true; - drm_for_each_encoder_mask (encoder, crtc->dev, cstate->encoder_mask) { + drm_for_each_encoder_mask (encoder, crtc->drm, cstate->encoder_mask) { if (dpu_encoder_get_intf_mode(encoder) == INTF_MODE_CMD) { return true; } @@ -1262,7 +1270,7 @@ int dpu_crtc_vblank(struct drm_crtc *crtc, bool en) * about the assigned crtcs being inconsistent with the current state * (which means no need to worry about modeset locks). */ - list_for_each_entry(enc, &crtc->dev->mode_config.encoder_list, head) { + list_for_each_entry(enc, &crtc->drm->mode_config.encoder_list, head) { trace_dpu_crtc_vblank_enable(DRMID(crtc), DRMID(enc), en, dpu_crtc); @@ -1291,7 +1299,7 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data) dpu_crtc = s->private; crtc = &dpu_crtc->base; - drm_modeset_lock_all(crtc->dev); + drm_modeset_lock_all(crtc->drm); cstate = to_dpu_crtc_state(crtc->state); mode = &crtc->state->adjusted_mode; @@ -1383,7 +1391,7 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data) dpu_crtc->vblank_cb_time = ktime_set(0, 0); } - drm_modeset_unlock_all(crtc->dev); + drm_modeset_unlock_all(crtc->drm); return 0; } @@ -1474,7 +1482,7 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane, return ERR_PTR(-ENOMEM); crtc = &dpu_crtc->base; - crtc->dev = dev; + crtc->drm = dev; spin_lock_init(&dpu_crtc->spin_lock); atomic_set(&dpu_crtc->frame_pending, 0); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 6c44e1e65fcc..dd1fb12dabd6 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -468,7 +468,7 @@ static void dpu_kms_wait_for_commit_done(struct msm_kms *kms, return; } - dev = crtc->dev; + dev = crtc->drm; if (!crtc->state->enable) { DPU_DEBUG("[crtc:%d] not enable\n", crtc->base.id); diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c index 169f9de4a12a..4c4fc5b8c5ba 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c @@ -61,7 +61,7 @@ struct mdp4_crtc { static struct mdp4_kms *get_kms(struct drm_crtc *crtc) { - struct msm_drm_private *priv = crtc->dev->dev_private; + struct msm_drm_private *priv = crtc->drm->dev_private; return to_mdp4_kms(to_mdp_kms(priv->kms)); } @@ -98,7 +98,7 @@ static void crtc_flush(struct drm_crtc *crtc) static void complete_flip(struct drm_crtc *crtc, struct drm_file *file) { struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_pending_vblank_event *event; unsigned long flags; @@ -327,7 +327,7 @@ static void mdp4_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) { struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned long flags; DBG("%s: event: %p", mdp4_crtc->name, crtc->state->event); @@ -407,7 +407,7 @@ static int mdp4_crtc_cursor_set(struct drm_crtc *crtc, struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); struct mdp4_kms *mdp4_kms = get_kms(crtc); struct msm_kms *kms = &mdp4_kms->base.base; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_gem_object *cursor_bo, *old_bo; unsigned long flags; uint64_t iova; @@ -499,7 +499,7 @@ static void mdp4_crtc_vblank_irq(struct mdp_irq *irq, uint32_t irqstatus) { struct mdp4_crtc *mdp4_crtc = container_of(irq, struct mdp4_crtc, vblank); struct drm_crtc *crtc = &mdp4_crtc->base; - struct msm_drm_private *priv = crtc->dev->dev_private; + struct msm_drm_private *priv = crtc->drm->dev_private; unsigned pending; mdp_irq_unregister(&get_kms(crtc)->base, &mdp4_crtc->vblank); @@ -526,7 +526,7 @@ static void mdp4_crtc_err_irq(struct mdp_irq *irq, uint32_t irqstatus) static void mdp4_crtc_wait_for_flush_done(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); struct mdp4_kms *mdp4_kms = get_kms(crtc); int ret; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c index 86036dd4e1e8..0cd5c075423c 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c @@ -69,7 +69,7 @@ static void mdp5_crtc_restore_cursor(struct drm_crtc *crtc); static struct mdp5_kms *get_kms(struct drm_crtc *crtc) { - struct msm_drm_private *priv = crtc->dev->dev_private; + struct msm_drm_private *priv = crtc->drm->dev_private; return to_mdp5_kms(to_mdp_kms(priv->kms)); } @@ -140,7 +140,7 @@ static void complete_flip(struct drm_crtc *crtc, struct drm_file *file) struct mdp5_pipeline *pipeline = &mdp5_cstate->pipeline; struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc); struct mdp5_ctl *ctl = mdp5_cstate->ctl; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_pending_vblank_event *event; unsigned long flags; @@ -412,7 +412,7 @@ static void mdp5_crtc_mode_set_nofb(struct drm_crtc *crtc) static struct drm_encoder *get_encoder_from_crtc(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_encoder *encoder; drm_for_each_encoder(encoder, dev) @@ -701,7 +701,7 @@ static int mdp5_crtc_atomic_check(struct drm_crtc *crtc, struct mdp5_interface *intf = mdp5_cstate->pipeline.intf; struct mdp5_kms *mdp5_kms = get_kms(crtc); struct drm_plane *plane; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct plane_state pstates[STAGE_MAX + 1]; const struct mdp5_cfg_hw *hw_cfg; const struct drm_plane_state *pstate; @@ -800,7 +800,7 @@ static void mdp5_crtc_atomic_flush(struct drm_crtc *crtc, { struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc); struct mdp5_crtc_state *mdp5_cstate = to_mdp5_crtc_state(crtc->state); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned long flags; DBG("%s: event: %p", crtc->name, crtc->state->event); @@ -954,7 +954,7 @@ static int mdp5_crtc_cursor_set(struct drm_crtc *crtc, struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc); struct mdp5_crtc_state *mdp5_cstate = to_mdp5_crtc_state(crtc->state); struct mdp5_pipeline *pipeline = &mdp5_cstate->pipeline; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mdp5_kms *mdp5_kms = get_kms(crtc); struct platform_device *pdev = mdp5_kms->pdev; struct msm_kms *kms = &mdp5_kms->base.base; @@ -1042,7 +1042,7 @@ static int mdp5_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc); struct mdp5_crtc_state *mdp5_cstate = to_mdp5_crtc_state(crtc->state); uint32_t flush_mask = mdp_ctl_flush_mask_cursor(0); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; uint32_t roi_w; uint32_t roi_h; unsigned long flags; @@ -1189,7 +1189,7 @@ static void mdp5_crtc_vblank_irq(struct mdp_irq *irq, uint32_t irqstatus) { struct mdp5_crtc *mdp5_crtc = container_of(irq, struct mdp5_crtc, vblank); struct drm_crtc *crtc = &mdp5_crtc->base; - struct msm_drm_private *priv = crtc->dev->dev_private; + struct msm_drm_private *priv = crtc->drm->dev_private; unsigned pending; mdp_irq_unregister(&get_kms(crtc)->base, &mdp5_crtc->vblank); @@ -1221,7 +1221,7 @@ static void mdp5_crtc_pp_done_irq(struct mdp_irq *irq, uint32_t irqstatus) static void mdp5_crtc_wait_for_pp_done(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc); struct mdp5_crtc_state *mdp5_cstate = to_mdp5_crtc_state(crtc->state); int ret; @@ -1235,7 +1235,7 @@ static void mdp5_crtc_wait_for_pp_done(struct drm_crtc *crtc) static void mdp5_crtc_wait_for_flush_done(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc); struct mdp5_crtc_state *mdp5_cstate = to_mdp5_crtc_state(crtc->state); struct mdp5_ctl *ctl = mdp5_cstate->ctl; diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 2a0e3529598b..11ff297db886 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -638,7 +638,7 @@ static void msm_postclose(struct drm_device *dev, struct drm_file *file) int msm_crtc_enable_vblank(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; struct msm_drm_private *priv = dev->dev_private; struct msm_kms *kms = priv->kms; @@ -650,7 +650,7 @@ int msm_crtc_enable_vblank(struct drm_crtc *crtc) void msm_crtc_disable_vblank(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; struct msm_drm_private *priv = dev->dev_private; struct msm_kms *kms = priv->kms; diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index 2541d2de4e45..fb5e211c838f 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -402,7 +402,7 @@ static void lcdif_crtc_mode_set_nofb(struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { struct lcdif_crtc_state *lcdif_crtc_state = to_lcdif_crtc_state(crtc_state); - struct drm_device *drm = crtc_state->crtc->dev; + struct drm_device *drm = crtc_state->crtc->drm; struct lcdif_drm_private *lcdif = to_lcdif_drm_private(drm); struct drm_display_mode *m = &crtc_state->adjusted_mode; @@ -424,7 +424,7 @@ static void lcdif_crtc_mode_set_nofb(struct drm_crtc_state *crtc_state, static int lcdif_crtc_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); struct lcdif_crtc_state *lcdif_crtc_state = to_lcdif_crtc_state(crtc_state); @@ -505,7 +505,7 @@ static int lcdif_crtc_atomic_check(struct drm_crtc *crtc, static void lcdif_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->dev); + struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->drm); struct drm_pending_vblank_event *event; u32 reg; @@ -519,18 +519,18 @@ static void lcdif_crtc_atomic_flush(struct drm_crtc *crtc, if (!event) return; - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (drm_crtc_vblank_get(crtc) == 0) drm_crtc_arm_vblank_event(crtc, event); else drm_crtc_send_vblank_event(crtc, event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } static void lcdif_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->dev); + struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->drm); struct drm_crtc_state *new_cstate = drm_atomic_get_new_crtc_state(state, crtc); struct drm_plane_state *new_pstate = drm_atomic_get_new_plane_state(state, crtc->primary); @@ -560,7 +560,7 @@ static void lcdif_crtc_atomic_enable(struct drm_crtc *crtc, static void lcdif_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->dev); + struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->drm); struct drm_device *drm = lcdif->drm; struct drm_pending_vblank_event *event; @@ -623,7 +623,7 @@ lcdif_crtc_atomic_duplicate_state(struct drm_crtc *crtc) static int lcdif_crtc_enable_vblank(struct drm_crtc *crtc) { - struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->dev); + struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->drm); /* Clear and enable VBLANK IRQ */ writel(INT_STATUS_D0_VS_BLANK, lcdif->base + LCDC_V8_INT_STATUS_D0); @@ -634,7 +634,7 @@ static int lcdif_crtc_enable_vblank(struct drm_crtc *crtc) static void lcdif_crtc_disable_vblank(struct drm_crtc *crtc) { - struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->dev); + struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->drm); /* Disable and clear VBLANK IRQ */ writel(0, lcdif->base + LCDC_V8_INT_ENABLE_D0); diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsfb_kms.c index 7ed2516b6de0..d84e03a0c9eb 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c @@ -279,7 +279,7 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb, struct drm_bridge_state *bridge_state, const u32 bus_format) { - struct drm_device *drm = mxsfb->crtc.dev; + struct drm_device *drm = mxsfb->crtc.drm; struct drm_display_mode *m = &mxsfb->crtc.state->adjusted_mode; u32 bus_flags = mxsfb->connector->display_info.bus_flags; int err; @@ -335,18 +335,18 @@ static void mxsfb_crtc_atomic_flush(struct drm_crtc *crtc, if (!event) return; - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (drm_crtc_vblank_get(crtc) == 0) drm_crtc_arm_vblank_event(crtc, event); else drm_crtc_send_vblank_event(crtc, event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->dev); + struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->drm); struct drm_plane_state *new_pstate = drm_atomic_get_new_plane_state(state, crtc->primary); struct drm_bridge_state *bridge_state = NULL; @@ -400,7 +400,7 @@ static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc, static void mxsfb_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->dev); + struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->drm); struct drm_device *drm = mxsfb->drm; struct drm_pending_vblank_event *event; @@ -422,7 +422,7 @@ static void mxsfb_crtc_atomic_disable(struct drm_crtc *crtc, static int mxsfb_crtc_enable_vblank(struct drm_crtc *crtc) { - struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->dev); + struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->drm); /* Clear and enable VBLANK IRQ */ writel(CTRL1_CUR_FRAME_DONE_IRQ, mxsfb->base + LCDC_CTRL1 + REG_CLR); @@ -433,7 +433,7 @@ static int mxsfb_crtc_enable_vblank(struct drm_crtc *crtc) static void mxsfb_crtc_disable_vblank(struct drm_crtc *crtc) { - struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->dev); + struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->drm); /* Disable and clear VBLANK IRQ */ writel(CTRL1_CUR_FRAME_DONE_IRQ_EN, mxsfb->base + LCDC_CTRL1 + REG_CLR); @@ -447,7 +447,7 @@ static int mxsfb_crtc_set_crc_source(struct drm_crtc *crtc, const char *source) if (!crtc) return -ENODEV; - mxsfb = to_mxsfb_drm_private(crtc->dev); + mxsfb = to_mxsfb_drm_private(crtc->drm); if (source && strcmp(source, "auto") == 0) mxsfb->crc_active = true; diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c index a6f2e681bde9..d43234bd31e4 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c +++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c @@ -56,18 +56,18 @@ nv04_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, static void crtc_wr_cio_state(struct drm_crtc *crtc, struct nv04_crtc_reg *crtcstate, int index) { - NVWriteVgaCrtc(crtc->dev, nouveau_crtc(crtc)->index, index, + NVWriteVgaCrtc(crtc->drm, nouveau_crtc(crtc)->index, index, crtcstate->CRTC[index]); } static void nv_crtc_set_digital_vibrance(struct drm_crtc *crtc, int level) { struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct nv04_crtc_reg *regp = &nv04_display(dev)->mode_reg.crtc_reg[nv_crtc->index]; regp->CRTC[NV_CIO_CRE_CSB] = nv_crtc->saturation = level; - if (nv_crtc->saturation && nv_gf4_disp_arch(crtc->dev)) { + if (nv_crtc->saturation && nv_gf4_disp_arch(crtc->drm)) { regp->CRTC[NV_CIO_CRE_CSB] = 0x80; regp->CRTC[NV_CIO_CRE_5B] = nv_crtc->saturation << 2; crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_5B); @@ -78,14 +78,15 @@ static void nv_crtc_set_digital_vibrance(struct drm_crtc *crtc, int level) static void nv_crtc_set_image_sharpening(struct drm_crtc *crtc, int level) { struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct nv04_crtc_reg *regp = &nv04_display(dev)->mode_reg.crtc_reg[nv_crtc->index]; nv_crtc->sharpness = level; if (level < 0) /* blur is in hw range 0x3f -> 0x20 */ level += 0x40; regp->ramdac_634 = level; - NVWriteRAMDAC(crtc->dev, nv_crtc->index, NV_PRAMDAC_634, regp->ramdac_634); + NVWriteRAMDAC(crtc->drm, nv_crtc->index, NV_PRAMDAC_634, + regp->ramdac_634); } #define PLLSEL_VPLL1_MASK \ @@ -116,7 +117,7 @@ static void nv_crtc_set_image_sharpening(struct drm_crtc *crtc, int level) static void nv_crtc_calc_state_ext(struct drm_crtc *crtc, struct drm_display_mode * mode, int dot_clock) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nvkm_bios *bios = nvxx_bios(&drm->client.device); struct nvkm_clk *clk = nvxx_clk(&drm->client.device); @@ -175,7 +176,7 @@ static void nv_crtc_dpms(struct drm_crtc *crtc, int mode) { struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct nouveau_drm *drm = nouveau_drm(dev); unsigned char seq1 = 0, crtc17 = 0; unsigned char crtc1A; @@ -236,7 +237,7 @@ nv_crtc_dpms(struct drm_crtc *crtc, int mode) static void nv_crtc_mode_set_vga(struct drm_crtc *crtc, struct drm_display_mode *mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); struct nv04_crtc_reg *regp = &nv04_display(dev)->mode_reg.crtc_reg[nv_crtc->index]; struct drm_framebuffer *fb = crtc->primary->fb; @@ -460,7 +461,7 @@ nv_crtc_mode_set_vga(struct drm_crtc *crtc, struct drm_display_mode *mode) static void nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); struct nv04_crtc_reg *regp = &nv04_display(dev)->mode_reg.crtc_reg[nv_crtc->index]; @@ -609,7 +610,7 @@ nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode) static int nv_crtc_swap_fbs(struct drm_crtc *crtc, struct drm_framebuffer *old_fb) { - struct nv04_display *disp = nv04_display(crtc->dev); + struct nv04_display *disp = nv04_display(crtc->drm); struct drm_framebuffer *fb = crtc->primary->fb; struct nouveau_bo *nvbo = nouveau_gem_object(fb->obj[0]); struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); @@ -638,7 +639,7 @@ nv_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode, int x, int y, struct drm_framebuffer *old_fb) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); struct nouveau_drm *drm = nouveau_drm(dev); int ret; @@ -665,16 +666,16 @@ nv_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, static void nv_crtc_save(struct drm_crtc *crtc) { struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct nv04_mode_state *state = &nv04_display(dev)->mode_reg; struct nv04_crtc_reg *crtc_state = &state->crtc_reg[nv_crtc->index]; struct nv04_mode_state *saved = &nv04_display(dev)->saved_reg; struct nv04_crtc_reg *crtc_saved = &saved->crtc_reg[nv_crtc->index]; - if (nv_two_heads(crtc->dev)) - NVSetOwner(crtc->dev, nv_crtc->index); + if (nv_two_heads(crtc->drm)) + NVSetOwner(crtc->drm, nv_crtc->index); - nouveau_hw_save_state(crtc->dev, nv_crtc->index, saved); + nouveau_hw_save_state(crtc->drm, nv_crtc->index, saved); /* init some state to saved value */ state->sel_clk = saved->sel_clk & ~(0x5 << 16); @@ -686,22 +687,22 @@ static void nv_crtc_save(struct drm_crtc *crtc) static void nv_crtc_restore(struct drm_crtc *crtc) { struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; int head = nv_crtc->index; uint8_t saved_cr21 = nv04_display(dev)->saved_reg.crtc_reg[head].CRTC[NV_CIO_CRE_21]; - if (nv_two_heads(crtc->dev)) - NVSetOwner(crtc->dev, head); + if (nv_two_heads(crtc->drm)) + NVSetOwner(crtc->drm, head); - nouveau_hw_load_state(crtc->dev, head, &nv04_display(dev)->saved_reg); - nv_lock_vga_crtc_shadow(crtc->dev, head, saved_cr21); + nouveau_hw_load_state(crtc->drm, head, &nv04_display(dev)->saved_reg); + nv_lock_vga_crtc_shadow(crtc->drm, head, saved_cr21); nv_crtc->last_dpms = NV_DPMS_CLEARED; } static void nv_crtc_prepare(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); const struct drm_crtc_helper_funcs *funcs = crtc->helper_private; @@ -724,7 +725,7 @@ static void nv_crtc_prepare(struct drm_crtc *crtc) static void nv_crtc_commit(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; const struct drm_crtc_helper_funcs *funcs = crtc->helper_private; struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); @@ -746,7 +747,7 @@ static void nv_crtc_commit(struct drm_crtc *crtc) static void nv_crtc_destroy(struct drm_crtc *crtc) { - struct nv04_display *disp = nv04_display(crtc->dev); + struct nv04_display *disp = nv04_display(crtc->drm); struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); if (!nv_crtc) @@ -770,7 +771,7 @@ static void nv_crtc_gamma_load(struct drm_crtc *crtc) { struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); - struct drm_device *dev = nv_crtc->base.dev; + struct drm_device *dev = nv_crtc->base.drm; struct rgb { uint8_t r, g, b; } __attribute__((packed)) *rgbs; u16 *r, *g, *b; int i; @@ -792,7 +793,7 @@ nv_crtc_gamma_load(struct drm_crtc *crtc) static void nv_crtc_disable(struct drm_crtc *crtc) { - struct nv04_display *disp = nv04_display(crtc->dev); + struct nv04_display *disp = nv04_display(crtc->drm); struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); if (disp->image[nv_crtc->index]) nouveau_bo_unpin(disp->image[nv_crtc->index]); @@ -827,7 +828,7 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc, int x, int y, bool atomic) { struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nv04_crtc_reg *regp = &nv04_display(dev)->mode_reg.crtc_reg[nv_crtc->index]; struct nouveau_bo *nvbo; @@ -982,7 +983,7 @@ static int nv04_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, uint32_t buffer_handle, uint32_t width, uint32_t height) { - struct nouveau_drm *drm = nouveau_drm(crtc->dev); + struct nouveau_drm *drm = nouveau_drm(crtc->drm); struct drm_device *dev = drm->dev; struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); struct nouveau_bo *cursor = NULL; @@ -1140,7 +1141,7 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_modeset_acquire_ctx *ctx) { const int swap_interval = (flags & DRM_MODE_PAGE_FLIP_ASYNC) ? 0 : 1; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct drm_framebuffer *old_fb = crtc->primary->fb; struct nouveau_bo *old_bo = nouveau_gem_object(old_fb->obj[0]); diff --git a/drivers/gpu/drm/nouveau/dispnv04/cursor.c b/drivers/gpu/drm/nouveau/dispnv04/cursor.c index 4c6440d29c3f..d8b71731be6d 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/cursor.c +++ b/drivers/gpu/drm/nouveau/dispnv04/cursor.c @@ -8,20 +8,20 @@ static void nv04_cursor_show(struct nouveau_crtc *nv_crtc, bool update) { - nv_show_cursor(nv_crtc->base.dev, nv_crtc->index, true); + nv_show_cursor(nv_crtc->base.drm, nv_crtc->index, true); } static void nv04_cursor_hide(struct nouveau_crtc *nv_crtc, bool update) { - nv_show_cursor(nv_crtc->base.dev, nv_crtc->index, false); + nv_show_cursor(nv_crtc->base.drm, nv_crtc->index, false); } static void nv04_cursor_set_pos(struct nouveau_crtc *nv_crtc, int x, int y) { nv_crtc->cursor_saved_x = x; nv_crtc->cursor_saved_y = y; - NVWriteRAMDAC(nv_crtc->base.dev, nv_crtc->index, + NVWriteRAMDAC(nv_crtc->base.drm, nv_crtc->index, NV_PRAMDAC_CU_START_POS, XLATE(y, 0, NV_PRAMDAC_CU_START_POS_Y) | XLATE(x, 0, NV_PRAMDAC_CU_START_POS_X)); @@ -30,14 +30,14 @@ nv04_cursor_set_pos(struct nouveau_crtc *nv_crtc, int x, int y) static void crtc_wr_cio_state(struct drm_crtc *crtc, struct nv04_crtc_reg *crtcstate, int index) { - NVWriteVgaCrtc(crtc->dev, nouveau_crtc(crtc)->index, index, + NVWriteVgaCrtc(crtc->drm, nouveau_crtc(crtc)->index, index, crtcstate->CRTC[index]); } static void nv04_cursor_set_offset(struct nouveau_crtc *nv_crtc, uint32_t offset) { - struct drm_device *dev = nv_crtc->base.dev; + struct drm_device *dev = nv_crtc->base.drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nv04_crtc_reg *regp = &nv04_display(dev)->mode_reg.crtc_reg[nv_crtc->index]; struct drm_crtc *crtc = &nv_crtc->base; diff --git a/drivers/gpu/drm/nouveau/dispnv50/atom.h b/drivers/gpu/drm/nouveau/dispnv50/atom.h index 93f8f4f64578..6348fd4437b4 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/atom.h +++ b/drivers/gpu/drm/nouveau/dispnv50/atom.h @@ -163,7 +163,7 @@ nv50_head_atom_get_encoder(struct nv50_head_atom *atom) struct drm_encoder *encoder; /* We only ever have a single encoder */ - drm_for_each_encoder_mask(encoder, atom->state.crtc->dev, + drm_for_each_encoder_mask(encoder, atom->state.crtc->drm, atom->state.encoder_mask) return encoder; diff --git a/drivers/gpu/drm/nouveau/dispnv50/crc.c b/drivers/gpu/drm/nouveau/dispnv50/crc.c index beeb73e033ea..fbfcbe206d8c 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/crc.c +++ b/drivers/gpu/drm/nouveau/dispnv50/crc.c @@ -48,7 +48,7 @@ int nv50_crc_verify_source(struct drm_crtc *crtc, const char *source_name, size_t *values_cnt) { - struct nouveau_drm *drm = nouveau_drm(crtc->dev); + struct nouveau_drm *drm = nouveau_drm(crtc->drm); enum nv50_crc_source source; if (nv50_crc_parse_source(source_name, &source) < 0) { @@ -70,7 +70,7 @@ static void nv50_crc_program_ctx(struct nv50_head *head, struct nv50_crc_notifier_ctx *ctx) { - struct nv50_disp *disp = nv50_disp(head->base.base.dev); + struct nv50_disp *disp = nv50_disp(head->base.base.drm); struct nv50_core *core = disp->core; u32 interlock[NV50_DISP_INTERLOCK__SIZE] = { 0 }; @@ -84,7 +84,7 @@ static void nv50_crc_ctx_flip_work(struct kthread_work *base) struct nv50_crc *crc = container_of(work, struct nv50_crc, flip_work); struct nv50_head *head = container_of(crc, struct nv50_head, crc); struct drm_crtc *crtc = &head->base.base; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct nv50_disp *disp = nv50_disp(dev); const uint64_t start_vbl = drm_crtc_vblank_count(crtc); uint64_t end_vbl; @@ -154,7 +154,7 @@ void nv50_crc_handle_vblank(struct nv50_head *head) struct drm_crtc *crtc = &head->base.base; struct nv50_crc *crc = &head->crc; const struct nv50_crc_func *func = - nv50_disp(head->base.base.dev)->core->func->crc; + nv50_disp(head->base.base.drm)->core->func->crc; struct nv50_crc_notifier_ctx *ctx; bool need_reschedule = false; @@ -193,7 +193,7 @@ void nv50_crc_handle_vblank(struct nv50_head *head) * updates back-to-back without waiting, we'll just be * optimistic and assume we always miss exactly one frame. */ - drm_dbg_kms(head->base.base.dev, + drm_dbg_kms(head->base.base.drm, "Notifier ctx flip for head-%d finished, lost CRC for frame %llu\n", head->base.index, crc->frame); crc->frame++; @@ -219,7 +219,7 @@ static void nv50_crc_wait_ctx_finished(struct nv50_head *head, const struct nv50_crc_func *func, struct nv50_crc_notifier_ctx *ctx) { - struct drm_device *dev = head->base.base.dev; + struct drm_device *dev = head->base.base.drm; struct nouveau_drm *drm = nouveau_drm(dev); s64 ret; @@ -256,7 +256,7 @@ void nv50_crc_atomic_stop_reporting(struct drm_atomic_state *state) drm_crtc_vblank_put(crtc); drm_vblank_work_cancel_sync(&crc->flip_work); - NV_ATOMIC(nouveau_drm(crtc->dev), + NV_ATOMIC(nouveau_drm(crtc->drm), "CRC reporting on vblank for head-%d disabled\n", head->base.index); @@ -340,7 +340,7 @@ void nv50_crc_atomic_start_reporting(struct drm_atomic_state *state) true); spin_unlock_irq(&crc->lock); - NV_ATOMIC(nouveau_drm(crtc->dev), + NV_ATOMIC(nouveau_drm(crtc->drm), "CRC reporting on vblank for head-%d enabled\n", head->base.index); } @@ -449,7 +449,7 @@ void nv50_crc_atomic_set(struct nv50_head *head, struct nv50_head_atom *asyh) { struct drm_crtc *crtc = &head->base.base; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct nv50_crc *crc = &head->crc; const struct nv50_crc_func *func = nv50_disp(dev)->core->func->crc; struct nouveau_encoder *outp; @@ -470,7 +470,7 @@ void nv50_crc_atomic_set(struct nv50_head *head, void nv50_crc_atomic_clr(struct nv50_head *head) { const struct nv50_crc_func *func = - nv50_disp(head->base.base.dev)->core->func->crc; + nv50_disp(head->base.base.drm)->core->func->crc; func->set_src(head, 0, NV50_CRC_SOURCE_TYPE_NONE, NULL); } @@ -500,7 +500,7 @@ static inline int nv50_crc_ctx_init(struct nv50_head *head, struct nvif_mmu *mmu, struct nv50_crc_notifier_ctx *ctx, size_t len, int idx) { - struct nv50_core *core = nv50_disp(head->base.base.dev)->core; + struct nv50_core *core = nv50_disp(head->base.base.drm)->core; int ret; ret = nvif_mem_ctor_map(mmu, "kmsCrcNtfy", NVIF_MEM_VRAM, len, &ctx->mem); @@ -537,7 +537,7 @@ nv50_crc_ctx_fini(struct nv50_crc_notifier_ctx *ctx) int nv50_crc_set_source(struct drm_crtc *crtc, const char *source_str) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_atomic_state *state; struct drm_modeset_acquire_ctx ctx; struct nv50_head *head = nv50_head(crtc); @@ -656,10 +656,10 @@ nv50_crc_debugfs_flip_threshold_set(struct file *file, struct nv50_head *head = m->private; struct nv50_head_atom *armh; struct drm_crtc *crtc = &head->base.base; - struct nouveau_drm *drm = nouveau_drm(crtc->dev); + struct nouveau_drm *drm = nouveau_drm(crtc->drm); struct nv50_crc *crc = &head->crc; const struct nv50_crc_func *func = - nv50_disp(crtc->dev)->core->func->crc; + nv50_disp(crtc->drm)->core->func->crc; int value, ret; ret = kstrtoint_from_user(ubuf, len, 10, &value); @@ -706,7 +706,7 @@ int nv50_head_crc_late_register(struct nv50_head *head) { struct drm_crtc *crtc = &head->base.base; const struct nv50_crc_func *func = - nv50_disp(crtc->dev)->core->func->crc; + nv50_disp(crtc->drm)->core->func->crc; struct dentry *root; if (!func || !crtc->debugfs_entry) diff --git a/drivers/gpu/drm/nouveau/dispnv50/crc907d.c b/drivers/gpu/drm/nouveau/dispnv50/crc907d.c index f9ad641555b7..89e1f2832368 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/crc907d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/crc907d.c @@ -26,7 +26,7 @@ static int crc907d_set_src(struct nv50_head *head, int or, enum nv50_crc_source_type source, struct nv50_crc_notifier_ctx *ctx) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; u32 crc_args = NVDEF(NV907D, HEAD_SET_CRC_CONTROL, CONTROLLING_CHANNEL, CORE) | NVDEF(NV907D, HEAD_SET_CRC_CONTROL, EXPECT_BUFFER_COLLAPSE, FALSE) | @@ -74,7 +74,7 @@ crc907d_set_src(struct nv50_head *head, int or, enum nv50_crc_source_type source static int crc907d_set_ctx(struct nv50_head *head, struct nv50_crc_notifier_ctx *ctx) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -97,7 +97,7 @@ static u32 crc907d_get_entry(struct nv50_head *head, static bool crc907d_ctx_finished(struct nv50_head *head, struct nv50_crc_notifier_ctx *ctx) { - struct nouveau_drm *drm = nouveau_drm(head->base.base.dev); + struct nouveau_drm *drm = nouveau_drm(head->base.base.drm); struct crc907d_notifier __iomem *notifier = ctx->mem.object.map.ptr; const u32 status = ioread32_native(¬ifier->status); const u32 overflow = status & 0x0000003e; diff --git a/drivers/gpu/drm/nouveau/dispnv50/crcc37d.c b/drivers/gpu/drm/nouveau/dispnv50/crcc37d.c index f10f6c484408..0a2a8a91da23 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/crcc37d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/crcc37d.c @@ -15,7 +15,7 @@ static int crcc37d_set_src(struct nv50_head *head, int or, enum nv50_crc_source_type source, struct nv50_crc_notifier_ctx *ctx) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; u32 crc_args = NVVAL(NVC37D, HEAD_SET_CRC_CONTROL, CONTROLLING_CHANNEL, i * 4) | NVDEF(NVC37D, HEAD_SET_CRC_CONTROL, EXPECT_BUFFER_COLLAPSE, FALSE) | @@ -53,7 +53,7 @@ crcc37d_set_src(struct nv50_head *head, int or, enum nv50_crc_source_type source int crcc37d_set_ctx(struct nv50_head *head, struct nv50_crc_notifier_ctx *ctx) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -81,7 +81,7 @@ u32 crcc37d_get_entry(struct nv50_head *head, struct nv50_crc_notifier_ctx *ctx, bool crcc37d_ctx_finished(struct nv50_head *head, struct nv50_crc_notifier_ctx *ctx) { - struct nouveau_drm *drm = nouveau_drm(head->base.base.dev); + struct nouveau_drm *drm = nouveau_drm(head->base.base.drm); struct crcc37d_notifier __iomem *notifier = ctx->mem.object.map.ptr; const u32 status = ioread32_native(¬ifier->status); const u32 overflow = status & 0x0000007e; diff --git a/drivers/gpu/drm/nouveau/dispnv50/crcc57d.c b/drivers/gpu/drm/nouveau/dispnv50/crcc57d.c index cc0130e3d496..f0da0840a2da 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/crcc57d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/crcc57d.c @@ -13,7 +13,7 @@ static int crcc57d_set_src(struct nv50_head *head, int or, enum nv50_crc_source_type source, struct nv50_crc_notifier_ctx *ctx) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; u32 crc_args = NVDEF(NVC57D, HEAD_SET_CRC_CONTROL, CONTROLLING_CHANNEL, CORE) | NVDEF(NVC57D, HEAD_SET_CRC_CONTROL, EXPECT_BUFFER_COLLAPSE, FALSE) | diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 521bf7eeb558..8c04b5f554ea 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -2213,9 +2213,9 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) /* Get correct count/ts if racing with vblank irq */ if (new_crtc_state->active) drm_crtc_accurate_vblank_count(crtc); - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); drm_crtc_send_vblank_event(crtc, new_crtc_state->event); - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); new_crtc_state->event = NULL; if (new_crtc_state->active) diff --git a/drivers/gpu/drm/nouveau/dispnv50/head.c b/drivers/gpu/drm/nouveau/dispnv50/head.c index 5f490fbf1877..17a23d0751bd 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/head.c +++ b/drivers/gpu/drm/nouveau/dispnv50/head.c @@ -225,7 +225,7 @@ static int nv50_head_atomic_check_lut(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct drm_device *dev = head->base.base.dev; + struct drm_device *dev = head->base.base.drm; struct drm_crtc *crtc = &head->base.base; struct nv50_disp *disp = nv50_disp(dev); struct nouveau_drm *drm = nouveau_drm(dev); @@ -336,7 +336,7 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state) crtc); struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); - struct nouveau_drm *drm = nouveau_drm(crtc->dev); + struct nouveau_drm *drm = nouveau_drm(crtc->drm); struct nv50_head *head = nv50_head(crtc); struct nv50_head_atom *armh = nv50_head_atom(old_crtc_state); struct nv50_head_atom *asyh = nv50_head_atom(crtc_state); diff --git a/drivers/gpu/drm/nouveau/dispnv50/head507d.c b/drivers/gpu/drm/nouveau/dispnv50/head507d.c index 0edd4e520c8e..7fecdb0db07a 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/head507d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/head507d.c @@ -29,7 +29,7 @@ int head507d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -48,7 +48,7 @@ head507d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh) int head507d_dither(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -66,7 +66,7 @@ head507d_dither(struct nv50_head *head, struct nv50_head_atom *asyh) int head507d_ovly(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; u32 bounds = 0; int ret; @@ -94,7 +94,7 @@ head507d_ovly(struct nv50_head *head, struct nv50_head_atom *asyh) int head507d_base(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; u32 bounds = 0; int ret; @@ -122,7 +122,7 @@ head507d_base(struct nv50_head *head, struct nv50_head_atom *asyh) static int head507d_curs_clr(struct nv50_head *head) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -139,7 +139,7 @@ head507d_curs_clr(struct nv50_head *head) static int head507d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -188,7 +188,7 @@ head507d_curs_layout(struct nv50_head *head, struct nv50_wndw_atom *asyw, int head507d_core_clr(struct nv50_head *head) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -202,7 +202,7 @@ head507d_core_clr(struct nv50_head *head) static int head507d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -246,7 +246,7 @@ head507d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh) void head507d_core_calc(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nv50_disp *disp = nv50_disp(head->base.base.dev); + struct nv50_disp *disp = nv50_disp(head->base.base.drm); if ((asyh->core.visible = (asyh->base.cpp != 0))) { asyh->core.x = asyh->base.x; asyh->core.y = asyh->base.y; @@ -278,7 +278,7 @@ head507d_core_calc(struct nv50_head *head, struct nv50_head_atom *asyh) static int head507d_olut_clr(struct nv50_head *head) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -293,7 +293,7 @@ head507d_olut_clr(struct nv50_head *head) static int head507d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -345,7 +345,7 @@ head507d_olut(struct nv50_head *head, struct nv50_head_atom *asyh, int size) int head507d_mode(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; struct nv50_head_mode *m = &asyh->mode; const int i = head->base.index; int ret; @@ -400,7 +400,7 @@ head507d_mode(struct nv50_head *head, struct nv50_head_atom *asyh) int head507d_view(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; diff --git a/drivers/gpu/drm/nouveau/dispnv50/head827d.c b/drivers/gpu/drm/nouveau/dispnv50/head827d.c index 194d1771c481..a31ff645c60e 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/head827d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/head827d.c @@ -29,7 +29,7 @@ static int head827d_curs_clr(struct nv50_head *head) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -48,7 +48,7 @@ head827d_curs_clr(struct nv50_head *head) static int head827d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -73,7 +73,7 @@ head827d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh) static int head827d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -110,7 +110,7 @@ head827d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh) static int head827d_olut_clr(struct nv50_head *head) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -127,7 +127,7 @@ head827d_olut_clr(struct nv50_head *head) static int head827d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; diff --git a/drivers/gpu/drm/nouveau/dispnv50/head907d.c b/drivers/gpu/drm/nouveau/dispnv50/head907d.c index 18fe4c1e2d6a..7fd070d8c8ed 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/head907d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/head907d.c @@ -36,7 +36,7 @@ int head907d_or(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -57,7 +57,7 @@ head907d_or(struct nv50_head *head, struct nv50_head_atom *asyh) int head907d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -77,7 +77,7 @@ head907d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh) static int head907d_dither(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -95,7 +95,7 @@ head907d_dither(struct nv50_head *head, struct nv50_head_atom *asyh) int head907d_ovly(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; u32 bounds = 0; int ret; @@ -124,7 +124,7 @@ head907d_ovly(struct nv50_head *head, struct nv50_head_atom *asyh) static int head907d_base(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; u32 bounds = 0; int ret; @@ -152,7 +152,7 @@ head907d_base(struct nv50_head *head, struct nv50_head_atom *asyh) int head907d_curs_clr(struct nv50_head *head) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -171,7 +171,7 @@ head907d_curs_clr(struct nv50_head *head) int head907d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -195,7 +195,7 @@ head907d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh) int head907d_core_clr(struct nv50_head *head) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -209,7 +209,7 @@ head907d_core_clr(struct nv50_head *head) int head907d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -246,7 +246,7 @@ head907d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh) int head907d_olut_clr(struct nv50_head *head) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -263,7 +263,7 @@ head907d_olut_clr(struct nv50_head *head) int head907d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -322,7 +322,7 @@ bool head907d_ilut_check(int size) int head907d_mode(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; struct nv50_head_mode *m = &asyh->mode; const int i = head->base.index; int ret; @@ -378,7 +378,7 @@ head907d_mode(struct nv50_head *head, struct nv50_head_atom *asyh) int head907d_view(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; diff --git a/drivers/gpu/drm/nouveau/dispnv50/head917d.c b/drivers/gpu/drm/nouveau/dispnv50/head917d.c index 4ce47b55f72c..678b08dc53e3 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/head917d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/head917d.c @@ -30,7 +30,7 @@ static int head917d_dither(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -48,7 +48,7 @@ head917d_dither(struct nv50_head *head, struct nv50_head_atom *asyh) static int head917d_base(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; u32 bounds = 0; int ret; @@ -77,7 +77,7 @@ head917d_base(struct nv50_head *head, struct nv50_head_atom *asyh) static int head917d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; diff --git a/drivers/gpu/drm/nouveau/dispnv50/headc37d.c b/drivers/gpu/drm/nouveau/dispnv50/headc37d.c index a4a3b78ea42c..20dc6ac6201b 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/headc37d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/headc37d.c @@ -30,7 +30,7 @@ static int headc37d_or(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; u8 depth; int ret; @@ -64,7 +64,7 @@ headc37d_or(struct nv50_head *head, struct nv50_head_atom *asyh) static int headc37d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -85,7 +85,7 @@ headc37d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh) int headc37d_dither(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -104,7 +104,7 @@ headc37d_dither(struct nv50_head *head, struct nv50_head_atom *asyh) int headc37d_curs_clr(struct nv50_head *head) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -122,7 +122,7 @@ headc37d_curs_clr(struct nv50_head *head) int headc37d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -161,7 +161,7 @@ headc37d_curs_format(struct nv50_head *head, struct nv50_wndw_atom *asyw, static int headc37d_olut_clr(struct nv50_head *head) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -175,7 +175,7 @@ headc37d_olut_clr(struct nv50_head *head) static int headc37d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -209,7 +209,7 @@ headc37d_olut(struct nv50_head *head, struct nv50_head_atom *asyh, int size) static int headc37d_mode(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; struct nv50_head_mode *m = &asyh->mode; const int i = head->base.index; int ret; @@ -254,7 +254,7 @@ headc37d_mode(struct nv50_head *head, struct nv50_head_atom *asyh) int headc37d_view(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; diff --git a/drivers/gpu/drm/nouveau/dispnv50/headc57d.c b/drivers/gpu/drm/nouveau/dispnv50/headc57d.c index 543f08ceaad6..45b124f3217d 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/headc57d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/headc57d.c @@ -30,7 +30,7 @@ static int headc57d_or(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; u8 depth; int ret; @@ -65,7 +65,7 @@ headc57d_or(struct nv50_head *head, struct nv50_head_atom *asyh) static int headc57d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -83,7 +83,7 @@ headc57d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh) static int headc57d_olut_clr(struct nv50_head *head) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -97,7 +97,7 @@ headc57d_olut_clr(struct nv50_head *head) static int headc57d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; const int i = head->base.index; int ret; @@ -188,7 +188,7 @@ headc57d_olut(struct nv50_head *head, struct nv50_head_atom *asyh, int size) static int headc57d_mode(struct nv50_head *head, struct nv50_head_atom *asyh) { - struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + struct nvif_push *push = nv50_disp(head->base.base.drm)->core->chan.push; struct nv50_head_mode *m = &asyh->mode; const int i = head->base.index; int ret; diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.h b/drivers/gpu/drm/nouveau/nouveau_connector.h index 35bcb541722b..f34aeb6b31f8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.h +++ b/drivers/gpu/drm/nouveau/nouveau_connector.h @@ -181,7 +181,7 @@ nouveau_connector_is_mst(struct drm_connector *connector) static inline struct nouveau_connector * nouveau_crtc_connector_get(struct nouveau_crtc *nv_crtc) { - struct drm_device *dev = nv_crtc->base.dev; + struct drm_device *dev = nv_crtc->base.drm; struct drm_connector *connector; struct drm_connector_list_iter conn_iter; struct nouveau_connector *nv_connector = NULL; diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 99977e5fe716..1d005473a488 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -83,7 +83,7 @@ static bool nouveau_display_scanoutpos_head(struct drm_crtc *crtc, int *vpos, int *hpos, ktime_t *stime, ktime_t *etime) { - struct drm_vblank_crtc *vblank = &crtc->dev->vblank[drm_crtc_index(crtc)]; + struct drm_vblank_crtc *vblank = &crtc->drm->vblank[drm_crtc_index(crtc)]; struct nvif_head *head = &nouveau_crtc(crtc)->head; struct nvif_head_scanoutpos_v0 args; int retry = 20; diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c index 63ddc5127f7b..125172669e67 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c @@ -70,9 +70,9 @@ static bool omap_crtc_is_pending(struct drm_crtc *crtc) unsigned long flags; bool pending; - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); pending = omap_crtc->pending; - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); return pending; } @@ -109,7 +109,7 @@ void omap_crtc_dss_start_update(struct omap_drm_private *priv, void omap_crtc_set_enabled(struct drm_crtc *crtc, bool enable) { struct omap_crtc_state *omap_state = to_omap_crtc_state(crtc->state); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct omap_drm_private *priv = dev->dev_private; struct omap_crtc *omap_crtc = to_omap_crtc(crtc); enum omap_channel channel = omap_crtc->channel; @@ -228,7 +228,7 @@ int omap_crtc_dss_register_framedone( { struct drm_crtc *crtc = priv->channels[channel]->crtc; struct omap_crtc *omap_crtc = to_omap_crtc(crtc); - struct drm_device *dev = omap_crtc->base.dev; + struct drm_device *dev = omap_crtc->base.drm; if (omap_crtc->framedone_handler) return -EBUSY; @@ -247,7 +247,7 @@ void omap_crtc_dss_unregister_framedone( { struct drm_crtc *crtc = priv->channels[channel]->crtc; struct omap_crtc *omap_crtc = to_omap_crtc(crtc); - struct drm_device *dev = omap_crtc->base.dev; + struct drm_device *dev = omap_crtc->base.drm; dev_dbg(dev->dev, "unregister framedone %s", omap_crtc->name); @@ -278,17 +278,17 @@ void omap_crtc_error_irq(struct drm_crtc *crtc, u32 irqstatus) void omap_crtc_vblank_irq(struct drm_crtc *crtc) { struct omap_crtc *omap_crtc = to_omap_crtc(crtc); - struct drm_device *dev = omap_crtc->base.dev; + struct drm_device *dev = omap_crtc->base.drm; struct omap_drm_private *priv = dev->dev_private; bool pending; - spin_lock(&crtc->dev->event_lock); + spin_lock(&crtc->drm->event_lock); /* * If the dispc is busy we're racing the flush operation. Try again on * the next vblank interrupt. */ if (dispc_mgr_go_busy(priv->dispc, omap_crtc->channel)) { - spin_unlock(&crtc->dev->event_lock); + spin_unlock(&crtc->drm->event_lock); return; } @@ -300,7 +300,7 @@ void omap_crtc_vblank_irq(struct drm_crtc *crtc) pending = omap_crtc->pending; omap_crtc->pending = false; - spin_unlock(&crtc->dev->event_lock); + spin_unlock(&crtc->drm->event_lock); if (pending) drm_crtc_vblank_put(crtc); @@ -320,14 +320,14 @@ void omap_crtc_framedone_irq(struct drm_crtc *crtc, uint32_t irqstatus) omap_crtc->framedone_handler(omap_crtc->framedone_handler_data); - spin_lock(&crtc->dev->event_lock); + spin_lock(&crtc->drm->event_lock); /* Send the vblank event if one has been requested. */ if (omap_crtc->event) { drm_crtc_send_vblank_event(crtc, omap_crtc->event); omap_crtc->event = NULL; } omap_crtc->pending = false; - spin_unlock(&crtc->dev->event_lock); + spin_unlock(&crtc->drm->event_lock); /* Wake up omap_atomic_complete. */ wake_up(&omap_crtc->pending_wait); @@ -350,7 +350,7 @@ static void omap_crtc_manual_display_update(struct work_struct *data) struct omap_crtc *omap_crtc = container_of(data, struct omap_crtc, update_work.work); struct omap_dss_device *dssdev = omap_crtc->pipe->output; - struct drm_device *dev = omap_crtc->base.dev; + struct drm_device *dev = omap_crtc->base.drm; int ret; if (!dssdev || !dssdev->dsi_ops || !dssdev->dsi_ops->update) @@ -394,7 +394,7 @@ static void omap_crtc_cpr_coefs_from_ctm(const struct drm_color_ctm *ctm, static void omap_crtc_write_crtc_properties(struct drm_crtc *crtc) { - struct omap_drm_private *priv = crtc->dev->dev_private; + struct omap_drm_private *priv = crtc->drm->dev_private; struct omap_crtc *omap_crtc = to_omap_crtc(crtc); struct omap_overlay_manager_info info; @@ -447,7 +447,7 @@ static void omap_crtc_arm_event(struct drm_crtc *crtc) static void omap_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct omap_drm_private *priv = crtc->dev->dev_private; + struct omap_drm_private *priv = crtc->drm->dev_private; struct omap_crtc *omap_crtc = to_omap_crtc(crtc); struct omap_crtc_state *omap_state = to_omap_crtc_state(crtc->state); int ret; @@ -465,26 +465,26 @@ static void omap_crtc_atomic_enable(struct drm_crtc *crtc, ret = drm_crtc_vblank_get(crtc); WARN_ON(ret != 0); - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); omap_crtc_arm_event(crtc); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } static void omap_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct omap_drm_private *priv = crtc->dev->dev_private; + struct omap_drm_private *priv = crtc->drm->dev_private; struct omap_crtc *omap_crtc = to_omap_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; DBG("%s", omap_crtc->name); - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->event) { drm_crtc_send_vblank_event(crtc, crtc->state->event); crtc->state->event = NULL; } - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); cancel_delayed_work(&omap_crtc->update_work); @@ -499,7 +499,7 @@ static void omap_crtc_atomic_disable(struct drm_crtc *crtc, static enum drm_mode_status omap_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode) { - struct omap_drm_private *priv = crtc->dev->dev_private; + struct omap_drm_private *priv = crtc->drm->dev_private; struct omap_crtc *omap_crtc = to_omap_crtc(crtc); struct videomode vm = {0}; int r; @@ -615,7 +615,7 @@ static void omap_crtc_atomic_begin(struct drm_crtc *crtc, static void omap_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct omap_drm_private *priv = crtc->dev->dev_private; + struct omap_drm_private *priv = crtc->drm->dev_private; struct omap_crtc *omap_crtc = to_omap_crtc(crtc); struct omap_crtc_state *omap_crtc_state = to_omap_crtc_state(crtc->state); int ret; @@ -644,20 +644,20 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc, if (omap_crtc_state->manually_updated) { /* send new image for page flips and modeset changes */ - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); omap_crtc_flush(crtc); omap_crtc_arm_event(crtc); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); return; } ret = drm_crtc_vblank_get(crtc); WARN_ON(ret != 0); - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); dispc_mgr_go(priv->dispc, omap_crtc->channel); omap_crtc_arm_event(crtc); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } static int omap_crtc_atomic_set_property(struct drm_crtc *crtc, @@ -665,7 +665,7 @@ static int omap_crtc_atomic_set_property(struct drm_crtc *crtc, struct drm_property *property, u64 val) { - struct omap_drm_private *priv = crtc->dev->dev_private; + struct omap_drm_private *priv = crtc->drm->dev_private; struct drm_plane_state *plane_state; /* @@ -693,7 +693,7 @@ static int omap_crtc_atomic_get_property(struct drm_crtc *crtc, struct drm_property *property, u64 *val) { - struct omap_drm_private *priv = crtc->dev->dev_private; + struct omap_drm_private *priv = crtc->drm->dev_private; struct omap_crtc_state *omap_state = to_omap_crtc_state(state); if (property == crtc->primary->rotation_property) diff --git a/drivers/gpu/drm/omapdrm/omap_irq.c b/drivers/gpu/drm/omapdrm/omap_irq.c index a6f0bbc879d2..6308ca479056 100644 --- a/drivers/gpu/drm/omapdrm/omap_irq.c +++ b/drivers/gpu/drm/omapdrm/omap_irq.c @@ -78,7 +78,7 @@ int omap_irq_wait(struct drm_device *dev, struct omap_irq_wait *wait, int omap_irq_enable_framedone(struct drm_crtc *crtc, bool enable) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct omap_drm_private *priv = dev->dev_private; unsigned long flags; enum omap_channel channel = omap_crtc_channel(crtc); @@ -112,7 +112,7 @@ int omap_irq_enable_framedone(struct drm_crtc *crtc, bool enable) */ int omap_irq_enable_vblank(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct omap_drm_private *priv = dev->dev_private; unsigned long flags; enum omap_channel channel = omap_crtc_channel(crtc); @@ -138,7 +138,7 @@ int omap_irq_enable_vblank(struct drm_crtc *crtc) */ void omap_irq_disable_vblank(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct omap_drm_private *priv = dev->dev_private; unsigned long flags; enum omap_channel channel = omap_crtc_channel(crtc); diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9341.c b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c index 9156a98a7218..72d457ff3575 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9341.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c @@ -489,12 +489,12 @@ static void ili9341_dbi_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.drm); struct mipi_dbi *dbi = &dbidev->dbi; u8 addr_mode; int ret, idx; - if (!drm_dev_enter(pipe->crtc.dev, &idx)) + if (!drm_dev_enter(pipe->crtc.drm, &idx)) return; ret = mipi_dbi_poweron_conditional_reset(dbidev); diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c index b9fe926a49e8..7290c9ab81e5 100644 --- a/drivers/gpu/drm/pl111/pl111_display.c +++ b/drivers/gpu/drm/pl111/pl111_display.c @@ -51,7 +51,7 @@ static enum drm_mode_status pl111_mode_valid(struct drm_simple_display_pipe *pipe, const struct drm_display_mode *mode) { - struct drm_device *drm = pipe->crtc.dev; + struct drm_device *drm = pipe->crtc.drm; struct pl111_drm_dev_private *priv = drm->dev_private; u32 cpp = DIV_ROUND_UP(priv->variant->fb_depth, 8); u64 bw; @@ -122,7 +122,7 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe, { struct drm_crtc *crtc = &pipe->crtc; struct drm_plane *plane = &pipe->plane; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct pl111_drm_dev_private *priv = drm->dev_private; const struct drm_display_mode *mode = &cstate->mode; struct drm_framebuffer *fb = plane->state->fb; @@ -357,7 +357,7 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe, static void pl111_display_disable(struct drm_simple_display_pipe *pipe) { struct drm_crtc *crtc = &pipe->crtc; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct pl111_drm_dev_private *priv = drm->dev_private; u32 cntl; @@ -390,7 +390,7 @@ static void pl111_display_update(struct drm_simple_display_pipe *pipe, struct drm_plane_state *old_pstate) { struct drm_crtc *crtc = &pipe->crtc; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct pl111_drm_dev_private *priv = drm->dev_private; struct drm_pending_vblank_event *event = crtc->state->event; struct drm_plane *plane = &pipe->plane; @@ -406,19 +406,19 @@ static void pl111_display_update(struct drm_simple_display_pipe *pipe, if (event) { crtc->state->event = NULL; - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->active && drm_crtc_vblank_get(crtc) == 0) drm_crtc_arm_vblank_event(crtc, event); else drm_crtc_send_vblank_event(crtc, event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } } static int pl111_display_enable_vblank(struct drm_simple_display_pipe *pipe) { struct drm_crtc *crtc = &pipe->crtc; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct pl111_drm_dev_private *priv = drm->dev_private; writel(CLCD_IRQ_NEXTBASE_UPDATE, priv->regs + priv->ienb); @@ -429,7 +429,7 @@ static int pl111_display_enable_vblank(struct drm_simple_display_pipe *pipe) static void pl111_display_disable_vblank(struct drm_simple_display_pipe *pipe) { struct drm_crtc *crtc = &pipe->crtc; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct pl111_drm_dev_private *priv = drm->dev_private; writel(0, priv->regs + priv->ienb); diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index a5e0bbb014ce..3f86e1072f6a 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -315,7 +315,7 @@ static void qxl_send_monitors_config(struct qxl_device *qdev) static void qxl_crtc_update_monitors_config(struct drm_crtc *crtc, const char *reason) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct qxl_device *qdev = to_qxl(dev); struct qxl_crtc *qcrtc = to_qxl_crtc(crtc); struct qxl_head head; diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index ade13173921b..a151cc0499d5 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c @@ -39,7 +39,7 @@ static void atombios_overscan_setup(struct drm_crtc *crtc, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); SET_CRTC_OVERSCAN_PS_ALLOCATION args; @@ -82,7 +82,7 @@ static void atombios_overscan_setup(struct drm_crtc *crtc, static void atombios_scaler_setup(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); ENABLE_SCALER_PS_ALLOCATION args; @@ -167,7 +167,7 @@ static void atombios_scaler_setup(struct drm_crtc *crtc) static void atombios_lock_crtc(struct drm_crtc *crtc, int lock) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; int index = GetIndexIntoMasterTable(COMMAND, UpdateCRTC_DoubleBufferRegisters); @@ -184,7 +184,7 @@ static void atombios_lock_crtc(struct drm_crtc *crtc, int lock) static void atombios_enable_crtc(struct drm_crtc *crtc, int state) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; int index = GetIndexIntoMasterTable(COMMAND, EnableCRTC); ENABLE_CRTC_PS_ALLOCATION args; @@ -200,7 +200,7 @@ static void atombios_enable_crtc(struct drm_crtc *crtc, int state) static void atombios_enable_crtc_memreq(struct drm_crtc *crtc, int state) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; int index = GetIndexIntoMasterTable(COMMAND, EnableCRTCMemReq); ENABLE_CRTC_PS_ALLOCATION args; @@ -226,7 +226,7 @@ static const u32 vga_control_regs[6] = static void atombios_blank_crtc(struct drm_crtc *crtc, int state) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; int index = GetIndexIntoMasterTable(COMMAND, BlankCRTC); BLANK_CRTC_PS_ALLOCATION args; @@ -251,7 +251,7 @@ static void atombios_blank_crtc(struct drm_crtc *crtc, int state) static void atombios_powergate_crtc(struct drm_crtc *crtc, int state) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; int index = GetIndexIntoMasterTable(COMMAND, EnableDispPowerGating); ENABLE_DISP_POWER_GATING_PARAMETERS_V2_1 args; @@ -266,7 +266,7 @@ static void atombios_powergate_crtc(struct drm_crtc *crtc, int state) void atombios_crtc_dpms(struct drm_crtc *crtc, int mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); @@ -303,7 +303,7 @@ atombios_set_crtc_dtd_timing(struct drm_crtc *crtc, struct drm_display_mode *mode) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; SET_CRTC_USING_DTD_TIMING_PARAMETERS args; int index = GetIndexIntoMasterTable(COMMAND, SetCRTC_UsingDTDTiming); @@ -350,7 +350,7 @@ static void atombios_crtc_set_timing(struct drm_crtc *crtc, struct drm_display_mode *mode) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION args; int index = GetIndexIntoMasterTable(COMMAND, SetCRTC_Timing); @@ -558,7 +558,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, struct drm_display_mode *mode) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct drm_encoder *encoder = radeon_crtc->encoder; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); @@ -826,7 +826,7 @@ static void atombios_crtc_program_pll(struct drm_crtc *crtc, bool ss_enabled, struct radeon_atom_ss *ss) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; u8 frev, crev; int index = GetIndexIntoMasterTable(COMMAND, SetPixelClock); @@ -955,7 +955,7 @@ static void atombios_crtc_program_pll(struct drm_crtc *crtc, static bool atombios_crtc_prepare_pll(struct drm_crtc *crtc, struct drm_display_mode *mode) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(radeon_crtc->encoder); @@ -1053,7 +1053,7 @@ static bool atombios_crtc_prepare_pll(struct drm_crtc *crtc, struct drm_display_ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(radeon_crtc->encoder); @@ -1136,7 +1136,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc, int x, int y, int atomic) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct drm_framebuffer *target_fb; struct drm_gem_object *obj; @@ -1457,7 +1457,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc, int x, int y, int atomic) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct drm_gem_object *obj; struct radeon_bo *rbo; @@ -1663,7 +1663,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc, int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *old_fb) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; if (ASIC_IS_DCE4(rdev)) @@ -1678,7 +1678,7 @@ int atombios_crtc_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb, int x, int y, enum mode_set_atomic state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; if (ASIC_IS_DCE4(rdev)) @@ -1692,7 +1692,7 @@ int atombios_crtc_set_base_atomic(struct drm_crtc *crtc, /* properly set additional regs when using atombios */ static void radeon_legacy_atom_fixup(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); u32 disp_merge_cntl; @@ -1722,7 +1722,7 @@ static void radeon_legacy_atom_fixup(struct drm_crtc *crtc) */ static u32 radeon_get_pll_use_mask(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_crtc *test_crtc; struct radeon_crtc *test_radeon_crtc; u32 pll_in_use = 0; @@ -1749,7 +1749,7 @@ static u32 radeon_get_pll_use_mask(struct drm_crtc *crtc) */ static int radeon_get_shared_dp_ppll(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct drm_crtc *test_crtc; struct radeon_crtc *test_radeon_crtc; @@ -1783,7 +1783,7 @@ static int radeon_get_shared_dp_ppll(struct drm_crtc *crtc) static int radeon_get_shared_nondp_ppll(struct drm_crtc *crtc) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct drm_crtc *test_crtc; struct radeon_crtc *test_radeon_crtc; @@ -1862,7 +1862,7 @@ static int radeon_get_shared_nondp_ppll(struct drm_crtc *crtc) static int radeon_atom_pick_pll(struct drm_crtc *crtc) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(radeon_crtc->encoder); @@ -2043,7 +2043,7 @@ int atombios_crtc_mode_set(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *old_fb) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(radeon_crtc->encoder); @@ -2086,7 +2086,7 @@ static bool atombios_crtc_mode_fixup(struct drm_crtc *crtc, struct drm_display_mode *adjusted_mode) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_encoder *encoder; /* assign the encoder to the radeon crtc to avoid repeated lookups later */ @@ -2124,7 +2124,7 @@ static bool atombios_crtc_mode_fixup(struct drm_crtc *crtc, static void atombios_crtc_prepare(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; /* disable crtc pair power gating before programming */ @@ -2144,7 +2144,7 @@ static void atombios_crtc_commit(struct drm_crtc *crtc) static void atombios_crtc_disable(struct drm_crtc *crtc) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_atom_ss ss; int i; diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c index 3507805b34bc..aeac0f08ec9f 100644 --- a/drivers/gpu/drm/radeon/radeon_cursor.c +++ b/drivers/gpu/drm/radeon/radeon_cursor.c @@ -31,7 +31,7 @@ static void radeon_lock_cursor(struct drm_crtc *crtc, bool lock) { - struct radeon_device *rdev = crtc->dev->dev_private; + struct radeon_device *rdev = crtc->drm->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); uint32_t cur_lock; @@ -62,7 +62,7 @@ static void radeon_lock_cursor(struct drm_crtc *crtc, bool lock) static void radeon_hide_cursor(struct drm_crtc *crtc) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct radeon_device *rdev = crtc->dev->dev_private; + struct radeon_device *rdev = crtc->drm->dev_private; if (ASIC_IS_DCE4(rdev)) { WREG32_IDX(EVERGREEN_CUR_CONTROL + radeon_crtc->crtc_offset, @@ -90,7 +90,7 @@ static void radeon_hide_cursor(struct drm_crtc *crtc) static void radeon_show_cursor(struct drm_crtc *crtc) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct radeon_device *rdev = crtc->dev->dev_private; + struct radeon_device *rdev = crtc->drm->dev_private; if (radeon_crtc->cursor_out_of_bounds) return; @@ -144,7 +144,7 @@ static void radeon_show_cursor(struct drm_crtc *crtc) static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct radeon_device *rdev = crtc->dev->dev_private; + struct radeon_device *rdev = crtc->drm->dev_private; int xorigin = 0, yorigin = 0; int w = radeon_crtc->cursor_width; @@ -182,7 +182,8 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y) * crtc's lock as long as write access to this flag _always_ * grabs all locks. */ - list_for_each_entry(crtc_p, &crtc->dev->mode_config.crtc_list, head) { + list_for_each_entry(crtc_p, &crtc->drm->mode_config.crtc_list, + head) { if (crtc_p->enabled) i++; } @@ -282,7 +283,7 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc, int32_t hot_y) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct radeon_device *rdev = crtc->dev->dev_private; + struct radeon_device *rdev = crtc->drm->dev_private; struct drm_gem_object *obj; struct radeon_bo *robj; int ret; diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 901e75ec70ff..6cf657c803b7 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -49,7 +49,7 @@ static void avivo_crtc_load_lut(struct drm_crtc *crtc) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; u16 *r, *g, *b; int i; @@ -87,7 +87,7 @@ static void avivo_crtc_load_lut(struct drm_crtc *crtc) static void dce4_crtc_load_lut(struct drm_crtc *crtc) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; u16 *r, *g, *b; int i; @@ -121,7 +121,7 @@ static void dce4_crtc_load_lut(struct drm_crtc *crtc) static void dce5_crtc_load_lut(struct drm_crtc *crtc) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; u16 *r, *g, *b; int i; @@ -193,7 +193,7 @@ static void dce5_crtc_load_lut(struct drm_crtc *crtc) static void legacy_crtc_load_lut(struct drm_crtc *crtc) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; u16 *r, *g, *b; int i; @@ -220,7 +220,7 @@ static void legacy_crtc_load_lut(struct drm_crtc *crtc) void radeon_crtc_load_lut(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; if (!crtc->enabled) @@ -462,7 +462,7 @@ static void radeon_flip_work_func(struct work_struct *__work) usleep_range(1000, 2000); /* We borrow the event spin lock for protecting flip_status */ - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); /* set the proper interrupt */ radeon_irq_kms_pflip_irq_get(rdev, radeon_crtc->crtc_id); @@ -471,7 +471,7 @@ static void radeon_flip_work_func(struct work_struct *__work) radeon_page_flip(rdev, radeon_crtc->crtc_id, work->base, work->async); radeon_crtc->flip_status = RADEON_FLIP_SUBMITTED; - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); up_read(&rdev->exclusive_lock); } @@ -482,7 +482,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, uint32_t target, struct drm_modeset_acquire_ctx *ctx) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); struct drm_gem_object *obj; @@ -583,11 +583,11 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, crtc->funcs->get_vblank_counter(crtc); /* We borrow the event spin lock for protecting flip_work */ - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); if (radeon_crtc->flip_status != RADEON_FLIP_NONE) { DRM_DEBUG_DRIVER("flip queue: crtc already busy\n"); - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); r = -EBUSY; goto pflip_cleanup; } @@ -597,7 +597,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, /* update crtc fb */ crtc->primary->fb = fb; - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); queue_work(radeon_crtc->flip_queue, &work->flip_work); return 0; @@ -630,7 +630,7 @@ radeon_crtc_set_config(struct drm_mode_set *set, if (!set || !set->crtc) return -EINVAL; - dev = set->crtc->dev; + dev = set->crtc->drm; ret = pm_runtime_get_sync(dev->dev); if (ret < 0) { @@ -1681,7 +1681,7 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct drm_encoder *encoder; struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); @@ -1985,7 +1985,7 @@ radeon_get_crtc_scanout_position(struct drm_crtc *crtc, ktime_t *stime, ktime_t *etime, const struct drm_display_mode *mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; return radeon_get_crtc_scanoutpos(dev, pipe, 0, vpos, hpos, diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index e0214cf1b43b..c7220a6fce2c 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c @@ -760,7 +760,7 @@ void radeon_driver_postclose_kms(struct drm_device *dev, */ u32 radeon_get_vblank_counter_kms(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; int vpos, hpos, stat; u32 count; @@ -830,7 +830,7 @@ u32 radeon_get_vblank_counter_kms(struct drm_crtc *crtc) */ int radeon_enable_vblank_kms(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; struct radeon_device *rdev = dev->dev_private; unsigned long irqflags; @@ -857,7 +857,7 @@ int radeon_enable_vblank_kms(struct drm_crtc *crtc) */ void radeon_disable_vblank_kms(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; struct radeon_device *rdev = dev->dev_private; unsigned long irqflags; diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c index 825b351ff53c..bd699ef8156d 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c @@ -37,7 +37,7 @@ static void radeon_overscan_setup(struct drm_crtc *crtc, struct drm_display_mode *mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); @@ -49,7 +49,7 @@ static void radeon_overscan_setup(struct drm_crtc *crtc, static void radeon_legacy_rmx_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); int xres = mode->hdisplay; @@ -297,7 +297,7 @@ static uint8_t radeon_compute_pll_gain(uint16_t ref_freq, uint16_t ref_div, static void radeon_crtc_dpms(struct drm_crtc *crtc, int mode) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; uint32_t crtc_ext_cntl = 0; uint32_t mask; @@ -374,7 +374,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc, struct drm_framebuffer *fb, int x, int y, int atomic) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); struct drm_framebuffer *target_fb; @@ -572,7 +572,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc, static bool radeon_set_crtc_timing(struct drm_crtc *crtc, struct drm_display_mode *mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); const struct drm_framebuffer *fb = crtc->primary->fb; @@ -732,7 +732,7 @@ static bool radeon_set_crtc_timing(struct drm_crtc *crtc, struct drm_display_mod static void radeon_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); struct drm_encoder *encoder; @@ -1060,7 +1060,7 @@ static int radeon_crtc_mode_set(struct drm_crtc *crtc, static void radeon_crtc_prepare(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_crtc *crtci; /* @@ -1073,7 +1073,7 @@ static void radeon_crtc_prepare(struct drm_crtc *crtc) static void radeon_crtc_commit(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_crtc *crtci; /* diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c index 7e175dbfd892..99b279446c3c 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c @@ -436,7 +436,7 @@ static void rcar_du_crtc_update_planes(struct rcar_du_crtc *rcrtc) void rcar_du_crtc_finish_page_flip(struct rcar_du_crtc *rcrtc) { struct drm_pending_vblank_event *event; - struct drm_device *dev = rcrtc->crtc.dev; + struct drm_device *dev = rcrtc->crtc.drm; unsigned long flags; spin_lock_irqsave(&dev->event_lock, flags); @@ -457,7 +457,7 @@ void rcar_du_crtc_finish_page_flip(struct rcar_du_crtc *rcrtc) static bool rcar_du_crtc_page_flip_pending(struct rcar_du_crtc *rcrtc) { - struct drm_device *dev = rcrtc->crtc.dev; + struct drm_device *dev = rcrtc->crtc.drm; unsigned long flags; bool pending; @@ -703,7 +703,7 @@ static int rcar_du_crtc_atomic_check(struct drm_crtc *crtc, /* Store the routes from the CRTC output to the DU outputs. */ rstate->outputs = 0; - drm_for_each_encoder_mask(encoder, crtc->dev, + drm_for_each_encoder_mask(encoder, crtc->drm, crtc_state->encoder_mask) { struct rcar_du_encoder *renc; @@ -802,12 +802,12 @@ static void rcar_du_crtc_atomic_disable(struct drm_crtc *crtc, rcar_mipi_dsi_pclk_disable(bridge); } - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->event) { drm_crtc_send_vblank_event(crtc, crtc->state->event); crtc->state->event = NULL; } - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } static void rcar_du_crtc_atomic_begin(struct drm_crtc *crtc, @@ -843,7 +843,7 @@ static void rcar_du_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) { struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc); - struct drm_device *dev = rcrtc->crtc.dev; + struct drm_device *dev = rcrtc->crtc.drm; unsigned long flags; rcar_du_crtc_update_planes(rcrtc); @@ -1116,7 +1116,7 @@ static int rcar_du_crtc_set_crc_source(struct drm_crtc *crtc, /* Perform an atomic commit to set the CRC source. */ drm_modeset_acquire_init(&ctx, 0); - state = drm_atomic_state_alloc(crtc->dev); + state = drm_atomic_state_alloc(crtc->drm); if (!state) { ret = -ENOMEM; goto unlock; diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c index ff1bdb1a3e54..c8d8f86cd67c 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c @@ -64,7 +64,7 @@ static void shmob_drm_clk_off(struct shmob_drm_device *sdev) static void shmob_drm_crtc_setup_geometry(struct shmob_drm_crtc *scrtc) { struct drm_crtc *crtc = &scrtc->crtc; - struct shmob_drm_device *sdev = crtc->dev->dev_private; + struct shmob_drm_device *sdev = crtc->drm->dev_private; const struct shmob_drm_interface_data *idata = &sdev->pdata->iface; const struct drm_display_mode *mode = &crtc->mode; u32 value; @@ -121,7 +121,7 @@ static void shmob_drm_crtc_setup_geometry(struct shmob_drm_crtc *scrtc) static void shmob_drm_crtc_start_stop(struct shmob_drm_crtc *scrtc, bool start) { - struct shmob_drm_device *sdev = scrtc->crtc.dev->dev_private; + struct shmob_drm_device *sdev = scrtc->crtc.drm->dev_private; u32 value; value = lcdc_read(sdev, LDCNT2R); @@ -155,7 +155,7 @@ static void shmob_drm_crtc_start_stop(struct shmob_drm_crtc *scrtc, bool start) static void shmob_drm_crtc_start(struct shmob_drm_crtc *scrtc) { struct drm_crtc *crtc = &scrtc->crtc; - struct shmob_drm_device *sdev = crtc->dev->dev_private; + struct shmob_drm_device *sdev = crtc->drm->dev_private; const struct shmob_drm_interface_data *idata = &sdev->pdata->iface; const struct shmob_drm_format_info *format; struct drm_device *dev = sdev->ddev; @@ -257,7 +257,7 @@ static void shmob_drm_crtc_start(struct shmob_drm_crtc *scrtc) static void shmob_drm_crtc_stop(struct shmob_drm_crtc *scrtc) { struct drm_crtc *crtc = &scrtc->crtc; - struct shmob_drm_device *sdev = crtc->dev->dev_private; + struct shmob_drm_device *sdev = crtc->drm->dev_private; if (!scrtc->started) return; @@ -312,7 +312,7 @@ static void shmob_drm_crtc_compute_base(struct shmob_drm_crtc *scrtc, static void shmob_drm_crtc_update_base(struct shmob_drm_crtc *scrtc) { struct drm_crtc *crtc = &scrtc->crtc; - struct shmob_drm_device *sdev = crtc->dev->dev_private; + struct shmob_drm_device *sdev = crtc->drm->dev_private; shmob_drm_crtc_compute_base(scrtc, crtc->x, crtc->y); @@ -352,7 +352,7 @@ static int shmob_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_framebuffer *old_fb) { struct shmob_drm_crtc *scrtc = to_shmob_crtc(crtc); - struct shmob_drm_device *sdev = crtc->dev->dev_private; + struct shmob_drm_device *sdev = crtc->drm->dev_private; const struct shmob_drm_format_info *format; format = shmob_drm_format_info(crtc->primary->fb->format->format); @@ -394,7 +394,7 @@ static const struct drm_crtc_helper_funcs crtc_helper_funcs = { void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc) { struct drm_pending_vblank_event *event; - struct drm_device *dev = scrtc->crtc.dev; + struct drm_device *dev = scrtc->crtc.drm; unsigned long flags; spin_lock_irqsave(&dev->event_lock, flags); @@ -414,7 +414,7 @@ static int shmob_drm_crtc_page_flip(struct drm_crtc *crtc, struct drm_modeset_acquire_ctx *ctx) { struct shmob_drm_crtc *scrtc = to_shmob_crtc(crtc); - struct drm_device *dev = scrtc->crtc.dev; + struct drm_device *dev = scrtc->crtc.drm; unsigned long flags; spin_lock_irqsave(&dev->event_lock, flags); @@ -457,7 +457,7 @@ static void shmob_drm_crtc_enable_vblank(struct shmob_drm_device *sdev, static int shmob_drm_enable_vblank(struct drm_crtc *crtc) { - struct shmob_drm_device *sdev = crtc->dev->dev_private; + struct shmob_drm_device *sdev = crtc->drm->dev_private; shmob_drm_crtc_enable_vblank(sdev, true); @@ -466,7 +466,7 @@ static int shmob_drm_enable_vblank(struct drm_crtc *crtc) static void shmob_drm_disable_vblank(struct drm_crtc *crtc) { - struct shmob_drm_device *sdev = crtc->dev->dev_private; + struct shmob_drm_device *sdev = crtc->drm->dev_private; shmob_drm_crtc_enable_vblank(sdev, false); } diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index a530ecc4d207..d43418b8ec1d 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -758,9 +758,9 @@ static void vop_crtc_atomic_disable(struct drm_crtc *crtc, out: if (crtc->state->event && !crtc->state->active) { - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); drm_crtc_send_vblank_event(crtc, crtc->state->event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); crtc->state->event = NULL; } @@ -1567,7 +1567,7 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc, */ vop_wait_for_irq_handler(vop); - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->event) { WARN_ON(drm_crtc_vblank_get(crtc) != 0); WARN_ON(vop->event); @@ -1575,7 +1575,7 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc, vop->event = crtc->state->event; crtc->state->event = NULL; } - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); for_each_oldnew_plane_in_state(old_state, plane, old_plane_state, new_plane_state, i) { diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index ca73b8ccc29f..ab9d53cd34b2 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -924,9 +924,9 @@ static void vop2_crtc_atomic_disable(struct drm_crtc *crtc, vop2_unlock(vop2); if (crtc->state->event && !crtc->state->active) { - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); drm_crtc_send_vblank_event(crtc, crtc->state->event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); crtc->state->event = NULL; } @@ -1564,7 +1564,8 @@ static void vop2_crtc_atomic_enable(struct drm_crtc *crtc, if (mode->flags & DRM_MODE_FLAG_PVSYNC) polflags |= BIT(VSYNC_POSITIVE); - drm_for_each_encoder_mask(encoder, crtc->dev, crtc_state->encoder_mask) { + drm_for_each_encoder_mask(encoder, crtc->drm, + crtc_state->encoder_mask) { struct rockchip_encoder *rkencoder = to_rockchip_encoder(encoder); rk3568_set_intf_mux(vp, rkencoder->crtc_endpoint_id, polflags); @@ -2060,7 +2061,7 @@ static void vop2_crtc_atomic_flush(struct drm_crtc *crtc, vop2_cfg_done(vp); - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->event) { WARN_ON(drm_crtc_vblank_get(crtc)); @@ -2068,7 +2069,7 @@ static void vop2_crtc_atomic_flush(struct drm_crtc *crtc, crtc->state->event = NULL; } - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } static const struct drm_crtc_helper_funcs vop2_crtc_helper_funcs = { @@ -2162,7 +2163,7 @@ static irqreturn_t vop2_isr(int irq, void *data) if (irqs & VP_INT_FS_FIELD) { drm_crtc_handle_vblank(crtc); - spin_lock(&crtc->dev->event_lock); + spin_lock(&crtc->drm->event_lock); if (vp->event) { u32 val = vop2_readl(vop2, RK3568_REG_CFG_DONE); @@ -2172,7 +2173,7 @@ static irqreturn_t vop2_isr(int irq, void *data) drm_crtc_vblank_put(crtc); } } - spin_unlock(&crtc->dev->event_lock); + spin_unlock(&crtc->drm->event_lock); ret = IRQ_HANDLED; } diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c index e34750187b58..e435d5ef5736 100644 --- a/drivers/gpu/drm/solomon/ssd130x.c +++ b/drivers/gpu/drm/solomon/ssd130x.c @@ -672,7 +672,7 @@ static const struct drm_plane_funcs ssd130x_primary_plane_funcs = { static enum drm_mode_status ssd130x_crtc_helper_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode) { - struct ssd130x_device *ssd130x = drm_to_ssd130x(crtc->dev); + struct ssd130x_device *ssd130x = drm_to_ssd130x(crtc->drm); if (mode->hdisplay != ssd130x->mode.hdisplay && mode->vdisplay != ssd130x->mode.vdisplay) diff --git a/drivers/gpu/drm/sprd/sprd_dpu.c b/drivers/gpu/drm/sprd/sprd_dpu.c index b96fc6837b0d..7610d3b2138d 100644 --- a/drivers/gpu/drm/sprd/sprd_dpu.c +++ b/drivers/gpu/drm/sprd/sprd_dpu.c @@ -624,7 +624,7 @@ static void sprd_crtc_mode_set_nofb(struct drm_crtc *crtc) drm_display_mode_to_videomode(mode, &dpu->ctx.vm); - drm_for_each_encoder_mask(encoder, crtc->dev, + drm_for_each_encoder_mask(encoder, crtc->drm, crtc->state->encoder_mask) { dsi = encoder_to_dsi(encoder); @@ -651,7 +651,7 @@ static void sprd_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state) { struct sprd_dpu *dpu = to_sprd_crtc(crtc); - struct drm_device *drm = dpu->base.dev; + struct drm_device *drm = dpu->base.drm; drm_crtc_vblank_off(&dpu->base); @@ -670,7 +670,7 @@ static void sprd_crtc_atomic_flush(struct drm_crtc *crtc, { struct sprd_dpu *dpu = to_sprd_crtc(crtc); - struct drm_device *drm = dpu->base.dev; + struct drm_device *drm = dpu->base.drm; sprd_dpu_flip(dpu); diff --git a/drivers/gpu/drm/sti/sti_crtc.c b/drivers/gpu/drm/sti/sti_crtc.c index 3c7154f2d5f3..fc26584fe29e 100644 --- a/drivers/gpu/drm/sti/sti_crtc.c +++ b/drivers/gpu/drm/sti/sti_crtc.c @@ -134,7 +134,7 @@ sti_crtc_mode_set_nofb(struct drm_crtc *crtc) static void sti_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct drm_device *drm_dev = crtc->dev; + struct drm_device *drm_dev = crtc->drm; struct sti_mixer *mixer = to_sti_mixer(crtc); struct sti_compositor *compo = dev_get_drvdata(mixer->dev); struct drm_plane *p; @@ -209,12 +209,12 @@ static void sti_crtc_atomic_flush(struct drm_crtc *crtc, if (event) { crtc->state->event = NULL; - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); if (drm_crtc_vblank_get(crtc) == 0) drm_crtc_arm_vblank_event(crtc, event); else drm_crtc_send_vblank_event(crtc, event); - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); } } @@ -264,7 +264,7 @@ int sti_crtc_vblank_cb(struct notifier_block *nb, /* Disable mixer only if all overlay planes (GDP and VDP) * are disabled */ - list_for_each_entry(p, &crtc->dev->mode_config.plane_list, + list_for_each_entry(p, &crtc->drm->mode_config.plane_list, head) { struct sti_plane *plane = to_sti_plane(p); @@ -280,7 +280,7 @@ int sti_crtc_vblank_cb(struct notifier_block *nb, static int sti_crtc_enable_vblank(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; struct sti_private *dev_priv = dev->dev_private; struct sti_compositor *compo = dev_priv->compo; @@ -299,7 +299,7 @@ static int sti_crtc_enable_vblank(struct drm_crtc *crtc) static void sti_crtc_disable_vblank(struct drm_crtc *crtc) { - struct drm_device *drm_dev = crtc->dev; + struct drm_device *drm_dev = crtc->drm; unsigned int pipe = crtc->index; struct sti_private *priv = drm_dev->dev_private; struct sti_compositor *compo = priv->compo; @@ -318,7 +318,7 @@ static int sti_crtc_late_register(struct drm_crtc *crtc) struct sti_compositor *compo = dev_get_drvdata(mixer->dev); if (drm_crtc_index(crtc) == 0) - sti_compositor_debugfs_init(compo, crtc->dev->primary); + sti_compositor_debugfs_init(compo, crtc->drm->primary); return 0; } diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index b8be4c1db423..b27b73975bc1 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -484,7 +484,7 @@ static const u32 ltdc_ycbcr2rgb_coeffs[DRM_COLOR_ENCODING_MAX][DRM_COLOR_RANGE_M static inline struct ltdc_device *crtc_to_ltdc(struct drm_crtc *crtc) { - return (struct ltdc_device *)crtc->dev->dev_private; + return (struct ltdc_device *) crtc->drm->dev_private; } static inline struct ltdc_device *plane_to_ltdc(struct drm_plane *plane) @@ -775,7 +775,7 @@ static void ltdc_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state) { struct ltdc_device *ldev = crtc_to_ltdc(crtc); - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; DRM_DEBUG_DRIVER("\n"); @@ -798,7 +798,7 @@ static void ltdc_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state) { struct ltdc_device *ldev = crtc_to_ltdc(crtc); - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; int layer_index = 0; DRM_DEBUG_DRIVER("\n"); @@ -891,7 +891,7 @@ static bool ltdc_crtc_mode_fixup(struct drm_crtc *crtc, static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc) { struct ltdc_device *ldev = crtc_to_ltdc(crtc); - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; struct drm_connector_list_iter iter; struct drm_connector *connector = NULL; struct drm_encoder *encoder = NULL, *en_iter; @@ -1034,7 +1034,7 @@ static void ltdc_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) { struct ltdc_device *ldev = crtc_to_ltdc(crtc); - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; struct drm_pending_vblank_event *event = crtc->state->event; DRM_DEBUG_ATOMIC("\n"); @@ -1063,7 +1063,7 @@ static bool ltdc_crtc_get_scanout_position(struct drm_crtc *crtc, ktime_t *stime, ktime_t *etime, const struct drm_display_mode *mode) { - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; struct ltdc_device *ldev = ddev->dev_private; int line, vactive_start, vactive_end, vtotal; diff --git a/drivers/gpu/drm/sun4i/sun4i_crtc.c b/drivers/gpu/drm/sun4i/sun4i_crtc.c index c06d7cd45388..ec86a3221035 100644 --- a/drivers/gpu/drm/sun4i/sun4i_crtc.c +++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c @@ -38,7 +38,7 @@ static struct drm_encoder *sun4i_crtc_get_encoder(struct drm_crtc *crtc) { struct drm_encoder *encoder; - drm_for_each_encoder(encoder, crtc->dev) + drm_for_each_encoder(encoder, crtc->drm) if (encoder->crtc == crtc) return encoder; @@ -66,7 +66,7 @@ static void sun4i_crtc_atomic_begin(struct drm_crtc *crtc, struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, crtc); struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct sunxi_engine *engine = scrtc->engine; unsigned long flags; @@ -96,12 +96,12 @@ static void sun4i_crtc_atomic_flush(struct drm_crtc *crtc, if (event) { crtc->state->event = NULL; - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (drm_crtc_vblank_get(crtc) == 0) drm_crtc_arm_vblank_event(crtc, event); else drm_crtc_send_vblank_event(crtc, event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } } @@ -118,9 +118,9 @@ static void sun4i_crtc_atomic_disable(struct drm_crtc *crtc, sun4i_tcon_set_status(scrtc->tcon, encoder, false); if (crtc->state->event && !crtc->state->active) { - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); drm_crtc_send_vblank_event(crtc, crtc->state->event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); crtc->state->event = NULL; } diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 6e78416e64b0..133175353fba 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -1717,7 +1717,7 @@ static struct drm_info_list debugfs_files[] = { static int tegra_dc_late_register(struct drm_crtc *crtc) { unsigned int i, count = ARRAY_SIZE(debugfs_files); - struct drm_minor *minor = crtc->dev->primary; + struct drm_minor *minor = crtc->drm->primary; struct dentry *root; struct tegra_dc *dc = to_tegra_dc(crtc); @@ -1743,7 +1743,7 @@ static int tegra_dc_late_register(struct drm_crtc *crtc) static void tegra_dc_early_unregister(struct drm_crtc *crtc) { unsigned int count = ARRAY_SIZE(debugfs_files); - struct drm_minor *minor = crtc->dev->primary; + struct drm_minor *minor = crtc->drm->primary; struct tegra_dc *dc = to_tegra_dc(crtc); drm_debugfs_remove_files(dc->debugfs_files, count, minor); @@ -2119,14 +2119,14 @@ static void tegra_crtc_atomic_disable(struct drm_crtc *crtc, tegra_dc_stats_reset(&dc->stats); drm_crtc_vblank_off(crtc); - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->event) { drm_crtc_send_vblank_event(crtc, crtc->state->event); crtc->state->event = NULL; } - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); err = host1x_client_suspend(&dc->client); if (err < 0) @@ -2279,14 +2279,14 @@ static void tegra_crtc_atomic_begin(struct drm_crtc *crtc, tegra_crtc_update_memory_bandwidth(crtc, state, true); if (crtc->state->event) { - spin_lock_irqsave(&crtc->dev->event_lock, flags); + spin_lock_irqsave(&crtc->drm->event_lock, flags); if (drm_crtc_vblank_get(crtc) != 0) drm_crtc_send_vblank_event(crtc, crtc->state->event); else drm_crtc_arm_vblank_event(crtc, crtc->state->event); - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + spin_unlock_irqrestore(&crtc->drm->event_lock, flags); crtc->state->event = NULL; } diff --git a/drivers/gpu/drm/tidss/tidss_crtc.c b/drivers/gpu/drm/tidss/tidss_crtc.c index 5e5e466f35d1..bd44d78783c4 100644 --- a/drivers/gpu/drm/tidss/tidss_crtc.c +++ b/drivers/gpu/drm/tidss/tidss_crtc.c @@ -20,7 +20,7 @@ static void tidss_crtc_finish_page_flip(struct tidss_crtc *tcrtc) { - struct drm_device *ddev = tcrtc->crtc.dev; + struct drm_device *ddev = tcrtc->crtc.drm; struct tidss_device *tidss = to_tidss(ddev); struct drm_pending_vblank_event *event; unsigned long flags; @@ -75,7 +75,7 @@ void tidss_crtc_error_irq(struct drm_crtc *crtc, u64 irqstatus) { struct tidss_crtc *tcrtc = to_tidss_crtc(crtc); - dev_err_ratelimited(crtc->dev->dev, "CRTC%u SYNC LOST: (irq %llx)\n", + dev_err_ratelimited(crtc->drm->dev, "CRTC%u SYNC LOST: (irq %llx)\n", tcrtc->hw_videoport, irqstatus); } @@ -86,7 +86,7 @@ static int tidss_crtc_atomic_check(struct drm_crtc *crtc, { struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; struct tidss_device *tidss = to_tidss(ddev); struct dispc_device *dispc = tidss->dispc; struct tidss_crtc *tcrtc = to_tidss_crtc(crtc); @@ -165,7 +165,7 @@ static void tidss_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc); struct tidss_crtc *tcrtc = to_tidss_crtc(crtc); - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; struct tidss_device *tidss = to_tidss(ddev); unsigned long flags; @@ -218,7 +218,7 @@ static void tidss_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, crtc); struct tidss_crtc *tcrtc = to_tidss_crtc(crtc); - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; struct tidss_device *tidss = to_tidss(ddev); const struct drm_display_mode *mode = &crtc->state->adjusted_mode; unsigned long flags; @@ -261,7 +261,7 @@ static void tidss_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state) { struct tidss_crtc *tcrtc = to_tidss_crtc(crtc); - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; struct tidss_device *tidss = to_tidss(ddev); unsigned long flags; @@ -297,7 +297,7 @@ enum drm_mode_status tidss_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode) { struct tidss_crtc *tcrtc = to_tidss_crtc(crtc); - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; struct tidss_device *tidss = to_tidss(ddev); return dispc_vp_mode_valid(tidss->dispc, tcrtc->hw_videoport, mode); @@ -316,7 +316,7 @@ static const struct drm_crtc_helper_funcs tidss_crtc_helper_funcs = { static int tidss_crtc_enable_vblank(struct drm_crtc *crtc) { - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; struct tidss_device *tidss = to_tidss(ddev); dev_dbg(ddev->dev, "%s\n", __func__); @@ -330,7 +330,7 @@ static int tidss_crtc_enable_vblank(struct drm_crtc *crtc) static void tidss_crtc_disable_vblank(struct drm_crtc *crtc) { - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; struct tidss_device *tidss = to_tidss(ddev); dev_dbg(ddev->dev, "%s\n", __func__); diff --git a/drivers/gpu/drm/tidss/tidss_irq.c b/drivers/gpu/drm/tidss/tidss_irq.c index 0c681c7600bc..372f597f2b46 100644 --- a/drivers/gpu/drm/tidss/tidss_irq.c +++ b/drivers/gpu/drm/tidss/tidss_irq.c @@ -25,7 +25,7 @@ static void tidss_irq_update(struct tidss_device *tidss) void tidss_irq_enable_vblank(struct drm_crtc *crtc) { - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; struct tidss_device *tidss = to_tidss(ddev); struct tidss_crtc *tcrtc = to_tidss_crtc(crtc); u32 hw_videoport = tcrtc->hw_videoport; @@ -40,7 +40,7 @@ void tidss_irq_enable_vblank(struct drm_crtc *crtc) void tidss_irq_disable_vblank(struct drm_crtc *crtc) { - struct drm_device *ddev = crtc->dev; + struct drm_device *ddev = crtc->drm; struct tidss_device *tidss = to_tidss(ddev); struct tidss_crtc *tcrtc = to_tidss_crtc(crtc); u32 hw_videoport = tcrtc->hw_videoport; diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c index b5f60b2b2d0e..429fb75836b2 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c @@ -62,7 +62,7 @@ struct tilcdc_crtc { static void set_scanout(struct drm_crtc *crtc, struct drm_framebuffer *fb) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct tilcdc_drm_private *priv = dev->dev_private; struct drm_gem_dma_object *gem; dma_addr_t start, end; @@ -97,7 +97,7 @@ static void set_scanout(struct drm_crtc *crtc, struct drm_framebuffer *fb) static void tilcdc_crtc_load_palette(struct drm_crtc *crtc) { struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct tilcdc_drm_private *priv = dev->dev_private; int ret; @@ -176,7 +176,7 @@ static void tilcdc_crtc_disable_irqs(struct drm_device *dev) static void reset(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct tilcdc_drm_private *priv = dev->dev_private; if (priv->rev != 2) @@ -201,7 +201,7 @@ static unsigned int tilcdc_pclk_diff(unsigned long rate, static void tilcdc_crtc_set_clk(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct tilcdc_drm_private *priv = dev->dev_private; struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); unsigned long clk_rate, real_pclk_rate, pclk_rate; @@ -273,7 +273,7 @@ static uint tilcdc_mode_hvtotal(const struct drm_display_mode *mode) static void tilcdc_crtc_set_mode(struct drm_crtc *crtc) { struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct tilcdc_drm_private *priv = dev->dev_private; const struct tilcdc_panel_info *info = tilcdc_crtc->info; uint32_t reg, hbp, hfp, hsw, vbp, vfp, vsw; @@ -442,7 +442,7 @@ static void tilcdc_crtc_set_mode(struct drm_crtc *crtc) static void tilcdc_crtc_enable(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); unsigned long flags; @@ -491,7 +491,7 @@ static void tilcdc_crtc_atomic_enable(struct drm_crtc *crtc, static void tilcdc_crtc_off(struct drm_crtc *crtc, bool shutdown) { struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; int ret; mutex_lock(&tilcdc_crtc->enable_lock); @@ -517,14 +517,14 @@ static void tilcdc_crtc_off(struct drm_crtc *crtc, bool shutdown) drm_crtc_vblank_off(crtc); - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->event) { drm_crtc_send_vblank_event(crtc, crtc->state->event); crtc->state->event = NULL; } - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); tilcdc_crtc_disable_irqs(dev); @@ -551,10 +551,10 @@ static void tilcdc_crtc_atomic_flush(struct drm_crtc *crtc, if (!crtc->state->event) return; - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); drm_crtc_send_vblank_event(crtc, crtc->state->event); crtc->state->event = NULL; - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } void tilcdc_crtc_shutdown(struct drm_crtc *crtc) @@ -573,7 +573,7 @@ static void tilcdc_crtc_recover_work(struct work_struct *work) container_of(work, struct tilcdc_crtc, recover_work); struct drm_crtc *crtc = &tilcdc_crtc->base; - dev_info(crtc->dev->dev, "%s: Reset CRTC", __func__); + dev_info(crtc->drm->dev, "%s: Reset CRTC", __func__); drm_modeset_lock(&crtc->mutex, NULL); @@ -588,7 +588,7 @@ static void tilcdc_crtc_recover_work(struct work_struct *work) static void tilcdc_crtc_destroy(struct drm_crtc *crtc) { - struct tilcdc_drm_private *priv = crtc->dev->dev_private; + struct tilcdc_drm_private *priv = crtc->drm->dev_private; tilcdc_crtc_shutdown(crtc); @@ -603,7 +603,7 @@ int tilcdc_crtc_update_fb(struct drm_crtc *crtc, struct drm_pending_vblank_event *event) { struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; if (tilcdc_crtc->event) { dev_err(dev->dev, "already pending page flip!\n"); @@ -679,7 +679,7 @@ static int tilcdc_crtc_atomic_check(struct drm_crtc *crtc, if (state->planes[0].ptr != crtc->primary || state->planes[0].state == NULL || state->planes[0].state->crtc != crtc) { - dev_dbg(crtc->dev->dev, "CRTC primary plane must be present"); + dev_dbg(crtc->drm->dev, "CRTC primary plane must be present"); return -EINVAL; } @@ -689,7 +689,7 @@ static int tilcdc_crtc_atomic_check(struct drm_crtc *crtc, static int tilcdc_crtc_enable_vblank(struct drm_crtc *crtc) { struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct tilcdc_drm_private *priv = dev->dev_private; unsigned long flags; @@ -712,7 +712,7 @@ static int tilcdc_crtc_enable_vblank(struct drm_crtc *crtc) static void tilcdc_crtc_disable_vblank(struct drm_crtc *crtc) { struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct tilcdc_drm_private *priv = dev->dev_private; unsigned long flags; @@ -731,7 +731,7 @@ static void tilcdc_crtc_disable_vblank(struct drm_crtc *crtc) static void tilcdc_crtc_reset(struct drm_crtc *crtc) { struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; int ret; drm_atomic_helper_crtc_reset(crtc); @@ -771,7 +771,7 @@ static enum drm_mode_status tilcdc_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode) { - struct tilcdc_drm_private *priv = crtc->dev->dev_private; + struct tilcdc_drm_private *priv = crtc->drm->dev_private; unsigned int bandwidth; uint32_t hbp, hfp, hsw, vbp, vfp, vsw; @@ -883,7 +883,7 @@ void tilcdc_crtc_set_simulate_vesa_sync(struct drm_crtc *crtc, void tilcdc_crtc_update_clk(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct tilcdc_drm_private *priv = dev->dev_private; struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); @@ -907,7 +907,7 @@ void tilcdc_crtc_update_clk(struct drm_crtc *crtc) irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc) { struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct tilcdc_drm_private *priv = dev->dev_private; uint32_t stat, reg; diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c index d254679a136e..56bcd307c0c9 100644 --- a/drivers/gpu/drm/tiny/bochs.c +++ b/drivers/gpu/drm/tiny/bochs.c @@ -440,7 +440,7 @@ static void bochs_pipe_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct bochs_device *bochs = pipe->crtc.dev->dev_private; + struct bochs_device *bochs = pipe->crtc.drm->dev_private; bochs_hw_setmode(bochs, &crtc_state->mode); bochs_plane_update(bochs, plane_state); @@ -448,7 +448,7 @@ static void bochs_pipe_enable(struct drm_simple_display_pipe *pipe, static void bochs_pipe_disable(struct drm_simple_display_pipe *pipe) { - struct bochs_device *bochs = pipe->crtc.dev->dev_private; + struct bochs_device *bochs = pipe->crtc.drm->dev_private; bochs_hw_blank(bochs, true); } @@ -456,7 +456,7 @@ static void bochs_pipe_disable(struct drm_simple_display_pipe *pipe) static void bochs_pipe_update(struct drm_simple_display_pipe *pipe, struct drm_plane_state *old_state) { - struct bochs_device *bochs = pipe->crtc.dev->dev_private; + struct bochs_device *bochs = pipe->crtc.drm->dev_private; bochs_plane_update(bochs, pipe->plane.state); } diff --git a/drivers/gpu/drm/tiny/cirrus.c b/drivers/gpu/drm/tiny/cirrus.c index 3d3d6c8fd92e..2f6763999360 100644 --- a/drivers/gpu/drm/tiny/cirrus.c +++ b/drivers/gpu/drm/tiny/cirrus.c @@ -499,7 +499,7 @@ static int cirrus_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_ato static void cirrus_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct cirrus_device *cirrus = to_cirrus(crtc->dev); + struct cirrus_device *cirrus = to_cirrus(crtc->drm); struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); int idx; diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c index c5bb683e440c..e6279a9916ef 100644 --- a/drivers/gpu/drm/tiny/gm12u320.c +++ b/drivers/gpu/drm/tiny/gm12u320.c @@ -554,7 +554,7 @@ static void gm12u320_pipe_enable(struct drm_simple_display_pipe *pipe, struct drm_plane_state *plane_state) { struct drm_rect rect = { 0, 0, GM12U320_USER_WIDTH, GM12U320_HEIGHT }; - struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.dev); + struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.drm); struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state); gm12u320->fb_update.draw_status_timeout = FIRST_FRAME_TIMEOUT; @@ -563,7 +563,7 @@ static void gm12u320_pipe_enable(struct drm_simple_display_pipe *pipe, static void gm12u320_pipe_disable(struct drm_simple_display_pipe *pipe) { - struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.dev); + struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.drm); gm12u320_stop_fb_update(gm12u320); } diff --git a/drivers/gpu/drm/tiny/hx8357d.c b/drivers/gpu/drm/tiny/hx8357d.c index cdc4486e059b..0c2875df66c5 100644 --- a/drivers/gpu/drm/tiny/hx8357d.c +++ b/drivers/gpu/drm/tiny/hx8357d.c @@ -48,12 +48,12 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.drm); struct mipi_dbi *dbi = &dbidev->dbi; u8 addr_mode; int ret, idx; - if (!drm_dev_enter(pipe->crtc.dev, &idx)) + if (!drm_dev_enter(pipe->crtc.drm, &idx)) return; DRM_DEBUG_KMS("\n"); diff --git a/drivers/gpu/drm/tiny/ili9163.c b/drivers/gpu/drm/tiny/ili9163.c index bc4384d410fc..e5e4d5f62839 100644 --- a/drivers/gpu/drm/tiny/ili9163.c +++ b/drivers/gpu/drm/tiny/ili9163.c @@ -37,12 +37,12 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.drm); struct mipi_dbi *dbi = &dbidev->dbi; u8 addr_mode; int ret, idx; - if (!drm_dev_enter(pipe->crtc.dev, &idx)) + if (!drm_dev_enter(pipe->crtc.drm, &idx)) return; DRM_DEBUG_KMS("\n"); diff --git a/drivers/gpu/drm/tiny/ili9225.c b/drivers/gpu/drm/tiny/ili9225.c index 077c6ff5a2e1..ec33dc530a17 100644 --- a/drivers/gpu/drm/tiny/ili9225.c +++ b/drivers/gpu/drm/tiny/ili9225.c @@ -180,10 +180,10 @@ static void ili9225_pipe_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.drm); struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state); struct drm_framebuffer *fb = plane_state->fb; - struct device *dev = pipe->crtc.dev->dev; + struct device *dev = pipe->crtc.drm->dev; struct mipi_dbi *dbi = &dbidev->dbi; struct drm_rect rect = { .x1 = 0, @@ -194,7 +194,7 @@ static void ili9225_pipe_enable(struct drm_simple_display_pipe *pipe, int ret, idx; u8 am_id; - if (!drm_dev_enter(pipe->crtc.dev, &idx)) + if (!drm_dev_enter(pipe->crtc.drm, &idx)) return; DRM_DEBUG_KMS("\n"); @@ -289,7 +289,7 @@ static void ili9225_pipe_enable(struct drm_simple_display_pipe *pipe, static void ili9225_pipe_disable(struct drm_simple_display_pipe *pipe) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.drm); struct mipi_dbi *dbi = &dbidev->dbi; DRM_DEBUG_KMS("\n"); diff --git a/drivers/gpu/drm/tiny/ili9341.c b/drivers/gpu/drm/tiny/ili9341.c index 47b61c3bf145..94092848f554 100644 --- a/drivers/gpu/drm/tiny/ili9341.c +++ b/drivers/gpu/drm/tiny/ili9341.c @@ -54,12 +54,12 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.drm); struct mipi_dbi *dbi = &dbidev->dbi; u8 addr_mode; int ret, idx; - if (!drm_dev_enter(pipe->crtc.dev, &idx)) + if (!drm_dev_enter(pipe->crtc.drm, &idx)) return; DRM_DEBUG_KMS("\n"); diff --git a/drivers/gpu/drm/tiny/ili9486.c b/drivers/gpu/drm/tiny/ili9486.c index 02265c898816..3a1a7a35a46f 100644 --- a/drivers/gpu/drm/tiny/ili9486.c +++ b/drivers/gpu/drm/tiny/ili9486.c @@ -92,12 +92,12 @@ static void waveshare_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.drm); struct mipi_dbi *dbi = &dbidev->dbi; u8 addr_mode; int ret, idx; - if (!drm_dev_enter(pipe->crtc.dev, &idx)) + if (!drm_dev_enter(pipe->crtc.drm, &idx)) return; DRM_DEBUG_KMS("\n"); diff --git a/drivers/gpu/drm/tiny/mi0283qt.c b/drivers/gpu/drm/tiny/mi0283qt.c index 01ff43c8ac3f..4ccc752290df 100644 --- a/drivers/gpu/drm/tiny/mi0283qt.c +++ b/drivers/gpu/drm/tiny/mi0283qt.c @@ -52,12 +52,12 @@ static void mi0283qt_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.drm); struct mipi_dbi *dbi = &dbidev->dbi; u8 addr_mode; int ret, idx; - if (!drm_dev_enter(pipe->crtc.dev, &idx)) + if (!drm_dev_enter(pipe->crtc.drm, &idx)) return; DRM_DEBUG_KMS("\n"); diff --git a/drivers/gpu/drm/tiny/ofdrm.c b/drivers/gpu/drm/tiny/ofdrm.c index dbf053d603af..ddc0ddb29434 100644 --- a/drivers/gpu/drm/tiny/ofdrm.c +++ b/drivers/gpu/drm/tiny/ofdrm.c @@ -876,7 +876,7 @@ static const struct drm_plane_funcs ofdrm_primary_plane_funcs = { static enum drm_mode_status ofdrm_crtc_helper_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode) { - struct ofdrm_device *odev = ofdrm_device_of_dev(crtc->dev); + struct ofdrm_device *odev = ofdrm_device_of_dev(crtc->drm); return drm_crtc_helper_mode_valid_fixed(crtc, mode, &odev->mode); } @@ -886,7 +886,7 @@ static int ofdrm_crtc_helper_atomic_check(struct drm_crtc *crtc, { static const size_t gamma_lut_length = OFDRM_GAMMA_LUT_SIZE * sizeof(struct drm_color_lut); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_crtc_state *new_crtc_state = drm_atomic_get_new_crtc_state(new_state, crtc); int ret; @@ -911,7 +911,7 @@ static int ofdrm_crtc_helper_atomic_check(struct drm_crtc *crtc, static void ofdrm_crtc_helper_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct ofdrm_device *odev = ofdrm_device_of_dev(crtc->dev); + struct ofdrm_device *odev = ofdrm_device_of_dev(crtc->drm); struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); struct ofdrm_crtc_state *ofdrm_crtc_state = to_ofdrm_crtc_state(crtc_state); @@ -952,7 +952,7 @@ static void ofdrm_crtc_reset(struct drm_crtc *crtc) static struct drm_crtc_state *ofdrm_crtc_atomic_duplicate_state(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_crtc_state *crtc_state = crtc->state; struct ofdrm_crtc_state *new_ofdrm_crtc_state; struct ofdrm_crtc_state *ofdrm_crtc_state; diff --git a/drivers/gpu/drm/tiny/panel-mipi-dbi.c b/drivers/gpu/drm/tiny/panel-mipi-dbi.c index eb9f13f18a02..586c54dd579d 100644 --- a/drivers/gpu/drm/tiny/panel-mipi-dbi.c +++ b/drivers/gpu/drm/tiny/panel-mipi-dbi.c @@ -191,14 +191,14 @@ static void panel_mipi_dbi_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.drm); struct mipi_dbi *dbi = &dbidev->dbi; int ret, idx; - if (!drm_dev_enter(pipe->crtc.dev, &idx)) + if (!drm_dev_enter(pipe->crtc.drm, &idx)) return; - drm_dbg(pipe->crtc.dev, "\n"); + drm_dbg(pipe->crtc.drm, "\n"); ret = mipi_dbi_poweron_conditional_reset(dbidev); if (ret < 0) diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c index f884b2712bde..2a459960d10c 100644 --- a/drivers/gpu/drm/tiny/repaper.c +++ b/drivers/gpu/drm/tiny/repaper.c @@ -625,7 +625,7 @@ static enum drm_mode_status repaper_pipe_mode_valid(struct drm_simple_display_pi const struct drm_display_mode *mode) { struct drm_crtc *crtc = &pipe->crtc; - struct repaper_epd *epd = drm_to_epd(crtc->dev); + struct repaper_epd *epd = drm_to_epd(crtc->drm); return drm_crtc_helper_mode_valid_fixed(crtc, mode, epd->mode); } @@ -634,13 +634,13 @@ static void repaper_pipe_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct repaper_epd *epd = drm_to_epd(pipe->crtc.dev); + struct repaper_epd *epd = drm_to_epd(pipe->crtc.drm); struct spi_device *spi = epd->spi; struct device *dev = &spi->dev; bool dc_ok = false; int i, ret, idx; - if (!drm_dev_enter(pipe->crtc.dev, &idx)) + if (!drm_dev_enter(pipe->crtc.drm, &idx)) return; DRM_DEBUG_DRIVER("\n"); @@ -772,7 +772,7 @@ static void repaper_pipe_enable(struct drm_simple_display_pipe *pipe, static void repaper_pipe_disable(struct drm_simple_display_pipe *pipe) { - struct repaper_epd *epd = drm_to_epd(pipe->crtc.dev); + struct repaper_epd *epd = drm_to_epd(pipe->crtc.drm); struct spi_device *spi = epd->spi; unsigned int line; diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index fa511aff2545..be02d12f80eb 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -548,7 +548,7 @@ static const struct drm_plane_funcs simpledrm_primary_plane_funcs = { static enum drm_mode_status simpledrm_crtc_helper_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode) { - struct simpledrm_device *sdev = simpledrm_device_of_dev(crtc->dev); + struct simpledrm_device *sdev = simpledrm_device_of_dev(crtc->drm); return drm_crtc_helper_mode_valid_fixed(crtc, mode, &sdev->mode); } diff --git a/drivers/gpu/drm/tiny/st7586.c b/drivers/gpu/drm/tiny/st7586.c index 3cf4eec16a81..493dee2446d8 100644 --- a/drivers/gpu/drm/tiny/st7586.c +++ b/drivers/gpu/drm/tiny/st7586.c @@ -169,7 +169,7 @@ static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.drm); struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state); struct drm_framebuffer *fb = plane_state->fb; struct mipi_dbi *dbi = &dbidev->dbi; @@ -182,7 +182,7 @@ static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe, int idx, ret; u8 addr_mode; - if (!drm_dev_enter(pipe->crtc.dev, &idx)) + if (!drm_dev_enter(pipe->crtc.drm, &idx)) return; DRM_DEBUG_KMS("\n"); @@ -247,7 +247,7 @@ static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe, static void st7586_pipe_disable(struct drm_simple_display_pipe *pipe) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.drm); /* * This callback is not protected by drm_dev_enter/exit since we want to diff --git a/drivers/gpu/drm/tiny/st7735r.c b/drivers/gpu/drm/tiny/st7735r.c index 477eb36fbb70..26eb2b5446de 100644 --- a/drivers/gpu/drm/tiny/st7735r.c +++ b/drivers/gpu/drm/tiny/st7735r.c @@ -59,14 +59,14 @@ static void st7735r_pipe_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.drm); struct st7735r_priv *priv = container_of(dbidev, struct st7735r_priv, dbidev); struct mipi_dbi *dbi = &dbidev->dbi; int ret, idx; u8 addr_mode; - if (!drm_dev_enter(pipe->crtc.dev, &idx)) + if (!drm_dev_enter(pipe->crtc.drm, &idx)) return; DRM_DEBUG_KMS("\n"); diff --git a/drivers/gpu/drm/tve200/tve200_display.c b/drivers/gpu/drm/tve200/tve200_display.c index 37bdd976ae59..606462761ee2 100644 --- a/drivers/gpu/drm/tve200/tve200_display.c +++ b/drivers/gpu/drm/tve200/tve200_display.c @@ -124,7 +124,7 @@ static void tve200_display_enable(struct drm_simple_display_pipe *pipe, { struct drm_crtc *crtc = &pipe->crtc; struct drm_plane *plane = &pipe->plane; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct tve200_drm_dev_private *priv = drm->dev_private; const struct drm_display_mode *mode = &cstate->mode; struct drm_framebuffer *fb = plane->state->fb; @@ -242,7 +242,7 @@ static void tve200_display_enable(struct drm_simple_display_pipe *pipe, static void tve200_display_disable(struct drm_simple_display_pipe *pipe) { struct drm_crtc *crtc = &pipe->crtc; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct tve200_drm_dev_private *priv = drm->dev_private; drm_crtc_vblank_off(crtc); @@ -258,7 +258,7 @@ static void tve200_display_update(struct drm_simple_display_pipe *pipe, struct drm_plane_state *old_pstate) { struct drm_crtc *crtc = &pipe->crtc; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct tve200_drm_dev_private *priv = drm->dev_private; struct drm_pending_vblank_event *event = crtc->state->event; struct drm_plane *plane = &pipe->plane; @@ -282,19 +282,19 @@ static void tve200_display_update(struct drm_simple_display_pipe *pipe, if (event) { crtc->state->event = NULL; - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->active && drm_crtc_vblank_get(crtc) == 0) drm_crtc_arm_vblank_event(crtc, event); else drm_crtc_send_vblank_event(crtc, event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } } static int tve200_display_enable_vblank(struct drm_simple_display_pipe *pipe) { struct drm_crtc *crtc = &pipe->crtc; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct tve200_drm_dev_private *priv = drm->dev_private; /* Clear any IRQs and enable */ @@ -306,7 +306,7 @@ static int tve200_display_enable_vblank(struct drm_simple_display_pipe *pipe) static void tve200_display_disable_vblank(struct drm_simple_display_pipe *pipe) { struct drm_crtc *crtc = &pipe->crtc; - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct tve200_drm_dev_private *priv = drm->dev_private; writel(0, priv->regs + TVE200_INT_EN); diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c index 1c85223b4bdc..5a36bb90dbd3 100644 --- a/drivers/gpu/drm/udl/udl_modeset.c +++ b/drivers/gpu/drm/udl/udl_modeset.c @@ -322,7 +322,7 @@ static int udl_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic static void udl_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); struct drm_display_mode *mode = &crtc_state->mode; struct urb *urb; @@ -356,7 +356,7 @@ static void udl_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atom static void udl_crtc_helper_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct urb *urb; char *buf; int idx; diff --git a/drivers/gpu/drm/vboxvideo/vbox_mode.c b/drivers/gpu/drm/vboxvideo/vbox_mode.c index d7326d6b9062..ea5ceb51bd70 100644 --- a/drivers/gpu/drm/vboxvideo/vbox_mode.c +++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c @@ -41,7 +41,7 @@ static void vbox_do_modeset(struct drm_crtc *crtc) u16 flags; s32 x_offset, y_offset; - vbox = to_vbox_dev(crtc->dev); + vbox = to_vbox_dev(crtc->drm); width = vbox_crtc->width ? vbox_crtc->width : 640; height = vbox_crtc->height ? vbox_crtc->height : 480; bpp = fb ? fb->format->cpp[0] * 8 : 32; @@ -82,7 +82,7 @@ static void vbox_do_modeset(struct drm_crtc *crtc) static int vbox_set_view(struct drm_crtc *crtc) { struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtc); - struct vbox_private *vbox = to_vbox_dev(crtc->dev); + struct vbox_private *vbox = to_vbox_dev(crtc->drm); struct vbva_infoview *p; /* @@ -179,7 +179,7 @@ static void vbox_crtc_set_base_and_mode(struct drm_crtc *crtc, int x, int y) { struct drm_gem_vram_object *gbo = drm_gem_vram_of_gem(fb->obj[0]); - struct vbox_private *vbox = to_vbox_dev(crtc->dev); + struct vbox_private *vbox = to_vbox_dev(crtc->drm); struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtc); bool needs_modeset = drm_atomic_crtc_needs_modeset(crtc->state); diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index 7610e841ef3c..d5dc0d3bdce3 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -99,7 +99,7 @@ static bool vc4_crtc_get_scanout_position(struct drm_crtc *crtc, ktime_t *stime, ktime_t *etime, const struct drm_display_mode *mode) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_hvs *hvs = vc4->hvs; struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); @@ -220,7 +220,7 @@ static u32 vc4_get_fifo_full_level(struct vc4_crtc *vc4_crtc, u32 format) { const struct vc4_crtc_data *crtc_data = vc4_crtc_to_vc4_crtc_data(vc4_crtc); const struct vc4_pv_data *pv_data = vc4_crtc_to_vc4_pv_data(vc4_crtc); - struct vc4_dev *vc4 = to_vc4_dev(vc4_crtc->base.dev); + struct vc4_dev *vc4 = to_vc4_dev(vc4_crtc->base.drm); u32 fifo_len_bytes = pv_data->fifo_depth; /* @@ -296,7 +296,7 @@ struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc, WARN_ON(hweight32(state->encoder_mask) > 1); - drm_for_each_encoder_mask(encoder, crtc->dev, state->encoder_mask) + drm_for_each_encoder_mask(encoder, crtc->drm, state->encoder_mask) return encoder; return NULL; @@ -305,7 +305,7 @@ struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc, static void vc4_crtc_pixelvalve_reset(struct drm_crtc *crtc) { struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; int idx; if (!drm_dev_enter(dev, &idx)) @@ -321,7 +321,7 @@ static void vc4_crtc_pixelvalve_reset(struct drm_crtc *crtc) static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encoder, struct drm_atomic_state *state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder); struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); @@ -468,7 +468,7 @@ static int vc4_crtc_disable(struct drm_crtc *crtc, { struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder); struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); int idx, ret; @@ -514,7 +514,7 @@ static int vc4_crtc_disable(struct drm_crtc *crtc, int vc4_crtc_disable_at_boot(struct drm_crtc *crtc) { - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct vc4_dev *vc4 = to_vc4_dev(drm); struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); enum vc4_encoder_type encoder_type; @@ -571,7 +571,7 @@ int vc4_crtc_disable_at_boot(struct drm_crtc *crtc) void vc4_crtc_send_vblank(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned long flags; if (!crtc->state || !crtc->state->event) @@ -590,7 +590,7 @@ static void vc4_crtc_atomic_disable(struct drm_crtc *crtc, crtc); struct vc4_crtc_state *old_vc4_state = to_vc4_crtc_state(old_state); struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc, old_state); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; drm_dbg(dev, "Disabling CRTC %s (%u) connected to Encoder %s (%u)", crtc->name, crtc->base.id, encoder->name, encoder->base.id); @@ -614,7 +614,7 @@ static void vc4_crtc_atomic_enable(struct drm_crtc *crtc, { struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state, crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc, new_state); struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder); @@ -747,7 +747,7 @@ int vc4_crtc_atomic_check(struct drm_crtc *crtc, static int vc4_enable_vblank(struct drm_crtc *crtc) { struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; int idx; if (!drm_dev_enter(dev, &idx)) @@ -763,7 +763,7 @@ static int vc4_enable_vblank(struct drm_crtc *crtc) static void vc4_disable_vblank(struct drm_crtc *crtc) { struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; int idx; if (!drm_dev_enter(dev, &idx)) @@ -777,7 +777,7 @@ static void vc4_disable_vblank(struct drm_crtc *crtc) static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc) { struct drm_crtc *crtc = &vc4_crtc->base; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_hvs *hvs = vc4->hvs; u32 chan = vc4_crtc->current_hvs_channel; @@ -845,7 +845,7 @@ static void vc4_async_page_flip_complete(struct vc4_async_flip_state *flip_state) { struct drm_crtc *crtc = flip_state->crtc; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_plane *plane = crtc->primary; vc4_plane_async_set_fb(plane, flip_state->fb); @@ -943,7 +943,7 @@ vc4_async_page_flip_common(struct drm_crtc *crtc, struct drm_pending_vblank_event *event, uint32_t flags) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct drm_plane *plane = crtc->primary; struct vc4_async_flip_state *flip_state; @@ -993,7 +993,7 @@ static int vc4_async_page_flip(struct drm_crtc *crtc, struct drm_pending_vblank_event *event, uint32_t flags) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); struct drm_gem_dma_object *dma_bo = drm_fb_dma_get_gem_obj(fb, 0); struct vc4_bo *bo = to_vc4_bo(&dma_bo->base); @@ -1039,7 +1039,7 @@ int vc4_page_flip(struct drm_crtc *crtc, struct drm_modeset_acquire_ctx *ctx) { if (flags & DRM_MODE_PAGE_FLIP_ASYNC) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); if (vc4->is_vc5) @@ -1070,7 +1070,7 @@ struct drm_crtc_state *vc4_crtc_duplicate_state(struct drm_crtc *crtc) void vc4_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state) { - struct vc4_dev *vc4 = to_vc4_dev(crtc->dev); + struct vc4_dev *vc4 = to_vc4_dev(crtc->drm); struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(state); if (drm_mm_node_allocated(&vc4_state->mm)) { @@ -1104,7 +1104,7 @@ void vc4_crtc_reset(struct drm_crtc *crtc) int vc4_crtc_late_register(struct drm_crtc *crtc) { - struct drm_device *drm = crtc->dev; + struct drm_device *drm = crtc->drm; struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); const struct vc4_crtc_data *crtc_data = vc4_crtc_to_vc4_crtc_data(vc4_crtc); diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 5e53d4f8232d..58388eb9237f 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -304,7 +304,7 @@ static int reset_pipe(struct drm_crtc *crtc, struct drm_crtc_state *crtc_state; int ret; - state = drm_atomic_state_alloc(crtc->dev); + state = drm_atomic_state_alloc(crtc->drm); if (!state) return -ENOMEM; diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index 04af672caacb..488a207024c7 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -442,7 +442,7 @@ int vc4_hvs_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state) { struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc_state); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); struct drm_plane *plane; unsigned long flags; @@ -473,7 +473,7 @@ int vc4_hvs_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state) static void vc4_hvs_install_dlist(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_hvs *hvs = vc4->hvs; struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state); @@ -490,7 +490,7 @@ static void vc4_hvs_install_dlist(struct drm_crtc *crtc) static void vc4_hvs_update_dlist(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state); unsigned long flags; @@ -530,7 +530,7 @@ void vc4_hvs_atomic_begin(struct drm_crtc *crtc, void vc4_hvs_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); struct drm_display_mode *mode = &crtc->state->adjusted_mode; struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); @@ -544,7 +544,7 @@ void vc4_hvs_atomic_enable(struct drm_crtc *crtc, void vc4_hvs_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, crtc); struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(old_state); @@ -558,7 +558,7 @@ void vc4_hvs_atomic_flush(struct drm_crtc *crtc, { struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, crtc); - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_hvs *hvs = vc4->hvs; struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c index 4091fd872d65..ec46ea639dd2 100644 --- a/drivers/gpu/drm/vc4/vc4_txp.c +++ b/drivers/gpu/drm/vc4/vc4_txp.c @@ -433,7 +433,7 @@ static void vc4_txp_atomic_enable(struct drm_crtc *crtc, static void vc4_txp_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; /* Disable vblank irq handling before crtc is disabled. */ drm_crtc_vblank_off(crtc); diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index 6f9cc844412b..ad8941a0b6b7 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -85,7 +85,7 @@ virtio_gpu_framebuffer_init(struct drm_device *dev, static void virtio_gpu_crtc_mode_set_nofb(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct virtio_gpu_device *vgdev = dev->dev_private; struct virtio_gpu_output *output = drm_crtc_to_virtio_gpu_output(crtc); @@ -103,7 +103,7 @@ static void virtio_gpu_crtc_atomic_enable(struct drm_crtc *crtc, static void virtio_gpu_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; struct virtio_gpu_device *vgdev = dev->dev_private; struct virtio_gpu_output *output = drm_crtc_to_virtio_gpu_output(crtc); diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index 515f6772b866..a953f06303fa 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -61,7 +61,7 @@ static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer) static int vkms_enable_vblank(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = drm_crtc_index(crtc); struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; struct vkms_output *out = drm_crtc_to_vkms_output(crtc); @@ -87,7 +87,7 @@ static bool vkms_get_vblank_timestamp(struct drm_crtc *crtc, int *max_error, ktime_t *vblank_time, bool in_vblank_irq) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned int pipe = crtc->index; struct vkms_device *vkmsdev = drm_device_to_vkms_device(dev); struct vkms_output *output = &vkmsdev->output; @@ -190,7 +190,7 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc, if (ret < 0) return ret; - drm_for_each_plane_mask(plane, crtc->dev, crtc_state->plane_mask) { + drm_for_each_plane_mask(plane, crtc->drm, crtc_state->plane_mask) { plane_state = drm_atomic_get_existing_plane_state(crtc_state->state, plane); WARN_ON(!plane_state); @@ -207,7 +207,7 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc, vkms_state->num_active_planes = i; i = 0; - drm_for_each_plane_mask(plane, crtc->dev, crtc_state->plane_mask) { + drm_for_each_plane_mask(plane, crtc->drm, crtc_state->plane_mask) { plane_state = drm_atomic_get_existing_plane_state(crtc_state->state, plane); @@ -250,14 +250,14 @@ static void vkms_crtc_atomic_flush(struct drm_crtc *crtc, struct vkms_output *vkms_output = drm_crtc_to_vkms_output(crtc); if (crtc->state->event) { - spin_lock(&crtc->dev->event_lock); + spin_lock(&crtc->drm->event_lock); if (drm_crtc_vblank_get(crtc) != 0) drm_crtc_send_vblank_event(crtc, crtc->state->event); else drm_crtc_arm_vblank_event(crtc, crtc->state->event); - spin_unlock(&crtc->dev->event_lock); + spin_unlock(&crtc->drm->event_lock); crtc->state->event = NULL; } diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index e7cad0200f9b..c332ad7e4e8f 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -762,7 +762,7 @@ vmw_du_cursor_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); struct drm_crtc *crtc = new_state->crtc ?: old_state->crtc; - struct vmw_private *dev_priv = vmw_priv(crtc->dev); + struct vmw_private *dev_priv = vmw_priv(crtc->drm); struct vmw_display_unit *du = vmw_crtc_to_du(crtc); struct vmw_plane_state *vps = vmw_plane_state_to_vps(new_state); struct vmw_plane_state *old_vps = vmw_plane_state_to_vps(old_state); @@ -2240,7 +2240,7 @@ int vmw_du_crtc_gamma_set(struct drm_crtc *crtc, uint32_t size, struct drm_modeset_acquire_ctx *ctx) { - struct vmw_private *dev_priv = vmw_priv(crtc->dev); + struct vmw_private *dev_priv = vmw_priv(crtc->drm); int i; for (i = 0; i < size; i++) { diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c index 556a403b7eb5..00416a640d17 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c @@ -219,7 +219,7 @@ static void vmw_sou_crtc_mode_set_nofb(struct drm_crtc *crtc) int ret; sou = vmw_crtc_to_sou(crtc); - dev_priv = vmw_priv(crtc->dev); + dev_priv = vmw_priv(crtc->drm); ps = crtc->primary->state; fb = ps->fb; vps = vmw_plane_state_to_vps(ps); @@ -303,7 +303,7 @@ static void vmw_sou_crtc_atomic_disable(struct drm_crtc *crtc, } sou = vmw_crtc_to_sou(crtc); - dev_priv = vmw_priv(crtc->dev); + dev_priv = vmw_priv(crtc->drm); if (sou->defined) { ret = vmw_sou_fifo_destroy(dev_priv, sou); @@ -384,7 +384,7 @@ vmw_sou_primary_plane_cleanup_fb(struct drm_plane *plane, plane->state->crtc : old_state->crtc; if (vps->bo) - vmw_bo_unpin(vmw_priv(crtc->dev), vps->bo, false); + vmw_bo_unpin(vmw_priv(crtc->drm), vps->bo, false); vmw_bo_unreference(&vps->bo); vps->bo_size = 0; @@ -426,7 +426,7 @@ vmw_sou_primary_plane_prepare_fb(struct drm_plane *plane, } bo_params.size = new_state->crtc_w * new_state->crtc_h * 4; - dev_priv = vmw_priv(crtc->dev); + dev_priv = vmw_priv(crtc->drm); if (vps->bo) { if (vps->bo_size == bo_params.size) { @@ -730,7 +730,7 @@ vmw_sou_primary_plane_atomic_update(struct drm_plane *plane, /* In case of device error, maintain consistent atomic state */ if (crtc && new_state->fb) { - struct vmw_private *dev_priv = vmw_priv(crtc->dev); + struct vmw_private *dev_priv = vmw_priv(crtc->drm); struct vmw_framebuffer *vfb = vmw_framebuffer_to_vfb(new_state->fb); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index ba0c0e12cfe9..b3c3cdba00a8 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c @@ -371,7 +371,7 @@ static void vmw_stdu_crtc_mode_set_nofb(struct drm_crtc *crtc) int x, y, ret; stdu = vmw_crtc_to_stdu(crtc); - dev_priv = vmw_priv(crtc->dev); + dev_priv = vmw_priv(crtc->drm); conn_state = stdu->base.connector.state; vmw_conn_state = vmw_connector_state_to_vcs(conn_state); @@ -427,7 +427,7 @@ static void vmw_stdu_crtc_atomic_disable(struct drm_crtc *crtc, } stdu = vmw_crtc_to_stdu(crtc); - dev_priv = vmw_priv(crtc->dev); + dev_priv = vmw_priv(crtc->drm); if (stdu->defined) { ret = vmw_stdu_bind_st(dev_priv, stdu, NULL); @@ -1363,7 +1363,7 @@ vmw_stdu_primary_plane_atomic_update(struct drm_plane *plane, struct vmw_framebuffer *vfb = vmw_framebuffer_to_vfb(new_state->fb); stdu = vmw_crtc_to_stdu(crtc); - dev_priv = vmw_priv(crtc->dev); + dev_priv = vmw_priv(crtc->drm); stdu->display_srf = vps->surf; stdu->content_fb_type = vps->content_fb_type; @@ -1385,7 +1385,7 @@ vmw_stdu_primary_plane_atomic_update(struct drm_plane *plane, } else { crtc = old_state->crtc; stdu = vmw_crtc_to_stdu(crtc); - dev_priv = vmw_priv(crtc->dev); + dev_priv = vmw_priv(crtc->drm); /* Blank STDU when fb and crtc are NULL */ if (!stdu->defined) diff --git a/drivers/gpu/drm/xen/xen_drm_front_kms.c b/drivers/gpu/drm/xen/xen_drm_front_kms.c index dfa78a49a6d9..da01d713b87f 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_kms.c +++ b/drivers/gpu/drm/xen/xen_drm_front_kms.c @@ -93,7 +93,7 @@ static const struct drm_mode_config_funcs mode_config_funcs = { static void send_pending_event(struct xen_drm_front_drm_pipeline *pipeline) { struct drm_crtc *crtc = &pipeline->pipe.crtc; - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned long flags; spin_lock_irqsave(&dev->event_lock, flags); @@ -113,7 +113,7 @@ static void display_enable(struct drm_simple_display_pipe *pipe, struct drm_framebuffer *fb = plane_state->fb; int ret, idx; - if (!drm_dev_enter(pipe->crtc.dev, &idx)) + if (!drm_dev_enter(pipe->crtc.drm, &idx)) return; ret = xen_drm_front_mode_set(pipeline, crtc->x, crtc->y, @@ -135,7 +135,7 @@ static void display_disable(struct drm_simple_display_pipe *pipe) to_xen_drm_pipeline(pipe); int ret = 0, idx; - if (drm_dev_enter(pipe->crtc.dev, &idx)) { + if (drm_dev_enter(pipe->crtc.drm, &idx)) { ret = xen_drm_front_mode_set(pipeline, 0, 0, 0, 0, 0, xen_drm_front_fb_to_cookie(NULL)); drm_dev_exit(idx); @@ -251,7 +251,7 @@ static void display_update(struct drm_simple_display_pipe *pipe, event = crtc->state->event; if (event) { - struct drm_device *dev = crtc->dev; + struct drm_device *dev = crtc->drm; unsigned long flags; WARN_ON(pipeline->pending_event); @@ -263,7 +263,7 @@ static void display_update(struct drm_simple_display_pipe *pipe, spin_unlock_irqrestore(&dev->event_lock, flags); } - if (!drm_dev_enter(pipe->crtc.dev, &idx)) { + if (!drm_dev_enter(pipe->crtc.drm, &idx)) { send_pending_event(pipeline); return; } diff --git a/drivers/gpu/drm/xlnx/zynqmp_kms.c b/drivers/gpu/drm/xlnx/zynqmp_kms.c index a7f8611be6f4..37bbfd838499 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_kms.c +++ b/drivers/gpu/drm/xlnx/zynqmp_kms.c @@ -232,12 +232,12 @@ static void zynqmp_dpsub_crtc_atomic_disable(struct drm_crtc *crtc, drm_crtc_vblank_off(crtc); - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); if (crtc->state->event) { drm_crtc_send_vblank_event(crtc, crtc->state->event); crtc->state->event = NULL; } - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); clk_disable_unprepare(dpsub->vid_clk); pm_runtime_put_sync(dpsub->dev); @@ -269,9 +269,9 @@ static void zynqmp_dpsub_crtc_atomic_flush(struct drm_crtc *crtc, WARN_ON(drm_crtc_vblank_get(crtc) != 0); - spin_lock_irq(&crtc->dev->event_lock); + spin_lock_irq(&crtc->drm->event_lock); drm_crtc_arm_vblank_event(crtc, event); - spin_unlock_irq(&crtc->dev->event_lock); + spin_unlock_irq(&crtc->drm->event_lock); } } diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h index cdddabfc5d57..306badaccd00 100644 --- a/include/drm/drm_atomic_helper.h +++ b/include/drm/drm_atomic_helper.h @@ -173,7 +173,7 @@ int drm_atomic_helper_page_flip_target( * drm_atomic_crtc_state_for_each_plane(). */ #define drm_atomic_crtc_for_each_plane(plane, crtc) \ - drm_for_each_plane_mask(plane, (crtc)->dev, (crtc)->state->plane_mask) + drm_for_each_plane_mask(plane, (crtc)->drm, (crtc)->state->plane_mask) /** * drm_atomic_crtc_state_for_each_plane - iterate over attached planes in new state diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 8e1cbc75143e..4762786518d3 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -935,8 +935,8 @@ struct drm_crtc_funcs { * allows the CRTC to be controlled. */ struct drm_crtc { - /** @dev: parent DRM device */ - struct drm_device *dev; + /** @drm: parent DRM device */ + struct drm_device *drm; /** @port: OF node used by drm_of_find_possible_crtcs(). */ struct device_node *port; /** From patchwork Thu Jul 13 08:23:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311539 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62F67EB64DD for ; Thu, 13 Jul 2023 08:25:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C1C5010E628; Thu, 13 Jul 2023 08:25:01 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id E6BF410E625 for ; Thu, 13 Jul 2023 08:24:58 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrcd-0005r3-MH; Thu, 13 Jul 2023 10:24:23 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrcd-00E4jP-0Q; Thu, 13 Jul 2023 10:24:23 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrcc-004Vh4-8e; Thu, 13 Jul 2023 10:24:22 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 06/17] drm/debugfs_entry: Rename struct drm_debugfs_entry::dev to drm Date: Thu, 13 Jul 2023 10:23:57 +0200 Message-Id: <20230713082408.2266984-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=11922; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=DgS1CjufC9Jp/bZcfAXyxvJ1CLtBY8S3Y0LidXC7KTc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7SNLwyjRHm3p+2YosWYeciWEyiO3bWP1b6s6 J0NMkdJt1uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0jQAKCRCPgPtYfRL+ TveuB/4vVrmOJzB+Xm1Z6hT55LHaJpgmNnRWcuwmHnJLf+d56zX4ivWjqeOJ7+3v3btgos0n5kq hz44+zNctc+ZBAGnjHt1bBZNxN+706jujMbME0vQrRXmaSDqYhUpSDMCJYdZYz8MtfMSam2uAGT zOIhnOhSec5Z5ln77HMswWmEpq82gw9Mg/ZQU0fnPEZ525YxzNWMgIMMy2Wc7lElk/MLXFfYd46 BTu9mM7QtBYoz1TuNrqYxdOpGJ4teI3ZcMVELpS+/2M6ej2RB/+OUFUYnNdQtqrQpqCz1kM64mo OiDNcjnKIkSvQjcZDqGBQOmBtw7R+BaW2DhGvMlnJbDOa+oC X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/arm/hdlcd_drv.c | 4 ++-- drivers/gpu/drm/drm_atomic.c | 2 +- drivers/gpu/drm/drm_client.c | 2 +- drivers/gpu/drm/drm_debugfs.c | 8 ++++---- drivers/gpu/drm/drm_framebuffer.c | 2 +- drivers/gpu/drm/drm_gem_vram_helper.c | 2 +- drivers/gpu/drm/gud/gud_drv.c | 2 +- drivers/gpu/drm/v3d/v3d_debugfs.c | 8 ++++---- drivers/gpu/drm/vc4/vc4_bo.c | 2 +- drivers/gpu/drm/vc4/vc4_debugfs.c | 2 +- drivers/gpu/drm/vc4/vc4_hvs.c | 4 ++-- drivers/gpu/drm/vc4/vc4_v3d.c | 2 +- drivers/gpu/drm/vkms/vkms_drv.c | 2 +- include/drm/drm_debugfs.h | 4 ++-- 14 files changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index aa06f9838015..8d1f3b6157ed 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -194,7 +194,7 @@ static int hdlcd_setup_mode_config(struct drm_device *drm) static int hdlcd_show_underrun_count(struct seq_file *m, void *arg) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *drm = entry->dev; + struct drm_device *drm = entry->drm; struct hdlcd_drm_private *hdlcd = drm_to_hdlcd_priv(drm); seq_printf(m, "underrun : %d\n", atomic_read(&hdlcd->buffer_underrun_count)); @@ -207,7 +207,7 @@ static int hdlcd_show_underrun_count(struct seq_file *m, void *arg) static int hdlcd_show_pxlclock(struct seq_file *m, void *arg) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *drm = entry->dev; + struct drm_device *drm = entry->drm; struct hdlcd_drm_private *hdlcd = drm_to_hdlcd_priv(drm); unsigned long clkrate = clk_get_rate(hdlcd->clk); unsigned long mode_clock = hdlcd->crtc.mode.crtc_clock * 1000; diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 8c2ebb982972..58101873a651 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -1820,7 +1820,7 @@ EXPORT_SYMBOL(drm_state_dump); static int drm_state_info(struct seq_file *m, void *data) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *dev = entry->dev; + struct drm_device *dev = entry->drm; struct drm_printer p = drm_seq_file_printer(m); __drm_state_dump(dev, &p, true); diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c index a99417748053..3b82635dc9ff 100644 --- a/drivers/gpu/drm/drm_client.c +++ b/drivers/gpu/drm/drm_client.c @@ -500,7 +500,7 @@ EXPORT_SYMBOL(drm_client_framebuffer_flush); static int drm_client_debugfs_internal_clients(struct seq_file *m, void *data) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *dev = entry->dev; + struct drm_device *dev = entry->drm; struct drm_printer p = drm_seq_file_printer(m); struct drm_client_dev *client; diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index 3a70ac678e8f..4542eed896dd 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -52,7 +52,7 @@ static int drm_name_info(struct seq_file *m, void *data) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *dev = entry->dev; + struct drm_device *dev = entry->drm; struct drm_master *master; mutex_lock(&dev->master_mutex); @@ -73,7 +73,7 @@ static int drm_name_info(struct seq_file *m, void *data) static int drm_clients_info(struct seq_file *m, void *data) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *dev = entry->dev; + struct drm_device *dev = entry->drm; struct drm_file *priv; kuid_t uid; @@ -125,7 +125,7 @@ static int drm_gem_one_name_info(int id, void *ptr, void *data) static int drm_gem_name_info(struct seq_file *m, void *data) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *dev = entry->dev; + struct drm_device *dev = entry->drm; seq_printf(m, " name size handles refcount\n"); @@ -337,7 +337,7 @@ void drm_debugfs_add_file(struct drm_device *dev, const char *name, entry->file.name = name; entry->file.show = show; entry->file.data = data; - entry->dev = dev; + entry->drm = dev; mutex_lock(&dev->debugfs_mutex); list_add(&entry->list, &dev->debugfs_list); diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index aff3746dedfb..38a118e51a6f 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -1204,7 +1204,7 @@ void drm_framebuffer_print_info(struct drm_printer *p, unsigned int indent, static int drm_framebuffer_info(struct seq_file *m, void *data) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *dev = entry->dev; + struct drm_device *dev = entry->drm; struct drm_printer p = drm_seq_file_printer(m); struct drm_framebuffer *fb; diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index b67eafa55715..fc45a65708b7 100644 --- a/drivers/gpu/drm/drm_gem_vram_helper.c +++ b/drivers/gpu/drm/drm_gem_vram_helper.c @@ -969,7 +969,7 @@ static struct ttm_device_funcs bo_driver = { static int drm_vram_mm_debugfs(struct seq_file *m, void *data) { struct drm_debugfs_entry *entry = m->private; - struct drm_vram_mm *vmm = entry->dev->vram_mm; + struct drm_vram_mm *vmm = entry->drm->vram_mm; struct ttm_resource_manager *man = ttm_manager_type(&vmm->bdev, TTM_PL_VRAM); struct drm_printer p = drm_seq_file_printer(m); diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c index 9d7bf8ee45f1..a613407ac2df 100644 --- a/drivers/gpu/drm/gud/gud_drv.c +++ b/drivers/gpu/drm/gud/gud_drv.c @@ -326,7 +326,7 @@ static struct drm_gem_object *gud_gem_prime_import(struct drm_device *drm, struc static int gud_stats_debugfs(struct seq_file *m, void *data) { struct drm_debugfs_entry *entry = m->private; - struct gud_device *gdrm = to_gud_device(entry->dev); + struct gud_device *gdrm = to_gud_device(entry->drm); char buf[10]; string_get_size(gdrm->bulk_len, 1, STRING_UNITS_2, buf, sizeof(buf)); diff --git a/drivers/gpu/drm/v3d/v3d_debugfs.c b/drivers/gpu/drm/v3d/v3d_debugfs.c index 330669f51fa7..54a9cfbb5a7d 100644 --- a/drivers/gpu/drm/v3d/v3d_debugfs.c +++ b/drivers/gpu/drm/v3d/v3d_debugfs.c @@ -80,7 +80,7 @@ static const struct v3d_reg_def v3d_csd_reg_defs[] = { static int v3d_v3d_debugfs_regs(struct seq_file *m, void *unused) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *dev = entry->dev; + struct drm_device *dev = entry->drm; struct v3d_dev *v3d = to_v3d_dev(dev); int i, core; @@ -127,7 +127,7 @@ static int v3d_v3d_debugfs_regs(struct seq_file *m, void *unused) static int v3d_v3d_debugfs_ident(struct seq_file *m, void *unused) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *dev = entry->dev; + struct drm_device *dev = entry->drm; struct v3d_dev *v3d = to_v3d_dev(dev); u32 ident0, ident1, ident2, ident3, cores; int core; @@ -189,7 +189,7 @@ static int v3d_v3d_debugfs_ident(struct seq_file *m, void *unused) static int v3d_debugfs_bo_stats(struct seq_file *m, void *unused) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *dev = entry->dev; + struct drm_device *dev = entry->drm; struct v3d_dev *v3d = to_v3d_dev(dev); mutex_lock(&v3d->bo_lock); @@ -205,7 +205,7 @@ static int v3d_debugfs_bo_stats(struct seq_file *m, void *unused) static int v3d_measure_clock(struct seq_file *m, void *unused) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *dev = entry->dev; + struct drm_device *dev = entry->drm; struct v3d_dev *v3d = to_v3d_dev(dev); uint32_t cycles; int core = 0; diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c index 86d629e45307..71a6f5e47817 100644 --- a/drivers/gpu/drm/vc4/vc4_bo.c +++ b/drivers/gpu/drm/vc4/vc4_bo.c @@ -70,7 +70,7 @@ static void vc4_bo_stats_print(struct drm_printer *p, struct vc4_dev *vc4) static int vc4_bo_stats_debugfs(struct seq_file *m, void *unused) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *dev = entry->dev; + struct drm_device *dev = entry->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); struct drm_printer p = drm_seq_file_printer(m); diff --git a/drivers/gpu/drm/vc4/vc4_debugfs.c b/drivers/gpu/drm/vc4/vc4_debugfs.c index fac624a663ea..1af0432ee6a1 100644 --- a/drivers/gpu/drm/vc4/vc4_debugfs.c +++ b/drivers/gpu/drm/vc4/vc4_debugfs.c @@ -35,7 +35,7 @@ vc4_debugfs_init(struct drm_minor *minor) static int vc4_debugfs_regset32(struct seq_file *m, void *unused) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *drm = entry->dev; + struct drm_device *drm = entry->drm; struct debugfs_regset32 *regset = entry->file.data; struct drm_printer p = drm_seq_file_printer(m); int idx; diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index 488a207024c7..552142320e2d 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -94,7 +94,7 @@ void vc4_hvs_dump_state(struct vc4_hvs *hvs) static int vc4_hvs_debugfs_underrun(struct seq_file *m, void *data) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *dev = entry->dev; + struct drm_device *dev = entry->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); struct drm_printer p = drm_seq_file_printer(m); @@ -106,7 +106,7 @@ static int vc4_hvs_debugfs_underrun(struct seq_file *m, void *data) static int vc4_hvs_debugfs_dlist(struct seq_file *m, void *data) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *dev = entry->dev; + struct drm_device *dev = entry->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_hvs *hvs = vc4->hvs; struct drm_printer p = drm_seq_file_printer(m); diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c index 04ac7805e6d5..72edeb2d3d78 100644 --- a/drivers/gpu/drm/vc4/vc4_v3d.c +++ b/drivers/gpu/drm/vc4/vc4_v3d.c @@ -97,7 +97,7 @@ static const struct debugfs_reg32 v3d_regs[] = { static int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *dev = entry->dev; + struct drm_device *dev = entry->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); int ret = vc4_v3d_pm_get(vc4); diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c index a58d7e0d3078..f15f1bd51208 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -93,7 +93,7 @@ static void vkms_atomic_commit_tail(struct drm_atomic_state *old_state) static int vkms_config_show(struct seq_file *m, void *data) { struct drm_debugfs_entry *entry = m->private; - struct drm_device *dev = entry->dev; + struct drm_device *dev = entry->drm; struct vkms_device *vkmsdev = drm_device_to_vkms_device(dev); seq_printf(m, "writeback=%d\n", vkmsdev->config->writeback); diff --git a/include/drm/drm_debugfs.h b/include/drm/drm_debugfs.h index 7616f457ce70..f7c4f2774a8e 100644 --- a/include/drm/drm_debugfs.h +++ b/include/drm/drm_debugfs.h @@ -112,8 +112,8 @@ struct drm_debugfs_info { * drm_debugfs_info on a &struct drm_device. */ struct drm_debugfs_entry { - /** @dev: &struct drm_device for this node. */ - struct drm_device *dev; + /** @drm: &struct drm_device for this node. */ + struct drm_device *drm; /** @file: Template for this node. */ struct drm_debugfs_info file; From patchwork Thu Jul 13 08:23:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311547 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B64FEEB64DD for ; Thu, 13 Jul 2023 08:25:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C985B10E630; Thu, 13 Jul 2023 08:25:35 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7128510E632 for ; Thu, 13 Jul 2023 08:25:23 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrcd-0005rA-Tn; Thu, 13 Jul 2023 10:24:24 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrcd-00E4jX-8M; Thu, 13 Jul 2023 10:24:23 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrcc-004Vh8-Jf; Thu, 13 Jul 2023 10:24:22 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 07/17] drm/dp_mst_topology_mgr: Rename struct drm_dp_mst_topology_mgr::dev to drm Date: Thu, 13 Jul 2023 10:23:58 +0200 Message-Id: <20230713082408.2266984-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=37061; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zk8aZ4k7F8T548oEdS8x2h0Y5gQZOKVhx7iOUuO7q4s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7SPEk5jtgSsycKWeB80OYqhLSLTkR89CRGhO Ya7amkyyhOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0jwAKCRCPgPtYfRL+ TiHzB/wLD4u2IPcZmrcftxvTsYYWX1GJHa2LvSsszeEocXUXcI8S3aC+Wx7EMoFiMs6fLjCbkmI K0g9cODRETqSB8DRJnoi+DqNVmOkFMGByCTvSAIG52VeAlK2x+wvQmRJfdaI+g7hiRfteFHQolE kzdeFbyKFH7qVgb+63RaJQ/j/xcIVFCdIRpiLNvcwk6nDiOJV+UyoTGwRxSKqappCy2qXeFPcnI YVVowo/zJvpvRENu8zCQnAIPEApP8/5BLWdLva1zfTwTZEEpz4FH2OCCpIr+kaNVr5S0ygwq/VJ gPkgIdw1DRm5II/EzhvWdo6VWWZmJ/bqWvoNy6yfQg5xXwBO X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- drivers/gpu/drm/display/drm_dp_mst_topology.c | 249 +++++++++++------- drivers/gpu/drm/i915/display/intel_hdcp.c | 4 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +- include/drm/display/drm_dp_mst_helper.h | 4 +- 5 files changed, 163 insertions(+), 98 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 485a3991820f..ce694e9ed5a3 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6261,7 +6261,7 @@ static void amdgpu_dm_connector_destroy(struct drm_connector *connector) * Call only if mst_mgr was initialized before since it's not done * for all connector types. */ - if (aconnector->mst_mgr.dev) + if (aconnector->mst_mgr.drm) drm_dp_mst_topology_mgr_destroy(&aconnector->mst_mgr); if (aconnector->bl_idx != -1) { diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index 5070670b29b5..d4e6a01bb281 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -307,7 +307,8 @@ static bool drm_dp_decode_sideband_msg_hdr(const struct drm_dp_mst_topology_mgr crc4 = drm_dp_msg_header_crc4(buf, (len * 2) - 1); if ((crc4 & 0xf) != (buf[len - 1] & 0xf)) { - drm_dbg_kms(mgr->dev, "crc4 mismatch 0x%x 0x%x\n", crc4, buf[len - 1]); + drm_dbg_kms(mgr->drm, "crc4 mismatch 0x%x 0x%x\n", crc4, + buf[len - 1]); return false; } @@ -1059,7 +1060,7 @@ static bool drm_dp_sideband_parse_reply(const struct drm_dp_mst_topology_mgr *mg case DP_QUERY_STREAM_ENC_STATUS: return drm_dp_sideband_parse_query_stream_enc_status(raw, msg); default: - drm_err(mgr->dev, "Got unknown reply 0x%02x (%s)\n", + drm_err(mgr->drm, "Got unknown reply 0x%02x (%s)\n", msg->req_type, drm_dp_mst_req_type_str(msg->req_type)); return false; } @@ -1090,7 +1091,8 @@ drm_dp_sideband_parse_connection_status_notify(const struct drm_dp_mst_topology_ idx++; return true; fail_len: - drm_dbg_kms(mgr->dev, "connection status reply parse length fail %d %d\n", + drm_dbg_kms(mgr->drm, + "connection status reply parse length fail %d %d\n", idx, raw->curlen); return false; } @@ -1115,7 +1117,9 @@ static bool drm_dp_sideband_parse_resource_status_notify(const struct drm_dp_mst idx++; return true; fail_len: - drm_dbg_kms(mgr->dev, "resource status reply parse length fail %d %d\n", idx, raw->curlen); + drm_dbg_kms(mgr->drm, + "resource status reply parse length fail %d %d\n", idx, + raw->curlen); return false; } @@ -1132,7 +1136,7 @@ static bool drm_dp_sideband_parse_req(const struct drm_dp_mst_topology_mgr *mgr, case DP_RESOURCE_STATUS_NOTIFY: return drm_dp_sideband_parse_resource_status_notify(mgr, raw, msg); default: - drm_err(mgr->dev, "Got unknown request 0x%02x (%s)\n", + drm_err(mgr->drm, "Got unknown request 0x%02x (%s)\n", msg->req_type, drm_dp_mst_req_type_str(msg->req_type)); return false; } @@ -1291,7 +1295,7 @@ static int drm_dp_mst_wait_tx_reply(struct drm_dp_mst_branch *mstb, goto out; } } else { - drm_dbg_kms(mgr->dev, "timedout msg send %p %d %d\n", + drm_dbg_kms(mgr->drm, "timedout msg send %p %d %d\n", txmsg, txmsg->state, txmsg->seqno); /* dump some state */ @@ -1446,7 +1450,8 @@ static void drm_dp_mst_get_mstb_malloc(struct drm_dp_mst_branch *mstb) { kref_get(&mstb->malloc_kref); - drm_dbg(mstb->mgr->dev, "mstb %p (%d)\n", mstb, kref_read(&mstb->malloc_kref)); + drm_dbg(mstb->mgr->drm, "mstb %p (%d)\n", mstb, + kref_read(&mstb->malloc_kref)); } /** @@ -1463,7 +1468,8 @@ drm_dp_mst_get_mstb_malloc(struct drm_dp_mst_branch *mstb) static void drm_dp_mst_put_mstb_malloc(struct drm_dp_mst_branch *mstb) { - drm_dbg(mstb->mgr->dev, "mstb %p (%d)\n", mstb, kref_read(&mstb->malloc_kref) - 1); + drm_dbg(mstb->mgr->drm, "mstb %p (%d)\n", mstb, + kref_read(&mstb->malloc_kref) - 1); kref_put(&mstb->malloc_kref, drm_dp_free_mst_branch_device); } @@ -1497,7 +1503,8 @@ void drm_dp_mst_get_port_malloc(struct drm_dp_mst_port *port) { kref_get(&port->malloc_kref); - drm_dbg(port->mgr->dev, "port %p (%d)\n", port, kref_read(&port->malloc_kref)); + drm_dbg(port->mgr->drm, "port %p (%d)\n", port, + kref_read(&port->malloc_kref)); } EXPORT_SYMBOL(drm_dp_mst_get_port_malloc); @@ -1514,7 +1521,8 @@ EXPORT_SYMBOL(drm_dp_mst_get_port_malloc); void drm_dp_mst_put_port_malloc(struct drm_dp_mst_port *port) { - drm_dbg(port->mgr->dev, "port %p (%d)\n", port, kref_read(&port->malloc_kref) - 1); + drm_dbg(port->mgr->drm, "port %p (%d)\n", port, + kref_read(&port->malloc_kref) - 1); kref_put(&port->malloc_kref, drm_dp_free_mst_port); } EXPORT_SYMBOL(drm_dp_mst_put_port_malloc); @@ -1750,7 +1758,8 @@ drm_dp_mst_topology_try_get_mstb(struct drm_dp_mst_branch *mstb) topology_ref_history_lock(mstb->mgr); ret = kref_get_unless_zero(&mstb->topology_kref); if (ret) { - drm_dbg(mstb->mgr->dev, "mstb %p (%d)\n", mstb, kref_read(&mstb->topology_kref)); + drm_dbg(mstb->mgr->drm, "mstb %p (%d)\n", mstb, + kref_read(&mstb->topology_kref)); save_mstb_topology_ref(mstb, DRM_DP_MST_TOPOLOGY_REF_GET); } @@ -1780,7 +1789,8 @@ static void drm_dp_mst_topology_get_mstb(struct drm_dp_mst_branch *mstb) save_mstb_topology_ref(mstb, DRM_DP_MST_TOPOLOGY_REF_GET); WARN_ON(kref_read(&mstb->topology_kref) == 0); kref_get(&mstb->topology_kref); - drm_dbg(mstb->mgr->dev, "mstb %p (%d)\n", mstb, kref_read(&mstb->topology_kref)); + drm_dbg(mstb->mgr->drm, "mstb %p (%d)\n", mstb, + kref_read(&mstb->topology_kref)); topology_ref_history_unlock(mstb->mgr); } @@ -1802,7 +1812,8 @@ drm_dp_mst_topology_put_mstb(struct drm_dp_mst_branch *mstb) { topology_ref_history_lock(mstb->mgr); - drm_dbg(mstb->mgr->dev, "mstb %p (%d)\n", mstb, kref_read(&mstb->topology_kref) - 1); + drm_dbg(mstb->mgr->drm, "mstb %p (%d)\n", mstb, + kref_read(&mstb->topology_kref) - 1); save_mstb_topology_ref(mstb, DRM_DP_MST_TOPOLOGY_REF_PUT); topology_ref_history_unlock(mstb->mgr); @@ -1865,7 +1876,8 @@ drm_dp_mst_topology_try_get_port(struct drm_dp_mst_port *port) topology_ref_history_lock(port->mgr); ret = kref_get_unless_zero(&port->topology_kref); if (ret) { - drm_dbg(port->mgr->dev, "port %p (%d)\n", port, kref_read(&port->topology_kref)); + drm_dbg(port->mgr->drm, "port %p (%d)\n", port, + kref_read(&port->topology_kref)); save_port_topology_ref(port, DRM_DP_MST_TOPOLOGY_REF_GET); } @@ -1892,7 +1904,8 @@ static void drm_dp_mst_topology_get_port(struct drm_dp_mst_port *port) WARN_ON(kref_read(&port->topology_kref) == 0); kref_get(&port->topology_kref); - drm_dbg(port->mgr->dev, "port %p (%d)\n", port, kref_read(&port->topology_kref)); + drm_dbg(port->mgr->drm, "port %p (%d)\n", port, + kref_read(&port->topology_kref)); save_port_topology_ref(port, DRM_DP_MST_TOPOLOGY_REF_GET); topology_ref_history_unlock(port->mgr); @@ -1913,7 +1926,8 @@ static void drm_dp_mst_topology_put_port(struct drm_dp_mst_port *port) { topology_ref_history_lock(port->mgr); - drm_dbg(port->mgr->dev, "port %p (%d)\n", port, kref_read(&port->topology_kref) - 1); + drm_dbg(port->mgr->drm, "port %p (%d)\n", port, + kref_read(&port->topology_kref) - 1); save_port_topology_ref(port, DRM_DP_MST_TOPOLOGY_REF_PUT); topology_ref_history_unlock(port->mgr); @@ -2098,7 +2112,9 @@ drm_dp_port_set_pdt(struct drm_dp_mst_port *port, u8 new_pdt, mstb = drm_dp_add_mst_branch_device(lct, rad); if (!mstb) { ret = -ENOMEM; - drm_err(mgr->dev, "Failed to create MSTB for port %p", port); + drm_err(mgr->drm, + "Failed to create MSTB for port %p", + port); goto out; } @@ -2228,7 +2244,7 @@ static void build_mst_prop_path(const struct drm_dp_mst_branch *mstb, int drm_dp_mst_connector_late_register(struct drm_connector *connector, struct drm_dp_mst_port *port) { - drm_dbg_kms(port->mgr->dev, "registering %s remote bus for %s\n", + drm_dbg_kms(port->mgr->drm, "registering %s remote bus for %s\n", port->aux.name, connector->kdev->kobj.name); port->aux.dev = connector->kdev; @@ -2248,7 +2264,7 @@ EXPORT_SYMBOL(drm_dp_mst_connector_late_register); void drm_dp_mst_connector_early_unregister(struct drm_connector *connector, struct drm_dp_mst_port *port) { - drm_dbg_kms(port->mgr->dev, "unregistering %s remote bus for %s\n", + drm_dbg_kms(port->mgr->drm, "unregistering %s remote bus for %s\n", port->aux.name, connector->kdev->kobj.name); drm_dp_aux_unregister_devnode(&port->aux); } @@ -2279,7 +2295,8 @@ drm_dp_mst_port_add_connector(struct drm_dp_mst_branch *mstb, return; error: - drm_err(mgr->dev, "Failed to create connector for port %p: %d\n", port, ret); + drm_err(mgr->drm, "Failed to create connector for port %p: %d\n", + port, ret); } /* @@ -2513,7 +2530,8 @@ drm_dp_mst_handle_conn_stat(struct drm_dp_mst_branch *mstb, if (ret == 1) { dowork = true; } else if (ret < 0) { - drm_err(mgr->dev, "Failed to change PDT for port %p: %d\n", port, ret); + drm_err(mgr->drm, "Failed to change PDT for port %p: %d\n", + port, ret); dowork = false; } @@ -2549,7 +2567,7 @@ static struct drm_dp_mst_branch *drm_dp_get_mst_branch_device(struct drm_dp_mst_ if (port->port_num == port_num) { mstb = port->mstb; if (!mstb) { - drm_err(mgr->dev, + drm_err(mgr->drm, "failed to lookup MSTB with lct %d, rad %02x\n", lct, rad[0]); goto out; @@ -2645,7 +2663,7 @@ static void drm_dp_mst_link_probe_work(struct work_struct *work) { struct drm_dp_mst_topology_mgr *mgr = container_of(work, struct drm_dp_mst_topology_mgr, work); - struct drm_device *dev = mgr->dev; + struct drm_device *dev = mgr->drm; struct drm_dp_mst_branch *mstb; int ret; bool clear_payload_id_table; @@ -2739,7 +2757,8 @@ static int drm_dp_send_sideband_msg(struct drm_dp_mst_topology_mgr *mgr, retries++; goto retry; } - drm_dbg_kms(mgr->dev, "failed to dpcd write %d %d\n", tosend, ret); + drm_dbg_kms(mgr->drm, "failed to dpcd write %d %d\n", + tosend, ret); return -EIO; } @@ -2854,7 +2873,7 @@ static void process_single_down_tx_qlock(struct drm_dp_mst_topology_mgr *mgr) struct drm_dp_sideband_msg_tx, next); ret = process_single_tx_qlock(mgr, txmsg, false); if (ret < 0) { - drm_dbg_kms(mgr->dev, "failed to send msg in q %d\n", ret); + drm_dbg_kms(mgr->drm, "failed to send msg in q %d\n", ret); list_del(&txmsg->next); txmsg->state = DRM_DP_SIDEBAND_TX_TIMEOUT; wake_up_all(&mgr->tx_waitq); @@ -2887,7 +2906,7 @@ drm_dp_dump_link_address(const struct drm_dp_mst_topology_mgr *mgr, for (i = 0; i < reply->nports; i++) { port_reply = &reply->ports[i]; - drm_dbg_kms(mgr->dev, + drm_dbg_kms(mgr->drm, "port %d: input %d, pdt: %d, pn: %d, dpcd_rev: %02x, mcs: %d, ddps: %d, ldps %d, sdp %d/%d\n", i, port_reply->input_port, @@ -2924,17 +2943,18 @@ static int drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, /* FIXME: Actually do some real error handling here */ ret = drm_dp_mst_wait_tx_reply(mstb, txmsg); if (ret <= 0) { - drm_err(mgr->dev, "Sending link address failed with %d\n", ret); + drm_err(mgr->drm, "Sending link address failed with %d\n", + ret); goto out; } if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) { - drm_err(mgr->dev, "link address NAK received\n"); + drm_err(mgr->drm, "link address NAK received\n"); ret = -EIO; goto out; } reply = &txmsg->reply.u.link_addr; - drm_dbg_kms(mgr->dev, "link address reply: %d\n", reply->nports); + drm_dbg_kms(mgr->drm, "link address reply: %d\n", reply->nports); drm_dp_dump_link_address(mgr, reply); ret = drm_dp_check_mstb_guid(mstb, reply->guid); @@ -2942,13 +2962,13 @@ static int drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, char buf[64]; drm_dp_mst_rad_to_str(mstb->rad, mstb->lct, buf, sizeof(buf)); - drm_err(mgr->dev, "GUID check on %s failed: %d\n", buf, ret); + drm_err(mgr->drm, "GUID check on %s failed: %d\n", buf, ret); goto out; } for (i = 0; i < reply->nports; i++) { port_mask |= BIT(reply->ports[i].port_number); - ret = drm_dp_mst_handle_link_address_port(mstb, mgr->dev, + ret = drm_dp_mst_handle_link_address_port(mstb, mgr->drm, &reply->ports[i]); if (ret == 1) changed = true; @@ -2966,7 +2986,8 @@ static int drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, if (port_mask & BIT(port->port_num)) continue; - drm_dbg_kms(mgr->dev, "port %d was not in link address, removing\n", + drm_dbg_kms(mgr->drm, + "port %d was not in link address, removing\n", port->port_num); list_del(&port->next); drm_dp_mst_topology_put_port(port); @@ -2999,7 +3020,7 @@ drm_dp_send_clear_payload_id_table(struct drm_dp_mst_topology_mgr *mgr, ret = drm_dp_mst_wait_tx_reply(mstb, txmsg); if (ret > 0 && txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) - drm_dbg_kms(mgr->dev, "clear payload table id nak received\n"); + drm_dbg_kms(mgr->drm, "clear payload table id nak received\n"); kfree(txmsg); } @@ -3028,12 +3049,14 @@ drm_dp_send_enum_path_resources(struct drm_dp_mst_topology_mgr *mgr, path_res = &txmsg->reply.u.path_resources; if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) { - drm_dbg_kms(mgr->dev, "enum path resources nak received\n"); + drm_dbg_kms(mgr->drm, + "enum path resources nak received\n"); } else { if (port->port_num != path_res->port_number) DRM_ERROR("got incorrect port in response\n"); - drm_dbg_kms(mgr->dev, "enum path resources %d: %d %d\n", + drm_dbg_kms(mgr->drm, + "enum path resources %d: %d %d\n", path_res->port_number, path_res->full_payload_bw_number, path_res->avail_payload_bw_number); @@ -3238,7 +3261,8 @@ int drm_dp_send_query_stream_enc_status(struct drm_dp_mst_topology_mgr *mgr, if (ret < 0) { goto out; } else if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) { - drm_dbg_kms(mgr->dev, "query encryption status nak received\n"); + drm_dbg_kms(mgr->drm, + "query encryption status nak received\n"); ret = -ENXIO; goto out; } @@ -3280,7 +3304,7 @@ static int drm_dp_destroy_payload_step1(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_topology_state *mst_state, struct drm_dp_mst_atomic_payload *payload) { - drm_dbg_kms(mgr->dev, "\n"); + drm_dbg_kms(mgr->drm, "\n"); /* it's okay for these to fail */ drm_dp_payload_send_msg(mgr, payload->port, payload->vcpi, 0); @@ -3310,7 +3334,7 @@ int drm_dp_add_payload_part1(struct drm_dp_mst_topology_mgr *mgr, port = drm_dp_mst_topology_get_port_validated(mgr, payload->port); if (!port) { - drm_dbg_kms(mgr->dev, + drm_dbg_kms(mgr->drm, "VCPI %d for port %p not in topology, not creating a payload\n", payload->vcpi, payload->port); payload->vc_start_slot = -1; @@ -3325,7 +3349,8 @@ int drm_dp_add_payload_part1(struct drm_dp_mst_topology_mgr *mgr, ret = drm_dp_create_payload_step1(mgr, payload); drm_dp_mst_topology_put_port(port); if (ret < 0) { - drm_warn(mgr->dev, "Failed to create MST payload for port %p: %d\n", + drm_warn(mgr->drm, + "Failed to create MST payload for port %p: %d\n", payload->port, ret); payload->vc_start_slot = -1; return ret; @@ -3368,7 +3393,8 @@ void drm_dp_remove_payload(struct drm_dp_mst_topology_mgr *mgr, if (send_remove) drm_dp_destroy_payload_step1(mgr, mst_state, new_payload); else - drm_dbg_kms(mgr->dev, "Payload for VCPI %d not in topology, not sending remove\n", + drm_dbg_kms(mgr->drm, + "Payload for VCPI %d not in topology, not sending remove\n", new_payload->vcpi); list_for_each_entry(pos, &mst_state->payloads, next) { @@ -3413,10 +3439,12 @@ int drm_dp_add_payload_part2(struct drm_dp_mst_topology_mgr *mgr, ret = drm_dp_create_payload_step2(mgr, payload); if (ret < 0) { if (!payload->delete) - drm_err(mgr->dev, "Step 2 of creating MST payload for %p failed: %d\n", + drm_err(mgr->drm, + "Step 2 of creating MST payload for %p failed: %d\n", payload->port, ret); else - drm_dbg_kms(mgr->dev, "Step 2 of removing MST payload for %p failed: %d\n", + drm_dbg_kms(mgr->drm, + "Step 2 of removing MST payload for %p failed: %d\n", payload->port, ret); } @@ -3452,7 +3480,8 @@ static int drm_dp_send_dpcd_read(struct drm_dp_mst_topology_mgr *mgr, goto fail_free; if (txmsg->reply.reply_type == 1) { - drm_dbg_kms(mgr->dev, "mstb %p port %d: DPCD read on addr 0x%x for %d bytes NAKed\n", + drm_dbg_kms(mgr->drm, + "mstb %p port %d: DPCD read on addr 0x%x for %d bytes NAKed\n", mstb, port->port_num, offset, size); ret = -EIO; goto fail_free; @@ -3559,7 +3588,8 @@ int drm_dp_get_vc_payload_bw(const struct drm_dp_mst_topology_mgr *mgr, int link_rate, int link_lane_count) { if (link_rate == 0 || link_lane_count == 0) - drm_dbg_kms(mgr->dev, "invalid link rate/lane count: (%d / %d)\n", + drm_dbg_kms(mgr->drm, + "invalid link rate/lane count: (%d / %d)\n", link_rate, link_lane_count); /* See DP v2.0 2.6.4.2, VCPayload_Bandwidth_for_OneTimeSlotPer_MTP_Allocation */ @@ -3614,7 +3644,8 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms /* get dpcd info */ ret = drm_dp_read_dpcd_caps(mgr->aux, mgr->dpcd); if (ret < 0) { - drm_dbg_kms(mgr->dev, "%s: failed to read DPCD, ret %d\n", + drm_dbg_kms(mgr->drm, + "%s: failed to read DPCD, ret %d\n", mgr->aux->name, ret); goto out_unlock; } @@ -3734,7 +3765,8 @@ int drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr, goto out_fail; if (drm_dp_read_dpcd_caps(mgr->aux, mgr->dpcd) < 0) { - drm_dbg_kms(mgr->dev, "dpcd read failed - undocked during suspend?\n"); + drm_dbg_kms(mgr->drm, + "dpcd read failed - undocked during suspend?\n"); goto out_fail; } @@ -3743,20 +3775,23 @@ int drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr, DP_UP_REQ_EN | DP_UPSTREAM_IS_SRC); if (ret < 0) { - drm_dbg_kms(mgr->dev, "mst write failed - undocked during suspend?\n"); + drm_dbg_kms(mgr->drm, + "mst write failed - undocked during suspend?\n"); goto out_fail; } /* Some hubs forget their guids after they resume */ ret = drm_dp_dpcd_read(mgr->aux, DP_GUID, guid, 16); if (ret != 16) { - drm_dbg_kms(mgr->dev, "dpcd read failed - undocked during suspend?\n"); + drm_dbg_kms(mgr->drm, + "dpcd read failed - undocked during suspend?\n"); goto out_fail; } ret = drm_dp_check_mstb_guid(mgr->mst_primary, guid); if (ret) { - drm_dbg_kms(mgr->dev, "check mstb failed - undocked during suspend?\n"); + drm_dbg_kms(mgr->drm, + "check mstb failed - undocked during suspend?\n"); goto out_fail; } @@ -3769,7 +3804,7 @@ int drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr, mutex_unlock(&mgr->lock); if (sync) { - drm_dbg_kms(mgr->dev, + drm_dbg_kms(mgr->drm, "Waiting for link probe work to finish re-syncing topology...\n"); flush_work(&mgr->work); } @@ -3803,7 +3838,8 @@ drm_dp_get_one_sb_msg(struct drm_dp_mst_topology_mgr *mgr, bool up, len = min(mgr->max_dpcd_transaction_bytes, 16); ret = drm_dp_dpcd_read(mgr->aux, basereg, replyblock, len); if (ret != len) { - drm_dbg_kms(mgr->dev, "failed to read DPCD down rep %d %d\n", len, ret); + drm_dbg_kms(mgr->drm, "failed to read DPCD down rep %d %d\n", + len, ret); return false; } @@ -3811,7 +3847,7 @@ drm_dp_get_one_sb_msg(struct drm_dp_mst_topology_mgr *mgr, bool up, if (ret == false) { print_hex_dump(KERN_DEBUG, "failed hdr", DUMP_PREFIX_NONE, 16, 1, replyblock, len, false); - drm_dbg_kms(mgr->dev, "ERROR: failed header\n"); + drm_dbg_kms(mgr->drm, "ERROR: failed header\n"); return false; } @@ -3819,20 +3855,24 @@ drm_dp_get_one_sb_msg(struct drm_dp_mst_topology_mgr *mgr, bool up, /* Caller is responsible for giving back this reference */ *mstb = drm_dp_get_mst_branch_device(mgr, hdr.lct, hdr.rad); if (!*mstb) { - drm_dbg_kms(mgr->dev, "Got MST reply from unknown device %d\n", hdr.lct); + drm_dbg_kms(mgr->drm, + "Got MST reply from unknown device %d\n", + hdr.lct); return false; } } if (!drm_dp_sideband_msg_set_header(msg, &hdr, hdrlen)) { - drm_dbg_kms(mgr->dev, "sideband msg set header failed %d\n", replyblock[0]); + drm_dbg_kms(mgr->drm, "sideband msg set header failed %d\n", + replyblock[0]); return false; } replylen = min(msg->curchunk_len, (u8)(len - hdrlen)); ret = drm_dp_sideband_append_payload(msg, replyblock + hdrlen, replylen); if (!ret) { - drm_dbg_kms(mgr->dev, "sideband msg build failed %d\n", replyblock[0]); + drm_dbg_kms(mgr->drm, "sideband msg build failed %d\n", + replyblock[0]); return false; } @@ -3843,14 +3883,16 @@ drm_dp_get_one_sb_msg(struct drm_dp_mst_topology_mgr *mgr, bool up, ret = drm_dp_dpcd_read(mgr->aux, basereg + curreply, replyblock, len); if (ret != len) { - drm_dbg_kms(mgr->dev, "failed to read a chunk (len %d, ret %d)\n", + drm_dbg_kms(mgr->drm, + "failed to read a chunk (len %d, ret %d)\n", len, ret); return false; } ret = drm_dp_sideband_append_payload(msg, replyblock, len); if (!ret) { - drm_dbg_kms(mgr->dev, "failed to build sideband msg\n"); + drm_dbg_kms(mgr->drm, + "failed to build sideband msg\n"); return false; } @@ -3884,7 +3926,8 @@ static int drm_dp_mst_handle_down_rep(struct drm_dp_mst_topology_mgr *mgr) struct drm_dp_sideband_msg_hdr *hdr; hdr = &msg->initial_hdr; - drm_dbg_kms(mgr->dev, "Got MST reply with no msg %p %d %d %02x %02x\n", + drm_dbg_kms(mgr->drm, + "Got MST reply with no msg %p %d %d %02x %02x\n", mstb, hdr->seqno, hdr->lct, hdr->rad[0], msg->msg[0]); goto out_clear_reply; } @@ -3892,7 +3935,7 @@ static int drm_dp_mst_handle_down_rep(struct drm_dp_mst_topology_mgr *mgr) drm_dp_sideband_parse_reply(mgr, msg, &txmsg->reply); if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) { - drm_dbg_kms(mgr->dev, + drm_dbg_kms(mgr->drm, "Got NAK reply: req 0x%02x (%s), reason 0x%02x (%s), nak data 0x%02x\n", txmsg->reply.req_type, drm_dp_mst_req_type_str(txmsg->reply.req_type), @@ -3946,7 +3989,9 @@ drm_dp_mst_process_up_req(struct drm_dp_mst_topology_mgr *mgr, } if (!mstb) { - drm_dbg_kms(mgr->dev, "Got MST reply from unknown device %d\n", hdr->lct); + drm_dbg_kms(mgr->drm, + "Got MST reply from unknown device %d\n", + hdr->lct); return false; } @@ -3990,7 +4035,7 @@ static void drm_dp_mst_up_req_work(struct work_struct *work) mutex_unlock(&mgr->probe_lock); if (send_hotplug) - drm_kms_helper_hotplug_event(mgr->dev); + drm_kms_helper_hotplug_event(mgr->drm); } static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr) @@ -4013,7 +4058,8 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr) if (up_req->msg.req_type != DP_CONNECTION_STATUS_NOTIFY && up_req->msg.req_type != DP_RESOURCE_STATUS_NOTIFY) { - drm_dbg_kms(mgr->dev, "Received unknown up req type, ignoring: %x\n", + drm_dbg_kms(mgr->drm, + "Received unknown up req type, ignoring: %x\n", up_req->msg.req_type); kfree(up_req); goto out; @@ -4026,7 +4072,8 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr) const struct drm_dp_connection_status_notify *conn_stat = &up_req->msg.u.conn_stat; - drm_dbg_kms(mgr->dev, "Got CSN: pn: %d ldps:%d ddps: %d mcs: %d ip: %d pdt: %d\n", + drm_dbg_kms(mgr->drm, + "Got CSN: pn: %d ldps:%d ddps: %d mcs: %d ip: %d pdt: %d\n", conn_stat->port_number, conn_stat->legacy_device_plug_status, conn_stat->displayport_device_plug_status, @@ -4037,7 +4084,7 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr) const struct drm_dp_resource_status_notify *res_stat = &up_req->msg.u.resource_stat; - drm_dbg_kms(mgr->dev, "Got RSN: pn: %d avail_pbn %d\n", + drm_dbg_kms(mgr->drm, "Got RSN: pn: %d avail_pbn %d\n", res_stat->port_number, res_stat->available_pbn); } @@ -4303,8 +4350,8 @@ int drm_dp_atomic_find_time_slots(struct drm_atomic_state *state, * releasing and allocating the same timeslot allocation, * which is an error */ - if (drm_WARN_ON(mgr->dev, payload->delete)) { - drm_err(mgr->dev, + if (drm_WARN_ON(mgr->drm, payload->delete)) { + drm_err(mgr->drm, "cannot allocate and release time slots on [MST PORT:%p] in the same state\n", port); return -EINVAL; @@ -4313,10 +4360,12 @@ int drm_dp_atomic_find_time_slots(struct drm_atomic_state *state, req_slots = DIV_ROUND_UP(pbn, topology_state->pbn_div); - drm_dbg_atomic(mgr->dev, "[CONNECTOR:%d:%s] [MST PORT:%p] TU %d -> %d\n", + drm_dbg_atomic(mgr->drm, + "[CONNECTOR:%d:%s] [MST PORT:%p] TU %d -> %d\n", port->connector->base.id, port->connector->name, port, prev_slots, req_slots); - drm_dbg_atomic(mgr->dev, "[CONNECTOR:%d:%s] [MST PORT:%p] PBN %d -> %d\n", + drm_dbg_atomic(mgr->drm, + "[CONNECTOR:%d:%s] [MST PORT:%p] PBN %d -> %d\n", port->connector->base.id, port->connector->name, port, prev_bw, pbn); @@ -4402,7 +4451,8 @@ int drm_dp_atomic_release_time_slots(struct drm_atomic_state *state, payload = drm_atomic_get_mst_payload_state(topology_state, port); if (WARN_ON(!payload)) { - drm_err(mgr->dev, "No payload for [MST PORT:%p] found in mst state %p\n", + drm_err(mgr->drm, + "No payload for [MST PORT:%p] found in mst state %p\n", port, &topology_state->base); return -EINVAL; } @@ -4410,7 +4460,8 @@ int drm_dp_atomic_release_time_slots(struct drm_atomic_state *state, if (new_conn_state->crtc) return 0; - drm_dbg_atomic(mgr->dev, "[MST PORT:%p] TU %d -> 0\n", port, payload->time_slots); + drm_dbg_atomic(mgr->drm, "[MST PORT:%p] TU %d -> 0\n", port, + payload->time_slots); if (!payload->delete) { payload->pbn = 0; payload->delete = true; @@ -4609,14 +4660,16 @@ static int drm_dp_dpcd_write_payload(struct drm_dp_mst_topology_mgr *mgr, ret = drm_dp_dpcd_write(mgr->aux, DP_PAYLOAD_ALLOCATE_SET, payload_alloc, 3); if (ret != 3) { - drm_dbg_kms(mgr->dev, "failed to write payload allocation %d\n", ret); + drm_dbg_kms(mgr->drm, + "failed to write payload allocation %d\n", ret); goto fail; } retry: ret = drm_dp_dpcd_readb(mgr->aux, DP_PAYLOAD_TABLE_UPDATE_STATUS, &status); if (ret < 0) { - drm_dbg_kms(mgr->dev, "failed to read payload table status %d\n", ret); + drm_dbg_kms(mgr->drm, + "failed to read payload table status %d\n", ret); goto fail; } @@ -4626,7 +4679,8 @@ static int drm_dp_dpcd_write_payload(struct drm_dp_mst_topology_mgr *mgr, usleep_range(10000, 20000); goto retry; } - drm_dbg_kms(mgr->dev, "status not set after read payload table status %d\n", + drm_dbg_kms(mgr->drm, + "status not set after read payload table status %d\n", status); ret = -EINVAL; goto fail; @@ -4674,7 +4728,8 @@ int drm_dp_check_act_status(struct drm_dp_mst_topology_mgr *mgr) status & DP_PAYLOAD_ACT_HANDLED || status < 0, 200, timeout_ms * USEC_PER_MSEC); if (ret < 0 && status >= 0) { - drm_err(mgr->dev, "Failed to get ACT after %dms, last status: %02x\n", + drm_err(mgr->drm, + "Failed to get ACT after %dms, last status: %02x\n", timeout_ms, status); return -EINVAL; } else if (status < 0) { @@ -4682,7 +4737,9 @@ int drm_dp_check_act_status(struct drm_dp_mst_topology_mgr *mgr) * Failure here isn't unexpected - the hub may have * just been unplugged */ - drm_dbg_kms(mgr->dev, "Failed to read payload table status: %d\n", status); + drm_dbg_kms(mgr->drm, + "Failed to read payload table status: %d\n", + status); return status; } @@ -5019,7 +5076,7 @@ static void drm_dp_delayed_destroy_work(struct work_struct *work) } while (go_again); if (send_hotplug) - drm_kms_helper_hotplug_event(mgr->dev); + drm_kms_helper_hotplug_event(mgr->drm); } static struct drm_private_state * @@ -5130,11 +5187,12 @@ drm_dp_mst_atomic_check_mstb_bw_limit(struct drm_dp_mst_branch *mstb, return 0; if (mstb->port_parent) - drm_dbg_atomic(mstb->mgr->dev, + drm_dbg_atomic(mstb->mgr->drm, "[MSTB:%p] [MST PORT:%p] Checking bandwidth limits on [MSTB:%p]\n", mstb->port_parent->parent, mstb->port_parent, mstb); else - drm_dbg_atomic(mstb->mgr->dev, "[MSTB:%p] Checking bandwidth limits\n", mstb); + drm_dbg_atomic(mstb->mgr->drm, + "[MSTB:%p] Checking bandwidth limits\n", mstb); list_for_each_entry(port, &mstb->ports, next) { ret = drm_dp_mst_atomic_check_port_bw_limit(port, state); @@ -5167,7 +5225,7 @@ drm_dp_mst_atomic_check_port_bw_limit(struct drm_dp_mst_port *port, * the branch device still reports it as attached (PDT != NONE). */ if (!port->full_pbn) { - drm_dbg_atomic(port->mgr->dev, + drm_dbg_atomic(port->mgr->drm, "[MSTB:%p] [MST PORT:%p] no BW available for the port\n", port->parent, port); return -EINVAL; @@ -5182,13 +5240,14 @@ drm_dp_mst_atomic_check_port_bw_limit(struct drm_dp_mst_port *port, } if (pbn_used > port->full_pbn) { - drm_dbg_atomic(port->mgr->dev, + drm_dbg_atomic(port->mgr->drm, "[MSTB:%p] [MST PORT:%p] required PBN of %d exceeds port limit of %d\n", port->parent, port, pbn_used, port->full_pbn); return -ENOSPC; } - drm_dbg_atomic(port->mgr->dev, "[MSTB:%p] [MST PORT:%p] uses %d out of %d PBN\n", + drm_dbg_atomic(port->mgr->drm, + "[MSTB:%p] [MST PORT:%p] uses %d out of %d PBN\n", port->parent, port, pbn_used, port->full_pbn); return pbn_used; @@ -5204,24 +5263,26 @@ drm_dp_mst_atomic_check_payload_alloc_limits(struct drm_dp_mst_topology_mgr *mgr list_for_each_entry(payload, &mst_state->payloads, next) { /* Releasing payloads is always OK-even if the port is gone */ if (payload->delete) { - drm_dbg_atomic(mgr->dev, "[MST PORT:%p] releases all time slots\n", + drm_dbg_atomic(mgr->drm, + "[MST PORT:%p] releases all time slots\n", payload->port); continue; } - drm_dbg_atomic(mgr->dev, "[MST PORT:%p] requires %d time slots\n", + drm_dbg_atomic(mgr->drm, + "[MST PORT:%p] requires %d time slots\n", payload->port, payload->time_slots); avail_slots -= payload->time_slots; if (avail_slots < 0) { - drm_dbg_atomic(mgr->dev, + drm_dbg_atomic(mgr->drm, "[MST PORT:%p] not enough time slots in mst state %p (avail=%d)\n", payload->port, mst_state, avail_slots + payload->time_slots); return -ENOSPC; } if (++payload_count > mgr->max_payloads) { - drm_dbg_atomic(mgr->dev, + drm_dbg_atomic(mgr->drm, "[MST MGR:%p] state %p has too many payloads (max=%d)\n", mgr, mst_state, mgr->max_payloads); return -EINVAL; @@ -5230,7 +5291,8 @@ drm_dp_mst_atomic_check_payload_alloc_limits(struct drm_dp_mst_topology_mgr *mgr /* Assign a VCPI */ if (!payload->vcpi) { payload->vcpi = ffz(mst_state->payload_mask) + 1; - drm_dbg_atomic(mgr->dev, "[MST PORT:%p] assigned VCPI #%d\n", + drm_dbg_atomic(mgr->drm, + "[MST PORT:%p] assigned VCPI #%d\n", payload->port, payload->vcpi); mst_state->payload_mask |= BIT(payload->vcpi - 1); } @@ -5239,7 +5301,8 @@ drm_dp_mst_atomic_check_payload_alloc_limits(struct drm_dp_mst_topology_mgr *mgr if (!payload_count) mst_state->pbn_div = 0; - drm_dbg_atomic(mgr->dev, "[MST MGR:%p] mst state %p TU pbn_div=%d avail=%d used=%d\n", + drm_dbg_atomic(mgr->drm, + "[MST MGR:%p] mst state %p TU pbn_div=%d avail=%d used=%d\n", mgr, mst_state, mst_state->pbn_div, avail_slots, mst_state->total_avail_slots - avail_slots); @@ -5298,7 +5361,8 @@ int drm_dp_mst_add_affected_dsc_crtcs(struct drm_atomic_state *state, struct drm if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state); - drm_dbg_atomic(mgr->dev, "[MST MGR:%p] Setting mode_changed flag on CRTC %p\n", + drm_dbg_atomic(mgr->drm, + "[MST MGR:%p] Setting mode_changed flag on CRTC %p\n", mgr, crtc); crtc_state->mode_changed = true; @@ -5532,7 +5596,7 @@ int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr, INIT_WORK(&mgr->delayed_destroy_work, drm_dp_delayed_destroy_work); INIT_WORK(&mgr->up_req_work, drm_dp_mst_up_req_work); init_waitqueue_head(&mgr->tx_waitq); - mgr->dev = dev; + mgr->drm = dev; mgr->aux = aux; mgr->max_dpcd_transaction_bytes = max_dpcd_transaction_bytes; mgr->max_payloads = max_payloads; @@ -5569,7 +5633,7 @@ void drm_dp_mst_topology_mgr_destroy(struct drm_dp_mst_topology_mgr *mgr) destroy_workqueue(mgr->delayed_destroy_wq); mgr->delayed_destroy_wq = NULL; } - mgr->dev = NULL; + mgr->drm = NULL; mgr->aux = NULL; drm_atomic_private_obj_fini(&mgr->base); mgr->funcs = NULL; @@ -5733,7 +5797,8 @@ static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter, } else if (remote_i2c_write_ok(msgs, num)) { ret = drm_dp_mst_i2c_write(mstb, port, msgs, num); } else { - drm_dbg_kms(mgr->dev, "Unsupported I2C transaction for MST device\n"); + drm_dbg_kms(mgr->drm, + "Unsupported I2C transaction for MST device\n"); ret = -EIO; } @@ -5763,7 +5828,7 @@ static const struct i2c_algorithm drm_dp_mst_i2c_algo = { static int drm_dp_mst_register_i2c_bus(struct drm_dp_mst_port *port) { struct drm_dp_aux *aux = &port->aux; - struct device *parent_dev = port->mgr->dev->dev; + struct device *parent_dev = port->mgr->drm->dev; aux->ddc.algo = &drm_dp_mst_i2c_algo; aux->ddc.algo_data = aux; diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index b7cc69e5c2c3..31a1ac69dbcf 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -46,11 +46,11 @@ static int intel_conn_to_vcpi(struct drm_atomic_state *state, drm_modeset_lock(&mgr->base.lock, state->acquire_ctx); mst_state = to_drm_dp_mst_topology_state(mgr->base.state); payload = drm_atomic_get_mst_payload_state(mst_state, connector->port); - if (drm_WARN_ON(mgr->dev, !payload)) + if (drm_WARN_ON(mgr->drm, !payload)) goto out; vcpi = payload->vcpi; - if (drm_WARN_ON(mgr->dev, vcpi < 0)) { + if (drm_WARN_ON(mgr->drm, vcpi < 0)) { vcpi = 0; goto out; } diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 8c04b5f554ea..a6f6319c92b1 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -1463,7 +1463,7 @@ nv50_mstm_init(struct nouveau_encoder *outp, bool runtime) mutex_unlock(&outp->dp.hpd_irq_lock); if (ret == -1) - drm_kms_helper_hotplug_event(mstm->mgr.dev); + drm_kms_helper_hotplug_event(mstm->mgr.drm); } static void diff --git a/include/drm/display/drm_dp_mst_helper.h b/include/drm/display/drm_dp_mst_helper.h index ed5c9660563c..40fa95c7b07c 100644 --- a/include/drm/display/drm_dp_mst_helper.h +++ b/include/drm/display/drm_dp_mst_helper.h @@ -626,9 +626,9 @@ struct drm_dp_mst_topology_mgr { struct drm_private_obj base; /** - * @dev: device pointer for adding i2c devices etc. + * @drm: device pointer for adding i2c devices etc. */ - struct drm_device *dev; + struct drm_device *drm; /** * @cbs: callbacks for connector addition and destruction. */ From patchwork Thu Jul 13 08:23:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311990 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3E4AC001B0 for ; Thu, 13 Jul 2023 12:54:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 65FD910E691; Thu, 13 Jul 2023 12:53:57 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E9E210E633 for ; Thu, 13 Jul 2023 08:26:27 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrce-0005sr-VU; Thu, 13 Jul 2023 10:24:25 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrce-00E4jf-4c; Thu, 13 Jul 2023 10:24:24 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrcd-004VhC-1w; Thu, 13 Jul 2023 10:24:23 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 08/17] drm/encoder: Rename struct drm_encoder::dev to drm Date: Thu, 13 Jul 2023 10:23:59 +0200 Message-Id: <20230713082408.2266984-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=419928; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ZFrIXXWPn6b6ckh71ASCJieLyUDMfseUuXwtnftQXZ8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7SRKRZvhQxm/pOG+SqHmSnKkTy6Y9FHKrGU9 xHegmq5S3aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0kQAKCRCPgPtYfRL+ Tlr3B/91ONXViULZwvbgZ7l82yWOi6zUzoAkc98mKtg9XnETDHW0nJAHpLn23RaXoYneeZNO1f8 RdgY2JnmJgF3bDUPmjELv3e3DsyjWy4MmeEcSzMBsgCXgG+06n7oqYw9w0+XqQjKrVj6qoAFDUD 7HGPCrJthVFsehetFQmle/z1t2vlpHwxs+tuke3CWBTw1ZS8NiYSjXH5nfBSOjYGVPYkbLucX/y tCTZT2EgdlsEdsE0fn8DJcwcFtiGzSmdnXHlPXnsO2E2mJJ1Q2lSxfrFtlbeFdVHl7WzGSv/fRm Ij3iw8GZMchvEFUzN7vmzJDRGxr14X5t5MejCBkbjxohi/cp X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-Mailman-Approved-At: Thu, 13 Jul 2023 12:53:45 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- .../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c | 8 +- drivers/gpu/drm/amd/amdgpu/atombios_dp.c | 2 +- .../gpu/drm/amd/amdgpu/atombios_encoders.c | 30 +-- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 24 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 24 +- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 34 +-- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 24 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- drivers/gpu/drm/arm/malidp_mw.c | 2 +- drivers/gpu/drm/bridge/tc358775.c | 2 +- drivers/gpu/drm/drm_atomic.c | 2 +- drivers/gpu/drm/drm_atomic_helper.c | 19 +- drivers/gpu/drm/drm_bridge.c | 2 +- drivers/gpu/drm/drm_crtc_helper.c | 4 +- drivers/gpu/drm/drm_encoder.c | 8 +- drivers/gpu/drm/drm_mode_config.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 4 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_crt.c | 4 +- drivers/gpu/drm/gma500/cdv_intel_dp.c | 30 +-- drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 4 +- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 12 +- drivers/gpu/drm/gma500/oaktrail_hdmi.c | 4 +- drivers/gpu/drm/gma500/oaktrail_lvds.c | 8 +- drivers/gpu/drm/gma500/psb_intel_lvds.c | 12 +- drivers/gpu/drm/gma500/psb_intel_sdvo.c | 20 +- .../gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 2 +- drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 2 +- drivers/gpu/drm/i2c/ch7006_drv.c | 12 +- drivers/gpu/drm/i915/display/g4x_dp.c | 32 +-- drivers/gpu/drm/i915/display/g4x_hdmi.c | 26 +-- drivers/gpu/drm/i915/display/icl_dsi.c | 73 +++--- drivers/gpu/drm/i915/display/intel_audio.c | 34 +-- drivers/gpu/drm/i915/display/intel_bios.c | 2 +- drivers/gpu/drm/i915/display/intel_crt.c | 24 +- drivers/gpu/drm/i915/display/intel_cx0_phy.c | 28 +-- drivers/gpu/drm/i915/display/intel_ddi.c | 208 +++++++++--------- .../drm/i915/display/intel_ddi_buf_trans.c | 6 +- drivers/gpu/drm/i915/display/intel_display.c | 8 +- .../drm/i915/display/intel_display_debugfs.c | 2 +- .../i915/display/intel_display_power_well.c | 2 +- .../drm/i915/display/intel_display_types.h | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 62 +++--- drivers/gpu/drm/i915/display/intel_dp_aux.c | 10 +- drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 24 +- drivers/gpu/drm/i915/display/intel_dp_mst.c | 20 +- drivers/gpu/drm/i915/display/intel_dpio_phy.c | 26 +-- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 2 +- drivers/gpu/drm/i915/display/intel_dsi_vbt.c | 24 +- drivers/gpu/drm/i915/display/intel_dvo.c | 10 +- drivers/gpu/drm/i915/display/intel_fdi.c | 2 +- drivers/gpu/drm/i915/display/intel_hdcp.c | 6 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 118 +++++----- drivers/gpu/drm/i915/display/intel_hotplug.c | 2 +- .../gpu/drm/i915/display/intel_hotplug_irq.c | 34 +-- .../gpu/drm/i915/display/intel_load_detect.c | 4 +- drivers/gpu/drm/i915/display/intel_lspcon.c | 8 +- drivers/gpu/drm/i915/display/intel_lvds.c | 16 +- .../drm/i915/display/intel_modeset_setup.c | 6 +- drivers/gpu/drm/i915/display/intel_opregion.c | 2 +- drivers/gpu/drm/i915/display/intel_pps.c | 6 +- drivers/gpu/drm/i915/display/intel_psr.c | 4 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 46 ++-- drivers/gpu/drm/i915/display/intel_snps_phy.c | 10 +- drivers/gpu/drm/i915/display/intel_tc.c | 30 +-- drivers/gpu/drm/i915/display/intel_tv.c | 12 +- drivers/gpu/drm/i915/display/vlv_dsi.c | 48 ++-- drivers/gpu/drm/i915/display/vlv_dsi_pll.c | 26 +-- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 2 +- drivers/gpu/drm/logicvc/logicvc_interface.c | 2 +- drivers/gpu/drm/loongson/lsdc_output_7a1000.c | 4 +- drivers/gpu/drm/loongson/lsdc_output_7a2000.c | 12 +- drivers/gpu/drm/mediatek/mtk_hdmi.c | 4 +- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 28 +-- .../drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 2 +- .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 4 +- .../drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 2 +- .../gpu/drm/msm/disp/mdp4/mdp4_dsi_encoder.c | 2 +- .../gpu/drm/msm/disp/mdp4/mdp4_dtv_encoder.c | 4 +- .../gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c | 10 +- .../gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c | 13 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_encoder.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/dac.c | 24 +- drivers/gpu/drm/nouveau/dispnv04/dfp.c | 22 +- drivers/gpu/drm/nouveau/dispnv04/disp.c | 2 +- .../gpu/drm/nouveau/dispnv04/tvmodesnv17.c | 6 +- drivers/gpu/drm/nouveau/dispnv04/tvnv04.c | 8 +- drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 26 +-- drivers/gpu/drm/nouveau/dispnv50/disp.c | 48 ++-- drivers/gpu/drm/nouveau/nouveau_backlight.c | 16 +- drivers/gpu/drm/nouveau/nouveau_dp.c | 4 +- drivers/gpu/drm/omapdrm/omap_encoder.c | 2 +- drivers/gpu/drm/radeon/atombios_dp.c | 4 +- drivers/gpu/drm/radeon/atombios_encoders.c | 56 ++--- drivers/gpu/drm/radeon/cik.c | 2 +- drivers/gpu/drm/radeon/dce3_1_afmt.c | 12 +- drivers/gpu/drm/radeon/dce6_afmt.c | 10 +- drivers/gpu/drm/radeon/evergreen.c | 2 +- drivers/gpu/drm/radeon/evergreen_hdmi.c | 22 +- drivers/gpu/drm/radeon/r600.c | 2 +- drivers/gpu/drm/radeon/r600_hdmi.c | 18 +- drivers/gpu/drm/radeon/radeon_atombios.c | 14 +- drivers/gpu/drm/radeon/radeon_audio.c | 8 +- drivers/gpu/drm/radeon/radeon_combios.c | 22 +- drivers/gpu/drm/radeon/radeon_connectors.c | 4 +- drivers/gpu/drm/radeon/radeon_encoders.c | 16 +- .../gpu/drm/radeon/radeon_legacy_encoders.c | 66 +++--- drivers/gpu/drm/radeon/radeon_legacy_tv.c | 12 +- drivers/gpu/drm/radeon/rs600.c | 2 +- .../drm/renesas/rcar-du/rcar_du_writeback.c | 2 +- .../gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 4 +- drivers/gpu/drm/solomon/ssd130x.c | 4 +- drivers/gpu/drm/sti/sti_tvout.c | 2 +- drivers/gpu/drm/stm/ltdc.c | 8 +- drivers/gpu/drm/sun4i/sun4i_tcon.c | 6 +- drivers/gpu/drm/vc4/vc4_dpi.c | 8 +- drivers/gpu/drm/vc4/vc4_dsi.c | 2 +- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- drivers/gpu/drm/vc4/vc4_txp.c | 2 +- drivers/gpu/drm/vc4/vc4_vec.c | 6 +- include/drm/drm_encoder.h | 4 +- 124 files changed, 950 insertions(+), 945 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c index d8b446a64b5b..4ba7c8f45181 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c @@ -381,7 +381,7 @@ static void amdgpu_get_native_mode(struct drm_connector *connector) static struct drm_display_mode * amdgpu_connector_lcd_native_mode(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct drm_display_mode *mode = NULL; struct drm_display_mode *native_mode = &amdgpu_encoder->native_mode; @@ -419,7 +419,7 @@ amdgpu_connector_lcd_native_mode(struct drm_encoder *encoder) static void amdgpu_connector_add_common_modes(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct drm_display_mode *mode = NULL; struct drm_display_mode *native_mode = &amdgpu_encoder->native_mode; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c index 3aaeed2d3562..b72c4eafd1fd 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c @@ -61,7 +61,7 @@ amdgpu_link_encoder_connector(struct drm_device *dev) void amdgpu_encoder_set_active_device(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct drm_connector *connector; struct drm_connector_list_iter iter; @@ -83,7 +83,7 @@ void amdgpu_encoder_set_active_device(struct drm_encoder *encoder) struct drm_connector * amdgpu_get_connector_for_encoder(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct drm_connector *connector, *found = NULL; struct drm_connector_list_iter iter; @@ -104,7 +104,7 @@ amdgpu_get_connector_for_encoder(struct drm_encoder *encoder) struct drm_connector * amdgpu_get_connector_for_encoder_init(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct drm_connector *connector, *found = NULL; struct drm_connector_list_iter iter; @@ -124,7 +124,7 @@ amdgpu_get_connector_for_encoder_init(struct drm_encoder *encoder) struct drm_encoder *amdgpu_get_external_encoder(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct drm_encoder *other_encoder; struct amdgpu_encoder *other_amdgpu_encoder; diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_dp.c b/drivers/gpu/drm/amd/amdgpu/atombios_dp.c index 968888ba326e..8edbaa5d3666 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_dp.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_dp.c @@ -720,7 +720,7 @@ amdgpu_atombios_dp_link_train_ce(struct amdgpu_atombios_dp_link_train_info *dp_i void amdgpu_atombios_dp_link_train(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_connector *amdgpu_connector; diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c index ac55c615dad0..758ebf37784f 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c @@ -70,7 +70,7 @@ amdgpu_atombios_encoder_set_backlight_level_to_reg(struct amdgpu_device *adev, u8 amdgpu_atombios_encoder_get_backlight_level(struct amdgpu_encoder *amdgpu_encoder) { - struct drm_device *dev = amdgpu_encoder->base.dev; + struct drm_device *dev = amdgpu_encoder->base.drm; struct amdgpu_device *adev = drm_to_adev(dev); if (!(adev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU)) @@ -84,7 +84,7 @@ amdgpu_atombios_encoder_set_backlight_level(struct amdgpu_encoder *amdgpu_encode u8 level) { struct drm_encoder *encoder = &amdgpu_encoder->base; - struct drm_device *dev = amdgpu_encoder->base.dev; + struct drm_device *dev = amdgpu_encoder->base.drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder_atom_dig *dig; @@ -150,7 +150,7 @@ amdgpu_atombios_encoder_get_backlight_brightness(struct backlight_device *bd) { struct amdgpu_backlight_privdata *pdata = bl_get_data(bd); struct amdgpu_encoder *amdgpu_encoder = pdata->encoder; - struct drm_device *dev = amdgpu_encoder->base.dev; + struct drm_device *dev = amdgpu_encoder->base.drm; struct amdgpu_device *adev = drm_to_adev(dev); return amdgpu_atombios_encoder_get_backlight_level_from_reg(adev); @@ -164,7 +164,7 @@ static const struct backlight_ops amdgpu_atombios_encoder_backlight_ops = { void amdgpu_atombios_encoder_init_backlight(struct amdgpu_encoder *amdgpu_encoder, struct drm_connector *drm_connector) { - struct drm_device *dev = amdgpu_encoder->base.dev; + struct drm_device *dev = amdgpu_encoder->base.drm; struct amdgpu_device *adev = drm_to_adev(dev); struct backlight_device *bd; struct backlight_properties props; @@ -234,7 +234,7 @@ void amdgpu_atombios_encoder_init_backlight(struct amdgpu_encoder *amdgpu_encode void amdgpu_atombios_encoder_fini_backlight(struct amdgpu_encoder *amdgpu_encoder) { - struct drm_device *dev = amdgpu_encoder->base.dev; + struct drm_device *dev = amdgpu_encoder->base.drm; struct amdgpu_device *adev = drm_to_adev(dev); struct backlight_device *bd = NULL; struct amdgpu_encoder_atom_dig *dig; @@ -312,7 +312,7 @@ bool amdgpu_atombios_encoder_mode_fixup(struct drm_encoder *encoder, static void amdgpu_atombios_encoder_setup_dac(struct drm_encoder *encoder, int action) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); DAC_ENCODER_CONTROL_PS_ALLOCATION args; @@ -375,7 +375,7 @@ union dvo_encoder_control { static void amdgpu_atombios_encoder_setup_dvo(struct drm_encoder *encoder, int action) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); union dvo_encoder_control args; @@ -560,7 +560,7 @@ void amdgpu_atombios_encoder_setup_dig_encoder(struct drm_encoder *encoder, int action, int panel_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -749,7 +749,7 @@ void amdgpu_atombios_encoder_setup_dig_transmitter(struct drm_encoder *encoder, int action, uint8_t lane_num, uint8_t lane_set) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1191,7 +1191,7 @@ amdgpu_atombios_encoder_setup_external_encoder(struct drm_encoder *encoder, struct drm_encoder *ext_encoder, int action) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder *ext_amdgpu_encoder = to_amdgpu_encoder(ext_encoder); @@ -1432,7 +1432,7 @@ union crtc_source_param { void amdgpu_atombios_encoder_set_crtc_source(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(encoder->crtc); @@ -1667,7 +1667,7 @@ static bool amdgpu_atombios_encoder_dac_load_detect(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); @@ -1717,7 +1717,7 @@ enum drm_connector_status amdgpu_atombios_encoder_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); @@ -1756,7 +1756,7 @@ enum drm_connector_status amdgpu_atombios_encoder_dig_detect(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); @@ -1965,7 +1965,7 @@ union lvds_info { struct amdgpu_encoder_atom_dig * amdgpu_atombios_encoder_get_lcd_info(struct amdgpu_encoder *encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_mode_info *mode_info = &adev->mode_info; int index = GetIndexIntoMasterTable(DATA, LVDS_Info); diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c index 1c745d8adb63..7255ba6012e8 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c @@ -506,7 +506,7 @@ void dce_v10_0_disable_dce(struct amdgpu_device *adev) static void dce_v10_0_program_fmt(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(encoder->crtc); @@ -1212,7 +1212,7 @@ static struct amdgpu_audio_pin *dce_v10_0_audio_get_pin(struct amdgpu_device *ad static void dce_v10_0_afmt_audio_select_pin(struct drm_encoder *encoder) { - struct amdgpu_device *adev = drm_to_adev(encoder->dev); + struct amdgpu_device *adev = drm_to_adev(encoder->drm); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; u32 tmp; @@ -1228,7 +1228,7 @@ static void dce_v10_0_afmt_audio_select_pin(struct drm_encoder *encoder) static void dce_v10_0_audio_write_latency_fields(struct drm_encoder *encoder, struct drm_display_mode *mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1274,7 +1274,7 @@ static void dce_v10_0_audio_write_latency_fields(struct drm_encoder *encoder, static void dce_v10_0_audio_write_speaker_allocation(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1330,7 +1330,7 @@ static void dce_v10_0_audio_write_speaker_allocation(struct drm_encoder *encoder static void dce_v10_0_audio_write_sad_regs(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1485,7 +1485,7 @@ static void dce_v10_0_audio_fini(struct amdgpu_device *adev) */ static void dce_v10_0_afmt_update_ACR(struct drm_encoder *encoder, uint32_t clock) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_afmt_acr acr = amdgpu_afmt_acr(clock); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); @@ -1521,7 +1521,7 @@ static void dce_v10_0_afmt_update_ACR(struct drm_encoder *encoder, uint32_t cloc static void dce_v10_0_afmt_update_avi_infoframe(struct drm_encoder *encoder, void *buffer, size_t size) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1540,7 +1540,7 @@ static void dce_v10_0_afmt_update_avi_infoframe(struct drm_encoder *encoder, static void dce_v10_0_audio_set_dto(struct drm_encoder *encoder, u32 clock) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1571,7 +1571,7 @@ static void dce_v10_0_audio_set_dto(struct drm_encoder *encoder, u32 clock) static void dce_v10_0_afmt_setmode(struct drm_encoder *encoder, struct drm_display_mode *mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1751,7 +1751,7 @@ static void dce_v10_0_afmt_setmode(struct drm_encoder *encoder, static void dce_v10_0_afmt_enable(struct drm_encoder *encoder, bool enable) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -3363,7 +3363,7 @@ dce_v10_0_encoder_mode_set(struct drm_encoder *encoder, static void dce_v10_0_encoder_prepare(struct drm_encoder *encoder) { - struct amdgpu_device *adev = drm_to_adev(encoder->dev); + struct amdgpu_device *adev = drm_to_adev(encoder->drm); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct drm_connector *connector = amdgpu_get_connector_for_encoder(encoder); @@ -3402,7 +3402,7 @@ static void dce_v10_0_encoder_prepare(struct drm_encoder *encoder) static void dce_v10_0_encoder_commit(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); /* need to call this here as we need the crtc set up */ diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c index e9d97d7f3c38..d896c86a3f31 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c @@ -532,7 +532,7 @@ void dce_v11_0_disable_dce(struct amdgpu_device *adev) static void dce_v11_0_program_fmt(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(encoder->crtc); @@ -1238,7 +1238,7 @@ static struct amdgpu_audio_pin *dce_v11_0_audio_get_pin(struct amdgpu_device *ad static void dce_v11_0_afmt_audio_select_pin(struct drm_encoder *encoder) { - struct amdgpu_device *adev = drm_to_adev(encoder->dev); + struct amdgpu_device *adev = drm_to_adev(encoder->drm); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; u32 tmp; @@ -1254,7 +1254,7 @@ static void dce_v11_0_afmt_audio_select_pin(struct drm_encoder *encoder) static void dce_v11_0_audio_write_latency_fields(struct drm_encoder *encoder, struct drm_display_mode *mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1300,7 +1300,7 @@ static void dce_v11_0_audio_write_latency_fields(struct drm_encoder *encoder, static void dce_v11_0_audio_write_speaker_allocation(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1356,7 +1356,7 @@ static void dce_v11_0_audio_write_speaker_allocation(struct drm_encoder *encoder static void dce_v11_0_audio_write_sad_regs(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1527,7 +1527,7 @@ static void dce_v11_0_audio_fini(struct amdgpu_device *adev) */ static void dce_v11_0_afmt_update_ACR(struct drm_encoder *encoder, uint32_t clock) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_afmt_acr acr = amdgpu_afmt_acr(clock); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); @@ -1563,7 +1563,7 @@ static void dce_v11_0_afmt_update_ACR(struct drm_encoder *encoder, uint32_t cloc static void dce_v11_0_afmt_update_avi_infoframe(struct drm_encoder *encoder, void *buffer, size_t size) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1582,7 +1582,7 @@ static void dce_v11_0_afmt_update_avi_infoframe(struct drm_encoder *encoder, static void dce_v11_0_audio_set_dto(struct drm_encoder *encoder, u32 clock) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1613,7 +1613,7 @@ static void dce_v11_0_audio_set_dto(struct drm_encoder *encoder, u32 clock) static void dce_v11_0_afmt_setmode(struct drm_encoder *encoder, struct drm_display_mode *mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1793,7 +1793,7 @@ static void dce_v11_0_afmt_setmode(struct drm_encoder *encoder, static void dce_v11_0_afmt_enable(struct drm_encoder *encoder, bool enable) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -3486,7 +3486,7 @@ dce_v11_0_encoder_mode_set(struct drm_encoder *encoder, static void dce_v11_0_encoder_prepare(struct drm_encoder *encoder) { - struct amdgpu_device *adev = drm_to_adev(encoder->dev); + struct amdgpu_device *adev = drm_to_adev(encoder->drm); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct drm_connector *connector = amdgpu_get_connector_for_encoder(encoder); @@ -3525,7 +3525,7 @@ static void dce_v11_0_encoder_prepare(struct drm_encoder *encoder) static void dce_v11_0_encoder_commit(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); /* need to call this here as we need the crtc set up */ diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c index e226b57b8ef8..899c74f28c5e 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c @@ -403,7 +403,7 @@ void dce_v6_0_disable_dce(struct amdgpu_device *adev) static void dce_v6_0_program_fmt(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct drm_connector *connector = amdgpu_get_connector_for_encoder(encoder); @@ -1116,7 +1116,7 @@ static struct amdgpu_audio_pin *dce_v6_0_audio_get_pin(struct amdgpu_device *ade static void dce_v6_0_audio_select_pin(struct drm_encoder *encoder) { - struct amdgpu_device *adev = drm_to_adev(encoder->dev); + struct amdgpu_device *adev = drm_to_adev(encoder->drm); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1131,7 +1131,7 @@ static void dce_v6_0_audio_select_pin(struct drm_encoder *encoder) static void dce_v6_0_audio_write_latency_fields(struct drm_encoder *encoder, struct drm_display_mode *mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1175,7 +1175,7 @@ static void dce_v6_0_audio_write_latency_fields(struct drm_encoder *encoder, static void dce_v6_0_audio_write_speaker_allocation(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1236,7 +1236,7 @@ static void dce_v6_0_audio_write_speaker_allocation(struct drm_encoder *encoder) static void dce_v6_0_audio_write_sad_regs(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1393,7 +1393,7 @@ static void dce_v6_0_audio_fini(struct amdgpu_device *adev) static void dce_v6_0_audio_set_vbi_packet(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1409,7 +1409,7 @@ static void dce_v6_0_audio_set_vbi_packet(struct drm_encoder *encoder) static void dce_v6_0_audio_set_acr(struct drm_encoder *encoder, uint32_t clock, int bpc) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_afmt_acr acr = amdgpu_afmt_acr(clock); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); @@ -1447,7 +1447,7 @@ static void dce_v6_0_audio_set_acr(struct drm_encoder *encoder, static void dce_v6_0_audio_set_avi_infoframe(struct drm_encoder *encoder, struct drm_display_mode *mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1489,7 +1489,7 @@ static void dce_v6_0_audio_set_avi_infoframe(struct drm_encoder *encoder, static void dce_v6_0_audio_set_dto(struct drm_encoder *encoder, u32 clock) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(encoder->crtc); int em = amdgpu_atombios_encoder_get_encoder_mode(encoder); @@ -1523,7 +1523,7 @@ static void dce_v6_0_audio_set_dto(struct drm_encoder *encoder, u32 clock) static void dce_v6_0_audio_set_packet(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1567,7 +1567,7 @@ static void dce_v6_0_audio_set_packet(struct drm_encoder *encoder) static void dce_v6_0_audio_set_mute(struct drm_encoder *encoder, bool mute) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1580,7 +1580,7 @@ static void dce_v6_0_audio_set_mute(struct drm_encoder *encoder, bool mute) static void dce_v6_0_audio_hdmi_enable(struct drm_encoder *encoder, bool enable) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1617,7 +1617,7 @@ static void dce_v6_0_audio_hdmi_enable(struct drm_encoder *encoder, bool enable) static void dce_v6_0_audio_dp_enable(struct drm_encoder *encoder, bool enable) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1646,7 +1646,7 @@ static void dce_v6_0_audio_dp_enable(struct drm_encoder *encoder, bool enable) static void dce_v6_0_afmt_setmode(struct drm_encoder *encoder, struct drm_display_mode *mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1715,7 +1715,7 @@ static void dce_v6_0_afmt_setmode(struct drm_encoder *encoder, static void dce_v6_0_afmt_enable(struct drm_encoder *encoder, bool enable) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -3167,7 +3167,7 @@ dce_v6_0_encoder_mode_set(struct drm_encoder *encoder, static void dce_v6_0_encoder_prepare(struct drm_encoder *encoder) { - struct amdgpu_device *adev = drm_to_adev(encoder->dev); + struct amdgpu_device *adev = drm_to_adev(encoder->drm); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct drm_connector *connector = amdgpu_get_connector_for_encoder(encoder); @@ -3207,7 +3207,7 @@ static void dce_v6_0_encoder_prepare(struct drm_encoder *encoder) static void dce_v6_0_encoder_commit(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); /* need to call this here as we need the crtc set up */ diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c index e17b9e3a21fc..7b3dbe6318e4 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c @@ -446,7 +446,7 @@ void dce_v8_0_disable_dce(struct amdgpu_device *adev) static void dce_v8_0_program_fmt(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(encoder->crtc); @@ -1149,7 +1149,7 @@ static struct amdgpu_audio_pin *dce_v8_0_audio_get_pin(struct amdgpu_device *ade static void dce_v8_0_afmt_audio_select_pin(struct drm_encoder *encoder) { - struct amdgpu_device *adev = drm_to_adev(encoder->dev); + struct amdgpu_device *adev = drm_to_adev(encoder->drm); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; u32 offset; @@ -1166,7 +1166,7 @@ static void dce_v8_0_afmt_audio_select_pin(struct drm_encoder *encoder) static void dce_v8_0_audio_write_latency_fields(struct drm_encoder *encoder, struct drm_display_mode *mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1227,7 +1227,7 @@ static void dce_v8_0_audio_write_latency_fields(struct drm_encoder *encoder, static void dce_v8_0_audio_write_speaker_allocation(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1280,7 +1280,7 @@ static void dce_v8_0_audio_write_speaker_allocation(struct drm_encoder *encoder) static void dce_v8_0_audio_write_sad_regs(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1448,7 +1448,7 @@ static void dce_v8_0_audio_fini(struct amdgpu_device *adev) */ static void dce_v8_0_afmt_update_ACR(struct drm_encoder *encoder, uint32_t clock) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_afmt_acr acr = amdgpu_afmt_acr(clock); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); @@ -1471,7 +1471,7 @@ static void dce_v8_0_afmt_update_ACR(struct drm_encoder *encoder, uint32_t clock static void dce_v8_0_afmt_update_avi_infoframe(struct drm_encoder *encoder, void *buffer, size_t size) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1491,7 +1491,7 @@ static void dce_v8_0_afmt_update_avi_infoframe(struct drm_encoder *encoder, static void dce_v8_0_audio_set_dto(struct drm_encoder *encoder, u32 clock) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1518,7 +1518,7 @@ static void dce_v8_0_audio_set_dto(struct drm_encoder *encoder, u32 clock) static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder, struct drm_display_mode *mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -1680,7 +1680,7 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder, static void dce_v8_0_afmt_enable(struct drm_encoder *encoder, bool enable) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv; @@ -3256,7 +3256,7 @@ dce_v8_0_encoder_mode_set(struct drm_encoder *encoder, static void dce_v8_0_encoder_prepare(struct drm_encoder *encoder) { - struct amdgpu_device *adev = drm_to_adev(encoder->dev); + struct amdgpu_device *adev = drm_to_adev(encoder->drm); struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct drm_connector *connector = amdgpu_get_connector_for_encoder(encoder); @@ -3295,7 +3295,7 @@ static void dce_v8_0_encoder_prepare(struct drm_encoder *encoder) static void dce_v8_0_encoder_commit(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_device *adev = drm_to_adev(dev); /* need to call this here as we need the crtc set up */ diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index ce694e9ed5a3..ebc22b9780c4 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6991,7 +6991,7 @@ amdgpu_dm_create_common_mode(struct drm_encoder *encoder, char *name, int hdisplay, int vdisplay) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); struct drm_display_mode *mode = NULL; struct drm_display_mode *native_mode = &amdgpu_encoder->native_mode; diff --git a/drivers/gpu/drm/arm/malidp_mw.c b/drivers/gpu/drm/arm/malidp_mw.c index 0dd21bc77dd8..e34e496b0627 100644 --- a/drivers/gpu/drm/arm/malidp_mw.c +++ b/drivers/gpu/drm/arm/malidp_mw.c @@ -129,7 +129,7 @@ malidp_mw_encoder_atomic_check(struct drm_encoder *encoder, struct drm_connector_state *conn_state) { struct malidp_mw_connector_state *mw_state = to_mw_state(conn_state); - struct malidp_drm *malidp = drm_to_malidp(encoder->dev); + struct malidp_drm *malidp = drm_to_malidp(encoder->drm); struct drm_framebuffer *fb; int i, n_planes; diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c index 90a89d70d832..7bb7f9f3bda5 100644 --- a/drivers/gpu/drm/bridge/tc358775.c +++ b/drivers/gpu/drm/bridge/tc358775.c @@ -363,7 +363,7 @@ static void d2l_write(struct i2c_client *i2c, u16 addr, u32 val) /* helper function to access bus_formats */ static struct drm_connector *get_connector(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_connector *connector; list_for_each_entry(connector, &dev->mode_config.connector_list, head) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 58101873a651..dfcd7aa474b7 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -1241,7 +1241,7 @@ drm_atomic_add_encoder_bridges(struct drm_atomic_state *state, if (!encoder) return 0; - drm_dbg_atomic(encoder->dev, + drm_dbg_atomic(encoder->drm, "Adding all bridges for [encoder:%d:%s] to %p\n", encoder->base.id, encoder->name, state); diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 9828f630fdd2..39e8900e6283 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -272,7 +272,7 @@ steal_encoder(struct drm_atomic_state *state, encoder_crtc = old_connector_state->crtc; - drm_dbg_atomic(encoder->dev, + drm_dbg_atomic(encoder->drm, "[ENCODER:%d:%s] in use on [CRTC:%d:%s], stealing it\n", encoder->base.id, encoder->name, encoder_crtc->base.id, encoder_crtc->name); @@ -452,7 +452,8 @@ mode_fixup(struct drm_atomic_state *state) new_crtc_state, new_conn_state); if (ret) { - drm_dbg_atomic(encoder->dev, "Bridge atomic check failed\n"); + drm_dbg_atomic(encoder->drm, + "Bridge atomic check failed\n"); return ret; } @@ -460,7 +461,7 @@ mode_fixup(struct drm_atomic_state *state) ret = funcs->atomic_check(encoder, new_crtc_state, new_conn_state); if (ret) { - drm_dbg_atomic(encoder->dev, + drm_dbg_atomic(encoder->drm, "[ENCODER:%d:%s] check failed\n", encoder->base.id, encoder->name); return ret; @@ -469,7 +470,7 @@ mode_fixup(struct drm_atomic_state *state) ret = funcs->mode_fixup(encoder, &new_crtc_state->mode, &new_crtc_state->adjusted_mode); if (!ret) { - drm_dbg_atomic(encoder->dev, + drm_dbg_atomic(encoder->drm, "[ENCODER:%d:%s] fixup failed\n", encoder->base.id, encoder->name); return -EINVAL; @@ -514,7 +515,7 @@ static enum drm_mode_status mode_valid_path(struct drm_connector *connector, ret = drm_encoder_mode_valid(encoder, mode); if (ret != MODE_OK) { - drm_dbg_atomic(encoder->dev, + drm_dbg_atomic(encoder->drm, "[ENCODER:%d:%s] mode_valid() failed\n", encoder->base.id, encoder->name); return ret; @@ -524,13 +525,14 @@ static enum drm_mode_status mode_valid_path(struct drm_connector *connector, ret = drm_bridge_chain_mode_valid(bridge, &connector->display_info, mode); if (ret != MODE_OK) { - drm_dbg_atomic(encoder->dev, "[BRIDGE] mode_valid() failed\n"); + drm_dbg_atomic(encoder->drm, "[BRIDGE] mode_valid() failed\n"); return ret; } ret = drm_crtc_mode_valid(crtc, mode); if (ret != MODE_OK) { - drm_dbg_atomic(encoder->dev, "[CRTC:%d:%s] mode_valid() failed\n", + drm_dbg_atomic(encoder->drm, + "[CRTC:%d:%s] mode_valid() failed\n", crtc->base.id, crtc->name); return ret; } @@ -821,7 +823,8 @@ drm_atomic_helper_check_wb_encoder_state(struct drm_encoder *encoder, if (fb->format->format == formats[i]) return 0; - drm_dbg_kms(encoder->dev, "Invalid pixel format %p4cc\n", &fb->format->format); + drm_dbg_kms(encoder->drm, "Invalid pixel format %p4cc\n", + &fb->format->format); return -EINVAL; } diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index cdc373f56ce6..f952b6d7e128 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -311,7 +311,7 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, if (bridge->drm) return -EBUSY; - bridge->drm = encoder->dev; + bridge->drm = encoder->drm; bridge->encoder = encoder; if (previous) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index d610c9e740d0..c5dbfec52c0e 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -108,7 +108,7 @@ bool drm_helper_encoder_in_use(struct drm_encoder *encoder) { struct drm_connector *connector; struct drm_connector_list_iter conn_iter; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; WARN_ON(drm_drv_uses_atomic_modeset(dev)); @@ -839,7 +839,7 @@ static int drm_helper_choose_encoder_dpms(struct drm_encoder *encoder) int dpms = DRM_MODE_DPMS_OFF; struct drm_connector *connector; struct drm_connector_list_iter conn_iter; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; drm_connector_list_iter_begin(dev, &conn_iter); drm_for_each_connector_iter(connector, &conn_iter) diff --git a/drivers/gpu/drm/drm_encoder.c b/drivers/gpu/drm/drm_encoder.c index 1143bc7f3252..e4ded7cd329b 100644 --- a/drivers/gpu/drm/drm_encoder.c +++ b/drivers/gpu/drm/drm_encoder.c @@ -109,7 +109,7 @@ static int __drm_encoder_init(struct drm_device *dev, if (ret) return ret; - encoder->dev = dev; + encoder->drm = dev; encoder->encoder_type = encoder_type; encoder->funcs = funcs; if (name) { @@ -182,7 +182,7 @@ EXPORT_SYMBOL(drm_encoder_init); */ void drm_encoder_cleanup(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_bridge *bridge, *next; /* Note that the encoder_list is considered to be static; should we @@ -207,7 +207,7 @@ static void drmm_encoder_alloc_release(struct drm_device *dev, void *ptr) { struct drm_encoder *encoder = ptr; - if (WARN_ON(!encoder->dev)) + if (WARN_ON(!encoder->drm)) return; drm_encoder_cleanup(encoder); @@ -300,7 +300,7 @@ EXPORT_SYMBOL(drmm_encoder_init); static struct drm_crtc *drm_encoder_get_crtc(struct drm_encoder *encoder) { struct drm_connector *connector; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; bool uses_atomic = false; struct drm_connector_list_iter conn_iter; diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index 87eb591fe9b5..f9eed0916fe1 100644 --- a/drivers/gpu/drm/drm_mode_config.c +++ b/drivers/gpu/drm/drm_mode_config.c @@ -584,7 +584,7 @@ static void fixup_encoder_possible_clones(struct drm_encoder *encoder) static void validate_encoder_possible_clones(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; u32 encoder_mask = full_encoder_mask(dev); struct drm_encoder *other; @@ -621,7 +621,7 @@ static u32 full_crtc_mask(struct drm_device *dev) static void validate_encoder_possible_crtcs(struct drm_encoder *encoder) { - u32 crtc_mask = full_crtc_mask(encoder->dev); + u32 crtc_mask = full_crtc_mask(encoder->drm); WARN((encoder->possible_crtcs & crtc_mask) == 0 || (encoder->possible_crtcs & ~crtc_mask) != 0, diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 395c79eb438f..368e2e14c831 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -221,8 +221,8 @@ struct exynos_drm_crtc *exynos_drm_crtc_get_by_type(struct drm_device *drm_dev, int exynos_drm_set_possible_crtcs(struct drm_encoder *encoder, enum exynos_drm_output_type out_type) { - struct exynos_drm_crtc *crtc = exynos_drm_crtc_get_by_type(encoder->dev, - out_type); + struct exynos_drm_crtc *crtc = exynos_drm_crtc_get_by_type(encoder->drm, + out_type); if (IS_ERR(crtc)) return PTR_ERR(crtc); diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c b/drivers/gpu/drm/exynos/exynos_drm_dpi.c index 16bef23c6a73..def6679d7c51 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c @@ -99,7 +99,7 @@ static int exynos_dpi_create_connector(struct drm_encoder *encoder) connector->polled = DRM_CONNECTOR_POLL_HPD; - ret = drm_connector_init(encoder->dev, connector, + ret = drm_connector_init(encoder->drm, connector, &exynos_dpi_connector_funcs, DRM_MODE_CONNECTOR_VGA); if (ret) { diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index fc81f728e6ba..5bd77acd0d28 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -37,7 +37,7 @@ static int exynos_dsi_host_attach(struct samsung_dsim *dsim, { struct exynos_dsi *dsi = dsim->priv; struct drm_encoder *encoder = &dsi->encoder; - struct drm_device *drm = encoder->dev; + struct drm_device *drm = encoder->drm; drm_bridge_attach(encoder, &dsim->bridge, list_first_entry_or_null(&encoder->bridge_chain, @@ -64,7 +64,7 @@ static void exynos_dsi_host_detach(struct samsung_dsim *dsim, struct mipi_dsi_device *device) { struct exynos_dsi *dsi = dsim->priv; - struct drm_device *drm = dsi->encoder.dev; + struct drm_device *drm = dsi->encoder.drm; if (drm->mode_config.poll_enabled) drm_kms_helper_hotplug_event(drm); diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index b7c11bdce2c8..1a4cec02dd0c 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -989,7 +989,7 @@ static bool hdmi_mode_fixup(struct drm_encoder *encoder, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_connector *connector; struct drm_display_mode *m; struct drm_connector_list_iter conn_iter; diff --git a/drivers/gpu/drm/gma500/cdv_intel_crt.c b/drivers/gpu/drm/gma500/cdv_intel_crt.c index 2bb9b92aa414..587478c1e0f2 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_crt.c +++ b/drivers/gpu/drm/gma500/cdv_intel_crt.c @@ -42,7 +42,7 @@ static void cdv_intel_crt_dpms(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; u32 temp, reg; reg = ADPA; @@ -90,7 +90,7 @@ static void cdv_intel_crt_mode_set(struct drm_encoder *encoder, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_crtc *crtc = encoder->crtc; struct gma_crtc *gma_crtc = to_gma_crtc(crtc); int dpll_md_reg; diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c index e525a6782245..2f71ce9ae848 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c @@ -375,7 +375,7 @@ cdv_intel_dp_max_data_rate(int max_link_clock, int max_lanes) static void cdv_intel_edp_panel_vdd_on(struct gma_encoder *intel_encoder) { - struct drm_device *dev = intel_encoder->base.dev; + struct drm_device *dev = intel_encoder->base.drm; struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; u32 pp; @@ -395,7 +395,7 @@ static void cdv_intel_edp_panel_vdd_on(struct gma_encoder *intel_encoder) static void cdv_intel_edp_panel_vdd_off(struct gma_encoder *intel_encoder) { - struct drm_device *dev = intel_encoder->base.dev; + struct drm_device *dev = intel_encoder->base.drm; u32 pp; DRM_DEBUG_KMS("\n"); @@ -410,7 +410,7 @@ static void cdv_intel_edp_panel_vdd_off(struct gma_encoder *intel_encoder) /* Returns true if the panel was already on when called */ static bool cdv_intel_edp_panel_on(struct gma_encoder *intel_encoder) { - struct drm_device *dev = intel_encoder->base.dev; + struct drm_device *dev = intel_encoder->base.drm; struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; u32 pp, idle_on_mask = PP_ON | PP_SEQUENCE_NONE; @@ -437,7 +437,7 @@ static bool cdv_intel_edp_panel_on(struct gma_encoder *intel_encoder) static void cdv_intel_edp_panel_off (struct gma_encoder *intel_encoder) { - struct drm_device *dev = intel_encoder->base.dev; + struct drm_device *dev = intel_encoder->base.drm; u32 pp, idle_off_mask = PP_ON ; struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; @@ -469,7 +469,7 @@ static void cdv_intel_edp_panel_off (struct gma_encoder *intel_encoder) static void cdv_intel_edp_backlight_on (struct gma_encoder *intel_encoder) { - struct drm_device *dev = intel_encoder->base.dev; + struct drm_device *dev = intel_encoder->base.drm; u32 pp; DRM_DEBUG_KMS("\n"); @@ -489,7 +489,7 @@ static void cdv_intel_edp_backlight_on (struct gma_encoder *intel_encoder) static void cdv_intel_edp_backlight_off (struct gma_encoder *intel_encoder) { - struct drm_device *dev = intel_encoder->base.dev; + struct drm_device *dev = intel_encoder->base.drm; struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; u32 pp; @@ -569,7 +569,7 @@ cdv_intel_dp_aux_ch(struct gma_encoder *encoder, { struct cdv_intel_dp *intel_dp = encoder->dev_priv; uint32_t output_reg = intel_dp->output_reg; - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; uint32_t ch_ctl = output_reg + 0x10; uint32_t ch_data = ch_ctl + 4; int i; @@ -892,7 +892,7 @@ static bool cdv_intel_dp_mode_fixup(struct drm_encoder *encoder, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_psb_private *dev_priv = to_drm_psb_private(encoder->dev); + struct drm_psb_private *dev_priv = to_drm_psb_private(encoder->drm); struct gma_encoder *intel_encoder = to_gma_encoder(encoder); struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; int lane_count, clock; @@ -1040,7 +1040,7 @@ cdv_intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode struct drm_crtc *crtc = encoder->crtc; struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; intel_dp->DP = DP_VOLTAGE_0_4 | DP_PRE_EMPHASIS_0; intel_dp->DP |= intel_dp->color_range; @@ -1168,7 +1168,7 @@ cdv_intel_dp_dpms(struct drm_encoder *encoder, int mode) { struct gma_encoder *intel_encoder = to_gma_encoder(encoder); struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; uint32_t dp_reg = REG_READ(intel_dp->output_reg); int edp = is_edp(intel_encoder); @@ -1354,7 +1354,7 @@ cdv_intel_dp_set_link_train(struct gma_encoder *encoder, uint32_t dp_reg_value, uint8_t dp_train_pat) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; int ret; struct cdv_intel_dp *intel_dp = encoder->dev_priv; @@ -1398,7 +1398,7 @@ cdv_intel_dplink_set_level(struct gma_encoder *encoder, static void cdv_intel_dp_set_vswing_premph(struct gma_encoder *encoder, uint8_t signal_level) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct cdv_intel_dp *intel_dp = encoder->dev_priv; struct ddi_regoff *ddi_reg; int vswing, premph, index; @@ -1464,7 +1464,7 @@ cdv_intel_dp_set_vswing_premph(struct gma_encoder *encoder, uint8_t signal_level static void cdv_intel_dp_start_link_train(struct gma_encoder *encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct cdv_intel_dp *intel_dp = encoder->dev_priv; int i; uint8_t voltage; @@ -1557,7 +1557,7 @@ cdv_intel_dp_start_link_train(struct gma_encoder *encoder) static void cdv_intel_dp_complete_link_train(struct gma_encoder *encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct cdv_intel_dp *intel_dp = encoder->dev_priv; int tries, cr_tries; u32 reg; @@ -1640,7 +1640,7 @@ cdv_intel_dp_complete_link_train(struct gma_encoder *encoder) static void cdv_intel_dp_link_down(struct gma_encoder *encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct cdv_intel_dp *intel_dp = encoder->dev_priv; uint32_t DP = intel_dp->DP; diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c index 555c33d51ffe..e42b6aa79c45 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c +++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c @@ -62,7 +62,7 @@ static void cdv_hdmi_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct gma_encoder *gma_encoder = to_gma_encoder(encoder); struct mid_intel_hdmi_priv *hdmi_priv = gma_encoder->dev_priv; u32 hdmib; @@ -90,7 +90,7 @@ static void cdv_hdmi_mode_set(struct drm_encoder *encoder, static void cdv_hdmi_dpms(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct gma_encoder *gma_encoder = to_gma_encoder(encoder); struct mid_intel_hdmi_priv *hdmi_priv = gma_encoder->dev_priv; u32 hdmib; diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c index 605cc7031015..4d9e0021f58f 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c +++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c @@ -136,7 +136,7 @@ static void cdv_intel_lvds_set_power(struct drm_device *dev, static void cdv_intel_lvds_encoder_dpms(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; if (mode == DRM_MODE_DPMS_ON) cdv_intel_lvds_set_power(dev, encoder, true); else @@ -181,7 +181,7 @@ static bool cdv_intel_lvds_mode_fixup(struct drm_encoder *encoder, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct drm_encoder *tmp_encoder; @@ -228,7 +228,7 @@ static bool cdv_intel_lvds_mode_fixup(struct drm_encoder *encoder, static void cdv_intel_lvds_prepare(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; @@ -246,7 +246,7 @@ static void cdv_intel_lvds_prepare(struct drm_encoder *encoder) static void cdv_intel_lvds_commit(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; @@ -261,7 +261,7 @@ static void cdv_intel_lvds_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct gma_crtc *gma_crtc = to_gma_crtc(encoder->crtc); u32 pfit_control; @@ -381,7 +381,7 @@ static int cdv_intel_lvds_set_property(struct drm_connector *connector, value)) return -1; else - gma_backlight_set(encoder->dev, value); + gma_backlight_set(encoder->drm, value); } else if (!strcmp(property->name, "DPMS") && encoder) { const struct drm_encoder_helper_funcs *helpers = encoder->helper_private; diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c index e0ac4c88c762..79baee98cf74 100644 --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c @@ -496,7 +496,7 @@ static void oaktrail_hdmi_dpms(struct drm_encoder *encoder, int mode) { static int dpms_mode = -1; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; u32 temp; @@ -592,7 +592,7 @@ static void oaktrail_hdmi_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; oaktrail_hdmi_audio_enable(dev); return; diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c b/drivers/gpu/drm/gma500/oaktrail_lvds.c index d974d0c60d2a..bec28856ca09 100644 --- a/drivers/gpu/drm/gma500/oaktrail_lvds.c +++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c @@ -68,7 +68,7 @@ static void oaktrail_lvds_set_power(struct drm_device *dev, static void oaktrail_lvds_dpms(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct gma_encoder *gma_encoder = to_gma_encoder(encoder); if (mode == DRM_MODE_DPMS_ON) @@ -83,7 +83,7 @@ static void oaktrail_lvds_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct drm_connector_list_iter conn_iter; @@ -156,7 +156,7 @@ static void oaktrail_lvds_mode_set(struct drm_encoder *encoder, static void oaktrail_lvds_prepare(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct gma_encoder *gma_encoder = to_gma_encoder(encoder); struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; @@ -192,7 +192,7 @@ static u32 oaktrail_lvds_get_max_backlight(struct drm_device *dev) static void oaktrail_lvds_commit(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct gma_encoder *gma_encoder = to_gma_encoder(encoder); struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c index 48e1a8b0d869..cf679051bca6 100644 --- a/drivers/gpu/drm/gma500/psb_intel_lvds.c +++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c @@ -240,7 +240,7 @@ static void psb_intel_lvds_set_power(struct drm_device *dev, bool on) static void psb_intel_lvds_encoder_dpms(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; if (mode == DRM_MODE_DPMS_ON) psb_intel_lvds_set_power(dev, true); @@ -362,7 +362,7 @@ bool psb_intel_lvds_mode_fixup(struct drm_encoder *encoder, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; struct gma_crtc *gma_crtc = to_gma_crtc(encoder->crtc); @@ -423,7 +423,7 @@ bool psb_intel_lvds_mode_fixup(struct drm_encoder *encoder, static void psb_intel_lvds_prepare(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; @@ -441,7 +441,7 @@ static void psb_intel_lvds_prepare(struct drm_encoder *encoder) static void psb_intel_lvds_commit(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; @@ -456,7 +456,7 @@ static void psb_intel_lvds_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); u32 pfit_control; @@ -576,7 +576,7 @@ int psb_intel_lvds_set_property(struct drm_connector *connector, value)) goto set_prop_error; else - gma_backlight_set(encoder->dev, value); + gma_backlight_set(encoder->drm, value); } else if (!strcmp(property->name, "DPMS")) { const struct drm_encoder_helper_funcs *hfuncs = encoder->helper_private; diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c index 91b5aa9d92ed..68357c67b5e8 100644 --- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c +++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c @@ -230,7 +230,7 @@ psb_intel_sdvo_create_enhance_property(struct psb_intel_sdvo *psb_intel_sdvo, */ static void psb_intel_sdvo_write_sdvox(struct psb_intel_sdvo *psb_intel_sdvo, u32 val) { - struct drm_device *dev = psb_intel_sdvo->base.base.dev; + struct drm_device *dev = psb_intel_sdvo->base.base.drm; u32 bval = val, cval = val; int i, j; int need_aux = IS_MRST(dev) ? 1 : 0; @@ -405,7 +405,7 @@ static const struct _sdvo_cmd_name { static void psb_intel_sdvo_debug_write(struct psb_intel_sdvo *psb_intel_sdvo, u8 cmd, const void *args, int args_len) { - struct drm_device *dev = psb_intel_sdvo->base.base.dev; + struct drm_device *dev = psb_intel_sdvo->base.base.drm; int i, pos = 0; char buffer[73]; @@ -506,7 +506,7 @@ static bool psb_intel_sdvo_write_cmd(struct psb_intel_sdvo *psb_intel_sdvo, u8 c static bool psb_intel_sdvo_read_response(struct psb_intel_sdvo *psb_intel_sdvo, void *response, int response_len) { - struct drm_device *dev = psb_intel_sdvo->base.base.dev; + struct drm_device *dev = psb_intel_sdvo->base.base.drm; char buffer[73]; int i, pos = 0; u8 retry = 5; @@ -989,7 +989,7 @@ static void psb_intel_sdvo_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_crtc *crtc = encoder->crtc; struct gma_crtc *gma_crtc = to_gma_crtc(crtc); struct psb_intel_sdvo *psb_intel_sdvo = to_psb_intel_sdvo(encoder); @@ -1094,7 +1094,7 @@ static void psb_intel_sdvo_mode_set(struct drm_encoder *encoder, static void psb_intel_sdvo_dpms(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct psb_intel_sdvo *psb_intel_sdvo = to_psb_intel_sdvo(encoder); u32 temp; int i; @@ -1786,7 +1786,7 @@ static void psb_intel_sdvo_enc_destroy(struct drm_encoder *encoder) struct psb_intel_sdvo *psb_intel_sdvo = to_psb_intel_sdvo(encoder); if (psb_intel_sdvo->sdvo_lvds_fixed_mode != NULL) - drm_mode_destroy(encoder->dev, + drm_mode_destroy(encoder->drm, psb_intel_sdvo->sdvo_lvds_fixed_mode); i2c_del_adapter(&psb_intel_sdvo->ddc); @@ -1939,7 +1939,7 @@ static void psb_intel_sdvo_connector_init(struct psb_intel_sdvo_connector *connector, struct psb_intel_sdvo *encoder) { - drm_connector_init(encoder->base.base.dev, + drm_connector_init(encoder->base.base.drm, &connector->base.base, &psb_intel_sdvo_connector_funcs, connector->base.base.connector_type); @@ -2181,7 +2181,7 @@ static bool psb_intel_sdvo_tv_create_property(struct psb_intel_sdvo *psb_intel_s struct psb_intel_sdvo_connector *psb_intel_sdvo_connector, int type) { - struct drm_device *dev = psb_intel_sdvo->base.base.dev; + struct drm_device *dev = psb_intel_sdvo->base.base.drm; struct psb_intel_sdvo_tv_format format; uint32_t format_map, i; @@ -2246,7 +2246,7 @@ psb_intel_sdvo_create_enhance_property_tv(struct psb_intel_sdvo *psb_intel_sdvo, struct psb_intel_sdvo_connector *psb_intel_sdvo_connector, struct psb_intel_sdvo_enhancements_reply enhancements) { - struct drm_device *dev = psb_intel_sdvo->base.base.dev; + struct drm_device *dev = psb_intel_sdvo->base.base.drm; struct drm_connector *connector = &psb_intel_sdvo_connector->base.base; uint16_t response, data_value[2]; @@ -2361,7 +2361,7 @@ psb_intel_sdvo_create_enhance_property_lvds(struct psb_intel_sdvo *psb_intel_sdv struct psb_intel_sdvo_connector *psb_intel_sdvo_connector, struct psb_intel_sdvo_enhancements_reply enhancements) { - struct drm_device *dev = psb_intel_sdvo->base.base.dev; + struct drm_device *dev = psb_intel_sdvo->base.base.drm; struct drm_connector *connector = &psb_intel_sdvo_connector->base.base; uint16_t response, data_value[2]; diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c index 380125fd8bcb..7be72e916889 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c @@ -71,7 +71,7 @@ static void hibmc_encoder_mode_set(struct drm_encoder *encoder, struct drm_display_mode *adj_mode) { u32 reg; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct hibmc_drm_private *priv = to_hibmc_drm_private(dev); reg = readl(priv->mmio + HIBMC_DISPLAY_CONTROL_HISILE); diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c index 566de4658719..8df594c8eccc 100644 --- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c +++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c @@ -653,7 +653,7 @@ static enum drm_mode_status dsi_encoder_mode_valid(struct drm_encoder *encoder, * mode_fixup to figure out the adjusted mode before we * validate it. */ - drm_for_each_crtc(crtc, encoder->dev) { + drm_for_each_crtc(crtc, encoder->drm) { /* * reset adj_mode to the mode value each time, * so we don't adjust the mode twice diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c index 131512a5f3bd..5979e5502b25 100644 --- a/drivers/gpu/drm/i2c/ch7006_drv.c +++ b/drivers/gpu/drm/i2c/ch7006_drv.c @@ -44,7 +44,7 @@ static void ch7006_encoder_destroy(struct drm_encoder *encoder) { struct ch7006_priv *priv = to_ch7006_priv(encoder); - drm_property_destroy(encoder->dev, priv->scale_property); + drm_property_destroy(encoder->drm, priv->scale_property); kfree(priv); to_encoder_slave(encoder)->slave_priv = NULL; @@ -217,8 +217,8 @@ static enum drm_connector_status ch7006_encoder_detect(struct drm_encoder *encod priv->subconnector = DRM_MODE_SUBCONNECTOR_Unknown; drm_object_property_set_value(&connector->base, - encoder->dev->mode_config.tv_subconnector_property, - priv->subconnector); + encoder->drm->mode_config.tv_subconnector_property, + priv->subconnector); return priv->subconnector ? connector_status_connected : connector_status_disconnected; @@ -237,7 +237,7 @@ static int ch7006_encoder_get_modes(struct drm_encoder *encoder, continue; drm_mode_probed_add(connector, - drm_mode_duplicate(encoder->dev, &mode->mode)); + drm_mode_duplicate(encoder->drm, &mode->mode)); n++; } @@ -249,7 +249,7 @@ static int ch7006_encoder_create_resources(struct drm_encoder *encoder, struct drm_connector *connector) { struct ch7006_priv *priv = to_ch7006_priv(encoder); - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_mode_config *conf = &dev->mode_config; drm_mode_create_tv_properties_legacy(dev, NUM_TV_NORMS, ch7006_tv_norm_names); @@ -288,7 +288,7 @@ static int ch7006_encoder_set_property(struct drm_encoder *encoder, struct i2c_client *client = drm_i2c_encoder_get_client(encoder); struct ch7006_priv *priv = to_ch7006_priv(encoder); struct ch7006_state *state = &priv->state; - struct drm_mode_config *conf = &encoder->dev->mode_config; + struct drm_mode_config *conf = &encoder->drm->mode_config; struct drm_crtc *crtc = encoder->crtc; bool modes_changed = false; diff --git a/drivers/gpu/drm/i915/display/g4x_dp.c b/drivers/gpu/drm/i915/display/g4x_dp.c index 85ad8466bc81..a17669cdb86a 100644 --- a/drivers/gpu/drm/i915/display/g4x_dp.c +++ b/drivers/gpu/drm/i915/display/g4x_dp.c @@ -56,7 +56,7 @@ const struct dpll *vlv_get_dpll(struct drm_i915_private *i915) void g4x_dp_set_clock(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); const struct dpll *divisor = NULL; int i, count = 0; @@ -88,7 +88,7 @@ void g4x_dp_set_clock(struct intel_encoder *encoder, static void intel_dp_prepare(struct intel_encoder *encoder, const struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); enum port port = encoder->port; struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); @@ -166,7 +166,7 @@ static void intel_dp_prepare(struct intel_encoder *encoder, static void assert_dp_port(struct intel_dp *intel_dp, bool state) { struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); - struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.drm); bool cur_state = intel_de_read(dev_priv, intel_dp->output_reg) & DP_PORT_EN; I915_STATE_WARN(dev_priv, cur_state != state, @@ -296,7 +296,7 @@ bool g4x_dp_port_enabled(struct drm_i915_private *dev_priv, static bool intel_dp_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); intel_wakeref_t wakeref; bool ret; @@ -332,7 +332,7 @@ static void g4x_dp_get_m_n(struct intel_crtc_state *crtc_state) static void intel_dp_get_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); u32 tmp, flags = 0; enum port port = encoder->port; @@ -403,7 +403,7 @@ static void intel_dp_link_down(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); enum port port = encoder->port; @@ -540,7 +540,7 @@ static void chv_post_disable_dp(struct intel_atomic_state *state, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); intel_dp_link_down(encoder, old_crtc_state); @@ -637,7 +637,7 @@ static void intel_enable_dp(struct intel_atomic_state *state, const struct intel_crtc_state *pipe_config, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); u32 dp_reg = intel_de_read(dev_priv, intel_dp->output_reg); intel_wakeref_t wakeref; @@ -991,7 +991,7 @@ static void g4x_set_signal_levels(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); u8 train_set = intel_dp->train_set[0]; u32 signal_levels; @@ -1039,7 +1039,7 @@ static void snb_cpu_edp_set_signal_levels(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); u8 train_set = intel_dp->train_set[0]; u32 signal_levels; @@ -1091,7 +1091,7 @@ static void ivb_cpu_edp_set_signal_levels(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); u8 train_set = intel_dp->train_set[0]; u32 signal_levels; @@ -1153,7 +1153,7 @@ intel_dp_hotplug(struct intel_encoder *encoder, drm_modeset_drop_locks(&ctx); drm_modeset_acquire_fini(&ctx); - drm_WARN(encoder->base.dev, ret, + drm_WARN(encoder->base.drm, ret, "Acquiring modeset locks failed with %i\n", ret); /* @@ -1168,7 +1168,7 @@ intel_dp_hotplug(struct intel_encoder *encoder, static bool ibx_digital_port_connected(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 bit = dev_priv->display.hotplug.pch_hpd[encoder->hpd_pin]; return intel_de_read(dev_priv, SDEISR) & bit; @@ -1176,7 +1176,7 @@ static bool ibx_digital_port_connected(struct intel_encoder *encoder) static bool g4x_digital_port_connected(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 bit; switch (encoder->hpd_pin) { @@ -1199,7 +1199,7 @@ static bool g4x_digital_port_connected(struct intel_encoder *encoder) static bool ilk_digital_port_connected(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 bit = dev_priv->display.hotplug.hpd[encoder->hpd_pin]; return intel_de_read(dev_priv, DEISR) & bit; @@ -1228,7 +1228,7 @@ enum pipe vlv_active_pipe(struct intel_dp *intel_dp) static void intel_dp_encoder_reset(struct drm_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->dev); + struct drm_i915_private *dev_priv = to_i915(encoder->drm); struct intel_dp *intel_dp = enc_to_intel_dp(to_intel_encoder(encoder)); intel_dp->DP = intel_de_read(dev_priv, intel_dp->output_reg); diff --git a/drivers/gpu/drm/i915/display/g4x_hdmi.c b/drivers/gpu/drm/i915/display/g4x_hdmi.c index 7f3743dea587..8acab6eb529e 100644 --- a/drivers/gpu/drm/i915/display/g4x_hdmi.c +++ b/drivers/gpu/drm/i915/display/g4x_hdmi.c @@ -25,7 +25,7 @@ static void intel_hdmi_prepare(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); @@ -64,7 +64,7 @@ static void intel_hdmi_prepare(struct intel_encoder *encoder, static bool intel_hdmi_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); intel_wakeref_t wakeref; bool ret; @@ -131,7 +131,7 @@ static int g4x_hdmi_compute_config(struct intel_encoder *encoder, { struct intel_atomic_state *state = to_intel_atomic_state(crtc_state->uapi.state); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); if (HAS_PCH_SPLIT(i915)) crtc_state->has_pch_encoder = true; @@ -149,7 +149,7 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) { struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); u32 tmp, flags = 0; int dotclock; @@ -216,7 +216,7 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, static void g4x_hdmi_enable_port(struct intel_encoder *encoder, const struct intel_crtc_state *pipe_config) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); u32 temp; @@ -236,7 +236,7 @@ static void g4x_enable_hdmi(struct intel_atomic_state *state, const struct intel_crtc_state *pipe_config, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); g4x_hdmi_enable_port(encoder, pipe_config); @@ -250,7 +250,7 @@ static void ibx_enable_hdmi(struct intel_atomic_state *state, const struct intel_crtc_state *pipe_config, const struct drm_connector_state *conn_state) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); u32 temp; @@ -303,7 +303,7 @@ static void cpt_enable_hdmi(struct intel_atomic_state *state, const struct intel_crtc_state *pipe_config, const struct drm_connector_state *conn_state) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); @@ -358,7 +358,7 @@ static void vlv_enable_hdmi(struct intel_atomic_state *state, const struct intel_crtc_state *pipe_config, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); drm_WARN_ON(&dev_priv->drm, pipe_config->has_audio && !pipe_config->has_hdmi_sink); @@ -370,7 +370,7 @@ static void intel_disable_hdmi(struct intel_atomic_state *state, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); struct intel_digital_port *dig_port = @@ -471,7 +471,7 @@ static void vlv_hdmi_pre_enable(struct intel_atomic_state *state, const struct drm_connector_state *conn_state) { struct intel_digital_port *dig_port = enc_to_dig_port(encoder); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); vlv_phy_pre_encoder_enable(encoder, pipe_config); @@ -531,7 +531,7 @@ static void chv_hdmi_post_disable(struct intel_atomic_state *state, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); vlv_dpio_get(dev_priv); @@ -548,7 +548,7 @@ static void chv_hdmi_pre_enable(struct intel_atomic_state *state, const struct drm_connector_state *conn_state) { struct intel_digital_port *dig_port = enc_to_dig_port(encoder); - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); chv_phy_pre_encoder_enable(encoder, pipe_config); diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index 995ba2ed1e87..da401441cd5a 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -97,7 +97,7 @@ static enum transcoder dsi_port_to_transcoder(enum port port) static void wait_for_cmds_dispatched_to_panel(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); struct mipi_dsi_device *dsi; enum port port; @@ -141,7 +141,7 @@ static int dsi_send_pkt_payld(struct intel_dsi_host *host, const struct mipi_dsi_packet *packet) { struct intel_dsi *intel_dsi = host->intel_dsi; - struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev); + struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.drm); enum transcoder dsi_trans = dsi_port_to_transcoder(host->port); const u8 *data = packet->payload; u32 len = packet->payload_length; @@ -173,7 +173,7 @@ static int dsi_send_pkt_hdr(struct intel_dsi_host *host, bool enable_lpdt) { struct intel_dsi *intel_dsi = host->intel_dsi; - struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.drm); enum transcoder dsi_trans = dsi_port_to_transcoder(host->port); u32 tmp; @@ -230,7 +230,7 @@ void icl_dsi_frame_update(struct intel_crtc_state *crtc_state) static void dsi_program_swing_and_deemphasis(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum phy phy; u32 tmp, mask, val; @@ -276,7 +276,7 @@ static void dsi_program_swing_and_deemphasis(struct intel_encoder *encoder) static void configure_dual_link_mode(struct intel_encoder *encoder, const struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); i915_reg_t dss_ctl1_reg, dss_ctl2_reg; u32 dss_ctl1; @@ -340,7 +340,7 @@ static int afe_clk(struct intel_encoder *encoder, static void gen11_dsi_program_esc_clk_div(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; int afe_clk_khz; @@ -396,7 +396,7 @@ static void get_dsi_io_power_domains(struct drm_i915_private *dev_priv, static void gen11_dsi_enable_io_power(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -409,7 +409,7 @@ static void gen11_dsi_enable_io_power(struct intel_encoder *encoder) static void gen11_dsi_power_up_lanes(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum phy phy; @@ -420,7 +420,7 @@ static void gen11_dsi_power_up_lanes(struct intel_encoder *encoder) static void gen11_dsi_config_phy_lanes_sequence(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum phy phy; u32 tmp; @@ -461,7 +461,7 @@ static void gen11_dsi_config_phy_lanes_sequence(struct intel_encoder *encoder) static void gen11_dsi_voltage_swing_program_seq(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); u32 tmp; enum phy phy; @@ -504,7 +504,7 @@ static void gen11_dsi_voltage_swing_program_seq(struct intel_encoder *encoder) static void gen11_dsi_enable_ddi_buffer(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -523,7 +523,7 @@ static void gen11_dsi_setup_dphy_timings(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; enum phy phy; @@ -583,7 +583,7 @@ gen11_dsi_setup_dphy_timings(struct intel_encoder *encoder, static void gen11_dsi_gate_clocks(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); u32 tmp; enum phy phy; @@ -599,7 +599,7 @@ static void gen11_dsi_gate_clocks(struct intel_encoder *encoder) static void gen11_dsi_ungate_clocks(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); u32 tmp; enum phy phy; @@ -615,7 +615,7 @@ static void gen11_dsi_ungate_clocks(struct intel_encoder *encoder) static bool gen11_dsi_is_clock_enabled(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); bool clock_enabled = false; enum phy phy; @@ -634,7 +634,7 @@ static bool gen11_dsi_is_clock_enabled(struct intel_encoder *encoder) static void gen11_dsi_map_pll(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); struct intel_shared_dpll *pll = crtc_state->shared_dpll; enum phy phy; @@ -663,7 +663,7 @@ static void gen11_dsi_configure_transcoder(struct intel_encoder *encoder, const struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); enum pipe pipe = crtc->pipe; @@ -823,7 +823,7 @@ static void gen11_dsi_set_transcoder_timings(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; @@ -987,7 +987,7 @@ gen11_dsi_set_transcoder_timings(struct intel_encoder *encoder, static void gen11_dsi_enable_transcoder(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; enum transcoder dsi_trans; @@ -1007,7 +1007,7 @@ static void gen11_dsi_enable_transcoder(struct intel_encoder *encoder) static void gen11_dsi_setup_timeouts(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; enum transcoder dsi_trans; @@ -1054,7 +1054,7 @@ static void gen11_dsi_setup_timeouts(struct intel_encoder *encoder, static void gen11_dsi_config_util_pin(struct intel_encoder *encoder, bool enable) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); u32 tmp; @@ -1111,7 +1111,7 @@ gen11_dsi_enable_port_and_phy(struct intel_encoder *encoder, static void gen11_dsi_powerup_panel(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); struct mipi_dsi_device *dsi; enum port port; @@ -1191,7 +1191,7 @@ static void gen11_dsi_pre_enable(struct intel_atomic_state *state, static void icl_apply_kvmr_pipe_a_wa(struct intel_encoder *encoder, enum pipe pipe, bool enable) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); if (DISPLAY_VER(dev_priv) == 11 && pipe == PIPE_B) intel_de_rmw(dev_priv, CHICKEN_PAR1_1, @@ -1207,7 +1207,7 @@ static void icl_apply_kvmr_pipe_a_wa(struct intel_encoder *encoder, */ static void adlp_set_lp_hs_wakeup_gb(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -1247,7 +1247,7 @@ static void gen11_dsi_enable(struct intel_atomic_state *state, static void gen11_dsi_disable_transcoder(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; enum transcoder dsi_trans; @@ -1280,7 +1280,7 @@ static void gen11_dsi_powerdown_panel(struct intel_encoder *encoder) static void gen11_dsi_deconfigure_trancoder(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; enum transcoder dsi_trans; @@ -1326,7 +1326,7 @@ static void gen11_dsi_deconfigure_trancoder(struct intel_encoder *encoder) static void gen11_dsi_disable_port(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -1346,7 +1346,7 @@ static void gen11_dsi_disable_port(struct intel_encoder *encoder) static void gen11_dsi_disable_io_power(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -1460,7 +1460,7 @@ static void gen11_dsi_get_timings(struct intel_encoder *encoder, static bool gen11_dsi_is_periodic_cmd_mode(struct intel_dsi *intel_dsi) { - struct drm_device *dev = intel_dsi->base.base.dev; + struct drm_device *dev = intel_dsi->base.base.drm; struct drm_i915_private *dev_priv = to_i915(dev); enum transcoder dsi_trans; u32 val; @@ -1513,7 +1513,7 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder, static void gen11_dsi_sync_state(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *intel_crtc; enum pipe pipe; @@ -1535,7 +1535,7 @@ static void gen11_dsi_sync_state(struct intel_encoder *encoder, static int gen11_dsi_dsc_compute_config(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; int dsc_max_bpc = DISPLAY_VER(dev_priv) >= 12 ? 12 : 10; bool use_dsc; @@ -1583,7 +1583,7 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi, base); struct intel_connector *intel_connector = intel_dsi->attached_connector; @@ -1636,7 +1636,7 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder, static void gen11_dsi_get_power_domains(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); get_dsi_io_power_domains(i915, enc_to_intel_dsi(encoder)); @@ -1645,7 +1645,7 @@ static void gen11_dsi_get_power_domains(struct intel_encoder *encoder, static bool gen11_dsi_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum transcoder dsi_trans; intel_wakeref_t wakeref; @@ -1691,7 +1691,8 @@ static bool gen11_dsi_initial_fastset_check(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state) { if (crtc_state->dsc.compression_enable) { - drm_dbg_kms(encoder->base.dev, "Forcing full modeset due to DSC being enabled\n"); + drm_dbg_kms(encoder->base.drm, + "Forcing full modeset due to DSC being enabled\n"); crtc_state->uapi.mode_changed = true; return false; @@ -1789,7 +1790,7 @@ static const struct mipi_dsi_host_ops gen11_dsi_host_ops = { static void icl_dphy_param_init(struct intel_dsi *intel_dsi) { - struct drm_device *dev = intel_dsi->base.base.dev; + struct drm_device *dev = intel_dsi->base.base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_connector *connector = intel_dsi->attached_connector; struct mipi_config *mipi_config = connector->panel.vbt.dsi.config; diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index 82fb23692c15..3b9ee53b5712 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -319,7 +319,7 @@ static int g4x_eld_buffer_size(struct drm_i915_private *i915) static void g4x_audio_codec_get_config(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); u32 *eld = (u32 *)crtc_state->eld; int eld_buffer_size, len, i; u32 tmp; @@ -341,7 +341,7 @@ static void g4x_audio_codec_disable(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); /* Invalidate ELD */ @@ -356,7 +356,7 @@ static void g4x_audio_codec_enable(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); const u32 *eld = (const u32 *)crtc_state->eld; int eld_buffer_size, len, i; @@ -385,7 +385,7 @@ static void hsw_dp_audio_config_update(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct i915_audio_component *acomp = i915->display.audio.component; enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; enum port port = encoder->port; @@ -433,7 +433,7 @@ static void hsw_hdmi_audio_config_update(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct i915_audio_component *acomp = i915->display.audio.component; enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; enum port port = encoder->port; @@ -485,7 +485,7 @@ static void hsw_audio_codec_disable(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); enum transcoder cpu_transcoder = old_crtc_state->cpu_transcoder; @@ -517,7 +517,7 @@ static void hsw_audio_codec_disable(struct intel_encoder *encoder, static unsigned int calc_hblank_early_prog(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); unsigned int link_clks_available, link_clks_required; unsigned int tu_data, tu_line, link_clks_active; unsigned int h_active, h_total, hblank_delta, pixel_clk; @@ -580,7 +580,7 @@ static unsigned int calc_samples_room(const struct intel_crtc_state *crtc_state) static void enable_audio_dsc_wa(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; unsigned int hblank_early_prog, samples_room; unsigned int val; @@ -626,7 +626,7 @@ static void hsw_audio_codec_enable(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; @@ -687,7 +687,7 @@ static void ibx_audio_codec_disable(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); enum port port = encoder->port; enum pipe pipe = crtc->pipe; @@ -723,7 +723,7 @@ static void ibx_audio_codec_enable(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); enum port port = encoder->port; enum pipe pipe = crtc->pipe; @@ -762,7 +762,7 @@ static void ibx_audio_codec_enable(struct intel_encoder *encoder, void intel_audio_sdp_split_update(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum transcoder trans = crtc_state->cpu_transcoder; if (HAS_DP20(i915)) @@ -774,7 +774,7 @@ bool intel_audio_compute_config(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state, struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct drm_connector *connector = conn_state->connector; const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; @@ -807,7 +807,7 @@ void intel_audio_codec_enable(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct i915_audio_component *acomp = i915->display.audio.component; struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); struct intel_connector *connector = to_intel_connector(conn_state->connector); @@ -866,7 +866,7 @@ void intel_audio_codec_disable(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct i915_audio_component *acomp = i915->display.audio.component; struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); struct intel_connector *connector = to_intel_connector(old_conn_state->connector); @@ -911,7 +911,7 @@ void intel_audio_codec_disable(struct intel_encoder *encoder, static void intel_acomp_get_config(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; struct intel_audio_state *audio_state; @@ -928,7 +928,7 @@ static void intel_acomp_get_config(struct intel_encoder *encoder, void intel_audio_codec_get_config(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); if (!crtc_state->has_audio) return; diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index 34a397adbd6b..b6dbb2de0aea 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -3550,7 +3550,7 @@ bool intel_bios_get_dsc_params(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state, int dsc_max_bpc) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); const struct intel_bios_encoder_data *devdata; list_for_each_entry(devdata, &i915->display.vbt.display_devices, node) { diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c index 608ec14776d5..61d0287167f7 100644 --- a/drivers/gpu/drm/i915/display/intel_crt.c +++ b/drivers/gpu/drm/i915/display/intel_crt.c @@ -99,7 +99,7 @@ bool intel_crt_port_enabled(struct drm_i915_private *dev_priv, static bool intel_crt_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crt *crt = intel_encoder_to_crt(encoder); intel_wakeref_t wakeref; bool ret; @@ -118,7 +118,7 @@ static bool intel_crt_get_hw_state(struct intel_encoder *encoder, static unsigned int intel_crt_get_flags(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crt *crt = intel_encoder_to_crt(encoder); u32 tmp, flags = 0; @@ -167,7 +167,7 @@ static void intel_crt_set_dpms(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, int mode) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crt *crt = intel_encoder_to_crt(encoder); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; @@ -240,7 +240,7 @@ static void hsw_disable_crt(struct intel_atomic_state *state, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); drm_WARN_ON(&dev_priv->drm, !old_crtc_state->has_pch_encoder); @@ -253,7 +253,7 @@ static void hsw_post_disable_crt(struct intel_atomic_state *state, const struct drm_connector_state *old_conn_state) { struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); intel_crtc_vblank_off(old_crtc_state); @@ -281,7 +281,7 @@ static void hsw_pre_pll_enable_crt(struct intel_atomic_state *state, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); drm_WARN_ON(&dev_priv->drm, !crtc_state->has_pch_encoder); @@ -293,7 +293,7 @@ static void hsw_pre_enable_crt(struct intel_atomic_state *state, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); enum pipe pipe = crtc->pipe; @@ -311,7 +311,7 @@ static void hsw_enable_crt(struct intel_atomic_state *state, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); enum pipe pipe = crtc->pipe; @@ -422,7 +422,7 @@ static int hsw_crt_compute_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; @@ -648,7 +648,7 @@ static int intel_crt_ddc_get_modes(struct drm_connector *connector, static bool intel_crt_detect_ddc(struct drm_connector *connector) { struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector)); - struct drm_i915_private *dev_priv = to_i915(crt->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(crt->base.base.drm); const struct drm_edid *drm_edid; struct i2c_adapter *i2c; bool ret = false; @@ -686,7 +686,7 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector) static enum drm_connector_status intel_crt_load_detect(struct intel_crt *crt, enum pipe pipe) { - struct drm_device *dev = crt->base.base.dev; + struct drm_device *dev = crt->base.base.drm; struct drm_i915_private *dev_priv = to_i915(dev); enum transcoder cpu_transcoder = (enum transcoder)pipe; u32 save_bclrpat; @@ -946,7 +946,7 @@ static int intel_crt_get_modes(struct drm_connector *connector) void intel_crt_reset(struct drm_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->dev); + struct drm_i915_private *dev_priv = to_i915(encoder->drm); struct intel_crt *crt = intel_encoder_to_crt(to_intel_encoder(encoder)); if (DISPLAY_VER(dev_priv) >= 5) { diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c b/drivers/gpu/drm/i915/display/intel_cx0_phy.c index 41837b17602d..183024d2ca4a 100644 --- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c +++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c @@ -63,7 +63,7 @@ assert_dc_off(struct drm_i915_private *i915) */ static intel_wakeref_t intel_cx0_phy_transaction_begin(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); intel_psr_pause(intel_dp); @@ -72,7 +72,7 @@ static intel_wakeref_t intel_cx0_phy_transaction_begin(struct intel_encoder *enc static void intel_cx0_phy_transaction_end(struct intel_encoder *encoder, intel_wakeref_t wakeref) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); intel_psr_resume(intel_dp); @@ -357,7 +357,7 @@ static u8 intel_c10_get_tx_term_ctl(const struct intel_crtc_state *crtc_state) void intel_cx0_phy_set_signal_levels(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); const struct intel_ddi_buf_trans *trans; enum phy phy = intel_port_to_phy(i915, encoder->port); intel_wakeref_t wakeref; @@ -1763,7 +1763,7 @@ intel_c10pll_tables_get(struct intel_crtc_state *crtc_state, static void intel_c10pll_update_pll(struct intel_crtc_state *crtc_state, struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_cx0pll_state *pll_state = &crtc_state->cx0pll_state; int i; @@ -1809,7 +1809,7 @@ static int intel_c10pll_calc_state(struct intel_crtc_state *crtc_state, void intel_c10pll_readout_hw_state(struct intel_encoder *encoder, struct intel_c10pll_state *pll_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); u8 lane = INTEL_CX0_LANE0; intel_wakeref_t wakeref; int i; @@ -2042,7 +2042,7 @@ static int intel_c20pll_calc_state(struct intel_crtc_state *crtc_state, int intel_cx0pll_calc_state(struct intel_crtc_state *crtc_state, struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); if (intel_is_c10phy(i915, phy)) @@ -2062,7 +2062,7 @@ static bool intel_c20_use_mplla(u32 clock) void intel_c20pll_readout_hw_state(struct intel_encoder *encoder, struct intel_c20pll_state *pll_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); bool cntx; intel_wakeref_t wakeref; int i; @@ -2410,7 +2410,7 @@ static void intel_program_port_clock_ctl(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, bool lane_reversal) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); u32 val = 0; intel_de_rmw(i915, XELPDP_PORT_BUF_CTL1(encoder->port), XELPDP_PORT_REVERSAL, @@ -2697,7 +2697,7 @@ static u32 intel_cx0_get_pclk_pll_ack(u8 lane_mask) static void intel_cx0pll_enable(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); bool lane_reversal = dig_port->saved_port_bits & DDI_BUF_PORT_REVERSAL; @@ -2772,7 +2772,7 @@ static void intel_cx0pll_enable(struct intel_encoder *encoder, int intel_mtl_tbt_calc_port_clock(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); u32 clock; u32 val = intel_de_read(i915, XELPDP_PORT_CLOCK_CTL(encoder->port)); @@ -2817,7 +2817,7 @@ static int intel_mtl_tbt_clock_select(struct drm_i915_private *i915, int clock) static void intel_mtl_tbt_pll_enable(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); u32 val = 0; @@ -2878,7 +2878,7 @@ void intel_mtl_pll_enable(struct intel_encoder *encoder, static void intel_cx0pll_disable(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); bool is_c10 = intel_is_c10phy(i915, phy); intel_wakeref_t wakeref = intel_cx0_phy_transaction_begin(encoder); @@ -2930,7 +2930,7 @@ static void intel_cx0pll_disable(struct intel_encoder *encoder) static void intel_mtl_tbt_pll_disable(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); /* @@ -2980,7 +2980,7 @@ enum icl_port_dpll_id intel_mtl_port_pll_type(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); /* * TODO: Determine the PLL type from the SW state, once MTL PLL * handling is done via the standard shared DPLL framework. diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index 26955a3efb3e..abe754da87c7 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -117,7 +117,7 @@ static bool has_iboost(struct drm_i915_private *i915) void hsw_prepare_dp_ddi_buffers(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 iboost_bit = 0; int i, n_entries; enum port port = encoder->port; @@ -148,7 +148,7 @@ void hsw_prepare_dp_ddi_buffers(struct intel_encoder *encoder, static void hsw_prepare_hdmi_ddi_buffers(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); int level = intel_ddi_level(encoder, crtc_state, 0); u32 iboost_bit = 0; int n_entries; @@ -323,7 +323,7 @@ static u32 ddi_buf_phy_link_rate(int port_clock) static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); enum phy phy = intel_port_to_phy(i915, encoder->port); @@ -451,7 +451,7 @@ static void intel_ddi_config_transcoder_dp2(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; u32 val = 0; @@ -670,7 +670,7 @@ int intel_ddi_toggle_hdcp_bits(struct intel_encoder *intel_encoder, enum transcoder cpu_transcoder, bool enable, u32 hdcp_mask) { - struct drm_device *dev = intel_encoder->base.dev; + struct drm_device *dev = intel_encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); intel_wakeref_t wakeref; int ret = 0; @@ -756,7 +756,7 @@ bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector) static void intel_ddi_get_encoder_pipes(struct intel_encoder *encoder, u8 *pipe_mask, bool *is_dp_mst) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); enum port port = encoder->port; intel_wakeref_t wakeref; @@ -889,7 +889,7 @@ static enum intel_display_power_domain intel_ddi_main_link_aux_domain(struct intel_digital_port *dig_port, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); enum phy phy = intel_port_to_phy(i915, dig_port->base.port); /* @@ -919,7 +919,7 @@ static void main_link_aux_power_domain_get(struct intel_digital_port *dig_port, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); enum intel_display_power_domain domain = intel_ddi_main_link_aux_domain(dig_port, crtc_state); @@ -935,7 +935,7 @@ static void main_link_aux_power_domain_put(struct intel_digital_port *dig_port, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); enum intel_display_power_domain domain = intel_ddi_main_link_aux_domain(dig_port, crtc_state); intel_wakeref_t wf; @@ -950,7 +950,7 @@ main_link_aux_power_domain_put(struct intel_digital_port *dig_port, static void intel_ddi_get_power_domains(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_digital_port *dig_port; /* @@ -1031,7 +1031,7 @@ static void skl_ddi_set_iboost(struct intel_encoder *encoder, int level) { struct intel_digital_port *dig_port = enc_to_dig_port(encoder); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u8 iboost; if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) @@ -1066,7 +1066,7 @@ static u8 intel_ddi_dp_voltage_max(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state) { struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); int n_entries; encoder->get_buf_trans(encoder, crtc_state, &n_entries); @@ -1106,7 +1106,7 @@ static u32 icl_combo_phy_loadgen_select(const struct intel_crtc_state *crtc_stat static void icl_ddi_combo_vswing_program(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); const struct intel_ddi_buf_trans *trans; enum phy phy = intel_port_to_phy(dev_priv, encoder->port); int n_entries, ln; @@ -1170,7 +1170,7 @@ static void icl_ddi_combo_vswing_program(struct intel_encoder *encoder, static void icl_combo_phy_set_signal_levels(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(dev_priv, encoder->port); u32 val; int ln; @@ -1221,7 +1221,7 @@ static void icl_combo_phy_set_signal_levels(struct intel_encoder *encoder, static void icl_mg_phy_set_signal_levels(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum tc_port tc_port = intel_port_to_tc(dev_priv, encoder->port); const struct intel_ddi_buf_trans *trans; int n_entries, ln; @@ -1322,7 +1322,7 @@ static void icl_mg_phy_set_signal_levels(struct intel_encoder *encoder, static void tgl_dkl_phy_set_signal_levels(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum tc_port tc_port = intel_port_to_tc(dev_priv, encoder->port); const struct intel_ddi_buf_trans *trans; int n_entries, ln; @@ -1424,7 +1424,7 @@ int intel_ddi_level(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, int lane) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); const struct intel_ddi_buf_trans *trans; int level, n_entries; @@ -1448,7 +1448,7 @@ static void hsw_set_signal_levels(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); int level = intel_ddi_level(encoder, crtc_state, 0); enum port port = encoder->port; @@ -1519,7 +1519,7 @@ _icl_ddi_get_pll(struct drm_i915_private *i915, i915_reg_t reg, static void adls_ddi_enable_clock(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); const struct intel_shared_dpll *pll = crtc_state->shared_dpll; enum phy phy = intel_port_to_phy(i915, encoder->port); @@ -1534,7 +1534,7 @@ static void adls_ddi_enable_clock(struct intel_encoder *encoder, static void adls_ddi_disable_clock(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); _icl_ddi_disable_clock(i915, ADLS_DPCLKA_CFGCR(phy), @@ -1543,7 +1543,7 @@ static void adls_ddi_disable_clock(struct intel_encoder *encoder) static bool adls_ddi_is_clock_enabled(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); return _icl_ddi_is_clock_enabled(i915, ADLS_DPCLKA_CFGCR(phy), @@ -1552,7 +1552,7 @@ static bool adls_ddi_is_clock_enabled(struct intel_encoder *encoder) static struct intel_shared_dpll *adls_ddi_get_pll(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); return _icl_ddi_get_pll(i915, ADLS_DPCLKA_CFGCR(phy), @@ -1563,7 +1563,7 @@ static struct intel_shared_dpll *adls_ddi_get_pll(struct intel_encoder *encoder) static void rkl_ddi_enable_clock(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); const struct intel_shared_dpll *pll = crtc_state->shared_dpll; enum phy phy = intel_port_to_phy(i915, encoder->port); @@ -1578,7 +1578,7 @@ static void rkl_ddi_enable_clock(struct intel_encoder *encoder, static void rkl_ddi_disable_clock(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); _icl_ddi_disable_clock(i915, ICL_DPCLKA_CFGCR0, @@ -1587,7 +1587,7 @@ static void rkl_ddi_disable_clock(struct intel_encoder *encoder) static bool rkl_ddi_is_clock_enabled(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); return _icl_ddi_is_clock_enabled(i915, ICL_DPCLKA_CFGCR0, @@ -1596,7 +1596,7 @@ static bool rkl_ddi_is_clock_enabled(struct intel_encoder *encoder) static struct intel_shared_dpll *rkl_ddi_get_pll(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); return _icl_ddi_get_pll(i915, ICL_DPCLKA_CFGCR0, @@ -1607,7 +1607,7 @@ static struct intel_shared_dpll *rkl_ddi_get_pll(struct intel_encoder *encoder) static void dg1_ddi_enable_clock(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); const struct intel_shared_dpll *pll = crtc_state->shared_dpll; enum phy phy = intel_port_to_phy(i915, encoder->port); @@ -1631,7 +1631,7 @@ static void dg1_ddi_enable_clock(struct intel_encoder *encoder, static void dg1_ddi_disable_clock(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); _icl_ddi_disable_clock(i915, DG1_DPCLKA_CFGCR0(phy), @@ -1640,7 +1640,7 @@ static void dg1_ddi_disable_clock(struct intel_encoder *encoder) static bool dg1_ddi_is_clock_enabled(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); return _icl_ddi_is_clock_enabled(i915, DG1_DPCLKA_CFGCR0(phy), @@ -1649,7 +1649,7 @@ static bool dg1_ddi_is_clock_enabled(struct intel_encoder *encoder) static struct intel_shared_dpll *dg1_ddi_get_pll(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); enum intel_dpll_id id; u32 val; @@ -1673,7 +1673,7 @@ static struct intel_shared_dpll *dg1_ddi_get_pll(struct intel_encoder *encoder) static void icl_ddi_combo_enable_clock(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); const struct intel_shared_dpll *pll = crtc_state->shared_dpll; enum phy phy = intel_port_to_phy(i915, encoder->port); @@ -1688,7 +1688,7 @@ static void icl_ddi_combo_enable_clock(struct intel_encoder *encoder, static void icl_ddi_combo_disable_clock(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); _icl_ddi_disable_clock(i915, ICL_DPCLKA_CFGCR0, @@ -1697,7 +1697,7 @@ static void icl_ddi_combo_disable_clock(struct intel_encoder *encoder) static bool icl_ddi_combo_is_clock_enabled(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); return _icl_ddi_is_clock_enabled(i915, ICL_DPCLKA_CFGCR0, @@ -1706,7 +1706,7 @@ static bool icl_ddi_combo_is_clock_enabled(struct intel_encoder *encoder) struct intel_shared_dpll *icl_ddi_combo_get_pll(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); return _icl_ddi_get_pll(i915, ICL_DPCLKA_CFGCR0, @@ -1717,7 +1717,7 @@ struct intel_shared_dpll *icl_ddi_combo_get_pll(struct intel_encoder *encoder) static void jsl_ddi_tc_enable_clock(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); const struct intel_shared_dpll *pll = crtc_state->shared_dpll; enum port port = encoder->port; @@ -1735,7 +1735,7 @@ static void jsl_ddi_tc_enable_clock(struct intel_encoder *encoder, static void jsl_ddi_tc_disable_clock(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum port port = encoder->port; icl_ddi_combo_disable_clock(encoder); @@ -1745,7 +1745,7 @@ static void jsl_ddi_tc_disable_clock(struct intel_encoder *encoder) static bool jsl_ddi_tc_is_clock_enabled(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum port port = encoder->port; u32 tmp; @@ -1760,7 +1760,7 @@ static bool jsl_ddi_tc_is_clock_enabled(struct intel_encoder *encoder) static void icl_ddi_tc_enable_clock(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); const struct intel_shared_dpll *pll = crtc_state->shared_dpll; enum tc_port tc_port = intel_port_to_tc(i915, encoder->port); enum port port = encoder->port; @@ -1781,7 +1781,7 @@ static void icl_ddi_tc_enable_clock(struct intel_encoder *encoder, static void icl_ddi_tc_disable_clock(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum tc_port tc_port = intel_port_to_tc(i915, encoder->port); enum port port = encoder->port; @@ -1797,7 +1797,7 @@ static void icl_ddi_tc_disable_clock(struct intel_encoder *encoder) static bool icl_ddi_tc_is_clock_enabled(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum tc_port tc_port = intel_port_to_tc(i915, encoder->port); enum port port = encoder->port; u32 tmp; @@ -1814,7 +1814,7 @@ static bool icl_ddi_tc_is_clock_enabled(struct intel_encoder *encoder) static struct intel_shared_dpll *icl_ddi_tc_get_pll(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum tc_port tc_port = intel_port_to_tc(i915, encoder->port); enum port port = encoder->port; enum intel_dpll_id id; @@ -1844,7 +1844,7 @@ static struct intel_shared_dpll *icl_ddi_tc_get_pll(struct intel_encoder *encode static struct intel_shared_dpll *bxt_ddi_get_pll(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum intel_dpll_id id; switch (encoder->port) { @@ -1868,7 +1868,7 @@ static struct intel_shared_dpll *bxt_ddi_get_pll(struct intel_encoder *encoder) static void skl_ddi_enable_clock(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); const struct intel_shared_dpll *pll = crtc_state->shared_dpll; enum port port = encoder->port; @@ -1888,7 +1888,7 @@ static void skl_ddi_enable_clock(struct intel_encoder *encoder, static void skl_ddi_disable_clock(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum port port = encoder->port; mutex_lock(&i915->display.dpll.lock); @@ -1901,7 +1901,7 @@ static void skl_ddi_disable_clock(struct intel_encoder *encoder) static bool skl_ddi_is_clock_enabled(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum port port = encoder->port; /* @@ -1913,7 +1913,7 @@ static bool skl_ddi_is_clock_enabled(struct intel_encoder *encoder) static struct intel_shared_dpll *skl_ddi_get_pll(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum port port = encoder->port; enum intel_dpll_id id; u32 tmp; @@ -1936,7 +1936,7 @@ static struct intel_shared_dpll *skl_ddi_get_pll(struct intel_encoder *encoder) void hsw_ddi_enable_clock(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); const struct intel_shared_dpll *pll = crtc_state->shared_dpll; enum port port = encoder->port; @@ -1948,7 +1948,7 @@ void hsw_ddi_enable_clock(struct intel_encoder *encoder, void hsw_ddi_disable_clock(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum port port = encoder->port; intel_de_write(i915, PORT_CLK_SEL(port), PORT_CLK_SEL_NONE); @@ -1956,7 +1956,7 @@ void hsw_ddi_disable_clock(struct intel_encoder *encoder) bool hsw_ddi_is_clock_enabled(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum port port = encoder->port; return intel_de_read(i915, PORT_CLK_SEL(port)) != PORT_CLK_SEL_NONE; @@ -1964,7 +1964,7 @@ bool hsw_ddi_is_clock_enabled(struct intel_encoder *encoder) static struct intel_shared_dpll *hsw_ddi_get_pll(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum port port = encoder->port; enum intel_dpll_id id; u32 tmp; @@ -2015,7 +2015,7 @@ void intel_ddi_disable_clock(struct intel_encoder *encoder) void intel_ddi_sanitize_encoder_pll_mapping(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); u32 port_mask; bool ddi_clk_needed; @@ -2080,7 +2080,7 @@ static void icl_program_mg_dp_mode(struct intel_digital_port *dig_port, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.drm); enum tc_port tc_port = intel_port_to_tc(dev_priv, dig_port->base.port); enum phy phy = intel_port_to_phy(dev_priv, dig_port->base.port); u32 ln0, ln1, pin_assignment; @@ -2173,7 +2173,7 @@ tgl_dp_tp_transcoder(const struct intel_crtc_state *crtc_state) i915_reg_t dp_tp_ctl_reg(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); if (DISPLAY_VER(dev_priv) >= 12) return TGL_DP_TP_CTL(tgl_dp_tp_transcoder(crtc_state)); @@ -2184,7 +2184,7 @@ i915_reg_t dp_tp_ctl_reg(struct intel_encoder *encoder, i915_reg_t dp_tp_status_reg(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); if (DISPLAY_VER(dev_priv) >= 12) return TGL_DP_TP_STATUS(tgl_dp_tp_transcoder(crtc_state)); @@ -2224,7 +2224,7 @@ static void intel_dp_sink_set_fec_ready(struct intel_dp *intel_dp, static void intel_ddi_enable_fec(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); if (!crtc_state->fec_enable) return; @@ -2236,7 +2236,7 @@ static void intel_ddi_enable_fec(struct intel_encoder *encoder, static void intel_ddi_disable_fec_state(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); if (!crtc_state->fec_enable) return; @@ -2249,7 +2249,7 @@ static void intel_ddi_disable_fec_state(struct intel_encoder *encoder, static void intel_ddi_power_up_lanes(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); enum phy phy = intel_port_to_phy(i915, encoder->port); @@ -2354,7 +2354,7 @@ static u8 mtl_get_port_width(u8 lane_count) static void mtl_ddi_enable_d2d(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum port port = encoder->port; intel_de_rmw(dev_priv, XELPDP_PORT_BUF_CTL1(port), 0, @@ -2370,7 +2370,7 @@ mtl_ddi_enable_d2d(struct intel_encoder *encoder) static void mtl_port_buf_ctl_program(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); enum port port = encoder->port; u32 val; @@ -2393,7 +2393,7 @@ static void mtl_port_buf_ctl_program(struct intel_encoder *encoder, static void mtl_port_buf_ctl_io_selection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); u32 val; @@ -2513,7 +2513,7 @@ static void tgl_ddi_pre_enable_dp(struct intel_atomic_state *state, const struct drm_connector_state *conn_state) { struct intel_dp *intel_dp = enc_to_intel_dp(encoder); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); bool is_mst = intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST); @@ -2651,7 +2651,7 @@ static void hsw_ddi_pre_enable_dp(struct intel_atomic_state *state, const struct drm_connector_state *conn_state) { struct intel_dp *intel_dp = enc_to_intel_dp(encoder); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum port port = encoder->port; struct intel_digital_port *dig_port = enc_to_dig_port(encoder); bool is_mst = intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST); @@ -2715,7 +2715,7 @@ static void intel_ddi_pre_enable_dp(struct intel_atomic_state *state, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); if (HAS_DP20(dev_priv)) intel_dp_128b132b_sdp_crc16(enc_to_intel_dp(encoder), @@ -2742,7 +2742,7 @@ static void intel_ddi_pre_enable_hdmi(struct intel_atomic_state *state, { struct intel_digital_port *dig_port = enc_to_dig_port(encoder); struct intel_hdmi *intel_hdmi = &dig_port->hdmi; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); intel_dp_dual_mode_set_tmds_output(intel_hdmi, true); intel_ddi_enable_clock(encoder, crtc_state); @@ -2807,7 +2807,7 @@ static void intel_ddi_pre_enable(struct intel_atomic_state *state, static void mtl_ddi_disable_d2d_link(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum port port = encoder->port; intel_de_rmw(dev_priv, XELPDP_PORT_BUF_CTL1(port), @@ -2822,7 +2822,7 @@ mtl_ddi_disable_d2d_link(struct intel_encoder *encoder) static void mtl_disable_ddi_buf(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum port port = encoder->port; u32 val; @@ -2849,7 +2849,7 @@ static void mtl_disable_ddi_buf(struct intel_encoder *encoder, static void disable_ddi_buf(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum port port = encoder->port; bool wait = false; u32 val; @@ -2875,7 +2875,7 @@ static void disable_ddi_buf(struct intel_encoder *encoder, static void intel_disable_ddi_buf(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); if (DISPLAY_VER(dev_priv) >= 14) { mtl_disable_ddi_buf(encoder, crtc_state); @@ -2892,7 +2892,7 @@ static void intel_ddi_post_disable_dp(struct intel_atomic_state *state, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); struct intel_dp *intel_dp = &dig_port->dp; intel_wakeref_t wakeref; @@ -2955,7 +2955,7 @@ static void intel_ddi_post_disable_hdmi(struct intel_atomic_state *state, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); struct intel_hdmi *intel_hdmi = &dig_port->hdmi; intel_wakeref_t wakeref; @@ -2987,7 +2987,7 @@ static void intel_ddi_post_disable(struct intel_atomic_state *state, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *slave_crtc; if (!intel_crtc_has_type(old_crtc_state, INTEL_OUTPUT_DP_MST)) { @@ -3042,7 +3042,7 @@ static void intel_ddi_post_pll_disable(struct intel_atomic_state *state, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); enum phy phy = intel_port_to_phy(i915, encoder->port); bool is_tc_port = intel_phy_is_tc(i915, phy); @@ -3095,7 +3095,7 @@ static void intel_enable_ddi_dp(struct intel_atomic_state *state, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); enum port port = encoder->port; @@ -3139,7 +3139,7 @@ static void intel_enable_ddi_hdmi(struct intel_atomic_state *state, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); struct drm_connector *connector = conn_state->connector; enum port port = encoder->port; @@ -3290,7 +3290,7 @@ static void intel_disable_ddi_hdmi(struct intel_atomic_state *state, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct drm_connector *connector = old_conn_state->connector; intel_audio_codec_disable(encoder, old_crtc_state, old_conn_state); @@ -3350,7 +3350,7 @@ void intel_ddi_update_active_dpll(struct intel_atomic_state *state, struct intel_encoder *encoder, struct intel_crtc *crtc) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); struct intel_crtc *slave_crtc; @@ -3372,7 +3372,7 @@ intel_ddi_pre_pll_enable(struct intel_atomic_state *state, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); enum phy phy = intel_port_to_phy(dev_priv, encoder->port); bool is_tc_port = intel_phy_is_tc(dev_priv, phy); @@ -3400,7 +3400,7 @@ intel_ddi_pre_pll_enable(struct intel_atomic_state *state, static void adlp_tbt_to_dp_alt_switch_wa(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum tc_port tc_port = intel_port_to_tc(i915, encoder->port); int ln; @@ -3413,7 +3413,7 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp, { struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); struct intel_encoder *encoder = &dig_port->base; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum port port = encoder->port; u32 dp_tp_ctl; @@ -3460,7 +3460,7 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp, { struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); struct intel_encoder *encoder = &dig_port->base; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum port port = encoder->port; u32 dp_tp_ctl, ddi_buf_ctl; bool wait = false; @@ -3510,7 +3510,7 @@ static void intel_ddi_set_link_train(struct intel_dp *intel_dp, u8 dp_train_pat) { struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 temp; temp = intel_de_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state)); @@ -3541,7 +3541,7 @@ static void intel_ddi_set_idle_link_train(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state) { struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum port port = encoder->port; intel_de_rmw(dev_priv, dp_tp_ctl_reg(encoder, crtc_state), @@ -3651,7 +3651,7 @@ static void bdw_get_trans_port_sync_config(struct intel_crtc_state *crtc_state) static void intel_ddi_read_func_ctl(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; struct intel_digital_port *dig_port = enc_to_dig_port(encoder); @@ -3771,7 +3771,7 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder, static void intel_ddi_get_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; /* XXX: DSI transcoder paranoia */ @@ -3826,7 +3826,7 @@ void intel_ddi_get_clock(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state, struct intel_shared_dpll *pll) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum icl_port_dpll_id port_dpll_id = ICL_PORT_DPLL_DEFAULT; struct icl_port_dpll *port_dpll = &crtc_state->icl_port_dplls[port_dpll_id]; bool pll_active; @@ -3847,7 +3847,7 @@ void intel_ddi_get_clock(struct intel_encoder *encoder, static void mtl_ddi_get_config(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); @@ -3912,7 +3912,7 @@ static enum icl_port_dpll_id icl_ddi_tc_port_pll_type(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); const struct intel_shared_dpll *pll = crtc_state->shared_dpll; if (drm_WARN_ON(&i915->drm, !pll)) @@ -3938,7 +3938,7 @@ static void icl_ddi_tc_get_clock(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state, struct intel_shared_dpll *pll) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum icl_port_dpll_id port_dpll_id; struct icl_port_dpll *port_dpll; bool pll_active; @@ -3997,7 +3997,7 @@ void hsw_ddi_get_config(struct intel_encoder *encoder, static void intel_ddi_sync_state(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); if (intel_phy_is_tc(i915, phy)) @@ -4011,7 +4011,7 @@ static void intel_ddi_sync_state(struct intel_encoder *encoder, static bool intel_ddi_initial_fastset_check(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); bool fastset = true; @@ -4052,7 +4052,7 @@ static int intel_ddi_compute_config(struct intel_encoder *encoder, struct drm_connector_state *conn_state) { struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum port port = encoder->port; int ret; @@ -4167,7 +4167,7 @@ static int intel_ddi_compute_config_late(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state, struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct drm_connector *connector = conn_state->connector; u8 port_sync_transcoders = 0; @@ -4199,7 +4199,7 @@ static int intel_ddi_compute_config_late(struct intel_encoder *encoder, static void intel_ddi_encoder_destroy(struct drm_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->dev); + struct drm_i915_private *i915 = to_i915(encoder->drm); struct intel_digital_port *dig_port = enc_to_dig_port(to_intel_encoder(encoder)); enum phy phy = intel_port_to_phy(i915, dig_port->base.port); @@ -4215,7 +4215,7 @@ static void intel_ddi_encoder_destroy(struct drm_encoder *encoder) static void intel_ddi_encoder_reset(struct drm_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->dev); + struct drm_i915_private *i915 = to_i915(encoder->drm); struct intel_dp *intel_dp = enc_to_intel_dp(to_intel_encoder(encoder)); struct intel_digital_port *dig_port = enc_to_dig_port(to_intel_encoder(encoder)); enum phy phy = intel_port_to_phy(i915, dig_port->base.port); @@ -4246,7 +4246,7 @@ static const struct drm_encoder_funcs intel_ddi_funcs = { static struct intel_connector * intel_ddi_init_dp_connector(struct intel_digital_port *dig_port) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_connector *connector; enum port port = dig_port->base.port; @@ -4271,7 +4271,7 @@ intel_ddi_init_dp_connector(struct intel_digital_port *dig_port) } if (dig_port->base.type == INTEL_OUTPUT_EDP) { - struct drm_device *dev = dig_port->base.base.dev; + struct drm_device *dev = dig_port->base.base.drm; struct drm_privacy_screen *privacy_screen; privacy_screen = drm_privacy_screen_get(dev->dev, NULL); @@ -4318,7 +4318,7 @@ static int modeset_pipe(struct drm_crtc *crtc, static int intel_hdmi_reset_link(struct intel_encoder *encoder, struct drm_modeset_acquire_ctx *ctx) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_hdmi *hdmi = enc_to_intel_hdmi(encoder); struct intel_connector *connector = hdmi->attached_connector; struct i2c_adapter *adapter = @@ -4392,7 +4392,7 @@ static enum intel_hotplug_state intel_ddi_hotplug(struct intel_encoder *encoder, struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); struct intel_dp *intel_dp = &dig_port->dp; enum phy phy = intel_port_to_phy(i915, encoder->port); @@ -4418,7 +4418,7 @@ intel_ddi_hotplug(struct intel_encoder *encoder, ret = intel_dp_retrain_link(encoder, &ctx); } - drm_WARN_ON(encoder->base.dev, ret); + drm_WARN_ON(encoder->base.drm, ret); } /* @@ -4453,7 +4453,7 @@ intel_ddi_hotplug(struct intel_encoder *encoder, static bool lpt_digital_port_connected(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 bit = dev_priv->display.hotplug.pch_hpd[encoder->hpd_pin]; return intel_de_read(dev_priv, SDEISR) & bit; @@ -4461,7 +4461,7 @@ static bool lpt_digital_port_connected(struct intel_encoder *encoder) static bool hsw_digital_port_connected(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 bit = dev_priv->display.hotplug.hpd[encoder->hpd_pin]; return intel_de_read(dev_priv, DEISR) & bit; @@ -4469,7 +4469,7 @@ static bool hsw_digital_port_connected(struct intel_encoder *encoder) static bool bdw_digital_port_connected(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 bit = dev_priv->display.hotplug.hpd[encoder->hpd_pin]; return intel_de_read(dev_priv, GEN8_DE_PORT_ISR) & bit; @@ -4493,7 +4493,7 @@ intel_ddi_init_hdmi_connector(struct intel_digital_port *dig_port) static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dig_port) { - struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.drm); if (dig_port->base.port != PORT_A) return false; @@ -4513,7 +4513,7 @@ static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dig_port) static int intel_ddi_max_lanes(struct intel_digital_port *dig_port) { - struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.drm); enum port port = dig_port->base.port; int max_lanes = 4; diff --git a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c index b7d20485bde5..d8431f3929f3 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c +++ b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c @@ -1387,7 +1387,7 @@ tgl_get_combo_buf_trans_dp(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, int *n_entries) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); if (crtc_state->port_clock > 270000) { if (IS_TGL_UY(dev_priv)) { @@ -1671,7 +1671,7 @@ mtl_get_cx0_buf_trans(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, int *n_entries) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); if (intel_crtc_has_dp_encoder(crtc_state) && crtc_state->port_clock >= 1000000) @@ -1684,7 +1684,7 @@ mtl_get_cx0_buf_trans(struct intel_encoder *encoder, void intel_ddi_buf_trans_init(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); if (DISPLAY_VER(i915) >= 14) { diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 5d381ca03aa2..0c8beaa8f638 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -1822,7 +1822,7 @@ enum tc_port intel_port_to_tc(struct drm_i915_private *dev_priv, enum port port) enum intel_display_power_domain intel_aux_power_domain(struct intel_digital_port *dig_port) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); if (intel_tc_port_in_tbt_alt_mode(dig_port)) return intel_display_power_tbt_aux_domain(i915, dig_port->aux_ch); @@ -3967,7 +3967,7 @@ int intel_crtc_dotclock(const struct intel_crtc_state *pipe_config) struct drm_display_mode * intel_encoder_current_mode(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc_state *crtc_state; struct drm_display_mode *mode; struct intel_crtc *crtc; @@ -7328,7 +7328,7 @@ int intel_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data, static u32 intel_encoder_possible_clones(struct intel_encoder *encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct intel_encoder *source_encoder; u32 possible_clones = 0; @@ -7342,7 +7342,7 @@ static u32 intel_encoder_possible_clones(struct intel_encoder *encoder) static u32 intel_encoder_possible_crtcs(struct intel_encoder *encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct intel_crtc *crtc; u32 possible_crtcs = 0; diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c index 53d577a71c2b..a4b818da32ed 100644 --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c @@ -1264,7 +1264,7 @@ static ssize_t i915_dsc_fec_support_write(struct file *file, struct drm_connector *connector = ((struct seq_file *)file->private_data)->private; struct intel_encoder *encoder = intel_attached_encoder(to_intel_connector(connector)); - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); if (len == 0) diff --git a/drivers/gpu/drm/i915/display/intel_display_power_well.c b/drivers/gpu/drm/i915/display/intel_display_power_well.c index 916009894d89..e5930ca68f12 100644 --- a/drivers/gpu/drm/i915/display/intel_display_power_well.c +++ b/drivers/gpu/drm/i915/display/intel_display_power_well.c @@ -1596,7 +1596,7 @@ bool chv_phy_powergate_ch(struct drm_i915_private *dev_priv, enum dpio_phy phy, void chv_phy_powergate_lanes(struct intel_encoder *encoder, bool override, unsigned int mask) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct i915_power_domains *power_domains = &dev_priv->display.power.domains; enum dpio_phy phy = vlv_dig_port_to_phy(enc_to_dig_port(encoder)); enum dpio_channel ch = vlv_dig_port_to_channel(enc_to_dig_port(encoder)); diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 731f2ec04d5c..4e24ca3fc63c 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1978,7 +1978,7 @@ dp_to_lspcon(struct intel_dp *intel_dp) return &dp_to_dig_port(intel_dp)->lspcon; } -#define dp_to_i915(__intel_dp) to_i915(dp_to_dig_port(__intel_dp)->base.base.dev) +#define dp_to_i915(__intel_dp) to_i915(dp_to_dig_port(__intel_dp)->base.base.drm) #define CAN_PSR(intel_dp) ((intel_dp)->psr.sink_support && \ (intel_dp)->psr.source_support) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 79d0e99a9a76..0c1d60661bbc 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -391,7 +391,7 @@ bool intel_dp_can_bigjoiner(struct intel_dp *intel_dp) { struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); struct intel_encoder *encoder = &intel_dig_port->base; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); return DISPLAY_VER(dev_priv) >= 12 || (DISPLAY_VER(dev_priv) == 11 && @@ -406,7 +406,7 @@ static int dg2_max_source_rate(struct intel_dp *intel_dp) static int icl_max_source_rate(struct intel_dp *intel_dp) { struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); - struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.drm); enum phy phy = intel_port_to_phy(dev_priv, dig_port->base.port); if (intel_phy_is_combo(dev_priv, phy) && !intel_dp_is_edp(intel_dp)) @@ -426,7 +426,7 @@ static int ehl_max_source_rate(struct intel_dp *intel_dp) static int mtl_max_source_rate(struct intel_dp *intel_dp) { struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); enum phy phy = intel_port_to_phy(i915, dig_port->base.port); if (intel_is_c10phy(i915, phy)) @@ -480,7 +480,7 @@ intel_dp_set_source_rates(struct intel_dp *intel_dp) 162000, 270000 }; struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); - struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.drm); const int *source_rates; int size, max_rate = 0, vbt_max_rate; @@ -1564,7 +1564,7 @@ static int intel_dp_get_slice_height(int vactive) static int intel_dp_dsc_compute_params(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; u8 line_buf_depth; @@ -1650,7 +1650,7 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, bool compute_pipe_bpp) { struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); - struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.drm); const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; int pipe_bpp; @@ -1793,7 +1793,7 @@ intel_dp_compute_link_config(struct intel_encoder *encoder, struct drm_connector_state *conn_state, bool respect_downstream_limits) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; @@ -2164,7 +2164,7 @@ intel_dp_drrs_compute_config(struct intel_connector *connector, static bool intel_dp_has_audio(struct intel_encoder *encoder, const struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_connector *connector = intel_dp->attached_connector; const struct intel_digital_connector_state *intel_conn_state = @@ -2185,7 +2185,7 @@ intel_dp_compute_output_format(struct intel_encoder *encoder, struct drm_connector_state *conn_state, bool respect_downstream_limits) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_connector *connector = intel_dp->attached_connector; const struct drm_display_info *info = &connector->base.display_info; @@ -2228,7 +2228,7 @@ intel_dp_audio_compute_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct drm_connector *connector = conn_state->connector; pipe_config->sdp_split_enable = @@ -2245,7 +2245,7 @@ intel_dp_compute_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; struct intel_dp *intel_dp = enc_to_intel_dp(encoder); const struct drm_display_mode *fixed_mode; @@ -2471,7 +2471,7 @@ void intel_dp_wait_source_oui(struct intel_dp *intel_dp) void intel_dp_set_power(struct intel_dp *intel_dp, u8 mode) { struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base; - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); int ret, i; /* Should have a valid DPCD by this point */ @@ -2545,7 +2545,7 @@ void intel_dp_sync_state(struct intel_encoder *encoder, bool intel_dp_initial_fastset_check(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); bool fastset = true; @@ -3034,7 +3034,7 @@ static void intel_edp_mso_mode_fixup(struct intel_connector *connector, void intel_edp_fixup_vbt_bpp(struct intel_encoder *encoder, int pipe_bpp) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_connector *connector = intel_dp->attached_connector; @@ -3099,7 +3099,7 @@ static bool intel_edp_init_dpcd(struct intel_dp *intel_dp) { struct drm_i915_private *dev_priv = - to_i915(dp_to_dig_port(intel_dp)->base.base.dev); + to_i915(dp_to_dig_port(intel_dp)->base.base.drm); /* this function is meant to be called only once */ drm_WARN_ON(&dev_priv->drm, intel_dp->dpcd[DP_DPCD_REV] != 0); @@ -3469,7 +3469,7 @@ static void intel_write_dp_sdp(struct intel_encoder *encoder, unsigned int type) { struct intel_digital_port *dig_port = enc_to_dig_port(encoder); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct dp_sdp sdp = {}; ssize_t len; @@ -3503,7 +3503,7 @@ void intel_write_dp_vsc_sdp(struct intel_encoder *encoder, const struct drm_dp_vsc_sdp *vsc) { struct intel_digital_port *dig_port = enc_to_dig_port(encoder); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct dp_sdp sdp = {}; ssize_t len; @@ -3521,7 +3521,7 @@ void intel_dp_set_infoframes(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); i915_reg_t reg = HSW_TVIDEO_DIP_CTL(crtc_state->cpu_transcoder); u32 dip_enable = VIDEO_DIP_ENABLE_AVI_HSW | VIDEO_DIP_ENABLE_GCP_HSW | VIDEO_DIP_ENABLE_VS_HSW | VIDEO_DIP_ENABLE_GMP_HSW | @@ -3667,7 +3667,7 @@ static void intel_read_dp_vsc_sdp(struct intel_encoder *encoder, struct drm_dp_vsc_sdp *vsc) { struct intel_digital_port *dig_port = enc_to_dig_port(encoder); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); unsigned int type = DP_SDP_VSC; struct dp_sdp sdp = {}; int ret; @@ -3693,7 +3693,7 @@ static void intel_read_dp_hdr_metadata_infoframe_sdp(struct intel_encoder *encod struct hdmi_drm_infoframe *drm_infoframe) { struct intel_digital_port *dig_port = enc_to_dig_port(encoder); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); unsigned int type = HDMI_PACKET_TYPE_GAMUT_METADATA; struct dp_sdp sdp = {}; int ret; @@ -3882,7 +3882,7 @@ static void intel_dp_phy_pattern_update(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state) { struct drm_i915_private *dev_priv = - to_i915(dp_to_dig_port(intel_dp)->base.base.dev); + to_i915(dp_to_dig_port(intel_dp)->base.base.drm); struct drm_dp_phy_test_params *data = &intel_dp->compliance.test_data.phytest; struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); @@ -4042,7 +4042,7 @@ static bool intel_dp_link_ok(struct intel_dp *intel_dp, u8 link_status[DP_LINK_STATUS_SIZE]) { struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base; - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); bool uhbr = intel_dp->link_rate >= 1000000; bool ok; @@ -4080,7 +4080,7 @@ intel_dp_mst_hpd_irq(struct intel_dp *intel_dp, u8 *esi, u8 *ack) static bool intel_dp_mst_link_status(struct intel_dp *intel_dp) { struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base; - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); u8 link_status[DP_LINK_STATUS_SIZE] = {}; const size_t esi_link_status_size = DP_LINK_STATUS_SIZE - 2; @@ -4298,7 +4298,7 @@ static bool intel_dp_is_connected(struct intel_dp *intel_dp) int intel_dp_retrain_link(struct intel_encoder *encoder, struct drm_modeset_acquire_ctx *ctx) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_crtc *crtc; u8 pipe_mask; @@ -4422,7 +4422,7 @@ static int intel_dp_prep_phy_test(struct intel_dp *intel_dp, static int intel_dp_do_phy_test(struct intel_encoder *encoder, struct drm_modeset_acquire_ctx *ctx) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_crtc *crtc; u8 pipe_mask; @@ -4480,7 +4480,7 @@ void intel_dp_phy_test(struct intel_encoder *encoder) drm_modeset_drop_locks(&ctx); drm_modeset_acquire_fini(&ctx); - drm_WARN(encoder->base.dev, ret, + drm_WARN(encoder->base.drm, ret, "Acquiring modeset locks failed with %i\n", ret); } @@ -4673,7 +4673,7 @@ edp_detect(struct intel_dp *intel_dp) */ bool intel_digital_port_connected(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); bool is_connected = false; intel_wakeref_t wakeref; @@ -4968,7 +4968,7 @@ intel_dp_force(struct drm_connector *connector) struct intel_dp *intel_dp = intel_attached_dp(to_intel_connector(connector)); struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); struct intel_encoder *intel_encoder = &dig_port->base; - struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.drm); enum intel_display_power_domain aux_domain = intel_aux_power_domain(dig_port); intel_wakeref_t wakeref; @@ -5278,7 +5278,7 @@ static const struct drm_connector_helper_funcs intel_dp_connector_helper_funcs = enum irqreturn intel_dp_hpd_pulse(struct intel_digital_port *dig_port, bool long_hpd) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_dp *intel_dp = &dig_port->dp; if (dig_port->base.type == INTEL_OUTPUT_EDP && @@ -5345,7 +5345,7 @@ bool intel_dp_is_port_edp(struct drm_i915_private *i915, enum port port) static bool has_gamut_metadata_dip(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum port port = encoder->port; if (intel_bios_encoder_is_lspcon(encoder->devdata)) @@ -5610,7 +5610,7 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, struct drm_connector *connector = &intel_connector->base; struct intel_dp *intel_dp = &dig_port->dp; struct intel_encoder *intel_encoder = &dig_port->base; - struct drm_device *dev = intel_encoder->base.dev; + struct drm_device *dev = intel_encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); enum port port = intel_encoder->port; enum phy phy = intel_port_to_phy(dev_priv, port); diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.c b/drivers/gpu/drm/i915/display/intel_dp_aux.c index 197c6e81db14..aa72aba432ca 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_aux.c +++ b/drivers/gpu/drm/i915/display/intel_dp_aux.c @@ -151,7 +151,7 @@ static u32 g4x_get_aux_send_ctl(struct intel_dp *intel_dp, { struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); struct drm_i915_private *dev_priv = - to_i915(dig_port->base.base.dev); + to_i915(dig_port->base.base.drm); u32 timeout; /* Max timeout value on G4x-BDW: 1.6ms */ @@ -176,7 +176,7 @@ static u32 skl_get_aux_send_ctl(struct intel_dp *intel_dp, u32 unused) { struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); u32 ret; /* @@ -215,7 +215,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp, { struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); struct drm_i915_private *i915 = - to_i915(dig_port->base.base.dev); + to_i915(dig_port->base.base.drm); enum phy phy = intel_port_to_phy(i915, dig_port->base.port); bool is_tc_port = intel_phy_is_tc(i915, phy); i915_reg_t ch_ctl, ch_data[5]; @@ -783,7 +783,7 @@ void intel_dp_aux_init(struct intel_dp *intel_dp) static enum aux_ch default_aux_ch(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); /* SKL has DDI E but no AUX E */ if (DISPLAY_VER(i915) == 9 && encoder->port == PORT_E) @@ -794,7 +794,7 @@ static enum aux_ch default_aux_ch(struct intel_encoder *encoder) enum aux_ch intel_dp_aux_ch(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum aux_ch aux_ch; aux_ch = intel_bios_dp_aux_ch(encoder->devdata); diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c index 631d60184b4b..22511f8cc655 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c @@ -52,7 +52,7 @@ static int intel_dp_hdcp_write_an_aksv(struct intel_digital_port *dig_port, u8 *an) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); u8 aksv[DRM_HDCP_KSV_LEN] = {}; ssize_t dpcd_ret; @@ -87,7 +87,7 @@ int intel_dp_hdcp_write_an_aksv(struct intel_digital_port *dig_port, static int intel_dp_hdcp_read_bksv(struct intel_digital_port *dig_port, u8 *bksv) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); ssize_t ret; ret = drm_dp_dpcd_read(&dig_port->dp.aux, DP_AUX_HDCP_BKSV, bksv, @@ -103,7 +103,7 @@ static int intel_dp_hdcp_read_bksv(struct intel_digital_port *dig_port, static int intel_dp_hdcp_read_bstatus(struct intel_digital_port *dig_port, u8 *bstatus) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); ssize_t ret; /* @@ -125,7 +125,7 @@ static int intel_dp_hdcp_read_bcaps(struct intel_digital_port *dig_port, u8 *bcaps) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); ssize_t ret; ret = drm_dp_dpcd_read(&dig_port->dp.aux, DP_AUX_HDCP_BCAPS, @@ -158,7 +158,7 @@ static int intel_dp_hdcp_read_ri_prime(struct intel_digital_port *dig_port, u8 *ri_prime) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); ssize_t ret; ret = drm_dp_dpcd_read(&dig_port->dp.aux, DP_AUX_HDCP_RI_PRIME, @@ -175,7 +175,7 @@ static int intel_dp_hdcp_read_ksv_ready(struct intel_digital_port *dig_port, bool *ksv_ready) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); ssize_t ret; u8 bstatus; @@ -194,7 +194,7 @@ static int intel_dp_hdcp_read_ksv_fifo(struct intel_digital_port *dig_port, int num_downstream, u8 *ksv_fifo) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); ssize_t ret; int i; @@ -219,7 +219,7 @@ static int intel_dp_hdcp_read_v_prime_part(struct intel_digital_port *dig_port, int i, u32 *part) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); ssize_t ret; if (i >= DRM_HDCP_V_PRIME_NUM_PARTS) @@ -249,7 +249,7 @@ static bool intel_dp_hdcp_check_link(struct intel_digital_port *dig_port, struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); ssize_t ret; u8 bstatus; @@ -334,7 +334,7 @@ static int intel_dp_hdcp2_read_rx_status(struct intel_digital_port *dig_port, u8 *rx_status) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); ssize_t ret; ret = drm_dp_dpcd_read(&dig_port->dp.aux, @@ -386,7 +386,7 @@ static ssize_t intel_dp_hdcp2_wait_for_msg(struct intel_digital_port *dig_port, const struct hdcp2_dp_msg_data *hdcp2_msg_data) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_dp *dp = &dig_port->dp; struct intel_hdcp *hdcp = &dp->attached_connector->hdcp; u8 msg_id = hdcp2_msg_data->msg_id; @@ -497,7 +497,7 @@ static int intel_dp_hdcp2_read_msg(struct intel_digital_port *dig_port, u8 msg_id, void *buf, size_t size) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_dp *dp = &dig_port->dp; struct intel_hdcp *hdcp = &dp->attached_connector->hdcp; unsigned int offset; diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index 0f327ce194bd..b6a51477b1e0 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -271,7 +271,7 @@ static int intel_dp_mst_update_slots(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state, struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder); struct intel_dp *intel_dp = &intel_mst->primary->dp; struct drm_dp_mst_topology_mgr *mgr = &intel_dp->mst_mgr; @@ -307,7 +307,7 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder); struct intel_dp *intel_dp = &intel_mst->primary->dp; const struct drm_display_mode *adjusted_mode = @@ -527,7 +527,7 @@ intel_dp_mst_atomic_check(struct drm_connector *connector, static void clear_act_sent(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); intel_de_write(i915, dp_tp_status_reg(encoder, crtc_state), DP_TP_STATUS_ACT_SENT); @@ -536,7 +536,7 @@ static void clear_act_sent(struct intel_encoder *encoder, static void wait_for_act_sent(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder); struct intel_dp *intel_dp = &intel_mst->primary->dp; @@ -692,7 +692,7 @@ static void intel_mst_pre_enable_dp(struct intel_atomic_state *state, struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder); struct intel_digital_port *dig_port = intel_mst->primary; struct intel_dp *intel_dp = &dig_port->dp; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_connector *connector = to_intel_connector(conn_state->connector); struct drm_dp_mst_topology_state *mst_state = @@ -752,7 +752,7 @@ static void intel_mst_enable_dp(struct intel_atomic_state *state, struct intel_digital_port *dig_port = intel_mst->primary; struct intel_dp *intel_dp = &dig_port->dp; struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct drm_dp_mst_topology_state *mst_state = drm_atomic_get_new_mst_topology_state(&state->base, &intel_dp->mst_mgr); enum transcoder trans = pipe_config->cpu_transcoder; @@ -1091,7 +1091,7 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo { struct intel_dp *intel_dp = container_of(mgr, struct intel_dp, mst_mgr); struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); - struct drm_device *dev = dig_port->base.base.dev; + struct drm_device *dev = dig_port->base.base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_connector *intel_connector; struct drm_connector *connector; @@ -1161,7 +1161,7 @@ intel_dp_create_fake_mst_encoder(struct intel_digital_port *dig_port, enum pipe { struct intel_dp_mst_encoder *intel_mst; struct intel_encoder *intel_encoder; - struct drm_device *dev = dig_port->base.base.dev; + struct drm_device *dev = dig_port->base.base.drm; intel_mst = kzalloc(sizeof(*intel_mst), GFP_KERNEL); @@ -1210,7 +1210,7 @@ static bool intel_dp_create_fake_mst_encoders(struct intel_digital_port *dig_port) { struct intel_dp *intel_dp = &dig_port->dp; - struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.drm); enum pipe pipe; for_each_pipe(dev_priv, pipe) @@ -1227,7 +1227,7 @@ intel_dp_mst_encoder_active_links(struct intel_digital_port *dig_port) int intel_dp_mst_encoder_init(struct intel_digital_port *dig_port, int conn_base_id) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_dp *intel_dp = &dig_port->dp; enum port port = dig_port->base.port; int ret; diff --git a/drivers/gpu/drm/i915/display/intel_dpio_phy.c b/drivers/gpu/drm/i915/display/intel_dpio_phy.c index 62b93d097e44..567537ca3e60 100644 --- a/drivers/gpu/drm/i915/display/intel_dpio_phy.c +++ b/drivers/gpu/drm/i915/display/intel_dpio_phy.c @@ -272,7 +272,7 @@ void bxt_port_to_phy_channel(struct drm_i915_private *dev_priv, enum port port, void bxt_ddi_phy_set_signal_levels(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); int level = intel_ddi_level(encoder, crtc_state, 0); const struct intel_ddi_buf_trans *trans; enum dpio_channel ch; @@ -589,7 +589,7 @@ bxt_ddi_phy_calc_lane_lat_optim_mask(u8 lane_count) void bxt_ddi_phy_set_lane_optim_mask(struct intel_encoder *encoder, u8 lane_lat_optim_mask) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum port port = encoder->port; enum dpio_phy phy; enum dpio_channel ch; @@ -617,7 +617,7 @@ void bxt_ddi_phy_set_lane_optim_mask(struct intel_encoder *encoder, u8 bxt_ddi_phy_get_lane_lat_optim_mask(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum port port = encoder->port; enum dpio_phy phy; enum dpio_channel ch; @@ -685,7 +685,7 @@ void chv_set_phy_signal_level(struct intel_encoder *encoder, u32 deemph_reg_value, u32 margin_reg_value, bool uniq_trans_scale) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); enum dpio_channel ch = vlv_dig_port_to_channel(dig_port); @@ -781,7 +781,7 @@ void chv_data_lane_soft_reset(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, bool reset) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum dpio_channel ch = vlv_dig_port_to_channel(enc_to_dig_port(encoder)); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); enum pipe pipe = crtc->pipe; @@ -826,7 +826,7 @@ void chv_phy_pre_pll_enable(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { struct intel_digital_port *dig_port = enc_to_dig_port(encoder); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); enum dpio_channel ch = vlv_dig_port_to_channel(dig_port); enum pipe pipe = crtc->pipe; @@ -907,7 +907,7 @@ void chv_phy_pre_encoder_enable(struct intel_encoder *encoder, { struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); enum dpio_channel ch = vlv_dig_port_to_channel(dig_port); enum pipe pipe = crtc->pipe; @@ -985,7 +985,7 @@ void chv_phy_pre_encoder_enable(struct intel_encoder *encoder, void chv_phy_release_cl2_override(struct intel_encoder *encoder) { struct intel_digital_port *dig_port = enc_to_dig_port(encoder); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); if (dig_port->release_cl2_override) { chv_phy_powergate_ch(dev_priv, DPIO_PHY0, DPIO_CH1, false); @@ -996,7 +996,7 @@ void chv_phy_release_cl2_override(struct intel_encoder *encoder) void chv_phy_post_pll_disable(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum pipe pipe = to_intel_crtc(old_crtc_state->uapi.crtc)->pipe; u32 val; @@ -1032,7 +1032,7 @@ void vlv_set_phy_signal_level(struct intel_encoder *encoder, u32 demph_reg_value, u32 preemph_reg_value, u32 uniqtranscale_reg_value, u32 tx3_demph) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); enum dpio_channel port = vlv_dig_port_to_channel(dig_port); @@ -1060,7 +1060,7 @@ void vlv_phy_pre_pll_enable(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { struct intel_digital_port *dig_port = enc_to_dig_port(encoder); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); enum dpio_channel port = vlv_dig_port_to_channel(dig_port); enum pipe pipe = crtc->pipe; @@ -1090,7 +1090,7 @@ void vlv_phy_pre_encoder_enable(struct intel_encoder *encoder, { struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); enum dpio_channel port = vlv_dig_port_to_channel(dig_port); enum pipe pipe = crtc->pipe; @@ -1119,7 +1119,7 @@ void vlv_phy_reset_lanes(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state) { struct intel_digital_port *dig_port = enc_to_dig_port(encoder); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); enum dpio_channel port = vlv_dig_port_to_channel(dig_port); enum pipe pipe = crtc->pipe; diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c index ca96d98ac285..ced242623619 100644 --- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c +++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c @@ -4287,7 +4287,7 @@ void intel_update_active_dpll(struct intel_atomic_state *state, struct intel_crtc *crtc, struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); const struct intel_dpll_mgr *dpll_mgr = dev_priv->display.dpll.mgr; if (drm_WARN_ON(&dev_priv->drm, !dpll_mgr)) diff --git a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c index 2668362be33a..0f39e9ff9932 100644 --- a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c +++ b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c @@ -152,7 +152,7 @@ static enum port intel_dsi_seq_port_to_port(struct intel_dsi *intel_dsi, static const u8 *mipi_exec_send_packet(struct intel_dsi *intel_dsi, const u8 *data) { - struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.drm); struct mipi_dsi_device *dsi_device; u8 type, flags, seq_port; u16 len; @@ -232,7 +232,7 @@ static const u8 *mipi_exec_send_packet(struct intel_dsi *intel_dsi, static const u8 *mipi_exec_delay(struct intel_dsi *intel_dsi, const u8 *data) { - struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev); + struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.drm); u32 delay = *((const u32 *) data); drm_dbg_kms(&i915->drm, "\n"); @@ -461,7 +461,7 @@ static void icl_native_gpio_set_value(struct drm_i915_private *dev_priv, static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data) { - struct drm_device *dev = intel_dsi->base.base.dev; + struct drm_device *dev = intel_dsi->base.base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_connector *connector = intel_dsi->attached_connector; u8 gpio_source, gpio_index = 0, gpio_number; @@ -534,7 +534,7 @@ static int i2c_adapter_lookup(struct acpi_resource *ares, void *data) static void i2c_acpi_find_adapter(struct intel_dsi *intel_dsi, const u16 slave_addr) { - struct drm_device *drm_dev = intel_dsi->base.base.dev; + struct drm_device *drm_dev = intel_dsi->base.base.drm; struct acpi_device *adev = ACPI_COMPANION(drm_dev->dev); struct i2c_adapter_lookup lookup = { .slave_addr = slave_addr, @@ -555,7 +555,7 @@ static inline void i2c_acpi_find_adapter(struct intel_dsi *intel_dsi, static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data) { - struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev); + struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.drm); struct i2c_adapter *adapter; struct i2c_msg msg; int ret; @@ -603,7 +603,7 @@ static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data) static const u8 *mipi_exec_spi(struct intel_dsi *intel_dsi, const u8 *data) { - struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev); + struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.drm); drm_dbg_kms(&i915->drm, "Skipping SPI element execution\n"); @@ -612,7 +612,7 @@ static const u8 *mipi_exec_spi(struct intel_dsi *intel_dsi, const u8 *data) static const u8 *mipi_exec_pmic(struct intel_dsi *intel_dsi, const u8 *data) { - struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev); + struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.drm); #ifdef CONFIG_PMIC_OPREGION u32 value, mask, reg_address; u16 i2c_address; @@ -679,7 +679,7 @@ static const char *sequence_name(enum mipi_seq seq_id) static void intel_dsi_vbt_exec(struct intel_dsi *intel_dsi, enum mipi_seq seq_id) { - struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.drm); struct intel_connector *connector = intel_dsi->attached_connector; const u8 *data; fn_mipi_elem_exec mipi_elem_exec; @@ -765,7 +765,7 @@ void intel_dsi_vbt_exec_sequence(struct intel_dsi *intel_dsi, void intel_dsi_log_params(struct intel_dsi *intel_dsi) { - struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev); + struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.drm); drm_dbg_kms(&i915->drm, "Pclk %d\n", intel_dsi->pclk); drm_dbg_kms(&i915->drm, "Pixel overlap %d\n", @@ -817,7 +817,7 @@ void intel_dsi_log_params(struct intel_dsi *intel_dsi) bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id) { - struct drm_device *dev = intel_dsi->base.base.dev; + struct drm_device *dev = intel_dsi->base.base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_connector *connector = intel_dsi->attached_connector; struct mipi_config *mipi_config = connector->panel.vbt.dsi.config; @@ -956,7 +956,7 @@ static const struct pinctrl_map soc_pwm_pinctrl_map[] = { void intel_dsi_vbt_gpio_init(struct intel_dsi *intel_dsi, bool panel_is_on) { - struct drm_device *dev = intel_dsi->base.base.dev; + struct drm_device *dev = intel_dsi->base.base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_connector *connector = intel_dsi->attached_connector; struct mipi_config *mipi_config = connector->panel.vbt.dsi.config; @@ -1012,7 +1012,7 @@ void intel_dsi_vbt_gpio_init(struct intel_dsi *intel_dsi, bool panel_is_on) void intel_dsi_vbt_gpio_cleanup(struct intel_dsi *intel_dsi) { - struct drm_device *dev = intel_dsi->base.base.dev; + struct drm_device *dev = intel_dsi->base.base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_connector *connector = intel_dsi->attached_connector; struct mipi_config *mipi_config = connector->panel.vbt.dsi.config; diff --git a/drivers/gpu/drm/i915/display/intel_dvo.c b/drivers/gpu/drm/i915/display/intel_dvo.c index d69f288ce644..8eaa6d3fc97b 100644 --- a/drivers/gpu/drm/i915/display/intel_dvo.c +++ b/drivers/gpu/drm/i915/display/intel_dvo.c @@ -143,7 +143,7 @@ static bool intel_dvo_connector_get_hw_state(struct intel_connector *connector) static bool intel_dvo_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum port port = encoder->port; u32 tmp; @@ -157,7 +157,7 @@ static bool intel_dvo_get_hw_state(struct intel_encoder *encoder, static void intel_dvo_get_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum port port = encoder->port; u32 tmp, flags = 0; @@ -183,7 +183,7 @@ static void intel_disable_dvo(struct intel_atomic_state *state, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_dvo *intel_dvo = enc_to_dvo(encoder); enum port port = encoder->port; @@ -198,7 +198,7 @@ static void intel_enable_dvo(struct intel_atomic_state *state, const struct intel_crtc_state *pipe_config, const struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_dvo *intel_dvo = enc_to_dvo(encoder); enum port port = encoder->port; @@ -282,7 +282,7 @@ static void intel_dvo_pre_enable(struct intel_atomic_state *state, const struct intel_crtc_state *pipe_config, const struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; enum port port = encoder->port; diff --git a/drivers/gpu/drm/i915/display/intel_fdi.c b/drivers/gpu/drm/i915/display/intel_fdi.c index 1f89020787fc..9353376e3d46 100644 --- a/drivers/gpu/drm/i915/display/intel_fdi.c +++ b/drivers/gpu/drm/i915/display/intel_fdi.c @@ -869,7 +869,7 @@ void hsw_fdi_link_train(struct intel_encoder *encoder, void hsw_fdi_disable(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); /* * Bspec lists this as both step 13 (before DDI_BUF_CTL disable) diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 31a1ac69dbcf..dcbd28eb812f 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -120,7 +120,7 @@ static int intel_hdcp_read_valid_bksv(struct intel_digital_port *dig_port, const struct intel_hdcp_shim *shim, u8 *bksv) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); int ret, i, tries = 2; /* HDCP spec states that we must retry the bksv if it is invalid */ @@ -2293,7 +2293,7 @@ intel_hdcp_set_streams(struct intel_digital_port *dig_port, struct drm_connector_list_iter conn_iter; struct intel_digital_port *conn_dig_port; struct intel_connector *connector; - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct hdcp_port_data *data = &dig_port->hdcp_port_data; if (!intel_encoder_is_mst(&dig_port->base)) { @@ -2337,7 +2337,7 @@ int intel_hdcp_enable(struct intel_atomic_state *state, const struct intel_crtc_state *pipe_config, const struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_connector *connector = to_intel_connector(conn_state->connector); struct intel_digital_port *dig_port = intel_attached_dig_port(connector); diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index 2c819d1b191b..549505084891 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -61,7 +61,7 @@ inline struct drm_i915_private *intel_hdmi_to_i915(struct intel_hdmi *intel_hdmi) { - return to_i915(hdmi_to_dig_port(intel_hdmi)->base.base.dev); + return to_i915(hdmi_to_dig_port(intel_hdmi)->base.base.drm); } static void @@ -203,7 +203,7 @@ static void g4x_write_infoframe(struct intel_encoder *encoder, const void *frame, ssize_t len) { const u32 *data = frame; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 val = intel_de_read(dev_priv, VIDEO_DIP_CTL); int i; @@ -238,7 +238,7 @@ static void g4x_read_infoframe(struct intel_encoder *encoder, unsigned int type, void *frame, ssize_t len) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 *data = frame; int i; @@ -252,7 +252,7 @@ static void g4x_read_infoframe(struct intel_encoder *encoder, static u32 g4x_infoframes_enabled(struct intel_encoder *encoder, const struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 val = intel_de_read(dev_priv, VIDEO_DIP_CTL); if ((val & VIDEO_DIP_ENABLE) == 0) @@ -271,7 +271,7 @@ static void ibx_write_infoframe(struct intel_encoder *encoder, const void *frame, ssize_t len) { const u32 *data = frame; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); i915_reg_t reg = TVIDEO_DIP_CTL(crtc->pipe); u32 val = intel_de_read(dev_priv, reg); @@ -309,7 +309,7 @@ static void ibx_read_infoframe(struct intel_encoder *encoder, unsigned int type, void *frame, ssize_t len) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); u32 *data = frame; int i; @@ -324,7 +324,7 @@ static void ibx_read_infoframe(struct intel_encoder *encoder, static u32 ibx_infoframes_enabled(struct intel_encoder *encoder, const struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum pipe pipe = to_intel_crtc(pipe_config->uapi.crtc)->pipe; i915_reg_t reg = TVIDEO_DIP_CTL(pipe); u32 val = intel_de_read(dev_priv, reg); @@ -346,7 +346,7 @@ static void cpt_write_infoframe(struct intel_encoder *encoder, const void *frame, ssize_t len) { const u32 *data = frame; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); i915_reg_t reg = TVIDEO_DIP_CTL(crtc->pipe); u32 val = intel_de_read(dev_priv, reg); @@ -387,7 +387,7 @@ static void cpt_read_infoframe(struct intel_encoder *encoder, unsigned int type, void *frame, ssize_t len) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); u32 *data = frame; int i; @@ -402,7 +402,7 @@ static void cpt_read_infoframe(struct intel_encoder *encoder, static u32 cpt_infoframes_enabled(struct intel_encoder *encoder, const struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum pipe pipe = to_intel_crtc(pipe_config->uapi.crtc)->pipe; u32 val = intel_de_read(dev_priv, TVIDEO_DIP_CTL(pipe)); @@ -420,7 +420,7 @@ static void vlv_write_infoframe(struct intel_encoder *encoder, const void *frame, ssize_t len) { const u32 *data = frame; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); i915_reg_t reg = VLV_TVIDEO_DIP_CTL(crtc->pipe); u32 val = intel_de_read(dev_priv, reg); @@ -459,7 +459,7 @@ static void vlv_read_infoframe(struct intel_encoder *encoder, unsigned int type, void *frame, ssize_t len) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); u32 *data = frame; int i; @@ -475,7 +475,7 @@ static void vlv_read_infoframe(struct intel_encoder *encoder, static u32 vlv_infoframes_enabled(struct intel_encoder *encoder, const struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum pipe pipe = to_intel_crtc(pipe_config->uapi.crtc)->pipe; u32 val = intel_de_read(dev_priv, VLV_TVIDEO_DIP_CTL(pipe)); @@ -496,7 +496,7 @@ void hsw_write_infoframe(struct intel_encoder *encoder, const void *frame, ssize_t len) { const u32 *data = frame; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; i915_reg_t ctl_reg = HSW_TVIDEO_DIP_CTL(cpu_transcoder); int data_size; @@ -535,7 +535,7 @@ void hsw_read_infoframe(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, unsigned int type, void *frame, ssize_t len) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; u32 *data = frame; int i; @@ -548,7 +548,7 @@ void hsw_read_infoframe(struct intel_encoder *encoder, static u32 hsw_infoframes_enabled(struct intel_encoder *encoder, const struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 val = intel_de_read(dev_priv, HSW_TVIDEO_DIP_CTL(pipe_config->cpu_transcoder)); u32 mask; @@ -588,7 +588,7 @@ u32 intel_hdmi_infoframe_enable(unsigned int type) u32 intel_hdmi_infoframes_enabled(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); u32 val, ret = 0; int i; @@ -641,12 +641,12 @@ static void intel_write_infoframe(struct intel_encoder *encoder, intel_hdmi_infoframe_enable(type)) == 0) return; - if (drm_WARN_ON(encoder->base.dev, frame->any.type != type)) + if (drm_WARN_ON(encoder->base.drm, frame->any.type != type)) return; /* see comment above for the reason for this offset */ len = hdmi_infoframe_pack_only(frame, buffer + 1, sizeof(buffer) - 1); - if (drm_WARN_ON(encoder->base.dev, len < 0)) + if (drm_WARN_ON(encoder->base.drm, len < 0)) return; /* Insert the 'hole' (see big comment above) at position 3 */ @@ -679,13 +679,13 @@ void intel_read_infoframe(struct intel_encoder *encoder, /* see comment above for the reason for this offset */ ret = hdmi_infoframe_unpack(frame, buffer + 1, sizeof(buffer) - 1); if (ret) { - drm_dbg_kms(encoder->base.dev, + drm_dbg_kms(encoder->base.drm, "Failed to unpack infoframe type 0x%02x\n", type); return; } if (frame->any.type != type) - drm_dbg_kms(encoder->base.dev, + drm_dbg_kms(encoder->base.drm, "Found the wrong infoframe type 0x%x (expected 0x%02x)\n", frame->any.type, type); } @@ -722,7 +722,7 @@ intel_hdmi_compute_avi_infoframe(struct intel_encoder *encoder, drm_hdmi_avi_infoframe_colorimetry(frame, conn_state); /* nonsense combination */ - drm_WARN_ON(encoder->base.dev, crtc_state->limited_color_range && + drm_WARN_ON(encoder->base.drm, crtc_state->limited_color_range && crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB); if (crtc_state->output_format == INTEL_OUTPUT_FORMAT_RGB) { @@ -741,7 +741,7 @@ intel_hdmi_compute_avi_infoframe(struct intel_encoder *encoder, /* TODO: handle pixel repetition for YCBCR420 outputs */ ret = hdmi_avi_infoframe_check(frame); - if (drm_WARN_ON(encoder->base.dev, ret)) + if (drm_WARN_ON(encoder->base.drm, ret)) return false; return true; @@ -752,7 +752,7 @@ intel_hdmi_compute_spd_infoframe(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state, struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct hdmi_spd_infoframe *frame = &crtc_state->infoframes.spd.spd; int ret; @@ -767,13 +767,13 @@ intel_hdmi_compute_spd_infoframe(struct intel_encoder *encoder, else ret = hdmi_spd_infoframe_init(frame, "Intel", "Integrated gfx"); - if (drm_WARN_ON(encoder->base.dev, ret)) + if (drm_WARN_ON(encoder->base.drm, ret)) return false; frame->sdi = HDMI_SPD_SDI_PC; ret = hdmi_spd_infoframe_check(frame); - if (drm_WARN_ON(encoder->base.dev, ret)) + if (drm_WARN_ON(encoder->base.drm, ret)) return false; return true; @@ -799,11 +799,11 @@ intel_hdmi_compute_hdmi_infoframe(struct intel_encoder *encoder, ret = drm_hdmi_vendor_infoframe_from_display_mode(frame, conn_state->connector, &crtc_state->hw.adjusted_mode); - if (drm_WARN_ON(encoder->base.dev, ret)) + if (drm_WARN_ON(encoder->base.drm, ret)) return false; ret = hdmi_vendor_infoframe_check(frame); - if (drm_WARN_ON(encoder->base.dev, ret)) + if (drm_WARN_ON(encoder->base.drm, ret)) return false; return true; @@ -815,7 +815,7 @@ intel_hdmi_compute_drm_infoframe(struct intel_encoder *encoder, struct drm_connector_state *conn_state) { struct hdmi_drm_infoframe *frame = &crtc_state->infoframes.drm.drm; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); int ret; if (DISPLAY_VER(dev_priv) < 10) @@ -849,7 +849,7 @@ static void g4x_set_infoframes(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); struct intel_hdmi *intel_hdmi = &dig_port->hdmi; i915_reg_t reg = VIDEO_DIP_CTL; @@ -961,7 +961,7 @@ static bool intel_hdmi_set_gcp_infoframe(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); i915_reg_t reg; @@ -986,7 +986,7 @@ static bool intel_hdmi_set_gcp_infoframe(struct intel_encoder *encoder, void intel_hdmi_read_gcp_infoframe(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); i915_reg_t reg; @@ -1010,7 +1010,7 @@ static void intel_hdmi_compute_gcp_infoframe(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state, struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); if (IS_G4X(dev_priv) || !crtc_state->has_infoframe) return; @@ -1033,7 +1033,7 @@ static void ibx_set_infoframes(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); struct intel_hdmi *intel_hdmi = &dig_port->hdmi; @@ -1092,7 +1092,7 @@ static void cpt_set_infoframes(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); i915_reg_t reg = TVIDEO_DIP_CTL(crtc->pipe); @@ -1141,7 +1141,7 @@ static void vlv_set_infoframes(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); i915_reg_t reg = VLV_TVIDEO_DIP_CTL(crtc->pipe); @@ -1199,7 +1199,7 @@ static void hsw_set_infoframes(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); i915_reg_t reg = HSW_TVIDEO_DIP_CTL(crtc_state->cpu_transcoder); u32 val = intel_de_read(dev_priv, reg); @@ -1256,7 +1256,7 @@ void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable) static int intel_hdmi_hdcp_read(struct intel_digital_port *dig_port, unsigned int offset, void *buffer, size_t size) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_hdmi *hdmi = &dig_port->hdmi; struct i2c_adapter *adapter = intel_gmbus_get_adapter(i915, hdmi->ddc_bus); @@ -1285,7 +1285,7 @@ static int intel_hdmi_hdcp_read(struct intel_digital_port *dig_port, static int intel_hdmi_hdcp_write(struct intel_digital_port *dig_port, unsigned int offset, void *buffer, size_t size) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_hdmi *hdmi = &dig_port->hdmi; struct i2c_adapter *adapter = intel_gmbus_get_adapter(i915, hdmi->ddc_bus); @@ -1319,7 +1319,7 @@ static int intel_hdmi_hdcp_write_an_aksv(struct intel_digital_port *dig_port, u8 *an) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_hdmi *hdmi = &dig_port->hdmi; struct i2c_adapter *adapter = intel_gmbus_get_adapter(i915, hdmi->ddc_bus); @@ -1344,7 +1344,7 @@ int intel_hdmi_hdcp_write_an_aksv(struct intel_digital_port *dig_port, static int intel_hdmi_hdcp_read_bksv(struct intel_digital_port *dig_port, u8 *bksv) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); int ret; ret = intel_hdmi_hdcp_read(dig_port, DRM_HDCP_DDC_BKSV, bksv, @@ -1359,7 +1359,7 @@ static int intel_hdmi_hdcp_read_bstatus(struct intel_digital_port *dig_port, u8 *bstatus) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); int ret; ret = intel_hdmi_hdcp_read(dig_port, DRM_HDCP_DDC_BSTATUS, @@ -1374,7 +1374,7 @@ static int intel_hdmi_hdcp_repeater_present(struct intel_digital_port *dig_port, bool *repeater_present) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); int ret; u8 val; @@ -1392,7 +1392,7 @@ static int intel_hdmi_hdcp_read_ri_prime(struct intel_digital_port *dig_port, u8 *ri_prime) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); int ret; ret = intel_hdmi_hdcp_read(dig_port, DRM_HDCP_DDC_RI_PRIME, @@ -1407,7 +1407,7 @@ static int intel_hdmi_hdcp_read_ksv_ready(struct intel_digital_port *dig_port, bool *ksv_ready) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); int ret; u8 val; @@ -1425,7 +1425,7 @@ static int intel_hdmi_hdcp_read_ksv_fifo(struct intel_digital_port *dig_port, int num_downstream, u8 *ksv_fifo) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); int ret; ret = intel_hdmi_hdcp_read(dig_port, DRM_HDCP_DDC_KSV_FIFO, ksv_fifo, num_downstream * DRM_HDCP_KSV_LEN); @@ -1441,7 +1441,7 @@ static int intel_hdmi_hdcp_read_v_prime_part(struct intel_digital_port *dig_port, int i, u32 *part) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); int ret; if (i >= DRM_HDCP_V_PRIME_NUM_PARTS) @@ -1527,7 +1527,7 @@ static bool intel_hdmi_hdcp_check_link_once(struct intel_digital_port *dig_port, struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); enum port port = dig_port->base.port; enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder; int ret; @@ -1558,7 +1558,7 @@ static bool intel_hdmi_hdcp_check_link(struct intel_digital_port *dig_port, struct intel_connector *connector) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); int retry; for (retry = 0; retry < 3; retry++) @@ -1616,7 +1616,7 @@ hdcp2_detect_msg_availability(struct intel_digital_port *dig_port, u8 msg_id, bool *msg_ready, ssize_t *msg_sz) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); u8 rx_status[HDCP_2_2_HDMI_RXSTATUS_LEN]; int ret; @@ -1643,7 +1643,7 @@ static ssize_t intel_hdmi_hdcp2_wait_for_msg(struct intel_digital_port *dig_port, u8 msg_id, bool paired) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); bool msg_ready = false; int timeout, ret; ssize_t msg_sz = 0; @@ -1678,7 +1678,7 @@ static int intel_hdmi_hdcp2_read_msg(struct intel_digital_port *dig_port, u8 msg_id, void *buf, size_t size) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_hdmi *hdmi = &dig_port->hdmi; struct intel_hdcp *hdcp = &hdmi->attached_connector->hdcp; unsigned int offset; @@ -1768,7 +1768,7 @@ static const struct intel_hdcp_shim intel_hdmi_hdcp_shim = { static int intel_hdmi_source_max_tmds_clock(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); int max_tmds_clock, vbt_max_tmds_clock; if (DISPLAY_VER(dev_priv) >= 10) @@ -2109,7 +2109,7 @@ static int intel_hdmi_compute_clock(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state, bool respect_downstream_limits) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; int bpc, clock = adjusted_mode->crtc_clock; @@ -2281,7 +2281,7 @@ int intel_hdmi_compute_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; struct drm_connector *connector = conn_state->connector; struct drm_scdc *scdc = &connector->display_info.hdmi.scdc; @@ -2680,7 +2680,7 @@ bool intel_hdmi_handle_sink_scrambling(struct intel_encoder *encoder, bool high_tmds_clock_ratio, bool scrambling) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct drm_scrambling *sink_scrambling = &connector->display_info.hdmi.scdc.scrambling; @@ -2882,7 +2882,7 @@ static u8 g4x_port_to_ddc_pin(struct drm_i915_private *dev_priv, static u8 intel_hdmi_ddc_pin(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum port port = encoder->port; u8 ddc_pin; @@ -2927,7 +2927,7 @@ static u8 intel_hdmi_ddc_pin(struct intel_encoder *encoder) void intel_infoframe_init(struct intel_digital_port *dig_port) { struct drm_i915_private *dev_priv = - to_i915(dig_port->base.base.dev); + to_i915(dig_port->base.base.drm); if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) { dig_port->write_infoframe = vlv_write_infoframe; @@ -2970,7 +2970,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *dig_port, struct drm_connector *connector = &intel_connector->base; struct intel_hdmi *intel_hdmi = &dig_port->hdmi; struct intel_encoder *intel_encoder = &dig_port->base; - struct drm_device *dev = intel_encoder->base.dev; + struct drm_device *dev = intel_encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct i2c_adapter *ddc; enum port port = intel_encoder->port; diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c index bec50f2d6650..1786027ae867 100644 --- a/drivers/gpu/drm/i915/display/intel_hotplug.c +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c @@ -354,7 +354,7 @@ static void i915_digport_work_func(struct work_struct *work) */ void intel_hpd_trigger_irq(struct intel_digital_port *dig_port) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); spin_lock_irq(&i915->irq_lock); i915->display.hotplug.short_port_mask |= BIT(dig_port->base.port); diff --git a/drivers/gpu/drm/i915/display/intel_hotplug_irq.c b/drivers/gpu/drm/i915/display/intel_hotplug_irq.c index f95fa793fabb..e16c72d38ce0 100644 --- a/drivers/gpu/drm/i915/display/intel_hotplug_irq.c +++ b/drivers/gpu/drm/i915/display/intel_hotplug_irq.c @@ -700,7 +700,7 @@ static u32 ibx_hotplug_mask(enum hpd_pin hpd_pin) static u32 ibx_hotplug_enables(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); switch (encoder->hpd_pin) { case HPD_PORT_A: @@ -738,7 +738,7 @@ static void ibx_hpd_detection_setup(struct drm_i915_private *dev_priv) static void ibx_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); intel_uncore_rmw(&i915->uncore, PCH_PORT_HOTPLUG, ibx_hotplug_mask(encoder->hpd_pin), @@ -804,7 +804,7 @@ static void icp_ddi_hpd_detection_setup(struct drm_i915_private *dev_priv) static void icp_ddi_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); intel_uncore_rmw(&i915->uncore, SHOTPLUG_CTL_DDI, icp_ddi_hotplug_mask(encoder->hpd_pin), @@ -820,7 +820,7 @@ static void icp_tc_hpd_detection_setup(struct drm_i915_private *dev_priv) static void icp_tc_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); intel_uncore_rmw(&i915->uncore, SHOTPLUG_CTL_TC, icp_tc_hotplug_mask(encoder->hpd_pin), @@ -880,7 +880,7 @@ static void dg1_hpd_invert(struct drm_i915_private *i915) static void dg1_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); dg1_hpd_invert(i915); icp_hpd_enable_detection(encoder); @@ -901,7 +901,7 @@ static void gen11_tc_hpd_detection_setup(struct drm_i915_private *dev_priv) static void gen11_tc_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); intel_uncore_rmw(&i915->uncore, GEN11_TC_HOTPLUG_CTL, gen11_hotplug_mask(encoder->hpd_pin), @@ -917,7 +917,7 @@ static void gen11_tbt_hpd_detection_setup(struct drm_i915_private *dev_priv) static void gen11_tbt_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); intel_uncore_rmw(&i915->uncore, GEN11_TBT_HOTPLUG_CTL, gen11_hotplug_mask(encoder->hpd_pin), @@ -926,7 +926,7 @@ static void gen11_tbt_hpd_enable_detection(struct intel_encoder *encoder) static void gen11_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); gen11_tc_hpd_enable_detection(encoder); gen11_tbt_hpd_enable_detection(encoder); @@ -996,7 +996,7 @@ static void mtp_ddi_hpd_detection_setup(struct drm_i915_private *i915) static void mtp_ddi_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); intel_de_rmw(i915, SHOTPLUG_CTL_DDI, mtp_ddi_hotplug_mask(encoder->hpd_pin), @@ -1012,7 +1012,7 @@ static void mtp_tc_hpd_detection_setup(struct drm_i915_private *i915) static void mtp_tc_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); intel_de_rmw(i915, SHOTPLUG_CTL_DDI, mtp_tc_hotplug_mask(encoder->hpd_pin), @@ -1035,7 +1035,7 @@ static void mtp_hpd_invert(struct drm_i915_private *i915) static void mtp_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); mtp_hpd_invert(i915); mtp_ddi_hpd_enable_detection(encoder); @@ -1078,7 +1078,7 @@ static void _xelpdp_pica_hpd_detection_setup(struct drm_i915_private *i915, static void xelpdp_pica_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); _xelpdp_pica_hpd_detection_setup(i915, encoder->hpd_pin, true); } @@ -1177,7 +1177,7 @@ static void spt_hpd_detection_setup(struct drm_i915_private *dev_priv) static void spt_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); /* Display WA #1179 WaHardHangonHotPlug: cnp */ if (HAS_PCH_CNP(i915)) { @@ -1246,7 +1246,7 @@ static void ilk_hpd_detection_setup(struct drm_i915_private *dev_priv) static void ilk_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); intel_uncore_rmw(&i915->uncore, DIGITAL_PORT_HOTPLUG_CNTRL, ilk_hotplug_mask(encoder->hpd_pin), @@ -1320,7 +1320,7 @@ static void bxt_hpd_detection_setup(struct drm_i915_private *dev_priv) static void bxt_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); intel_uncore_rmw(&i915->uncore, PCH_PORT_HOTPLUG, bxt_hotplug_mask(encoder->hpd_pin), @@ -1341,7 +1341,7 @@ static void bxt_hpd_irq_setup(struct drm_i915_private *dev_priv) static void i915_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); u32 hotplug_en = hpd_mask_i915[encoder->hpd_pin]; /* HPD sense and interrupt enable are one and the same */ @@ -1400,7 +1400,7 @@ HPD_FUNCS(ilk); void intel_hpd_enable_detection(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); if (i915->display.funcs.hotplug) i915->display.funcs.hotplug->hpd_enable_detection(encoder); diff --git a/drivers/gpu/drm/i915/display/intel_load_detect.c b/drivers/gpu/drm/i915/display/intel_load_detect.c index d5a0aecf3e8f..015b1586ef5f 100644 --- a/drivers/gpu/drm/i915/display/intel_load_detect.c +++ b/drivers/gpu/drm/i915/display/intel_load_detect.c @@ -52,7 +52,7 @@ intel_load_detect_get_pipe(struct drm_connector *connector, intel_attached_encoder(to_intel_connector(connector)); struct intel_crtc *possible_crtc; struct intel_crtc *crtc = NULL; - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct drm_mode_config *config = &dev->mode_config; struct drm_atomic_state *state = NULL, *restore_state = NULL; @@ -206,7 +206,7 @@ void intel_load_detect_release_pipe(struct drm_connector *connector, { struct intel_encoder *intel_encoder = intel_attached_encoder(to_intel_connector(connector)); - struct drm_i915_private *i915 = to_i915(intel_encoder->base.dev); + struct drm_i915_private *i915 = to_i915(intel_encoder->base.drm); struct drm_encoder *encoder = &intel_encoder->base; int ret; diff --git a/drivers/gpu/drm/i915/display/intel_lspcon.c b/drivers/gpu/drm/i915/display/intel_lspcon.c index bb3b5355a0d9..f3f07113a555 100644 --- a/drivers/gpu/drm/i915/display/intel_lspcon.c +++ b/drivers/gpu/drm/i915/display/intel_lspcon.c @@ -514,7 +514,7 @@ void lspcon_set_infoframes(struct intel_encoder *encoder, u8 buf[VIDEO_DIP_DATA_SIZE]; struct intel_digital_port *dig_port = enc_to_dig_port(encoder); struct intel_lspcon *lspcon = &dig_port->lspcon; - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; @@ -551,7 +551,7 @@ void lspcon_set_infoframes(struct intel_encoder *encoder, drm_hdmi_avi_infoframe_colorimetry(&frame.avi, conn_state); /* nonsense combination */ - drm_WARN_ON(encoder->base.dev, crtc_state->limited_color_range && + drm_WARN_ON(encoder->base.drm, crtc_state->limited_color_range && crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB); if (crtc_state->output_format == INTEL_OUTPUT_FORMAT_RGB) { @@ -613,7 +613,7 @@ u32 lspcon_infoframes_enabled(struct intel_encoder *encoder, { struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_lspcon *lspcon = enc_to_intel_lspcon(encoder); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); bool infoframes_enabled; u32 val = 0; u32 mask, tmp; @@ -685,7 +685,7 @@ u32 intel_lspcon_infoframes_enabled(struct intel_encoder *encoder, void lspcon_resume(struct intel_digital_port *dig_port) { struct intel_lspcon *lspcon = &dig_port->lspcon; - struct drm_device *dev = dig_port->base.base.dev; + struct drm_device *dev = dig_port->base.base.drm; struct drm_i915_private *i915 = to_i915(dev); enum drm_lspcon_mode expected_mode; diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c index c7b96ea7666c..ca98d81d1ed0 100644 --- a/drivers/gpu/drm/i915/display/intel_lvds.c +++ b/drivers/gpu/drm/i915/display/intel_lvds.c @@ -105,7 +105,7 @@ bool intel_lvds_port_enabled(struct drm_i915_private *i915, static bool intel_lvds_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); intel_wakeref_t wakeref; bool ret; @@ -124,7 +124,7 @@ static bool intel_lvds_get_hw_state(struct intel_encoder *encoder, static void intel_lvds_get_config(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); u32 tmp, flags = 0; @@ -236,7 +236,7 @@ static void intel_pre_enable_lvds(struct intel_atomic_state *state, const struct drm_connector_state *conn_state) { struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; enum pipe pipe = crtc->pipe; @@ -317,7 +317,7 @@ static void intel_enable_lvds(struct intel_atomic_state *state, const struct drm_connector_state *conn_state) { struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); intel_de_rmw(dev_priv, lvds_encoder->reg, 0, LVDS_PORT_EN); @@ -337,7 +337,7 @@ static void intel_disable_lvds(struct intel_atomic_state *state, const struct drm_connector_state *old_conn_state) { struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); intel_de_rmw(dev_priv, PP_CONTROL(0), PANEL_POWER_ON, 0); if (intel_de_wait_for_clear(dev_priv, PP_STATUS(0), PP_ON, 1000)) @@ -377,7 +377,7 @@ static void pch_post_disable_lvds(struct intel_atomic_state *state, static void intel_lvds_shutdown(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); if (intel_de_wait_for_clear(dev_priv, PP_STATUS(0), PP_CYCLE_DELAY_ACTIVE, 5000)) drm_err(&dev_priv->drm, @@ -411,7 +411,7 @@ static int intel_lvds_compute_config(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state, struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); struct intel_connector *connector = lvds_encoder->attached_connector; struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; @@ -783,7 +783,7 @@ bool intel_is_dual_link_lvds(struct drm_i915_private *i915) static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder) { - struct drm_i915_private *i915 = to_i915(lvds_encoder->base.base.dev); + struct drm_i915_private *i915 = to_i915(lvds_encoder->base.base.drm); struct intel_connector *connector = lvds_encoder->attached_connector; const struct drm_display_mode *fixed_mode = intel_panel_preferred_fixed_mode(connector); diff --git a/drivers/gpu/drm/i915/display/intel_modeset_setup.c b/drivers/gpu/drm/i915/display/intel_modeset_setup.c index 508ca534ab04..c588bf7faaf5 100644 --- a/drivers/gpu/drm/i915/display/intel_modeset_setup.c +++ b/drivers/gpu/drm/i915/display/intel_modeset_setup.c @@ -115,7 +115,7 @@ static void set_encoder_for_connector(struct intel_connector *connector, static void reset_encoder_connector_state(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_pmdemand_state *pmdemand_state = to_intel_pmdemand_state(i915->display.pmdemand.obj.state); struct intel_connector *connector; @@ -408,7 +408,7 @@ static bool intel_crtc_needs_link_reset(struct intel_crtc *crtc) static struct intel_connector *intel_encoder_find_connector(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct drm_connector_list_iter conn_iter; struct intel_connector *connector; struct intel_connector *found_connector = NULL; @@ -558,7 +558,7 @@ static bool has_bogus_dpll_config(const struct intel_crtc_state *crtc_state) static void intel_sanitize_encoder(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_connector *connector; struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc); struct intel_crtc_state *crtc_state = crtc ? diff --git a/drivers/gpu/drm/i915/display/intel_opregion.c b/drivers/gpu/drm/i915/display/intel_opregion.c index 246002019175..e2fcd783b92d 100644 --- a/drivers/gpu/drm/i915/display/intel_opregion.c +++ b/drivers/gpu/drm/i915/display/intel_opregion.c @@ -359,7 +359,7 @@ static int swsci(struct drm_i915_private *dev_priv, int intel_opregion_notify_encoder(struct intel_encoder *intel_encoder, bool enable) { - struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.drm); u32 parm = 0; u32 type = 0; u32 port; diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c index efe52b20dea0..de93c6ab1827 100644 --- a/drivers/gpu/drm/i915/display/intel_pps.c +++ b/drivers/gpu/drm/i915/display/intel_pps.c @@ -390,7 +390,7 @@ pps_initial_setup(struct intel_dp *intel_dp) { struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base; struct intel_connector *connector = intel_dp->attached_connector; - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); lockdep_assert_held(&i915->display.pps.mutex); @@ -1110,7 +1110,7 @@ void intel_pps_backlight_power(struct intel_connector *connector, bool enable) static void vlv_detach_power_sequencer(struct intel_dp *intel_dp) { struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); - struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.drm); enum pipe pipe = intel_dp->pps.pps_pipe; i915_reg_t pp_on_reg = PP_ON_DELAYS(pipe); @@ -1171,7 +1171,7 @@ static void vlv_steal_power_sequencer(struct drm_i915_private *dev_priv, void vlv_pps_init(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index f91e4f2f926a..2f60e3cc26e6 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -412,7 +412,7 @@ static void intel_dp_get_su_granularity(struct intel_dp *intel_dp) void intel_psr_init_dpcd(struct intel_dp *intel_dp) { struct drm_i915_private *dev_priv = - to_i915(dp_to_dig_port(intel_dp)->base.base.dev); + to_i915(dp_to_dig_port(intel_dp)->base.base.drm); drm_dp_dpcd_read(&intel_dp->aux, DP_PSR_SUPPORT, intel_dp->psr_dpcd, sizeof(intel_dp->psr_dpcd)); @@ -1154,7 +1154,7 @@ void intel_psr_compute_config(struct intel_dp *intel_dp, void intel_psr_get_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_digital_port *dig_port = enc_to_dig_port(encoder); enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; struct intel_dp *intel_dp; diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index 28d9f3654dfb..6918979f48da 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -214,7 +214,7 @@ intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo, */ static void intel_sdvo_write_sdvox(struct intel_sdvo *intel_sdvo, u32 val) { - struct drm_device *dev = intel_sdvo->base.base.dev; + struct drm_device *dev = intel_sdvo->base.base.drm; struct drm_i915_private *dev_priv = to_i915(dev); u32 bval = val, cval = val; int i; @@ -415,7 +415,7 @@ static const char *sdvo_cmd_name(u8 cmd) static void intel_sdvo_debug_write(struct intel_sdvo *intel_sdvo, u8 cmd, const void *args, int args_len) { - struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.drm); const char *cmd_name; int i, pos = 0; char buffer[64]; @@ -538,7 +538,7 @@ static bool intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd, static bool intel_sdvo_read_response(struct intel_sdvo *intel_sdvo, void *response, int response_len) { - struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.drm); const char *cmd_status; u8 retry = 15; /* 5 quick checks, followed by 10 long checks */ u8 status; @@ -1093,7 +1093,7 @@ static bool intel_sdvo_compute_avi_infoframe(struct intel_sdvo *intel_sdvo, struct intel_crtc_state *crtc_state, struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.drm); struct hdmi_avi_infoframe *frame = &crtc_state->infoframes.avi.avi; const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; @@ -1128,7 +1128,7 @@ static bool intel_sdvo_compute_avi_infoframe(struct intel_sdvo *intel_sdvo, static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.drm); u8 sdvo_data[HDMI_INFOFRAME_SIZE(AVI)]; const union hdmi_infoframe *frame = &crtc_state->infoframes.avi; ssize_t len; @@ -1187,7 +1187,7 @@ static void intel_sdvo_get_avi_infoframe(struct intel_sdvo *intel_sdvo, static void intel_sdvo_get_eld(struct intel_sdvo *intel_sdvo, struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); + struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.drm); ssize_t len; u8 val; @@ -1357,7 +1357,7 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder, pipe_config->sink_format = INTEL_OUTPUT_FORMAT_RGB; pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; - if (HAS_PCH_SPLIT(to_i915(encoder->base.dev))) + if (HAS_PCH_SPLIT(to_i915(encoder->base.drm))) pipe_config->has_pch_encoder = true; /* @@ -1498,7 +1498,7 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; const struct intel_sdvo_connector_state *sdvo_state = @@ -1659,7 +1659,7 @@ bool intel_sdvo_port_enabled(struct drm_i915_private *dev_priv, static bool intel_sdvo_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_sdvo *intel_sdvo = to_sdvo(encoder); u16 active_outputs = 0; bool ret; @@ -1674,7 +1674,7 @@ static bool intel_sdvo_get_hw_state(struct intel_encoder *encoder, static void intel_sdvo_get_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_sdvo *intel_sdvo = to_sdvo(encoder); struct intel_sdvo_dtd dtd; @@ -1800,7 +1800,7 @@ static void intel_disable_sdvo(struct intel_atomic_state *state, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_sdvo *intel_sdvo = to_sdvo(encoder); struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); u32 temp; @@ -1864,7 +1864,7 @@ static void intel_enable_sdvo(struct intel_atomic_state *state, const struct intel_crtc_state *pipe_config, const struct drm_connector_state *conn_state) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_sdvo *intel_sdvo = to_sdvo(encoder); struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); @@ -1992,7 +1992,7 @@ static u8 intel_sdvo_get_colorimetry_cap(struct intel_sdvo *intel_sdvo) static u16 intel_sdvo_get_hotplug_support(struct intel_sdvo *intel_sdvo) { - struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.drm); u16 hotplug; if (!I915_HAS_HOTPLUG(dev_priv)) @@ -2705,10 +2705,10 @@ intel_sdvo_connector_init(struct intel_sdvo_connector *connector, int ret; drm_connector = &connector->base.base; - ret = drm_connector_init(encoder->base.base.dev, - drm_connector, - &intel_sdvo_connector_funcs, - connector->base.base.connector_type); + ret = drm_connector_init(encoder->base.base.drm, + drm_connector, + &intel_sdvo_connector_funcs, + connector->base.base.connector_type); if (ret < 0) return ret; @@ -2881,7 +2881,7 @@ static bool intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, u16 type) { struct drm_encoder *encoder = &intel_sdvo->base.base; - struct drm_i915_private *i915 = to_i915(encoder->dev); + struct drm_i915_private *i915 = to_i915(encoder->drm); struct drm_connector *connector; struct intel_connector *intel_connector; struct intel_sdvo_connector *intel_sdvo_connector; @@ -2982,7 +2982,7 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo) SDVO_OUTPUT_LVDS0, SDVO_OUTPUT_LVDS1, }; - struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); + struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.drm); u16 flags; int i; @@ -3015,7 +3015,7 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo) static void intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo) { - struct drm_device *dev = intel_sdvo->base.base.dev; + struct drm_device *dev = intel_sdvo->base.base.drm; struct drm_connector *connector, *tmp; list_for_each_entry_safe(connector, tmp, @@ -3031,7 +3031,7 @@ static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo, struct intel_sdvo_connector *intel_sdvo_connector, int type) { - struct drm_device *dev = intel_sdvo->base.base.dev; + struct drm_device *dev = intel_sdvo->base.base.drm; struct intel_sdvo_tv_format format; u32 format_map, i; @@ -3095,7 +3095,7 @@ intel_sdvo_create_enhance_property_tv(struct intel_sdvo *intel_sdvo, struct intel_sdvo_connector *intel_sdvo_connector, struct intel_sdvo_enhancements_reply enhancements) { - struct drm_device *dev = intel_sdvo->base.base.dev; + struct drm_device *dev = intel_sdvo->base.base.drm; struct drm_connector *connector = &intel_sdvo_connector->base.base; struct drm_connector_state *conn_state = connector->state; struct intel_sdvo_connector_state *sdvo_state = @@ -3209,7 +3209,7 @@ intel_sdvo_create_enhance_property_lvds(struct intel_sdvo *intel_sdvo, struct intel_sdvo_connector *intel_sdvo_connector, struct intel_sdvo_enhancements_reply enhancements) { - struct drm_device *dev = intel_sdvo->base.base.dev; + struct drm_device *dev = intel_sdvo->base.base.drm; struct drm_connector *connector = &intel_sdvo_connector->base.base; u16 response, data_value[2]; diff --git a/drivers/gpu/drm/i915/display/intel_snps_phy.c b/drivers/gpu/drm/i915/display/intel_snps_phy.c index 6f5cd530539c..30b28cdf37c0 100644 --- a/drivers/gpu/drm/i915/display/intel_snps_phy.c +++ b/drivers/gpu/drm/i915/display/intel_snps_phy.c @@ -61,7 +61,7 @@ void intel_snps_phy_update_psr_power_state(struct drm_i915_private *i915, void intel_snps_phy_set_signal_levels(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); const struct intel_ddi_buf_trans *trans; enum phy phy = intel_port_to_phy(dev_priv, encoder->port); int n_entries, ln; @@ -1785,7 +1785,7 @@ intel_mpllb_tables_get(struct intel_crtc_state *crtc_state, int intel_mpllb_calc_state(struct intel_crtc_state *crtc_state, struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); const struct intel_mpllb_state * const *tables; int i; @@ -1820,7 +1820,7 @@ int intel_mpllb_calc_state(struct intel_crtc_state *crtc_state, void intel_mpllb_enable(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); const struct intel_mpllb_state *pll_state = &crtc_state->mpllb_state; enum phy phy = intel_port_to_phy(dev_priv, encoder->port); i915_reg_t enable_reg = (phy <= PHY_D ? @@ -1878,7 +1878,7 @@ void intel_mpllb_enable(struct intel_encoder *encoder, void intel_mpllb_disable(struct intel_encoder *encoder) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(i915, encoder->port); i915_reg_t enable_reg = (phy <= PHY_D ? DG2_PLL_ENABLE(phy) : MG_PLL_ENABLE(0)); @@ -1950,7 +1950,7 @@ int intel_mpllb_calc_port_clock(struct intel_encoder *encoder, void intel_mpllb_readout_hw_state(struct intel_encoder *encoder, struct intel_mpllb_state *pll_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); enum phy phy = intel_port_to_phy(dev_priv, encoder->port); pll_state->mpllb_cp = intel_de_read(dev_priv, SNPS_PHY_MPLLB_CP(phy)); diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915/display/intel_tc.c index 3ebf41859043..c53cedb21d1e 100644 --- a/drivers/gpu/drm/i915/display/intel_tc.c +++ b/drivers/gpu/drm/i915/display/intel_tc.c @@ -94,13 +94,13 @@ static struct intel_tc_port *to_tc_port(struct intel_digital_port *dig_port) static struct drm_i915_private *tc_to_i915(struct intel_tc_port *tc) { - return to_i915(tc->dig_port->base.base.dev); + return to_i915(tc->dig_port->base.base.drm); } static bool intel_tc_port_in_mode(struct intel_digital_port *dig_port, enum tc_port_mode mode) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); enum phy phy = intel_port_to_phy(i915, dig_port->base.port); struct intel_tc_port *tc = to_tc_port(dig_port); @@ -172,7 +172,7 @@ bool intel_tc_port_in_legacy_mode(struct intel_digital_port *dig_port) */ bool intel_tc_cold_requires_aux_pw(struct intel_digital_port *dig_port) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_tc_port *tc = to_tc_port(dig_port); return tc_phy_cold_off_domain(tc) == @@ -262,7 +262,7 @@ assert_tc_port_power_enabled(struct intel_tc_port *tc) u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_tc_port *tc = to_tc_port(dig_port); u32 lane_mask; @@ -277,7 +277,7 @@ u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port) u32 intel_tc_port_get_pin_assignment_mask(struct intel_digital_port *dig_port) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_tc_port *tc = to_tc_port(dig_port); u32 pin_mask; @@ -292,7 +292,7 @@ u32 intel_tc_port_get_pin_assignment_mask(struct intel_digital_port *dig_port) static int mtl_tc_port_get_pin_assignment_mask(struct intel_digital_port *dig_port) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); intel_wakeref_t wakeref; u32 pin_mask; @@ -313,7 +313,7 @@ static int mtl_tc_port_get_pin_assignment_mask(struct intel_digital_port *dig_po int intel_tc_port_fia_max_lane_count(struct intel_digital_port *dig_port) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_tc_port *tc = to_tc_port(dig_port); enum phy phy = intel_port_to_phy(i915, dig_port->base.port); intel_wakeref_t wakeref; @@ -351,7 +351,7 @@ int intel_tc_port_fia_max_lane_count(struct intel_digital_port *dig_port) void intel_tc_port_set_fia_lane_count(struct intel_digital_port *dig_port, int required_lanes) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_tc_port *tc = to_tc_port(dig_port); bool lane_reversal = dig_port->saved_port_bits & DDI_BUF_PORT_REVERSAL; u32 val; @@ -1161,7 +1161,7 @@ static bool tc_phy_is_connected(struct intel_tc_port *tc, enum icl_port_dpll_id port_pll_type) { struct intel_encoder *encoder = &tc->dig_port->base; - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); bool phy_is_ready = tc_phy_is_ready(tc); bool phy_is_owned = tc_phy_is_owned(tc); bool is_connected; @@ -1423,7 +1423,7 @@ static bool tc_port_is_enabled(struct intel_tc_port *tc) */ void intel_tc_port_init_mode(struct intel_digital_port *dig_port) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_tc_port *tc = to_tc_port(dig_port); bool update_mode = false; @@ -1509,7 +1509,7 @@ static bool tc_port_has_active_links(struct intel_tc_port *tc, void intel_tc_port_sanitize_mode(struct intel_digital_port *dig_port, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_tc_port *tc = to_tc_port(dig_port); mutex_lock(&tc->lock); @@ -1552,7 +1552,7 @@ void intel_tc_port_sanitize_mode(struct intel_digital_port *dig_port, bool intel_tc_port_connected_locked(struct intel_encoder *encoder) { struct intel_digital_port *dig_port = enc_to_dig_port(encoder); - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_tc_port *tc = to_tc_port(dig_port); u32 mask = ~0; @@ -1594,7 +1594,7 @@ static bool __intel_tc_port_link_needs_reset(struct intel_tc_port *tc) bool intel_tc_port_link_needs_reset(struct intel_digital_port *dig_port) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); enum phy phy = intel_port_to_phy(i915, dig_port->base.port); if (!intel_phy_is_tc(i915, phy)) @@ -1699,7 +1699,7 @@ bool intel_tc_port_link_reset(struct intel_digital_port *dig_port) void intel_tc_port_link_cancel_reset_work(struct intel_digital_port *dig_port) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); enum phy phy = intel_port_to_phy(i915, dig_port->base.port); struct intel_tc_port *tc = to_tc_port(dig_port); @@ -1817,7 +1817,7 @@ void intel_tc_port_put_link(struct intel_digital_port *dig_port) int intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy) { - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); + struct drm_i915_private *i915 = to_i915(dig_port->base.base.drm); struct intel_tc_port *tc; enum port port = dig_port->base.port; enum tc_port tc_port = intel_port_to_tc(i915, port); diff --git a/drivers/gpu/drm/i915/display/intel_tv.c b/drivers/gpu/drm/i915/display/intel_tv.c index 5f2c9ba488d9..3ee095ce47af 100644 --- a/drivers/gpu/drm/i915/display/intel_tv.c +++ b/drivers/gpu/drm/i915/display/intel_tv.c @@ -912,7 +912,7 @@ static struct intel_tv *intel_attached_tv(struct intel_connector *connector) static bool intel_tv_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 tmp = intel_de_read(dev_priv, TV_CTL); *pipe = (tmp & TV_ENC_PIPE_SEL_MASK) >> TV_ENC_PIPE_SEL_SHIFT; @@ -926,7 +926,7 @@ intel_enable_tv(struct intel_atomic_state *state, const struct intel_crtc_state *pipe_config, const struct drm_connector_state *conn_state) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); /* Prevents vblank waits from timing out in intel_tv_detect_type() */ @@ -941,7 +941,7 @@ intel_disable_tv(struct intel_atomic_state *state, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); intel_de_rmw(dev_priv, TV_CTL, TV_ENC_ENABLE, 0); @@ -1087,7 +1087,7 @@ static void intel_tv_get_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; struct drm_display_mode mode = {}; @@ -1190,7 +1190,7 @@ intel_tv_compute_config(struct intel_encoder *encoder, struct intel_atomic_state *state = to_intel_atomic_state(pipe_config->uapi.state); struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_tv_connector_state *tv_conn_state = to_intel_tv_connector_state(conn_state); const struct tv_mode *tv_mode = intel_tv_mode_find(conn_state); @@ -1433,7 +1433,7 @@ static void intel_tv_pre_enable(struct intel_atomic_state *state, const struct intel_crtc_state *pipe_config, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); struct intel_tv *intel_tv = enc_to_tv(encoder); const struct intel_tv_connector_state *tv_conn_state = diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c index 129e00578a28..5992e003dac8 100644 --- a/drivers/gpu/drm/i915/display/vlv_dsi.c +++ b/drivers/gpu/drm/i915/display/vlv_dsi.c @@ -85,7 +85,7 @@ enum mipi_dsi_pixel_format pixel_format_from_register_bits(u32 fmt) void vlv_dsi_wait_for_fifo_empty(struct intel_dsi *intel_dsi, enum port port) { struct drm_encoder *encoder = &intel_dsi->base.base; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_i915_private *dev_priv = to_i915(dev); u32 mask; @@ -131,7 +131,7 @@ static ssize_t intel_dsi_host_transfer(struct mipi_dsi_host *host, const struct mipi_dsi_msg *msg) { struct intel_dsi_host *intel_dsi_host = to_intel_dsi_host(host); - struct drm_device *dev = intel_dsi_host->intel_dsi->base.base.dev; + struct drm_device *dev = intel_dsi_host->intel_dsi->base.base.drm; struct drm_i915_private *dev_priv = to_i915(dev); enum port port = intel_dsi_host->port; struct mipi_dsi_packet packet; @@ -225,7 +225,7 @@ static int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs, enum port port) { struct drm_encoder *encoder = &intel_dsi->base.base; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_i915_private *dev_priv = to_i915(dev); u32 mask; @@ -271,7 +271,7 @@ static int intel_dsi_compute_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi, base); struct intel_connector *intel_connector = intel_dsi->attached_connector; @@ -328,7 +328,7 @@ static int intel_dsi_compute_config(struct intel_encoder *encoder, static bool glk_dsi_enable_io(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; bool cold_boot = false; @@ -368,7 +368,7 @@ static bool glk_dsi_enable_io(struct intel_encoder *encoder) static void glk_dsi_device_ready(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -430,7 +430,7 @@ static void glk_dsi_device_ready(struct intel_encoder *encoder) static void bxt_dsi_device_ready(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; u32 val; @@ -456,7 +456,7 @@ static void bxt_dsi_device_ready(struct intel_encoder *encoder) static void vlv_dsi_device_ready(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -496,7 +496,7 @@ static void vlv_dsi_device_ready(struct intel_encoder *encoder) static void intel_dsi_device_ready(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); if (IS_GEMINILAKE(dev_priv)) glk_dsi_device_ready(encoder); @@ -508,7 +508,7 @@ static void intel_dsi_device_ready(struct intel_encoder *encoder) static void glk_dsi_enter_low_power_mode(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -535,7 +535,7 @@ static void glk_dsi_enter_low_power_mode(struct intel_encoder *encoder) static void glk_dsi_disable_mipi_io(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -562,7 +562,7 @@ static void glk_dsi_clear_device_ready(struct intel_encoder *encoder) static void vlv_dsi_clear_device_ready(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -605,7 +605,7 @@ static void vlv_dsi_clear_device_ready(struct intel_encoder *encoder) static void intel_dsi_port_enable(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -657,7 +657,7 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder, static void intel_dsi_port_disable(struct intel_encoder *encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -845,7 +845,7 @@ static void intel_dsi_disable(struct intel_atomic_state *state, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_i915_private *i915 = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -869,7 +869,7 @@ static void intel_dsi_disable(struct intel_atomic_state *state, static void intel_dsi_clear_device_ready(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); if (IS_GEMINILAKE(dev_priv)) glk_dsi_clear_device_ready(encoder); @@ -882,7 +882,7 @@ static void intel_dsi_post_disable(struct intel_atomic_state *state, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -953,7 +953,7 @@ static void intel_dsi_shutdown(struct intel_encoder *encoder) static bool intel_dsi_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); intel_wakeref_t wakeref; enum port port; @@ -1029,7 +1029,7 @@ static bool intel_dsi_get_hw_state(struct intel_encoder *encoder, static void bxt_dsi_get_pipe_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; @@ -1192,7 +1192,7 @@ static void bxt_dsi_get_pipe_config(struct intel_encoder *encoder, static void intel_dsi_get_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); u32 pclk; @@ -1232,7 +1232,7 @@ static u16 txclkesc(u32 divider, unsigned int us) static void set_dsi_timings(struct drm_encoder *encoder, const struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_dsi *intel_dsi = enc_to_intel_dsi(to_intel_encoder(encoder)); enum port port; @@ -1322,7 +1322,7 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder, const struct intel_crtc_state *pipe_config) { struct drm_encoder *encoder = &intel_encoder->base; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); struct intel_dsi *intel_dsi = enc_to_intel_dsi(to_intel_encoder(encoder)); @@ -1528,7 +1528,7 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder, static void intel_dsi_unprepare(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -1603,7 +1603,7 @@ static void vlv_dsi_add_properties(struct intel_connector *connector) static void vlv_dphy_param_init(struct intel_dsi *intel_dsi) { - struct drm_device *dev = intel_dsi->base.base.dev; + struct drm_device *dev = intel_dsi->base.base.drm; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_connector *connector = intel_dsi->attached_connector; struct mipi_config *mipi_config = connector->panel.vbt.dsi.config; diff --git a/drivers/gpu/drm/i915/display/vlv_dsi_pll.c b/drivers/gpu/drm/i915/display/vlv_dsi_pll.c index ae0a0b11bae3..e1b627530df7 100644 --- a/drivers/gpu/drm/i915/display/vlv_dsi_pll.c +++ b/drivers/gpu/drm/i915/display/vlv_dsi_pll.c @@ -116,7 +116,7 @@ static int dsi_calc_mnp(struct drm_i915_private *dev_priv, static int vlv_dsi_pclk(struct intel_encoder *encoder, struct intel_crtc_state *config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); int bpp = mipi_dsi_pixel_format_to_bpp(intel_dsi->pixel_format); u32 dsi_clock; @@ -175,7 +175,7 @@ static int vlv_dsi_pclk(struct intel_encoder *encoder, int vlv_dsi_pll_compute(struct intel_encoder *encoder, struct intel_crtc_state *config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); int pclk, dsi_clk, ret; @@ -213,7 +213,7 @@ int vlv_dsi_pll_compute(struct intel_encoder *encoder, void vlv_dsi_pll_enable(struct intel_encoder *encoder, const struct intel_crtc_state *config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); drm_dbg_kms(&dev_priv->drm, "\n"); @@ -245,7 +245,7 @@ void vlv_dsi_pll_enable(struct intel_encoder *encoder, void vlv_dsi_pll_disable(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 tmp; drm_dbg_kms(&dev_priv->drm, "\n"); @@ -301,7 +301,7 @@ bool bxt_dsi_pll_is_enabled(struct drm_i915_private *dev_priv) void bxt_dsi_pll_disable(struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); drm_dbg_kms(&dev_priv->drm, "\n"); @@ -320,7 +320,7 @@ void bxt_dsi_pll_disable(struct intel_encoder *encoder) u32 vlv_dsi_get_pclk(struct intel_encoder *encoder, struct intel_crtc_state *config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 pll_ctl, pll_div; drm_dbg_kms(&dev_priv->drm, "\n"); @@ -352,7 +352,7 @@ static int bxt_dsi_pclk(struct intel_encoder *encoder, u32 bxt_dsi_get_pclk(struct intel_encoder *encoder, struct intel_crtc_state *config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); u32 pclk; config->dsi_pll.ctrl = intel_de_read(dev_priv, BXT_DSI_PLL_CTL); @@ -366,7 +366,7 @@ u32 bxt_dsi_get_pclk(struct intel_encoder *encoder, void vlv_dsi_reset_clocks(struct intel_encoder *encoder, enum port port) { u32 temp; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); temp = intel_de_read(dev_priv, MIPI_CTRL(port)); @@ -478,7 +478,7 @@ static void bxt_dsi_program_clocks(struct drm_device *dev, enum port port, int bxt_dsi_pll_compute(struct intel_encoder *encoder, struct intel_crtc_state *config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); u8 dsi_ratio, dsi_ratio_min, dsi_ratio_max; u32 dsi_clk; @@ -536,7 +536,7 @@ int bxt_dsi_pll_compute(struct intel_encoder *encoder, void bxt_dsi_pll_enable(struct intel_encoder *encoder, const struct intel_crtc_state *config) { - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.drm); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; @@ -549,9 +549,9 @@ void bxt_dsi_pll_enable(struct intel_encoder *encoder, /* Program TX, RX, Dphy clocks */ if (IS_BROXTON(dev_priv)) { for_each_dsi_port(port, intel_dsi->ports) - bxt_dsi_program_clocks(encoder->base.dev, port, config); + bxt_dsi_program_clocks(encoder->base.drm, port, config); } else { - glk_dsi_program_esc_clock(encoder->base.dev, config); + glk_dsi_program_esc_clock(encoder->base.drm, config); } /* Enable DSI PLL */ @@ -571,7 +571,7 @@ void bxt_dsi_pll_enable(struct intel_encoder *encoder, void bxt_dsi_reset_clocks(struct intel_encoder *encoder, enum port port) { u32 tmp; - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct drm_i915_private *dev_priv = to_i915(dev); /* Clear old configurations */ diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index 868d4979e464..c8b4b988e20b 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -730,7 +730,7 @@ static void ingenic_drm_encoder_atomic_mode_set(struct drm_encoder *encoder, struct drm_crtc_state *crtc_state, struct drm_connector_state *conn_state) { - struct ingenic_drm *priv = drm_device_get_priv(encoder->dev); + struct ingenic_drm *priv = drm_device_get_priv(encoder->drm); struct drm_display_mode *mode = &crtc_state->adjusted_mode; struct ingenic_drm_bridge *bridge = to_ingenic_drm_bridge(encoder); unsigned int cfg, rgbcfg = 0; diff --git a/drivers/gpu/drm/logicvc/logicvc_interface.c b/drivers/gpu/drm/logicvc/logicvc_interface.c index 689049d395c0..2424eb593ffd 100644 --- a/drivers/gpu/drm/logicvc/logicvc_interface.c +++ b/drivers/gpu/drm/logicvc/logicvc_interface.c @@ -30,7 +30,7 @@ static void logicvc_encoder_enable(struct drm_encoder *drm_encoder) { - struct logicvc_drm *logicvc = logicvc_drm(drm_encoder->dev); + struct logicvc_drm *logicvc = logicvc_drm(drm_encoder->drm); struct logicvc_interface *interface = logicvc_interface_from_drm_encoder(drm_encoder); diff --git a/drivers/gpu/drm/loongson/lsdc_output_7a1000.c b/drivers/gpu/drm/loongson/lsdc_output_7a1000.c index 6fc8dd1c7d9a..f7612aa51197 100644 --- a/drivers/gpu/drm/loongson/lsdc_output_7a1000.c +++ b/drivers/gpu/drm/loongson/lsdc_output_7a1000.c @@ -102,7 +102,7 @@ static const struct drm_connector_funcs ls7a1000_dpi_connector_funcs = { static void ls7a1000_pipe0_encoder_reset(struct drm_encoder *encoder) { - struct drm_device *ddev = encoder->dev; + struct drm_device *ddev = encoder->drm; struct lsdc_device *ldev = to_lsdc(ddev); /* @@ -115,7 +115,7 @@ static void ls7a1000_pipe0_encoder_reset(struct drm_encoder *encoder) static void ls7a1000_pipe1_encoder_reset(struct drm_encoder *encoder) { - struct drm_device *ddev = encoder->dev; + struct drm_device *ddev = encoder->drm; struct lsdc_device *ldev = to_lsdc(ddev); /* diff --git a/drivers/gpu/drm/loongson/lsdc_output_7a2000.c b/drivers/gpu/drm/loongson/lsdc_output_7a2000.c index 5ef9fe52bffc..9b230c56d6bd 100644 --- a/drivers/gpu/drm/loongson/lsdc_output_7a2000.c +++ b/drivers/gpu/drm/loongson/lsdc_output_7a2000.c @@ -227,7 +227,7 @@ static const struct drm_connector_funcs ls7a2000_hdmi_connector_funcs[2] = { */ static void ls7a2000_hdmi0_encoder_reset(struct drm_encoder *encoder) { - struct drm_device *ddev = encoder->dev; + struct drm_device *ddev = encoder->drm; struct lsdc_device *ldev = to_lsdc(ddev); u32 val; @@ -249,7 +249,7 @@ static void ls7a2000_hdmi0_encoder_reset(struct drm_encoder *encoder) static void ls7a2000_hdmi1_encoder_reset(struct drm_encoder *encoder) { - struct drm_device *ddev = encoder->dev; + struct drm_device *ddev = encoder->drm; struct lsdc_device *ldev = to_lsdc(ddev); u32 val; @@ -286,7 +286,7 @@ static int ls7a2000_hdmi_set_avi_infoframe(struct drm_encoder *encoder, struct lsdc_output *output = encoder_to_lsdc_output(encoder); struct lsdc_display_pipe *dispipe = output_to_display_pipe(output); unsigned int index = dispipe->index; - struct drm_device *ddev = encoder->dev; + struct drm_device *ddev = encoder->drm; struct lsdc_device *ldev = to_lsdc(ddev); struct hdmi_avi_infoframe infoframe; u8 buffer[HDMI_INFOFRAME_SIZE(AVI)]; @@ -337,7 +337,7 @@ static void ls7a2000_hdmi_atomic_disable(struct drm_encoder *encoder, struct lsdc_output *output = encoder_to_lsdc_output(encoder); struct lsdc_display_pipe *dispipe = output_to_display_pipe(output); unsigned int index = dispipe->index; - struct drm_device *ddev = encoder->dev; + struct drm_device *ddev = encoder->drm; struct lsdc_device *ldev = to_lsdc(ddev); u32 val; @@ -357,7 +357,7 @@ static void ls7a2000_hdmi_atomic_disable(struct drm_encoder *encoder, static void ls7a2000_hdmi_atomic_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { - struct drm_device *ddev = encoder->dev; + struct drm_device *ddev = encoder->drm; struct lsdc_device *ldev = to_lsdc(ddev); struct lsdc_output *output = encoder_to_lsdc_output(encoder); struct lsdc_display_pipe *dispipe = output_to_display_pipe(output); @@ -484,7 +484,7 @@ static void ls7a2000_hdmi_atomic_mode_set(struct drm_encoder *encoder, struct lsdc_output *output = encoder_to_lsdc_output(encoder); struct lsdc_display_pipe *dispipe = output_to_display_pipe(output); unsigned int index = dispipe->index; - struct drm_device *ddev = encoder->dev; + struct drm_device *ddev = encoder->drm; struct lsdc_device *ldev = to_lsdc(ddev); struct drm_display_mode *mode = &crtc_state->mode; diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index 0a8e0a13f516..e7e443c56bb6 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -1245,11 +1245,11 @@ static void mtk_hdmi_hpd_event(bool hpd, struct device *dev) { struct mtk_hdmi *hdmi = dev_get_drvdata(dev); - if (hdmi && hdmi->bridge.encoder && hdmi->bridge.encoder->dev) { + if (hdmi && hdmi->bridge.encoder && hdmi->bridge.encoder->drm) { static enum drm_connector_status status; status = mtk_hdmi_detect(hdmi); - drm_helper_hpd_irq_event(hdmi->bridge.encoder->dev); + drm_helper_hpd_irq_event(hdmi->bridge.encoder->drm); drm_bridge_hpd_notify(&hdmi->bridge, status); } } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 493905a5b63a..4421d23f4a39 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -617,7 +617,7 @@ static int dpu_encoder_virt_atomic_check( dpu_enc = to_dpu_encoder_virt(drm_enc); DPU_DEBUG_ENC(dpu_enc, "\n"); - priv = drm_enc->dev->dev_private; + priv = drm_enc->drm->dev_private; dpu_kms = to_dpu_kms(priv->kms); adj_mode = &crtc_state->adjusted_mode; global_state = dpu_kms_get_global_state(crtc_state->state); @@ -683,7 +683,7 @@ static void _dpu_encoder_update_vsync_source(struct dpu_encoder_virt *dpu_enc, drm_enc = &dpu_enc->base; /* this pointers are checked in virt_enable_helper */ - priv = drm_enc->dev->dev_private; + priv = drm_enc->drm->dev_private; dpu_kms = to_dpu_kms(priv->kms); hw_mdptop = dpu_kms->hw_mdp; @@ -747,7 +747,7 @@ static void _dpu_encoder_resource_control_helper(struct drm_encoder *drm_enc, struct dpu_encoder_virt *dpu_enc; dpu_enc = to_dpu_encoder_virt(drm_enc); - priv = drm_enc->dev->dev_private; + priv = drm_enc->drm->dev_private; dpu_kms = to_dpu_kms(priv->kms); trace_dpu_enc_rc_helper(DRMID(drm_enc), enable); @@ -781,12 +781,12 @@ static int dpu_encoder_resource_control(struct drm_encoder *drm_enc, struct msm_drm_private *priv; bool is_vid_mode = false; - if (!drm_enc || !drm_enc->dev || !drm_enc->crtc) { + if (!drm_enc || !drm_enc->drm || !drm_enc->crtc) { DPU_ERROR("invalid parameters\n"); return -EINVAL; } dpu_enc = to_dpu_encoder_virt(drm_enc); - priv = drm_enc->dev->dev_private; + priv = drm_enc->drm->dev_private; is_vid_mode = !dpu_enc->disp_info.is_cmd_mode; /* @@ -1045,7 +1045,7 @@ static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc, dpu_enc = to_dpu_encoder_virt(drm_enc); DPU_DEBUG_ENC(dpu_enc, "\n"); - priv = drm_enc->dev->dev_private; + priv = drm_enc->drm->dev_private; dpu_kms = to_dpu_kms(priv->kms); global_state = dpu_kms_get_existing_global_state(dpu_kms); @@ -1127,7 +1127,7 @@ static void _dpu_encoder_virt_enable_helper(struct drm_encoder *drm_enc) struct dpu_encoder_virt *dpu_enc = NULL; int i; - if (!drm_enc || !drm_enc->dev) { + if (!drm_enc || !drm_enc->drm) { DPU_ERROR("invalid parameters\n"); return; } @@ -1322,7 +1322,7 @@ void dpu_encoder_underrun_callback(struct drm_encoder *drm_enc, /* trigger dump only on the first underrun */ if (atomic_read(&phy_enc->underrun_cnt) == 1) - msm_disp_snapshot_state(drm_enc->dev); + msm_disp_snapshot_state(drm_enc->drm); trace_dpu_enc_underrun_cb(DRMID(drm_enc), atomic_read(&phy_enc->underrun_cnt)); @@ -1568,7 +1568,7 @@ static void dpu_encoder_helper_hw_reset(struct dpu_encoder_phys *phys_enc) rc = ctl->ops.reset(ctl); if (rc) { DPU_ERROR_ENC(dpu_enc, "ctl %d reset failure\n", ctl->idx); - msm_disp_snapshot_state(drm_enc->dev); + msm_disp_snapshot_state(drm_enc->drm); } phys_enc->enable_state = DPU_ENC_ENABLED; @@ -1762,12 +1762,12 @@ static void dpu_encoder_vsync_event_handler(struct timer_list *t) struct msm_drm_private *priv; struct msm_drm_thread *event_thread; - if (!drm_enc->dev || !drm_enc->crtc) { + if (!drm_enc->drm || !drm_enc->crtc) { DPU_ERROR("invalid parameters\n"); return; } - priv = drm_enc->dev->dev_private; + priv = drm_enc->drm->dev_private; if (drm_enc->crtc->index >= ARRAY_SIZE(priv->event_thread)) { DPU_ERROR("invalid crtc index\n"); @@ -2162,7 +2162,7 @@ static int _dpu_encoder_init_debugfs(struct drm_encoder *drm_enc) char name[12]; - if (!drm_enc->dev) { + if (!drm_enc->drm) { DPU_ERROR("invalid encoder or kms\n"); return -EINVAL; } @@ -2171,7 +2171,7 @@ static int _dpu_encoder_init_debugfs(struct drm_encoder *drm_enc) /* create overall sub-directory for the encoder */ dpu_enc->debugfs_root = debugfs_create_dir(name, - drm_enc->dev->primary->debugfs_root); + drm_enc->drm->primary->debugfs_root); /* don't error check these */ debugfs_create_file("status", 0600, @@ -2353,7 +2353,7 @@ static void dpu_encoder_frame_done_timeout(struct timer_list *t) struct drm_encoder *drm_enc = &dpu_enc->base; u32 event; - if (!drm_enc->dev) { + if (!drm_enc->drm) { DPU_ERROR("invalid parameters\n"); return; } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c index b856c6286c85..8b06543bc005 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c @@ -195,7 +195,7 @@ static int _dpu_encoder_phys_cmd_handle_ppdone_timeout( phys_enc->hw_ctl->idx - CTL_0, cmd_enc->pp_timeout_report_cnt, atomic_read(&phys_enc->pending_kickoff_cnt)); - msm_disp_snapshot_state(drm_enc->dev); + msm_disp_snapshot_state(drm_enc->drm); dpu_core_irq_unregister_callback(phys_enc->dpu_kms, phys_enc->irq[INTR_IDX_RDPTR]); } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c index 662d74ded1b9..c0f132772ee5 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c @@ -512,7 +512,7 @@ static void dpu_encoder_phys_vid_prepare_for_kickoff( if (rc) { DPU_ERROR_VIDENC(phys_enc, "ctl %d reset failure: %d\n", ctl->idx, rc); - msm_disp_snapshot_state(drm_enc->dev); + msm_disp_snapshot_state(drm_enc->drm); dpu_core_irq_unregister_callback(phys_enc->dpu_kms, phys_enc->irq[INTR_IDX_VSYNC]); } @@ -524,7 +524,7 @@ static void dpu_encoder_phys_vid_disable(struct dpu_encoder_phys *phys_enc) int ret; struct intf_status intf_status = {0}; - if (!phys_enc->parent || !phys_enc->parent->dev) { + if (!phys_enc->parent || !phys_enc->parent->drm) { DPU_ERROR("invalid encoder/device\n"); return; } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c index a466ff70a4d6..c663e9e56080 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c @@ -418,7 +418,7 @@ static void _dpu_encoder_phys_wb_handle_wbdone_timeout( wb_enc->wb_done_timeout_cnt++; if (wb_enc->wb_done_timeout_cnt == 1) - msm_disp_snapshot_state(phys_enc->parent->dev); + msm_disp_snapshot_state(phys_enc->parent->drm); atomic_add_unless(&phys_enc->pending_kickoff_cnt, -1, 0); diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_dsi_encoder.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_dsi_encoder.c index 39b8fe53c29d..bf2cb7491b9a 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_dsi_encoder.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_dsi_encoder.c @@ -22,7 +22,7 @@ struct mdp4_dsi_encoder { static struct mdp4_kms *get_kms(struct drm_encoder *encoder) { - struct msm_drm_private *priv = encoder->dev->dev_private; + struct msm_drm_private *priv = encoder->drm->dev_private; return to_mdp4_kms(to_mdp_kms(priv->kms)); } diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_dtv_encoder.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_dtv_encoder.c index 88645dbc3785..36dffbdd90ae 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_dtv_encoder.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_dtv_encoder.c @@ -21,7 +21,7 @@ struct mdp4_dtv_encoder { static struct mdp4_kms *get_kms(struct drm_encoder *encoder) { - struct msm_drm_private *priv = encoder->dev->dev_private; + struct msm_drm_private *priv = encoder->drm->dev_private; return to_mdp4_kms(to_mdp_kms(priv->kms)); } @@ -122,7 +122,7 @@ static void mdp4_dtv_encoder_disable(struct drm_encoder *encoder) static void mdp4_dtv_encoder_enable(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct mdp4_dtv_encoder *mdp4_dtv_encoder = to_mdp4_dtv_encoder(encoder); struct mdp4_kms *mdp4_kms = get_kms(encoder); unsigned long pc = mdp4_dtv_encoder->pixclock; diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c index 10eb3e5b218e..7383f9997a0f 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c @@ -26,7 +26,7 @@ struct mdp4_lcdc_encoder { static struct mdp4_kms *get_kms(struct drm_encoder *encoder) { - struct msm_drm_private *priv = encoder->dev->dev_private; + struct msm_drm_private *priv = encoder->drm->dev_private; return to_mdp4_kms(to_mdp_kms(priv->kms)); } @@ -45,7 +45,7 @@ static const struct drm_encoder_funcs mdp4_lcdc_encoder_funcs = { /* this should probably be a helper: */ static struct drm_connector *get_connector(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_connector *connector; list_for_each_entry(connector, &dev->mode_config.connector_list, head) @@ -57,7 +57,7 @@ static struct drm_connector *get_connector(struct drm_encoder *encoder) static void setup_phy(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_connector *connector = get_connector(encoder); struct mdp4_kms *mdp4_kms = get_kms(encoder); uint32_t lvds_intf = 0, lvds_phy_cfg0 = 0; @@ -271,7 +271,7 @@ static void mdp4_lcdc_encoder_mode_set(struct drm_encoder *encoder, static void mdp4_lcdc_encoder_disable(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct mdp4_lcdc_encoder *mdp4_lcdc_encoder = to_mdp4_lcdc_encoder(encoder); struct mdp4_kms *mdp4_kms = get_kms(encoder); @@ -312,7 +312,7 @@ static void mdp4_lcdc_encoder_disable(struct drm_encoder *encoder) static void mdp4_lcdc_encoder_enable(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct mdp4_lcdc_encoder *mdp4_lcdc_encoder = to_mdp4_lcdc_encoder(encoder); unsigned long pc = mdp4_lcdc_encoder->pixclock; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c index a640af22eafc..cdb3ea59a83d 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c @@ -12,7 +12,7 @@ static struct mdp5_kms *get_kms(struct drm_encoder *encoder) { - struct msm_drm_private *priv = encoder->dev->dev_private; + struct msm_drm_private *priv = encoder->drm->dev_private; return to_mdp5_kms(to_mdp_kms(priv->kms)); } @@ -21,7 +21,7 @@ static int pingpong_tearcheck_setup(struct drm_encoder *encoder, struct drm_display_mode *mode) { struct mdp5_kms *mdp5_kms = get_kms(encoder); - struct device *dev = encoder->dev->dev; + struct device *dev = encoder->drm->dev; u32 total_lines, vclks_line, cfg; long vsync_clk_speed; struct mdp5_hw_mixer *mixer = mdp5_crtc_get_mixer(encoder->crtc); @@ -84,14 +84,15 @@ static int pingpong_tearcheck_enable(struct drm_encoder *encoder) ret = clk_set_rate(mdp5_kms->vsync_clk, clk_round_rate(mdp5_kms->vsync_clk, VSYNC_CLK_RATE)); if (ret) { - DRM_DEV_ERROR(encoder->dev->dev, - "vsync_clk clk_set_rate failed, %d\n", ret); + DRM_DEV_ERROR(encoder->drm->dev, + "vsync_clk clk_set_rate failed, %d\n", ret); return ret; } ret = clk_prepare_enable(mdp5_kms->vsync_clk); if (ret) { - DRM_DEV_ERROR(encoder->dev->dev, - "vsync_clk clk_prepare_enable failed, %d\n", ret); + DRM_DEV_ERROR(encoder->drm->dev, + "vsync_clk clk_prepare_enable failed, %d\n", + ret); return ret; } diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_encoder.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_encoder.c index 79d67c495780..ede57f77d4bf 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_encoder.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_encoder.c @@ -12,7 +12,7 @@ static struct mdp5_kms *get_kms(struct drm_encoder *encoder) { - struct msm_drm_private *priv = encoder->dev->dev_private; + struct msm_drm_private *priv = encoder->drm->dev_private; return to_mdp5_kms(to_mdp_kms(priv->kms)); } @@ -33,7 +33,7 @@ static void mdp5_vid_encoder_mode_set(struct drm_encoder *encoder, { struct mdp5_encoder *mdp5_encoder = to_mdp5_encoder(encoder); struct mdp5_kms *mdp5_kms = get_kms(encoder); - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_connector *connector; int intf = mdp5_encoder->intf->num; uint32_t dtv_hsync_skew, vsync_period, vsync_len, ctrl_pol; diff --git a/drivers/gpu/drm/nouveau/dispnv04/dac.c b/drivers/gpu/drm/nouveau/dispnv04/dac.c index 417de5d0b540..fe8ff17f1720 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/dac.c +++ b/drivers/gpu/drm/nouveau/dispnv04/dac.c @@ -132,7 +132,7 @@ static int sample_load_twice(struct drm_device *dev, bool sense[2]) static enum drm_connector_status nv04_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nvif_object *device = &nouveau_drm(dev)->client.device.object; struct nouveau_drm *drm = nouveau_drm(dev); uint8_t saved_seq1, saved_pi, saved_rpc1, saved_cr_mode; @@ -234,7 +234,7 @@ static enum drm_connector_status nv04_dac_detect(struct drm_encoder *encoder, uint32_t nv17_dac_sample_load(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nvif_object *device = &nouveau_drm(dev)->client.device.object; struct nvkm_gpio *gpio = nvxx_gpio(&drm->client.device); @@ -335,7 +335,7 @@ uint32_t nv17_dac_sample_load(struct drm_encoder *encoder) static enum drm_connector_status nv17_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector) { - struct nouveau_drm *drm = nouveau_drm(encoder->dev); + struct nouveau_drm *drm = nouveau_drm(encoder->drm); struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; if (nv04_dac_in_use(encoder)) @@ -364,7 +364,7 @@ static bool nv04_dac_mode_fixup(struct drm_encoder *encoder, static void nv04_dac_prepare(struct drm_encoder *encoder) { const struct drm_encoder_helper_funcs *helper = encoder->helper_private; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; int head = nouveau_crtc(encoder->crtc)->index; helper->dpms(encoder, DRM_MODE_DPMS_OFF); @@ -376,7 +376,7 @@ static void nv04_dac_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nouveau_drm *drm = nouveau_drm(dev); int head = nouveau_crtc(encoder->crtc)->index; @@ -412,7 +412,7 @@ static void nv04_dac_mode_set(struct drm_encoder *encoder, static void nv04_dac_commit(struct drm_encoder *encoder) { struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); - struct nouveau_drm *drm = nouveau_drm(encoder->dev); + struct nouveau_drm *drm = nouveau_drm(encoder->drm); struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); const struct drm_encoder_helper_funcs *helper = encoder->helper_private; @@ -425,7 +425,7 @@ static void nv04_dac_commit(struct drm_encoder *encoder) void nv04_dac_update_dacclk(struct drm_encoder *encoder, bool enable) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; if (nv_gf4_disp_arch(dev)) { @@ -450,17 +450,17 @@ void nv04_dac_update_dacclk(struct drm_encoder *encoder, bool enable) * someone else. */ bool nv04_dac_in_use(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; - return nv_gf4_disp_arch(encoder->dev) && + return nv_gf4_disp_arch(encoder->drm) && (nv04_display(dev)->dac_users[ffs(dcb->or) - 1] & ~(1 << dcb->index)); } static void nv04_dac_dpms(struct drm_encoder *encoder, int mode) { struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); - struct nouveau_drm *drm = nouveau_drm(encoder->dev); + struct nouveau_drm *drm = nouveau_drm(encoder->drm); if (nv_encoder->last_dpms == mode) return; @@ -475,7 +475,7 @@ static void nv04_dac_dpms(struct drm_encoder *encoder, int mode) static void nv04_dac_save(struct drm_encoder *encoder) { struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; if (nv_gf4_disp_arch(dev)) nv_encoder->restore.output = NVReadRAMDAC(dev, 0, NV_PRAMDAC_DACCLK + @@ -485,7 +485,7 @@ static void nv04_dac_save(struct drm_encoder *encoder) static void nv04_dac_restore(struct drm_encoder *encoder) { struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; if (nv_gf4_disp_arch(dev)) NVWriteRAMDAC(dev, 0, NV_PRAMDAC_DACCLK + nv04_dac_output_offset(encoder), diff --git a/drivers/gpu/drm/nouveau/dispnv04/dfp.c b/drivers/gpu/drm/nouveau/dispnv04/dfp.c index 4469e00f43ad..f97a5f1c5c6e 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/dfp.c +++ b/drivers/gpu/drm/nouveau/dispnv04/dfp.c @@ -112,7 +112,7 @@ void nv04_dfp_disable(struct drm_device *dev, int head) void nv04_dfp_update_fp_control(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_crtc *crtc; struct nouveau_crtc *nv_crtc; uint32_t *fpc; @@ -151,7 +151,7 @@ void nv04_dfp_update_fp_control(struct drm_encoder *encoder, int mode) static struct drm_encoder *get_tmds_slave(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; struct drm_encoder *slave; @@ -246,7 +246,7 @@ static void nv04_dfp_prepare(struct drm_encoder *encoder) { struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); const struct drm_encoder_helper_funcs *helper = encoder->helper_private; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; int head = nouveau_crtc(encoder->crtc)->index; struct nv04_crtc_reg *crtcstate = nv04_display(dev)->mode_reg.crtc_reg; uint8_t *cr_lcd = &crtcstate[head].CRTC[NV_CIO_CRE_LCD__INDEX]; @@ -281,7 +281,7 @@ static void nv04_dfp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nvif_object *device = &nouveau_drm(dev)->client.device.object; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); @@ -445,7 +445,7 @@ static void nv04_dfp_mode_set(struct drm_encoder *encoder, static void nv04_dfp_commit(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nouveau_drm *drm = nouveau_drm(dev); const struct drm_encoder_helper_funcs *helper = encoder->helper_private; struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); @@ -486,7 +486,7 @@ static void nv04_dfp_commit(struct drm_encoder *encoder) static void nv04_dfp_update_backlight(struct drm_encoder *encoder, int mode) { #ifdef __powerpc__ - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nvif_object *device = &nouveau_drm(dev)->client.device.object; struct pci_dev *pdev = to_pci_dev(dev->dev); @@ -513,7 +513,7 @@ static inline bool is_powersaving_dpms(int mode) static void nv04_lvds_dpms(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_crtc *crtc = encoder->crtc; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); @@ -561,7 +561,7 @@ static void nv04_lvds_dpms(struct drm_encoder *encoder, int mode) static void nv04_tmds_dpms(struct drm_encoder *encoder, int mode) { - struct nouveau_drm *drm = nouveau_drm(encoder->dev); + struct nouveau_drm *drm = nouveau_drm(encoder->drm); struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); if (nv_encoder->last_dpms == mode) @@ -578,7 +578,7 @@ static void nv04_tmds_dpms(struct drm_encoder *encoder, int mode) static void nv04_dfp_save(struct drm_encoder *encoder) { struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; if (nv_two_heads(dev)) nv_encoder->restore.head = @@ -588,7 +588,7 @@ static void nv04_dfp_save(struct drm_encoder *encoder) static void nv04_dfp_restore(struct drm_encoder *encoder) { struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; int head = nv_encoder->restore.head; if (nv_encoder->dcb->type == DCB_OUTPUT_LVDS) { @@ -623,7 +623,7 @@ static void nv04_dfp_destroy(struct drm_encoder *encoder) static void nv04_tmds_slave_init(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; struct nouveau_drm *drm = nouveau_drm(dev); struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device); diff --git a/drivers/gpu/drm/nouveau/dispnv04/disp.c b/drivers/gpu/drm/nouveau/dispnv04/disp.c index e9ac3fb27ff7..d210e9d197f9 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv04/disp.c @@ -38,7 +38,7 @@ struct nouveau_connector * nv04_encoder_get_connector(struct nouveau_encoder *encoder) { - struct drm_device *dev = to_drm_encoder(encoder)->dev; + struct drm_device *dev = to_drm_encoder(encoder)->drm; struct drm_connector *connector; struct drm_connector_list_iter conn_iter; struct nouveau_connector *nv_connector = NULL; diff --git a/drivers/gpu/drm/nouveau/dispnv04/tvmodesnv17.c b/drivers/gpu/drm/nouveau/dispnv04/tvmodesnv17.c index a3fedd226854..2658034467e8 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/tvmodesnv17.c +++ b/drivers/gpu/drm/nouveau/dispnv04/tvmodesnv17.c @@ -469,7 +469,7 @@ const struct drm_display_mode nv17_tv_modes[] = { void nv17_tv_update_properties(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); struct nv17_tv_state *regs = &tv_enc->state; struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); @@ -524,7 +524,7 @@ void nv17_tv_update_properties(struct drm_encoder *encoder) void nv17_tv_update_rescaler(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); struct nv17_tv_state *regs = &tv_enc->state; @@ -540,7 +540,7 @@ void nv17_tv_update_rescaler(struct drm_encoder *encoder) void nv17_ctv_update_rescaler(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); int head = nouveau_crtc(encoder->crtc)->index; struct nv04_crtc_reg *regs = &nv04_display(dev)->mode_reg.crtc_reg[head]; diff --git a/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c index ed989f19aba6..d7af5aa1ee24 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c +++ b/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c @@ -73,7 +73,7 @@ int nv04_tv_identify(struct drm_device *dev, int i2c_index) static void nv04_tv_dpms(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); struct nv04_mode_state *state = &nv04_display(dev)->mode_reg; @@ -123,7 +123,7 @@ static void nv04_tv_bind(struct drm_device *dev, int head, bool bind) static void nv04_tv_prepare(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; int head = nouveau_crtc(encoder->crtc)->index; const struct drm_encoder_helper_funcs *helper = encoder->helper_private; @@ -141,7 +141,7 @@ static void nv04_tv_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); struct nv04_crtc_reg *regp = &nv04_display(dev)->mode_reg.crtc_reg[nv_crtc->index]; @@ -164,7 +164,7 @@ static void nv04_tv_mode_set(struct drm_encoder *encoder, static void nv04_tv_commit(struct drm_encoder *encoder) { struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); const struct drm_encoder_helper_funcs *helper = encoder->helper_private; diff --git a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c index 315b30a3befc..c4ca063c57e0 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c +++ b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c @@ -45,7 +45,7 @@ module_param_named(tv_norm, nouveau_tv_norm, charp, 0400); static uint32_t nv42_tv_sample_load(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nvkm_gpio *gpio = nvxx_gpio(&drm->client.device); uint32_t testval, regoffset = nv04_dac_output_offset(encoder); @@ -144,7 +144,7 @@ get_tv_detect_quirks(struct drm_device *dev, uint32_t *pin_mask) static enum drm_connector_status nv17_tv_detect(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct drm_mode_config *conf = &dev->mode_config; struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); @@ -208,7 +208,7 @@ static int nv17_tv_get_ld_modes(struct drm_encoder *encoder, for (tv_mode = nv17_tv_modes; tv_mode->hdisplay; tv_mode++) { struct drm_display_mode *mode; - mode = drm_mode_duplicate(encoder->dev, tv_mode); + mode = drm_mode_duplicate(encoder->drm, tv_mode); mode->clock = tv_norm->tv_enc_mode.vrefresh * mode->htotal / 1000 * @@ -257,11 +257,11 @@ static int nv17_tv_get_hd_modes(struct drm_encoder *encoder, if (modes[i].hdisplay == output_mode->hdisplay && modes[i].vdisplay == output_mode->vdisplay) { - mode = drm_mode_duplicate(encoder->dev, output_mode); + mode = drm_mode_duplicate(encoder->drm, output_mode); mode->type |= DRM_MODE_TYPE_PREFERRED; } else { - mode = drm_cvt_mode(encoder->dev, modes[i].hdisplay, + mode = drm_cvt_mode(encoder->drm, modes[i].hdisplay, modes[i].vdisplay, 60, false, (output_mode->flags & DRM_MODE_FLAG_INTERLACE), false); @@ -361,7 +361,7 @@ static bool nv17_tv_mode_fixup(struct drm_encoder *encoder, static void nv17_tv_dpms(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nvkm_gpio *gpio = nvxx_gpio(&drm->client.device); struct nv17_tv_state *regs = &to_tv_enc(encoder)->state; @@ -396,7 +396,7 @@ static void nv17_tv_dpms(struct drm_encoder *encoder, int mode) static void nv17_tv_prepare(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nouveau_drm *drm = nouveau_drm(dev); const struct drm_encoder_helper_funcs *helper = encoder->helper_private; struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); @@ -459,7 +459,7 @@ static void nv17_tv_mode_set(struct drm_encoder *encoder, struct drm_display_mode *drm_mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nouveau_drm *drm = nouveau_drm(dev); int head = nouveau_crtc(encoder->crtc)->index; struct nv04_crtc_reg *regs = &nv04_display(dev)->mode_reg.crtc_reg[head]; @@ -572,7 +572,7 @@ static void nv17_tv_mode_set(struct drm_encoder *encoder, static void nv17_tv_commit(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); @@ -606,7 +606,7 @@ static void nv17_tv_commit(struct drm_encoder *encoder) static void nv17_tv_save(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); nouveau_encoder(encoder)->restore.output = @@ -621,7 +621,7 @@ static void nv17_tv_save(struct drm_encoder *encoder) static void nv17_tv_restore(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; NVWriteRAMDAC(dev, 0, NV_PRAMDAC_DACCLK + nv04_dac_output_offset(encoder), @@ -635,7 +635,7 @@ static void nv17_tv_restore(struct drm_encoder *encoder) static int nv17_tv_create_resources(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct drm_mode_config *conf = &dev->mode_config; struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); @@ -686,7 +686,7 @@ static int nv17_tv_set_property(struct drm_encoder *encoder, struct drm_property *property, uint64_t val) { - struct drm_mode_config *conf = &encoder->dev->mode_config; + struct drm_mode_config *conf = &encoder->drm->mode_config; struct drm_crtc *crtc = encoder->crtc; struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index a6f6319c92b1..06a803f8c075 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -327,7 +327,7 @@ nv50_outp_atomic_check_view(struct drm_encoder *encoder, struct drm_display_mode *mode = &crtc_state->mode; struct drm_connector *connector = conn_state->connector; struct nouveau_conn_atom *asyc = nouveau_conn_atom(conn_state); - struct nouveau_drm *drm = nouveau_drm(encoder->dev); + struct nouveau_drm *drm = nouveau_drm(encoder->drm); NV_ATOMIC(drm, "%s atomic_check\n", encoder->name); asyc->scaler.full = false; @@ -472,7 +472,7 @@ static void nv50_dac_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_state *state) { struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); - struct nv50_core *core = nv50_disp(encoder->dev)->core; + struct nv50_core *core = nv50_disp(encoder->drm)->core; const u32 ctrl = NVDEF(NV507D, DAC_SET_CONTROL, OWNER, NONE); core->func->dac->ctrl(core, nv_encoder->outp.or.id, ctrl, NULL); @@ -487,7 +487,7 @@ nv50_dac_atomic_enable(struct drm_encoder *encoder, struct drm_atomic_state *sta struct nouveau_crtc *nv_crtc = nv50_outp_get_new_crtc(state, nv_encoder); struct nv50_head_atom *asyh = nv50_head_atom(drm_atomic_get_new_crtc_state(state, &nv_crtc->base)); - struct nv50_core *core = nv50_disp(encoder->dev)->core; + struct nv50_core *core = nv50_disp(encoder->drm)->core; u32 ctrl = 0; switch (nv_crtc->index) { @@ -517,7 +517,7 @@ nv50_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector) u32 loadval; int ret; - loadval = nouveau_drm(encoder->dev)->vbios.dactestval; + loadval = nouveau_drm(encoder->drm)->vbios.dactestval; if (loadval == 0) loadval = 340; @@ -707,7 +707,7 @@ nv50_audio_component_fini(struct nouveau_drm *drm) static bool nv50_audio_supported(struct drm_encoder *encoder) { - struct nv50_disp *disp = nv50_disp(encoder->dev); + struct nv50_disp *disp = nv50_disp(encoder->drm); if (disp->disp->object.oclass <= GT200_DISP || disp->disp->object.oclass == GT206_DISP) @@ -719,7 +719,7 @@ nv50_audio_supported(struct drm_encoder *encoder) static void nv50_audio_disable(struct drm_encoder *encoder, struct nouveau_crtc *nv_crtc) { - struct nouveau_drm *drm = nouveau_drm(encoder->dev); + struct nouveau_drm *drm = nouveau_drm(encoder->drm); struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); struct nvif_outp *outp = &nv_encoder->outp; @@ -742,7 +742,7 @@ nv50_audio_enable(struct drm_encoder *encoder, struct nouveau_crtc *nv_crtc, struct nouveau_connector *nv_connector, struct drm_atomic_state *state, struct drm_display_mode *mode) { - struct nouveau_drm *drm = nouveau_drm(encoder->dev); + struct nouveau_drm *drm = nouveau_drm(encoder->drm); struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); struct nvif_outp *outp = &nv_encoder->outp; @@ -769,7 +769,7 @@ nv50_hdmi_enable(struct drm_encoder *encoder, struct nouveau_crtc *nv_crtc, struct nouveau_connector *nv_connector, struct drm_atomic_state *state, struct drm_display_mode *mode, bool hda) { - struct nouveau_drm *drm = nouveau_drm(encoder->dev); + struct nouveau_drm *drm = nouveau_drm(encoder->drm); struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); struct drm_hdmi_info *hdmi = &nv_connector->base.display_info.hdmi; union hdmi_infoframe infoframe = { 0 }; @@ -886,7 +886,7 @@ nv50_msto_cleanup(struct drm_atomic_state *state, struct drm_dp_mst_topology_mgr *mgr, struct nv50_msto *msto) { - struct nouveau_drm *drm = nouveau_drm(msto->encoder.dev); + struct nouveau_drm *drm = nouveau_drm(msto->encoder.drm); struct drm_dp_mst_atomic_payload *payload = drm_atomic_get_mst_payload_state(mst_state, msto->mstc->port); @@ -907,7 +907,7 @@ nv50_msto_prepare(struct drm_atomic_state *state, struct drm_dp_mst_topology_mgr *mgr, struct nv50_msto *msto) { - struct nouveau_drm *drm = nouveau_drm(msto->encoder.dev); + struct nouveau_drm *drm = nouveau_drm(msto->encoder.drm); struct nv50_mstc *mstc = msto->mstc; struct nv50_mstm *mstm = mstc->mstm; struct drm_dp_mst_atomic_payload *payload; @@ -1010,7 +1010,7 @@ nv50_msto_atomic_enable(struct drm_encoder *encoder, struct drm_atomic_state *st struct drm_connector_list_iter conn_iter; u8 proto; - drm_connector_list_iter_begin(encoder->dev, &conn_iter); + drm_connector_list_iter_begin(encoder->drm, &conn_iter); drm_for_each_connector_iter(connector, &conn_iter) { if (connector->state->best_encoder == &msto->encoder) { mstc = nv50_mstc(connector); @@ -1228,7 +1228,7 @@ static int nv50_mstc_new(struct nv50_mstm *mstm, struct drm_dp_mst_port *port, const char *path, struct nv50_mstc **pmstc) { - struct drm_device *dev = mstm->outp->base.base.dev; + struct drm_device *dev = mstm->outp->base.base.drm; struct drm_crtc *crtc; struct nv50_mstc *mstc; int ret; @@ -1271,13 +1271,13 @@ nv50_mstm_cleanup(struct drm_atomic_state *state, struct drm_dp_mst_topology_state *mst_state, struct nv50_mstm *mstm) { - struct nouveau_drm *drm = nouveau_drm(mstm->outp->base.base.dev); + struct nouveau_drm *drm = nouveau_drm(mstm->outp->base.base.drm); struct drm_encoder *encoder; NV_ATOMIC(drm, "%s: mstm cleanup\n", mstm->outp->base.base.name); drm_dp_check_act_status(&mstm->mgr); - drm_for_each_encoder(encoder, mstm->outp->base.base.dev) { + drm_for_each_encoder(encoder, mstm->outp->base.base.drm) { if (encoder->encoder_type == DRM_MODE_ENCODER_DPMST) { struct nv50_msto *msto = nv50_msto(encoder); struct nv50_mstc *mstc = msto->mstc; @@ -1294,13 +1294,13 @@ nv50_mstm_prepare(struct drm_atomic_state *state, struct drm_dp_mst_topology_state *mst_state, struct nv50_mstm *mstm) { - struct nouveau_drm *drm = nouveau_drm(mstm->outp->base.base.dev); + struct nouveau_drm *drm = nouveau_drm(mstm->outp->base.base.drm); struct drm_encoder *encoder; NV_ATOMIC(drm, "%s: mstm prepare\n", mstm->outp->base.base.name); /* Disable payloads first */ - drm_for_each_encoder(encoder, mstm->outp->base.base.dev) { + drm_for_each_encoder(encoder, mstm->outp->base.base.drm) { if (encoder->encoder_type == DRM_MODE_ENCODER_DPMST) { struct nv50_msto *msto = nv50_msto(encoder); struct nv50_mstc *mstc = msto->mstc; @@ -1312,7 +1312,7 @@ nv50_mstm_prepare(struct drm_atomic_state *state, /* Add payloads for new heads, while also updating the start slots of any unmodified (but * active) heads that may have had their VC slots shifted left after the previous step */ - drm_for_each_encoder(encoder, mstm->outp->base.base.dev) { + drm_for_each_encoder(encoder, mstm->outp->base.base.drm) { if (encoder->encoder_type == DRM_MODE_ENCODER_DPMST) { struct nv50_msto *msto = nv50_msto(encoder); struct nv50_mstc *mstc = msto->mstc; @@ -1482,7 +1482,7 @@ nv50_mstm_new(struct nouveau_encoder *outp, struct drm_dp_aux *aux, int aux_max, int conn_base_id, struct nv50_mstm **pmstm) { const int max_payloads = hweight8(outp->dcb->heads); - struct drm_device *dev = outp->base.base.dev; + struct drm_device *dev = outp->base.base.drm; struct nv50_mstm *mstm; int ret; @@ -1506,7 +1506,7 @@ static void nv50_sor_update(struct nouveau_encoder *nv_encoder, u8 head, struct nv50_head_atom *asyh, u8 proto, u8 depth) { - struct nv50_disp *disp = nv50_disp(nv_encoder->base.base.dev); + struct nv50_disp *disp = nv50_disp(nv_encoder->base.base.drm); struct nv50_core *core = disp->core; if (!asyh) { @@ -1534,7 +1534,7 @@ nv50_sor_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_state *st struct nouveau_crtc *nv_crtc = nouveau_crtc(nv_encoder->crtc); struct nouveau_connector *nv_connector = nv50_outp_get_old_connector(state, nv_encoder); #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT - struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); + struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.drm); struct nouveau_backlight *backlight = nv_connector->backlight; #endif struct drm_dp_aux *aux = &nv_connector->aux; @@ -1574,9 +1574,9 @@ nv50_sor_atomic_enable(struct drm_encoder *encoder, struct drm_atomic_state *sta struct nv50_head_atom *asyh = nv50_head_atom(drm_atomic_get_new_crtc_state(state, &nv_crtc->base)); struct drm_display_mode *mode = &asyh->state.adjusted_mode; - struct nv50_disp *disp = nv50_disp(encoder->dev); + struct nv50_disp *disp = nv50_disp(encoder->drm); struct nvif_outp *outp = &nv_encoder->outp; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_connector *nv_connector; #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT @@ -1807,7 +1807,7 @@ static void nv50_pior_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_state *state) { struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); - struct nv50_core *core = nv50_disp(encoder->dev)->core; + struct nv50_core *core = nv50_disp(encoder->drm)->core; const u32 ctrl = NVDEF(NV507D, PIOR_SET_CONTROL, OWNER, NONE); core->func->pior->ctrl(core, nv_encoder->outp.or.id, ctrl, NULL); @@ -1822,7 +1822,7 @@ nv50_pior_atomic_enable(struct drm_encoder *encoder, struct drm_atomic_state *st struct nouveau_crtc *nv_crtc = nv50_outp_get_new_crtc(state, nv_encoder); struct nv50_head_atom *asyh = nv50_head_atom(drm_atomic_get_new_crtc_state(state, &nv_crtc->base)); - struct nv50_core *core = nv50_disp(encoder->dev)->core; + struct nv50_core *core = nv50_disp(encoder->drm)->core; u32 ctrl = 0; switch (nv_crtc->index) { diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c index 13b40f0383f0..71e013bbc55a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c @@ -64,7 +64,7 @@ static int nv40_get_intensity(struct backlight_device *bd) { struct nouveau_encoder *nv_encoder = bl_get_data(bd); - struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); + struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.drm); struct nvif_object *device = &drm->client.device.object; int val = (nvif_rd32(device, NV40_PMC_BACKLIGHT) & NV40_PMC_BACKLIGHT_MASK) >> 16; @@ -76,7 +76,7 @@ static int nv40_set_intensity(struct backlight_device *bd) { struct nouveau_encoder *nv_encoder = bl_get_data(bd); - struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); + struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.drm); struct nvif_object *device = &drm->client.device.object; int val = bd->props.brightness; int reg = nvif_rd32(device, NV40_PMC_BACKLIGHT); @@ -98,7 +98,7 @@ nv40_backlight_init(struct nouveau_encoder *encoder, struct backlight_properties *props, const struct backlight_ops **ops) { - struct nouveau_drm *drm = nouveau_drm(encoder->base.base.dev); + struct nouveau_drm *drm = nouveau_drm(encoder->base.base.drm); struct nvif_object *device = &drm->client.device.object; if (!(nvif_rd32(device, NV40_PMC_BACKLIGHT) & NV40_PMC_BACKLIGHT_MASK)) @@ -113,7 +113,7 @@ static int nv50_get_intensity(struct backlight_device *bd) { struct nouveau_encoder *nv_encoder = bl_get_data(bd); - struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); + struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.drm); struct nvif_object *device = &drm->client.device.object; int or = ffs(nv_encoder->dcb->or) - 1; u32 div = 1025; @@ -128,7 +128,7 @@ static int nv50_set_intensity(struct backlight_device *bd) { struct nouveau_encoder *nv_encoder = bl_get_data(bd); - struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); + struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.drm); struct nvif_object *device = &drm->client.device.object; int or = ffs(nv_encoder->dcb->or) - 1; u32 div = 1025; @@ -241,7 +241,7 @@ static int nva3_get_intensity(struct backlight_device *bd) { struct nouveau_encoder *nv_encoder = bl_get_data(bd); - struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); + struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.drm); struct nvif_object *device = &drm->client.device.object; int or = ffs(nv_encoder->dcb->or) - 1; u32 div, val; @@ -259,7 +259,7 @@ static int nva3_set_intensity(struct backlight_device *bd) { struct nouveau_encoder *nv_encoder = bl_get_data(bd); - struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); + struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.drm); struct nvif_object *device = &drm->client.device.object; int or = ffs(nv_encoder->dcb->or) - 1; u32 div, val; @@ -297,7 +297,7 @@ nv50_backlight_init(struct nouveau_backlight *bl, struct backlight_properties *props, const struct backlight_ops **ops) { - struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); + struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.drm); struct nvif_object *device = &drm->client.device.object; /* diff --git a/drivers/gpu/drm/nouveau/nouveau_dp.c b/drivers/gpu/drm/nouveau/nouveau_dp.c index 6a4980b2d4d4..0c41f21e822c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dp.c +++ b/drivers/gpu/drm/nouveau/nouveau_dp.c @@ -100,7 +100,7 @@ int nouveau_dp_detect(struct nouveau_connector *nv_connector, struct nouveau_encoder *nv_encoder) { - struct drm_device *dev = nv_encoder->base.base.dev; + struct drm_device *dev = nv_encoder->base.base.drm; struct nouveau_drm *drm = nouveau_drm(dev); struct drm_connector *connector = &nv_connector->base; struct nv50_mstm *mstm = nv_encoder->dp.mstm; @@ -229,7 +229,7 @@ nouveau_dp_irq(struct work_struct *work) container_of(work, typeof(*nv_connector), irq_work); struct drm_connector *connector = &nv_connector->base; struct nouveau_encoder *outp = find_encoder(connector, DCB_OUTPUT_DP); - struct nouveau_drm *drm = nouveau_drm(outp->base.base.dev); + struct nouveau_drm *drm = nouveau_drm(outp->base.base.drm); struct nv50_mstm *mstm; u64 hpd = 0; int ret; diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/omapdrm/omap_encoder.c index 4dd05bc732da..7c382f7dfe03 100644 --- a/drivers/gpu/drm/omapdrm/omap_encoder.c +++ b/drivers/gpu/drm/omapdrm/omap_encoder.c @@ -75,7 +75,7 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder, { struct omap_encoder *omap_encoder = to_omap_encoder(encoder); struct omap_dss_device *output = omap_encoder->output; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_connector *connector; struct drm_bridge *bridge; struct videomode vm = { 0 }; diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c index 3a3fc5eee5d9..9c0ef4ee9f87 100644 --- a/drivers/gpu/drm/radeon/atombios_dp.c +++ b/drivers/gpu/drm/radeon/atombios_dp.c @@ -410,7 +410,7 @@ bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector) int radeon_dp_get_panel_mode(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_connector *radeon_connector = to_radeon_connector(connector); int panel_mode = DP_PANEL_MODE_EXTERNAL_DP_MODE; @@ -784,7 +784,7 @@ static int radeon_dp_link_train_ce(struct radeon_dp_link_train_info *dp_info) void radeon_dp_link_train(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig; diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index 717cd6d71aff..31f20a457e9d 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c @@ -84,7 +84,7 @@ radeon_atom_set_backlight_level_to_reg(struct radeon_device *rdev, u8 atombios_get_backlight_level(struct radeon_encoder *radeon_encoder) { - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; if (!(rdev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU)) @@ -97,7 +97,7 @@ void atombios_set_backlight_level(struct radeon_encoder *radeon_encoder, u8 level) { struct drm_encoder *encoder = &radeon_encoder->base; - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder_atom_dig *dig; DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION args; @@ -173,7 +173,7 @@ static int radeon_atom_backlight_get_brightness(struct backlight_device *bd) { struct radeon_backlight_privdata *pdata = bl_get_data(bd); struct radeon_encoder *radeon_encoder = pdata->encoder; - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; return radeon_atom_get_backlight_level_from_reg(rdev); @@ -187,7 +187,7 @@ static const struct backlight_ops radeon_atom_backlight_ops = { void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder, struct drm_connector *drm_connector) { - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct backlight_device *bd; struct backlight_properties props; @@ -263,7 +263,7 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder, static void radeon_atom_backlight_exit(struct radeon_encoder *radeon_encoder) { - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct backlight_device *bd = NULL; struct radeon_encoder_atom_dig *dig; @@ -297,7 +297,7 @@ static bool radeon_atom_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *adjusted_mode) { struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; /* set the active encoder to connector routing */ @@ -343,7 +343,7 @@ static bool radeon_atom_mode_fixup(struct drm_encoder *encoder, static void atombios_dac_setup(struct drm_encoder *encoder, int action) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); DAC_ENCODER_CONTROL_PS_ALLOCATION args; @@ -395,7 +395,7 @@ atombios_dac_setup(struct drm_encoder *encoder, int action) static void atombios_tv_setup(struct drm_encoder *encoder, int action) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); TV_ENCODER_CONTROL_PS_ALLOCATION args; @@ -484,7 +484,7 @@ union dvo_encoder_control { void atombios_dvo_setup(struct drm_encoder *encoder, int action) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); union dvo_encoder_control args; @@ -556,7 +556,7 @@ union lvds_encoder_control { void atombios_digital_setup(struct drm_encoder *encoder, int action) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; @@ -669,7 +669,7 @@ atombios_digital_setup(struct drm_encoder *encoder, int action) int atombios_get_encoder_mode(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct drm_connector *connector; @@ -829,7 +829,7 @@ union dig_encoder_control { void atombios_dig_encoder_setup2(struct drm_encoder *encoder, int action, int panel_mode, int enc_override) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; @@ -999,7 +999,7 @@ union dig_transmitter_control { void atombios_dig_transmitter_setup2(struct drm_encoder *encoder, int action, uint8_t lane_num, uint8_t lane_set, int fe) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; @@ -1423,7 +1423,7 @@ atombios_external_encoder_setup(struct drm_encoder *encoder, struct drm_encoder *ext_encoder, int action) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder *ext_radeon_encoder = to_radeon_encoder(ext_encoder); @@ -1524,7 +1524,7 @@ atombios_external_encoder_setup(struct drm_encoder *encoder, static void atombios_yuv_setup(struct drm_encoder *encoder, bool enable) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc); @@ -1561,7 +1561,7 @@ atombios_yuv_setup(struct drm_encoder *encoder, bool enable) static void radeon_atom_encoder_dpms_avivo(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION args; @@ -1648,7 +1648,7 @@ radeon_atom_encoder_dpms_avivo(struct drm_encoder *encoder, int mode) static void radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct drm_encoder *ext_encoder = radeon_get_external_encoder(encoder); @@ -1762,7 +1762,7 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) static void radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); int encoder_mode = atombios_get_encoder_mode(encoder); @@ -1843,7 +1843,7 @@ union crtc_source_param { static void atombios_set_encoder_crtc_source(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc); @@ -1992,7 +1992,7 @@ static void atombios_apply_encoder_quirks(struct drm_encoder *encoder, struct drm_display_mode *mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc); @@ -2045,7 +2045,7 @@ void radeon_atom_release_dig_encoder(struct radeon_device *rdev, int enc_idx) int radeon_atom_pick_dig_encoder(struct drm_encoder *encoder, int fe_idx) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); @@ -2208,7 +2208,7 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); @@ -2271,7 +2271,7 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder, static bool atombios_dac_load_detect(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_connector *radeon_connector = to_radeon_connector(connector); @@ -2320,7 +2320,7 @@ atombios_dac_load_detect(struct drm_encoder *encoder, struct drm_connector *conn static enum drm_connector_status radeon_atom_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_connector *radeon_connector = to_radeon_connector(connector); @@ -2361,7 +2361,7 @@ radeon_atom_dac_detect(struct drm_encoder *encoder, struct drm_connector *connec static enum drm_connector_status radeon_atom_dig_detect(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_connector *radeon_connector = to_radeon_connector(connector); @@ -2419,7 +2419,7 @@ radeon_atom_ext_encoder_setup_ddc(struct drm_encoder *encoder) static void radeon_atom_encoder_prepare(struct drm_encoder *encoder) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); @@ -2479,7 +2479,7 @@ static void radeon_atom_encoder_commit(struct drm_encoder *encoder) static void radeon_atom_encoder_disable(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig; @@ -2622,7 +2622,7 @@ static const struct drm_encoder_funcs radeon_atom_enc_funcs = { static struct radeon_encoder_atom_dac * radeon_atombios_set_dac_info(struct radeon_encoder *radeon_encoder) { - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder_atom_dac *dac = kzalloc(sizeof(struct radeon_encoder_atom_dac), GFP_KERNEL); diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index 5819737c21c6..3b1025c18e2f 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c @@ -8722,7 +8722,7 @@ void cik_fini(struct radeon_device *rdev) void dce8_program_fmt(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc); diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c b/drivers/gpu/drm/radeon/dce3_1_afmt.c index e8fe239b9d79..1531c6d9bb5f 100644 --- a/drivers/gpu/drm/radeon/dce3_1_afmt.c +++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c @@ -30,7 +30,7 @@ void dce3_2_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder, u8 *sadb, int sad_count) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; u32 tmp; /* program the speaker allocation */ @@ -48,7 +48,7 @@ void dce3_2_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder, void dce3_2_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder, u8 *sadb, int sad_count) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; u32 tmp; /* program the speaker allocation */ @@ -67,7 +67,7 @@ void dce3_2_afmt_write_sad_regs(struct drm_encoder *encoder, struct cea_sad *sads, int sad_count) { int i; - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; static const u16 eld_reg_to_type[][2] = { { AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR0, HDMI_AUDIO_CODING_TYPE_PCM }, { AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR1, HDMI_AUDIO_CODING_TYPE_AC3 }, @@ -170,7 +170,7 @@ void dce3_2_audio_set_dto(struct radeon_device *rdev, void dce3_2_hdmi_update_acr(struct drm_encoder *encoder, long offset, const struct radeon_hdmi_acr *acr) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; WREG32(DCE3_HDMI0_ACR_PACKET_CONTROL + offset, @@ -201,7 +201,7 @@ void dce3_2_hdmi_update_acr(struct drm_encoder *encoder, long offset, void dce3_2_set_audio_packet(struct drm_encoder *encoder, u32 offset) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; WREG32(HDMI0_AUDIO_PACKET_CONTROL + offset, @@ -222,7 +222,7 @@ void dce3_2_set_audio_packet(struct drm_encoder *encoder, u32 offset) void dce3_2_set_mute(struct drm_encoder *encoder, u32 offset, bool mute) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; if (mute) diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c b/drivers/gpu/drm/radeon/dce6_afmt.c index 4a1d5447eac1..2955df1ca124 100644 --- a/drivers/gpu/drm/radeon/dce6_afmt.c +++ b/drivers/gpu/drm/radeon/dce6_afmt.c @@ -110,7 +110,7 @@ struct r600_audio_pin *dce6_audio_get_pin(struct radeon_device *rdev) void dce6_afmt_select_pin(struct drm_encoder *encoder) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; @@ -125,7 +125,7 @@ void dce6_afmt_write_latency_fields(struct drm_encoder *encoder, struct drm_connector *connector, struct drm_display_mode *mode) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; u32 tmp = 0; @@ -153,7 +153,7 @@ void dce6_afmt_write_latency_fields(struct drm_encoder *encoder, void dce6_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder, u8 *sadb, int sad_count) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; u32 tmp; @@ -178,7 +178,7 @@ void dce6_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder, void dce6_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder, u8 *sadb, int sad_count) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; u32 tmp; @@ -206,7 +206,7 @@ void dce6_afmt_write_sad_regs(struct drm_encoder *encoder, int i; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; static const u16 eld_reg_to_type[][2] = { { AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR0, HDMI_AUDIO_CODING_TYPE_PCM }, { AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR1, HDMI_AUDIO_CODING_TYPE_AC3 }, diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 4f06356d9ce2..0892206e2849 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c @@ -1290,7 +1290,7 @@ void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev) void dce4_program_fmt(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc); diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c b/drivers/gpu/drm/radeon/evergreen_hdmi.c index 5f3078f8ab95..b2f60315ff59 100644 --- a/drivers/gpu/drm/radeon/evergreen_hdmi.c +++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c @@ -68,7 +68,7 @@ void dce4_audio_enable(struct radeon_device *rdev, void evergreen_hdmi_update_acr(struct drm_encoder *encoder, long offset, const struct radeon_hdmi_acr *acr) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; int bpc = 8; @@ -98,7 +98,7 @@ void evergreen_hdmi_update_acr(struct drm_encoder *encoder, long offset, void dce4_afmt_write_latency_fields(struct drm_encoder *encoder, struct drm_connector *connector, struct drm_display_mode *mode) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; u32 tmp = 0; if (mode->flags & DRM_MODE_FLAG_INTERLACE) { @@ -120,7 +120,7 @@ void dce4_afmt_write_latency_fields(struct drm_encoder *encoder, void dce4_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder, u8 *sadb, int sad_count) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; u32 tmp; /* program the speaker allocation */ @@ -138,7 +138,7 @@ void dce4_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder, void dce4_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder, u8 *sadb, int sad_count) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; u32 tmp; /* program the speaker allocation */ @@ -157,7 +157,7 @@ void evergreen_hdmi_write_sad_regs(struct drm_encoder *encoder, struct cea_sad *sads, int sad_count) { int i; - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; static const u16 eld_reg_to_type[][2] = { { AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR0, HDMI_AUDIO_CODING_TYPE_PCM }, { AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR1, HDMI_AUDIO_CODING_TYPE_AC3 }, @@ -306,7 +306,7 @@ void dce4_dp_audio_set_dto(struct radeon_device *rdev, void dce4_set_vbi_packet(struct drm_encoder *encoder, u32 offset) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; WREG32(HDMI_VBI_PACKET_CONTROL + offset, @@ -317,7 +317,7 @@ void dce4_set_vbi_packet(struct drm_encoder *encoder, u32 offset) void dce4_hdmi_set_color_depth(struct drm_encoder *encoder, u32 offset, int bpc) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); uint32_t val; @@ -354,7 +354,7 @@ void dce4_hdmi_set_color_depth(struct drm_encoder *encoder, u32 offset, int bpc) void dce4_set_audio_packet(struct drm_encoder *encoder, u32 offset) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; WREG32(AFMT_INFOFRAME_CONTROL0 + offset, @@ -389,7 +389,7 @@ void dce4_set_audio_packet(struct drm_encoder *encoder, u32 offset) void dce4_set_mute(struct drm_encoder *encoder, u32 offset, bool mute) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; if (mute) @@ -400,7 +400,7 @@ void dce4_set_mute(struct drm_encoder *encoder, u32 offset, bool mute) void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; @@ -440,7 +440,7 @@ void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable) void evergreen_dp_enable(struct drm_encoder *encoder, bool enable) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 382795a8b3c0..1aa341b22124 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c @@ -295,7 +295,7 @@ int r600_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk) void dce3_program_fmt(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc); diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c index f3551ebaa2f0..b4d0a1af9a03 100644 --- a/drivers/gpu/drm/radeon/r600_hdmi.c +++ b/drivers/gpu/drm/radeon/r600_hdmi.c @@ -178,7 +178,7 @@ struct r600_audio_pin *r600_audio_get_pin(struct radeon_device *rdev) void r600_hdmi_update_acr(struct drm_encoder *encoder, long offset, const struct radeon_hdmi_acr *acr) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; /* DCE 3.0 uses register that's normally for CRC_CONTROL */ @@ -244,7 +244,7 @@ void r600_set_avi_packet(struct radeon_device *rdev, u32 offset, static void r600_hdmi_update_audio_infoframe(struct drm_encoder *encoder, const void *buffer, size_t size) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; @@ -262,7 +262,7 @@ static void r600_hdmi_update_audio_infoframe(struct drm_encoder *encoder, */ static bool r600_hdmi_is_audio_buffer_filled(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; @@ -295,7 +295,7 @@ int r600_hdmi_buffer_status_changed(struct drm_encoder *encoder) */ void r600_hdmi_audio_workaround(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; @@ -340,7 +340,7 @@ void r600_hdmi_audio_set_dto(struct radeon_device *rdev, void r600_set_vbi_packet(struct drm_encoder *encoder, u32 offset) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; WREG32_OR(HDMI0_VBI_PACKET_CONTROL + offset, @@ -351,7 +351,7 @@ void r600_set_vbi_packet(struct drm_encoder *encoder, u32 offset) void r600_set_audio_packet(struct drm_encoder *encoder, u32 offset) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; WREG32_P(HDMI0_AUDIO_PACKET_CONTROL + offset, @@ -393,7 +393,7 @@ void r600_set_audio_packet(struct drm_encoder *encoder, u32 offset) void r600_set_mute(struct drm_encoder *encoder, u32 offset, bool mute) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; if (mute) @@ -411,7 +411,7 @@ void r600_set_mute(struct drm_encoder *encoder, u32 offset, bool mute) */ void r600_hdmi_update_audio_settings(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; @@ -469,7 +469,7 @@ void r600_hdmi_update_audio_settings(struct drm_encoder *encoder) */ void r600_hdmi_enable(struct drm_encoder *encoder, bool enable) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 96b5f55c908f..b588acdf445c 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c @@ -1323,7 +1323,7 @@ bool radeon_atombios_sideport_present(struct radeon_device *rdev) bool radeon_atombios_get_tmds_info(struct radeon_encoder *encoder, struct radeon_encoder_int_tmds *tmds) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct radeon_mode_info *mode_info = &rdev->mode_info; int index = GetIndexIntoMasterTable(DATA, TMDS_Info); @@ -1612,7 +1612,7 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct radeon_encoder *encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct radeon_mode_info *mode_info = &rdev->mode_info; int index = GetIndexIntoMasterTable(DATA, LVDS_Info); @@ -1755,7 +1755,7 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct struct radeon_encoder_primary_dac * radeon_atombios_get_primary_dac_info(struct radeon_encoder *encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct radeon_mode_info *mode_info = &rdev->mode_info; int index = GetIndexIntoMasterTable(DATA, CompassionateData); @@ -1941,7 +1941,7 @@ radeon_atombios_get_tv_info(struct radeon_device *rdev) struct radeon_encoder_tv_dac * radeon_atombios_get_tv_dac_info(struct radeon_encoder *encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct radeon_mode_info *mode_info = &rdev->mode_info; int index = GetIndexIntoMasterTable(DATA, CompassionateData); @@ -4131,7 +4131,7 @@ void radeon_restore_bios_scratch_regs(struct radeon_device *rdev) void radeon_atom_output_lock(struct drm_encoder *encoder, bool lock) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; uint32_t bios_6_scratch; @@ -4344,7 +4344,7 @@ radeon_atombios_connected_scratch_regs(struct drm_connector *connector, void radeon_atombios_encoder_crtc_scratch_regs(struct drm_encoder *encoder, int crtc) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); uint32_t bios_3_scratch; @@ -4399,7 +4399,7 @@ radeon_atombios_encoder_crtc_scratch_regs(struct drm_encoder *encoder, int crtc) void radeon_atombios_encoder_dpms_scratch_regs(struct drm_encoder *encoder, bool on) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); uint32_t bios_2_scratch; diff --git a/drivers/gpu/drm/radeon/radeon_audio.c b/drivers/gpu/drm/radeon/radeon_audio.c index fbc2ea8bcae8..b1d76942adcb 100644 --- a/drivers/gpu/drm/radeon/radeon_audio.c +++ b/drivers/gpu/drm/radeon/radeon_audio.c @@ -361,7 +361,7 @@ static void radeon_audio_write_latency_fields(struct drm_encoder *encoder, struct r600_audio_pin* radeon_audio_get_pin(struct drm_encoder *encoder) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); if (radeon_encoder->audio && radeon_encoder->audio->get_pin) @@ -437,7 +437,7 @@ void radeon_audio_fini(struct radeon_device *rdev) static void radeon_audio_set_dto(struct drm_encoder *encoder, unsigned int clock) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_crtc *crtc = to_radeon_crtc(encoder->crtc); @@ -448,7 +448,7 @@ static void radeon_audio_set_dto(struct drm_encoder *encoder, unsigned int clock static int radeon_audio_set_avi_packet(struct drm_encoder *encoder, struct drm_display_mode *mode) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); @@ -673,7 +673,7 @@ static void radeon_audio_hdmi_mode_set(struct drm_encoder *encoder, static void radeon_audio_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 9a0eb4130c3b..7beaa0f64b93 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c @@ -859,7 +859,7 @@ struct radeon_encoder_primary_dac *radeon_combios_get_primary_dac_info(struct radeon_encoder *encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct radeon_device *rdev = dev->dev_private; uint16_t dac_info; uint8_t rev, bg, dac; @@ -1010,7 +1010,7 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct radeon_encoder *encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct radeon_device *rdev = dev->dev_private; uint16_t dac_info; uint8_t rev, bg, dac; @@ -1169,7 +1169,7 @@ static struct radeon_encoder_lvds *radeon_legacy_get_lvds_info_from_regs(struct struct radeon_encoder_lvds *radeon_combios_get_lvds_info(struct radeon_encoder *encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct radeon_device *rdev = dev->dev_private; uint16_t lcd_info; uint32_t panel_setup; @@ -1314,7 +1314,7 @@ static const struct radeon_tmds_pll default_tmds_pll[CHIP_LAST][4] = { bool radeon_legacy_get_tmds_info_from_table(struct radeon_encoder *encoder, struct radeon_encoder_int_tmds *tmds) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct radeon_device *rdev = dev->dev_private; int i; @@ -1330,7 +1330,7 @@ bool radeon_legacy_get_tmds_info_from_table(struct radeon_encoder *encoder, bool radeon_legacy_get_tmds_info_from_combios(struct radeon_encoder *encoder, struct radeon_encoder_int_tmds *tmds) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct radeon_device *rdev = dev->dev_private; uint16_t tmds_info; int i, n; @@ -1383,7 +1383,7 @@ bool radeon_legacy_get_tmds_info_from_combios(struct radeon_encoder *encoder, bool radeon_legacy_get_ext_tmds_info_from_table(struct radeon_encoder *encoder, struct radeon_encoder_ext_tmds *tmds) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct radeon_i2c_bus_rec i2c_bus; @@ -1407,7 +1407,7 @@ bool radeon_legacy_get_ext_tmds_info_from_table(struct radeon_encoder *encoder, bool radeon_legacy_get_ext_tmds_info_from_combios(struct radeon_encoder *encoder, struct radeon_encoder_ext_tmds *tmds) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct radeon_device *rdev = dev->dev_private; uint16_t offset; uint8_t ver; @@ -2882,7 +2882,7 @@ void radeon_external_tmds_setup(struct drm_encoder *encoder) bool radeon_combios_external_tmds_setup(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); uint16_t offset; @@ -3439,7 +3439,7 @@ void radeon_combios_initialize_bios_scratch_regs(struct drm_device *dev) void radeon_combios_output_lock(struct drm_encoder *encoder, bool lock) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; uint32_t bios_6_scratch; @@ -3559,7 +3559,7 @@ radeon_combios_connected_scratch_regs(struct drm_connector *connector, void radeon_combios_encoder_crtc_scratch_regs(struct drm_encoder *encoder, int crtc) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); uint32_t bios_5_scratch = RREG32(RADEON_BIOS_5_SCRATCH); @@ -3594,7 +3594,7 @@ radeon_combios_encoder_crtc_scratch_regs(struct drm_encoder *encoder, int crtc) void radeon_combios_encoder_dpms_scratch_regs(struct drm_encoder *encoder, bool on) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); uint32_t bios_6_scratch = RREG32(RADEON_BIOS_6_SCRATCH); diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 0215f88b3b70..d107954785c4 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -443,7 +443,7 @@ radeon_connector_analog_encoder_conflict_solve(struct drm_connector *connector, static struct drm_display_mode *radeon_fp_native_mode(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct drm_display_mode *mode = NULL; struct drm_display_mode *native_mode = &radeon_encoder->native_mode; @@ -478,7 +478,7 @@ static struct drm_display_mode *radeon_fp_native_mode(struct drm_encoder *encode static void radeon_add_common_modes(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct drm_display_mode *mode = NULL; struct drm_display_mode *native_mode = &radeon_encoder->native_mode; diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index b3518a8f95a0..9b5ded0d04cd 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -38,7 +38,7 @@ static uint32_t radeon_encoder_clones(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct drm_encoder *clone_encoder; @@ -160,7 +160,7 @@ radeon_get_encoder_enum(struct drm_device *dev, uint32_t supported_device, uint8 static void radeon_encoder_add_backlight(struct radeon_encoder *radeon_encoder, struct drm_connector *connector) { - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; bool use_bl = false; @@ -227,7 +227,7 @@ radeon_link_encoder_connector(struct drm_device *dev) void radeon_encoder_set_active_device(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct drm_connector *connector; @@ -245,7 +245,7 @@ void radeon_encoder_set_active_device(struct drm_encoder *encoder) struct drm_connector * radeon_get_connector_for_encoder(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct drm_connector *connector; struct radeon_connector *radeon_connector; @@ -261,7 +261,7 @@ radeon_get_connector_for_encoder(struct drm_encoder *encoder) struct drm_connector * radeon_get_connector_for_encoder_init(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct drm_connector *connector; struct radeon_connector *radeon_connector; @@ -276,7 +276,7 @@ radeon_get_connector_for_encoder_init(struct drm_encoder *encoder) struct drm_encoder *radeon_get_external_encoder(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct drm_encoder *other_encoder; struct radeon_encoder *other_radeon_encoder; @@ -317,7 +317,7 @@ void radeon_panel_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *adjusted_mode) { struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct drm_display_mode *native_mode = &radeon_encoder->native_mode; unsigned hblank = native_mode->htotal - native_mode->hdisplay; @@ -363,7 +363,7 @@ void radeon_panel_mode_fixup(struct drm_encoder *encoder, bool radeon_dig_monitor_is_duallink(struct drm_encoder *encoder, u32 pixel_clock) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct drm_connector *connector; struct radeon_connector *radeon_connector; diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c index 601d35d34eab..f9cd456164a3 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c @@ -55,7 +55,7 @@ static void radeon_legacy_encoder_disable(struct drm_encoder *encoder) static void radeon_legacy_lvds_update(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); uint32_t lvds_gen_cntl, lvds_pll_cntl, pixclks_cntl, disp_pwr_man; @@ -144,7 +144,7 @@ static void radeon_legacy_lvds_update(struct drm_encoder *encoder, int mode) static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); DRM_DEBUG("\n"); @@ -163,7 +163,7 @@ static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode) static void radeon_legacy_lvds_prepare(struct drm_encoder *encoder) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; if (rdev->is_atom_bios) radeon_atom_output_lock(encoder, true); @@ -174,7 +174,7 @@ static void radeon_legacy_lvds_prepare(struct drm_encoder *encoder) static void radeon_legacy_lvds_commit(struct drm_encoder *encoder) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; radeon_legacy_lvds_dpms(encoder, DRM_MODE_DPMS_ON); if (rdev->is_atom_bios) @@ -187,7 +187,7 @@ static void radeon_legacy_lvds_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); @@ -282,7 +282,7 @@ static const struct drm_encoder_helper_funcs radeon_legacy_lvds_helper_funcs = { u8 radeon_legacy_get_backlight_level(struct radeon_encoder *radeon_encoder) { - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; u8 backlight_level; @@ -295,7 +295,7 @@ radeon_legacy_get_backlight_level(struct radeon_encoder *radeon_encoder) void radeon_legacy_set_backlight_level(struct radeon_encoder *radeon_encoder, u8 level) { - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; int dpms_mode = DRM_MODE_DPMS_ON; @@ -354,7 +354,7 @@ static int radeon_legacy_backlight_get_brightness(struct backlight_device *bd) { struct radeon_backlight_privdata *pdata = bl_get_data(bd); struct radeon_encoder *radeon_encoder = pdata->encoder; - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; uint8_t backlight_level; @@ -372,7 +372,7 @@ static const struct backlight_ops radeon_backlight_ops = { void radeon_legacy_backlight_init(struct radeon_encoder *radeon_encoder, struct drm_connector *drm_connector) { - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct backlight_device *bd; struct backlight_properties props; @@ -465,7 +465,7 @@ void radeon_legacy_backlight_init(struct radeon_encoder *radeon_encoder, static void radeon_legacy_backlight_exit(struct radeon_encoder *radeon_encoder) { - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct backlight_device *bd = NULL; @@ -511,7 +511,7 @@ static const struct drm_encoder_funcs radeon_legacy_lvds_enc_funcs = { static void radeon_legacy_primary_dac_dpms(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; uint32_t crtc_ext_cntl = RREG32(RADEON_CRTC_EXT_CNTL); uint32_t dac_cntl = RREG32(RADEON_DAC_CNTL); @@ -553,7 +553,7 @@ static void radeon_legacy_primary_dac_dpms(struct drm_encoder *encoder, int mode static void radeon_legacy_primary_dac_prepare(struct drm_encoder *encoder) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; if (rdev->is_atom_bios) radeon_atom_output_lock(encoder, true); @@ -564,7 +564,7 @@ static void radeon_legacy_primary_dac_prepare(struct drm_encoder *encoder) static void radeon_legacy_primary_dac_commit(struct drm_encoder *encoder) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; radeon_legacy_primary_dac_dpms(encoder, DRM_MODE_DPMS_ON); @@ -578,7 +578,7 @@ static void radeon_legacy_primary_dac_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); @@ -634,7 +634,7 @@ static void radeon_legacy_primary_dac_mode_set(struct drm_encoder *encoder, static enum drm_connector_status radeon_legacy_primary_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; uint32_t vclk_ecp_cntl, crtc_ext_cntl; uint32_t dac_ext_cntl, dac_cntl, dac_macro_cntl, tmp; @@ -723,7 +723,7 @@ static const struct drm_encoder_funcs radeon_legacy_primary_dac_enc_funcs = { static void radeon_legacy_tmds_int_dpms(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; uint32_t fp_gen_cntl = RREG32(RADEON_FP_GEN_CNTL); DRM_DEBUG_KMS("\n"); @@ -750,7 +750,7 @@ static void radeon_legacy_tmds_int_dpms(struct drm_encoder *encoder, int mode) static void radeon_legacy_tmds_int_prepare(struct drm_encoder *encoder) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; if (rdev->is_atom_bios) radeon_atom_output_lock(encoder, true); @@ -761,7 +761,7 @@ static void radeon_legacy_tmds_int_prepare(struct drm_encoder *encoder) static void radeon_legacy_tmds_int_commit(struct drm_encoder *encoder) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; radeon_legacy_tmds_int_dpms(encoder, DRM_MODE_DPMS_ON); @@ -775,7 +775,7 @@ static void radeon_legacy_tmds_int_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); @@ -887,7 +887,7 @@ static const struct drm_encoder_funcs radeon_legacy_tmds_int_enc_funcs = { static void radeon_legacy_tmds_ext_dpms(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; uint32_t fp2_gen_cntl = RREG32(RADEON_FP2_GEN_CNTL); DRM_DEBUG_KMS("\n"); @@ -916,7 +916,7 @@ static void radeon_legacy_tmds_ext_dpms(struct drm_encoder *encoder, int mode) static void radeon_legacy_tmds_ext_prepare(struct drm_encoder *encoder) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; if (rdev->is_atom_bios) radeon_atom_output_lock(encoder, true); @@ -927,7 +927,7 @@ static void radeon_legacy_tmds_ext_prepare(struct drm_encoder *encoder) static void radeon_legacy_tmds_ext_commit(struct drm_encoder *encoder) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; radeon_legacy_tmds_ext_dpms(encoder, DRM_MODE_DPMS_ON); if (rdev->is_atom_bios) @@ -940,7 +940,7 @@ static void radeon_legacy_tmds_ext_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); @@ -1030,7 +1030,7 @@ static const struct drm_encoder_funcs radeon_legacy_tmds_ext_enc_funcs = { static void radeon_legacy_tv_dac_dpms(struct drm_encoder *encoder, int mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); uint32_t fp2_gen_cntl = 0, crtc2_gen_cntl = 0, tv_dac_cntl = 0; @@ -1121,7 +1121,7 @@ static void radeon_legacy_tv_dac_dpms(struct drm_encoder *encoder, int mode) static void radeon_legacy_tv_dac_prepare(struct drm_encoder *encoder) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; if (rdev->is_atom_bios) radeon_atom_output_lock(encoder, true); @@ -1132,7 +1132,7 @@ static void radeon_legacy_tv_dac_prepare(struct drm_encoder *encoder) static void radeon_legacy_tv_dac_commit(struct drm_encoder *encoder) { - struct radeon_device *rdev = encoder->dev->dev_private; + struct radeon_device *rdev = encoder->drm->dev_private; radeon_legacy_tv_dac_dpms(encoder, DRM_MODE_DPMS_ON); @@ -1146,7 +1146,7 @@ static void radeon_legacy_tv_dac_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); @@ -1299,7 +1299,7 @@ static void radeon_legacy_tv_dac_mode_set(struct drm_encoder *encoder, static bool r300_legacy_tv_detect(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; uint32_t crtc2_gen_cntl, tv_dac_cntl, dac_cntl2, dac_ext_cntl; uint32_t disp_output_cntl, gpiopad_a, tmp; @@ -1370,7 +1370,7 @@ static bool r300_legacy_tv_detect(struct drm_encoder *encoder, static bool radeon_legacy_tv_detect(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; uint32_t tv_dac_cntl, dac_cntl2; uint32_t config_cntl, tv_pre_dac_mux_cntl, tv_master_cntl, tmp; @@ -1434,7 +1434,7 @@ static bool radeon_legacy_tv_detect(struct drm_encoder *encoder, static bool radeon_legacy_ext_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; uint32_t gpio_monid, fp2_gen_cntl, disp_output_cntl, crtc2_gen_cntl; uint32_t disp_lin_trans_grph_a, disp_lin_trans_grph_b, disp_lin_trans_grph_c; @@ -1524,7 +1524,7 @@ static bool radeon_legacy_ext_dac_detect(struct drm_encoder *encoder, static enum drm_connector_status radeon_legacy_tv_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; uint32_t crtc2_gen_cntl = 0, tv_dac_cntl, dac_cntl2, dac_ext_cntl; uint32_t gpiopad_a = 0, pixclks_cntl, tmp; @@ -1690,7 +1690,7 @@ static const struct drm_encoder_funcs radeon_legacy_tv_dac_enc_funcs = { static struct radeon_encoder_int_tmds *radeon_legacy_get_tmds_info(struct radeon_encoder *encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder_int_tmds *tmds = NULL; bool ret; @@ -1713,7 +1713,7 @@ static struct radeon_encoder_int_tmds *radeon_legacy_get_tmds_info(struct radeon static struct radeon_encoder_ext_tmds *radeon_legacy_get_ext_tmds_info(struct radeon_encoder *encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_device *dev = encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder_ext_tmds *tmds = NULL; bool ret; diff --git a/drivers/gpu/drm/radeon/radeon_legacy_tv.c b/drivers/gpu/drm/radeon/radeon_legacy_tv.c index 12e180b119ac..df910657cfbe 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_tv.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_tv.c @@ -236,7 +236,7 @@ static const struct radeon_tv_mode_constants available_tv_modes[] = { static const struct radeon_tv_mode_constants *radeon_legacy_tv_get_std_mode(struct radeon_encoder *radeon_encoder, uint16_t *pll_ref_freq) { - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct radeon_crtc *radeon_crtc; struct radeon_encoder_tv_dac *tv_dac = radeon_encoder->enc_priv; @@ -276,7 +276,7 @@ static long SLOPE_limit[5] = { 6, 5, 4, 3, 2 }; static void radeon_wait_pll_lock(struct drm_encoder *encoder, unsigned n_tests, unsigned n_wait_loops, unsigned cnt_threshold) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; uint32_t save_pll_test; unsigned int i, j; @@ -300,7 +300,7 @@ static void radeon_wait_pll_lock(struct drm_encoder *encoder, unsigned n_tests, static void radeon_legacy_tv_write_fifo(struct radeon_encoder *radeon_encoder, uint16_t addr, uint32_t value) { - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; uint32_t tmp; int i = 0; @@ -385,7 +385,7 @@ static uint16_t radeon_get_vtiming_tables_addr(uint32_t tv_uv_adr) static void radeon_restore_tv_timing_tables(struct radeon_encoder *radeon_encoder) { - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder_tv_dac *tv_dac = radeon_encoder->enc_priv; uint16_t h_table, v_table; @@ -412,7 +412,7 @@ static void radeon_restore_tv_timing_tables(struct radeon_encoder *radeon_encode static void radeon_legacy_write_tv_restarts(struct radeon_encoder *radeon_encoder) { - struct drm_device *dev = radeon_encoder->base.dev; + struct drm_device *dev = radeon_encoder->base.drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder_tv_dac *tv_dac = radeon_encoder->enc_priv; WREG32(RADEON_TV_FRESTART, tv_dac->tv.frestart); @@ -524,7 +524,7 @@ void radeon_legacy_tv_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_tv_dac *tv_dac = radeon_encoder->enc_priv; diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index 8cf87a0a2b2a..6a400bf7a300 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c @@ -164,7 +164,7 @@ bool rs600_page_flip_pending(struct radeon_device *rdev, int crtc_id) void avivo_program_fmt(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c index 3ce190c67055..356d8019e941 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c @@ -146,7 +146,7 @@ static int rcar_du_wb_enc_atomic_check(struct drm_encoder *encoder, struct rcar_du_wb_conn_state *wb_state = to_rcar_wb_conn_state(conn_state); const struct drm_display_mode *mode = &crtc_state->mode; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_framebuffer *fb; if (!conn_state->writeback_job) diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c index c8d8f86cd67c..80f3973e40ff 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c @@ -530,7 +530,7 @@ int shmob_drm_crtc_create(struct shmob_drm_device *sdev) static void shmob_drm_encoder_dpms(struct drm_encoder *encoder, int mode) { struct shmob_drm_encoder *senc = to_shmob_encoder(encoder); - struct shmob_drm_device *sdev = encoder->dev->dev_private; + struct shmob_drm_device *sdev = encoder->drm->dev_private; struct shmob_drm_connector *scon = &sdev->connector; if (senc->dpms == mode) @@ -545,7 +545,7 @@ static bool shmob_drm_encoder_mode_fixup(struct drm_encoder *encoder, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct shmob_drm_device *sdev = dev->dev_private; struct drm_connector *connector = &sdev->connector.connector; const struct drm_display_mode *panel_mode; diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c index e435d5ef5736..251d0a11ed86 100644 --- a/drivers/gpu/drm/solomon/ssd130x.c +++ b/drivers/gpu/drm/solomon/ssd130x.c @@ -707,7 +707,7 @@ static const struct drm_crtc_funcs ssd130x_crtc_funcs = { static void ssd130x_encoder_helper_atomic_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { - struct drm_device *drm = encoder->dev; + struct drm_device *drm = encoder->drm; struct ssd130x_device *ssd130x = drm_to_ssd130x(drm); int ret; @@ -737,7 +737,7 @@ static void ssd130x_encoder_helper_atomic_enable(struct drm_encoder *encoder, static void ssd130x_encoder_helper_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_state *state) { - struct drm_device *drm = encoder->dev; + struct drm_device *drm = encoder->drm; struct ssd130x_device *ssd130x = drm_to_ssd130x(drm); backlight_disable(ssd130x->bl_dev); diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c index 64615638b79a..929d497855e5 100644 --- a/drivers/gpu/drm/sti/sti_tvout.c +++ b/drivers/gpu/drm/sti/sti_tvout.c @@ -607,7 +607,7 @@ static int sti_tvout_late_register(struct drm_encoder *encoder) if (tvout->debugfs_registered) return 0; - tvout_debugfs_init(tvout, encoder->dev->primary); + tvout_debugfs_init(tvout, encoder->drm->primary); tvout->debugfs_registered = true; return 0; diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index b27b73975bc1..7296cdebd712 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -494,7 +494,7 @@ static inline struct ltdc_device *plane_to_ltdc(struct drm_plane *plane) static inline struct ltdc_device *encoder_to_ltdc(struct drm_encoder *enc) { - return (struct ltdc_device *)enc->dev->dev_private; + return (struct ltdc_device *) enc->drm->dev_private; } static inline enum ltdc_pix_fmt to_ltdc_pixelformat(u32 drm_fmt) @@ -1722,7 +1722,7 @@ static int ltdc_crtc_init(struct drm_device *ddev, struct drm_crtc *crtc) static void ltdc_encoder_disable(struct drm_encoder *encoder) { - struct drm_device *ddev = encoder->dev; + struct drm_device *ddev = encoder->drm; struct ltdc_device *ldev = ddev->dev_private; DRM_DEBUG_DRIVER("\n"); @@ -1736,7 +1736,7 @@ static void ltdc_encoder_disable(struct drm_encoder *encoder) static void ltdc_encoder_enable(struct drm_encoder *encoder) { - struct drm_device *ddev = encoder->dev; + struct drm_device *ddev = encoder->drm; struct ltdc_device *ldev = ddev->dev_private; DRM_DEBUG_DRIVER("\n"); @@ -1753,7 +1753,7 @@ static void ltdc_encoder_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_device *ddev = encoder->dev; + struct drm_device *ddev = encoder->drm; DRM_DEBUG_DRIVER("\n"); diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index b07ccee78cc1..b644a389f124 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -45,7 +45,7 @@ static struct drm_connector *sun4i_tcon_get_connector(const struct drm_encoder * struct drm_connector *connector; struct drm_connector_list_iter iter; - drm_connector_list_iter_begin(encoder->dev, &iter); + drm_connector_list_iter_begin(encoder->drm, &iter); drm_for_each_connector_iter(connector, &iter) if (connector->encoder == encoder) { drm_connector_list_iter_end(&iter); @@ -1340,7 +1340,7 @@ static void sun4i_tcon_remove(struct platform_device *pdev) static int sun4i_a10_tcon_set_mux(struct sun4i_tcon *tcon, const struct drm_encoder *encoder) { - struct sun4i_tcon *tcon0 = sun4i_get_tcon0(encoder->dev); + struct sun4i_tcon *tcon0 = sun4i_get_tcon0(encoder->drm); u32 shift; if (!tcon0) @@ -1380,7 +1380,7 @@ static int sun5i_a13_tcon_set_mux(struct sun4i_tcon *tcon, static int sun6i_tcon_set_mux(struct sun4i_tcon *tcon, const struct drm_encoder *encoder) { - struct sun4i_tcon *tcon0 = sun4i_get_tcon0(encoder->dev); + struct sun4i_tcon *tcon0 = sun4i_get_tcon0(encoder->drm); u32 shift; if (!tcon0) diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c index 366c28ae2396..ffdb2269d28c 100644 --- a/drivers/gpu/drm/vc4/vc4_dpi.c +++ b/drivers/gpu/drm/vc4/vc4_dpi.c @@ -119,7 +119,7 @@ static const struct debugfs_reg32 dpi_regs[] = { static void vc4_dpi_encoder_disable(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct vc4_dpi *dpi = to_vc4_dpi(encoder); int idx; @@ -133,7 +133,7 @@ static void vc4_dpi_encoder_disable(struct drm_encoder *encoder) static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->drm; struct drm_display_mode *mode = &encoder->crtc->mode; struct vc4_dpi *dpi = to_vc4_dpi(encoder); struct drm_connector_list_iter conn_iter; @@ -262,7 +262,7 @@ static const struct drm_encoder_helper_funcs vc4_dpi_encoder_helper_funcs = { static int vc4_dpi_late_register(struct drm_encoder *encoder) { - struct drm_device *drm = encoder->dev; + struct drm_device *drm = encoder->drm; struct vc4_dpi *dpi = to_vc4_dpi(encoder); vc4_debugfs_add_regset32(drm, "dpi_regs", &dpi->regset); @@ -284,7 +284,7 @@ static const struct of_device_id vc4_dpi_dt_match[] = { */ static int vc4_dpi_init_bridge(struct vc4_dpi *dpi) { - struct drm_device *drm = dpi->encoder.base.dev; + struct drm_device *drm = dpi->encoder.base.drm; struct device *dev = &dpi->pdev->dev; struct drm_bridge *bridge; diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c index 5011fe0fef87..58ff88e8e73d 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/gpu/drm/vc4/vc4_dsi.c @@ -1419,7 +1419,7 @@ static const struct drm_bridge_funcs vc4_dsi_bridge_funcs = { static int vc4_dsi_late_register(struct drm_encoder *encoder) { - struct drm_device *drm = encoder->dev; + struct drm_device *drm = encoder->drm; struct vc4_dsi *dsi = to_vc4_dsi(encoder); vc4_debugfs_add_regset32(drm, dsi->variant->debugfs_name, &dsi->regset); diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 58388eb9237f..1539a671ef98 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2233,7 +2233,7 @@ static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = { static int vc4_hdmi_late_register(struct drm_encoder *encoder) { - struct drm_device *drm = encoder->dev; + struct drm_device *drm = encoder->drm; struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); const struct vc4_hdmi_variant *variant = vc4_hdmi->variant; diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c index ec46ea639dd2..8bffa84bb86b 100644 --- a/drivers/gpu/drm/vc4/vc4_txp.c +++ b/drivers/gpu/drm/vc4/vc4_txp.c @@ -361,7 +361,7 @@ static const struct drm_connector_funcs vc4_txp_connector_funcs = { static void vc4_txp_encoder_disable(struct drm_encoder *encoder) { - struct drm_device *drm = encoder->dev; + struct drm_device *drm = encoder->drm; struct vc4_txp *txp = encoder_to_vc4_txp(encoder); int idx; diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c index 725531d030a1..ec22ecc11a1d 100644 --- a/drivers/gpu/drm/vc4/vc4_vec.c +++ b/drivers/gpu/drm/vc4/vc4_vec.c @@ -511,7 +511,7 @@ static int vc4_vec_connector_init(struct drm_device *dev, struct vc4_vec *vec) static void vc4_vec_encoder_disable(struct drm_encoder *encoder, struct drm_atomic_state *state) { - struct drm_device *drm = encoder->dev; + struct drm_device *drm = encoder->drm; struct vc4_vec *vec = encoder_to_vc4_vec(encoder); int idx, ret; @@ -543,7 +543,7 @@ static void vc4_vec_encoder_disable(struct drm_encoder *encoder, static void vc4_vec_encoder_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { - struct drm_device *drm = encoder->dev; + struct drm_device *drm = encoder->drm; struct vc4_vec *vec = encoder_to_vc4_vec(encoder); struct drm_connector *connector = &vec->connector; struct drm_connector_state *conn_state = @@ -710,7 +710,7 @@ static const struct drm_encoder_helper_funcs vc4_vec_encoder_helper_funcs = { static int vc4_vec_late_register(struct drm_encoder *encoder) { - struct drm_device *drm = encoder->dev; + struct drm_device *drm = encoder->drm; struct vc4_vec *vec = encoder_to_vc4_vec(encoder); vc4_debugfs_add_regset32(drm, "vec_regs", &vec->regset); diff --git a/include/drm/drm_encoder.h b/include/drm/drm_encoder.h index 3a09682af685..f1f76a767432 100644 --- a/include/drm/drm_encoder.h +++ b/include/drm/drm_encoder.h @@ -85,7 +85,7 @@ struct drm_encoder_funcs { /** * struct drm_encoder - central DRM encoder structure - * @dev: parent DRM device + * @drm: parent DRM device * @head: list management * @base: base KMS object * @name: human readable name, can be overwritten by the driver @@ -96,7 +96,7 @@ struct drm_encoder_funcs { * appropriate for a given connector or set of connectors. */ struct drm_encoder { - struct drm_device *dev; + struct drm_device *drm; struct list_head head; struct drm_mode_object base; From patchwork Thu Jul 13 08:24:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311545 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 34464C001DC for ; Thu, 13 Jul 2023 08:25:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 00AA810E191; Thu, 13 Jul 2023 08:25:33 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id B279510E627 for ; Thu, 13 Jul 2023 08:25:13 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrcf-0005tH-0u; Thu, 13 Jul 2023 10:24:25 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrce-00E4jg-6F; Thu, 13 Jul 2023 10:24:24 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrcd-004VhH-J9; Thu, 13 Jul 2023 10:24:23 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 09/17] drm/fb_helper: Rename struct drm_fb_helper::dev to drm Date: Thu, 13 Jul 2023 10:24:00 +0200 Message-Id: <20230713082408.2266984-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=23631; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=xSJu93MIjI+hWgjzviz4RYJps8GL31qyS6/8poE4srI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7STMYljckdZaJtlrW2i6XHvv9221mJNEWUMW Zthnc3pIs6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0kwAKCRCPgPtYfRL+ ToIXB/92GI9vleZJDV83IJmuIZWg3DLFArCA6PiIksLimJGQyALTP1zv5SUZ6THmONgurp/2Xni J1lBZVDYd+AXaeuQymu6hcjZKpd+2Chj2pKxJv9D/szVg9mTf5qQQjMsjChLibtbSxG8xEwiKrN UZ3UtuiiBTpBa3Awoo7dt8SNXieOlyk3bhS7dWRXrLJvLa63XfE52p/lNJrcXlCe2sxhnEs4cPS 7UAU35nfMGpjbcQbgJhebJIxcKbtkXloX+E/82wHyGyhXYfJAyUw+9tcfP0hSsPiB/13ie06vcV OEXSlokfEdKtfhsF+hVlnrfaGngxSlTy6Bd6OPmCIau0ZD/Q X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/armada/armada_fbdev.c | 2 +- drivers/gpu/drm/drm_fb_helper.c | 56 +++++++++++----------- drivers/gpu/drm/drm_fbdev_dma.c | 8 ++-- drivers/gpu/drm/drm_fbdev_generic.c | 10 ++-- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 4 +- drivers/gpu/drm/gma500/fbdev.c | 2 +- drivers/gpu/drm/i915/display/intel_fbdev.c | 6 +-- drivers/gpu/drm/msm/msm_fbdev.c | 4 +- drivers/gpu/drm/omapdrm/omap_fbdev.c | 4 +- drivers/gpu/drm/radeon/radeon_fbdev.c | 10 ++-- drivers/gpu/drm/tegra/fbdev.c | 4 +- include/drm/drm_fb_helper.h | 10 ++-- 12 files changed, 60 insertions(+), 60 deletions(-) diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c index 241983120299..c820eb16945b 100644 --- a/drivers/gpu/drm/armada/armada_fbdev.c +++ b/drivers/gpu/drm/armada/armada_fbdev.c @@ -42,7 +42,7 @@ static const struct fb_ops armada_fb_ops = { static int armada_fbdev_create(struct drm_fb_helper *fbh, struct drm_fb_helper_surface_size *sizes) { - struct drm_device *dev = fbh->dev; + struct drm_device *dev = fbh->drm; struct drm_mode_fb_cmd2 mode; struct armada_framebuffer *dfb; struct armada_gem_object *obj; diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index a8a307c1f40d..9defdfae8495 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -190,7 +190,7 @@ int drm_fb_helper_debug_leave(struct fb_info *info) { struct drm_fb_helper *helper = info->par; struct drm_client_dev *client = &helper->client; - struct drm_device *dev = helper->dev; + struct drm_device *dev = helper->drm; struct drm_crtc *crtc; const struct drm_crtc_helper_funcs *funcs; struct drm_mode_set *mode_set; @@ -287,7 +287,7 @@ static void drm_fb_helper_restore_work_fn(struct work_struct *ignored) mutex_lock(&kernel_fb_helper_lock); list_for_each_entry(helper, &kernel_fb_helper_list, kernel_fb_list) { - struct drm_device *dev = helper->dev; + struct drm_device *dev = helper->drm; if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) continue; @@ -372,7 +372,7 @@ static void drm_fb_helper_resume_worker(struct work_struct *work) static void drm_fb_helper_fb_dirty(struct drm_fb_helper *helper) { - struct drm_device *dev = helper->dev; + struct drm_device *dev = helper->drm; struct drm_clip_rect *clip = &helper->damage_clip; struct drm_clip_rect clip_copy; unsigned long flags; @@ -448,7 +448,7 @@ void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper, helper->damage_clip.x1 = helper->damage_clip.y1 = ~0; mutex_init(&helper->lock); helper->funcs = funcs; - helper->dev = dev; + helper->drm = dev; helper->preferred_bpp = preferred_bpp; } EXPORT_SYMBOL(drm_fb_helper_prepare); @@ -516,7 +516,7 @@ EXPORT_SYMBOL(drm_fb_helper_init); */ struct fb_info *drm_fb_helper_alloc_info(struct drm_fb_helper *fb_helper) { - struct device *dev = fb_helper->dev->dev; + struct device *dev = fb_helper->drm->dev; struct fb_info *info; int ret; @@ -588,7 +588,7 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper) if (!fb_helper) return; - fb_helper->dev->fb_helper = NULL; + fb_helper->drm->fb_helper = NULL; if (!drm_fbdev_emulation) return; @@ -838,7 +838,7 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info) u16 *r, *g, *b; int ret = 0; - drm_modeset_lock_all(fb_helper->dev); + drm_modeset_lock_all(fb_helper->drm); drm_client_for_each_modeset(modeset, &fb_helper->client) { crtc = modeset->crtc; if (!crtc->funcs->gamma_set || !crtc->gamma_size) { @@ -865,7 +865,7 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info) goto out; } out: - drm_modeset_unlock_all(fb_helper->dev); + drm_modeset_unlock_all(fb_helper->drm); return ret; } @@ -916,7 +916,7 @@ static struct drm_property_blob *setcmap_new_gamma_lut(struct drm_crtc *crtc, static int setcmap_atomic(struct fb_cmap *cmap, struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; - struct drm_device *dev = fb_helper->dev; + struct drm_device *dev = fb_helper->drm; struct drm_property_blob *gamma_lut = NULL; struct drm_modeset_acquire_ctx ctx; struct drm_crtc_state *crtc_state; @@ -1009,7 +1009,7 @@ static int setcmap_atomic(struct fb_cmap *cmap, struct fb_info *info) int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; - struct drm_device *dev = fb_helper->dev; + struct drm_device *dev = fb_helper->drm; int ret; if (oops_in_progress) @@ -1025,7 +1025,7 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) mutex_lock(&fb_helper->client.modeset_mutex); if (info->fix.visual == FB_VISUAL_TRUECOLOR) ret = setcmap_pseudo_palette(cmap, info); - else if (drm_drv_uses_atomic_modeset(fb_helper->dev)) + else if (drm_drv_uses_atomic_modeset(fb_helper->drm)) ret = setcmap_atomic(cmap, info); else ret = setcmap_legacy(cmap, info); @@ -1052,7 +1052,7 @@ int drm_fb_helper_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) { struct drm_fb_helper *fb_helper = info->par; - struct drm_device *dev = fb_helper->dev; + struct drm_device *dev = fb_helper->drm; struct drm_crtc *crtc; int ret = 0; @@ -1221,7 +1221,7 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var, struct drm_fb_helper *fb_helper = info->par; struct drm_framebuffer *fb = fb_helper->fb; const struct drm_format_info *format = fb->format; - struct drm_device *dev = fb_helper->dev; + struct drm_device *dev = fb_helper->drm; unsigned int bpp; if (in_dbg_master()) @@ -1386,7 +1386,7 @@ static int pan_display_legacy(struct fb_var_screeninfo *var, int ret = 0; mutex_lock(&client->modeset_mutex); - drm_modeset_lock_all(fb_helper->dev); + drm_modeset_lock_all(fb_helper->drm); drm_client_for_each_modeset(modeset, client) { modeset->x = var->xoffset; modeset->y = var->yoffset; @@ -1399,7 +1399,7 @@ static int pan_display_legacy(struct fb_var_screeninfo *var, } } } - drm_modeset_unlock_all(fb_helper->dev); + drm_modeset_unlock_all(fb_helper->drm); mutex_unlock(&client->modeset_mutex); return ret; @@ -1414,7 +1414,7 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; - struct drm_device *dev = fb_helper->dev; + struct drm_device *dev = fb_helper->drm; int ret; if (oops_in_progress) @@ -1442,7 +1442,7 @@ EXPORT_SYMBOL(drm_fb_helper_pan_display); static uint32_t drm_fb_helper_find_format(struct drm_fb_helper *fb_helper, const uint32_t *formats, size_t format_count, uint32_t bpp, uint32_t depth) { - struct drm_device *dev = fb_helper->dev; + struct drm_device *dev = fb_helper->drm; uint32_t format; size_t i; @@ -1473,7 +1473,7 @@ static uint32_t drm_fb_helper_find_color_mode_format(struct drm_fb_helper *fb_he const uint32_t *formats, size_t format_count, unsigned int color_mode) { - struct drm_device *dev = fb_helper->dev; + struct drm_device *dev = fb_helper->drm; uint32_t bpp, depth; switch (color_mode) { @@ -1505,7 +1505,7 @@ static int __drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper, struct drm_fb_helper_surface_size *sizes) { struct drm_client_dev *client = &fb_helper->client; - struct drm_device *dev = fb_helper->dev; + struct drm_device *dev = fb_helper->drm; int crtc_count = 0; struct drm_connector_list_iter conn_iter; struct drm_connector *connector; @@ -1523,7 +1523,7 @@ static int __drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper, drm_dbg_kms(dev, "test CRTC %u primary plane\n", drm_crtc_index(crtc)); - drm_connector_list_iter_begin(fb_helper->dev, &conn_iter); + drm_connector_list_iter_begin(fb_helper->drm, &conn_iter); drm_client_for_each_connector_iter(connector, &conn_iter) { struct drm_cmdline_mode *cmdline_mode = &connector->cmdline_mode; @@ -1622,7 +1622,7 @@ static int drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper, struct drm_fb_helper_surface_size *sizes) { struct drm_client_dev *client = &fb_helper->client; - struct drm_device *dev = fb_helper->dev; + struct drm_device *dev = fb_helper->drm; struct drm_mode_config *config = &dev->mode_config; int ret; @@ -1652,7 +1652,7 @@ static int drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper, static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper) { struct drm_client_dev *client = &fb_helper->client; - struct drm_device *dev = fb_helper->dev; + struct drm_device *dev = fb_helper->drm; struct drm_fb_helper_surface_size sizes; int ret; @@ -1759,7 +1759,7 @@ void drm_fb_helper_fill_info(struct fb_info *info, * be changed due user-space tools (e.g: pm-utils) matching against it. */ snprintf(info->fix.id, sizeof(info->fix.id), "%sdrmfb", - fb_helper->dev->driver->name); + fb_helper->drm->driver->name); } EXPORT_SYMBOL(drm_fb_helper_fill_info); @@ -1795,7 +1795,7 @@ static void drm_setup_crtcs_fb(struct drm_fb_helper *fb_helper) } mutex_unlock(&client->modeset_mutex); - drm_connector_list_iter_begin(fb_helper->dev, &conn_iter); + drm_connector_list_iter_begin(fb_helper->drm, &conn_iter); drm_client_for_each_connector_iter(connector, &conn_iter) { /* use first connected connector for the physical dimensions */ @@ -1834,7 +1834,7 @@ static void drm_setup_crtcs_fb(struct drm_fb_helper *fb_helper) static int __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper) { - struct drm_device *dev = fb_helper->dev; + struct drm_device *dev = fb_helper->drm; struct fb_info *info; unsigned int width, height; int ret; @@ -1973,15 +1973,15 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) return err; } - if (!fb_helper->fb || !drm_master_internal_acquire(fb_helper->dev)) { + if (!fb_helper->fb || !drm_master_internal_acquire(fb_helper->drm)) { fb_helper->delayed_hotplug = true; mutex_unlock(&fb_helper->lock); return err; } - drm_master_internal_release(fb_helper->dev); + drm_master_internal_release(fb_helper->drm); - drm_dbg_kms(fb_helper->dev, "\n"); + drm_dbg_kms(fb_helper->drm, "\n"); drm_client_modeset_probe(&fb_helper->client, fb_helper->fb->width, fb_helper->fb->height); drm_setup_crtcs_fb(fb_helper); diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c index e4a37e6fce75..9a338a4fc5e1 100644 --- a/drivers/gpu/drm/drm_fbdev_dma.c +++ b/drivers/gpu/drm/drm_fbdev_dma.c @@ -19,7 +19,7 @@ static int drm_fbdev_dma_fb_open(struct fb_info *info, int user) struct drm_fb_helper *fb_helper = info->par; /* No need to take a ref for fbcon because it unbinds on unregister */ - if (user && !try_module_get(fb_helper->dev->driver->fops->owner)) + if (user && !try_module_get(fb_helper->drm->driver->fops->owner)) return -ENODEV; return 0; @@ -30,7 +30,7 @@ static int drm_fbdev_dma_fb_release(struct fb_info *info, int user) struct drm_fb_helper *fb_helper = info->par; if (user) - module_put(fb_helper->dev->driver->fops->owner); + module_put(fb_helper->drm->driver->fops->owner); return 0; } @@ -39,7 +39,7 @@ static void drm_fbdev_dma_fb_destroy(struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; - if (!fb_helper->dev) + if (!fb_helper->drm) return; drm_fb_helper_fini(fb_helper); @@ -77,7 +77,7 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper, struct drm_fb_helper_surface_size *sizes) { struct drm_client_dev *client = &fb_helper->client; - struct drm_device *dev = fb_helper->dev; + struct drm_device *dev = fb_helper->drm; struct drm_client_buffer *buffer; struct drm_gem_dma_object *dma_obj; struct drm_framebuffer *fb; diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index c5d9aab52064..c8714729a673 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -18,7 +18,7 @@ static int drm_fbdev_generic_fb_open(struct fb_info *info, int user) struct drm_fb_helper *fb_helper = info->par; /* No need to take a ref for fbcon because it unbinds on unregister */ - if (user && !try_module_get(fb_helper->dev->driver->fops->owner)) + if (user && !try_module_get(fb_helper->drm->driver->fops->owner)) return -ENODEV; return 0; @@ -29,7 +29,7 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user) struct drm_fb_helper *fb_helper = info->par; if (user) - module_put(fb_helper->dev->driver->fops->owner); + module_put(fb_helper->drm->driver->fops->owner); return 0; } @@ -43,7 +43,7 @@ static void drm_fbdev_generic_fb_destroy(struct fb_info *info) struct drm_fb_helper *fb_helper = info->par; void *shadow = info->screen_buffer; - if (!fb_helper->dev) + if (!fb_helper->drm) return; fb_deferred_io_cleanup(info); @@ -72,7 +72,7 @@ static int drm_fbdev_generic_helper_fb_probe(struct drm_fb_helper *fb_helper, struct drm_fb_helper_surface_size *sizes) { struct drm_client_dev *client = &fb_helper->client; - struct drm_device *dev = fb_helper->dev; + struct drm_device *dev = fb_helper->drm; struct drm_client_buffer *buffer; struct fb_info *info; size_t screen_size; @@ -216,7 +216,7 @@ static int drm_fbdev_generic_damage_blit(struct drm_fb_helper *fb_helper, static int drm_fbdev_generic_helper_fb_dirty(struct drm_fb_helper *helper, struct drm_clip_rect *clip) { - struct drm_device *dev = helper->dev; + struct drm_device *dev = helper->drm; int ret; /* Call damage handlers only if necessary */ diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index e7b9a13bd706..c2974a6425d5 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -67,7 +67,7 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper, fbi = drm_fb_helper_alloc_info(helper); if (IS_ERR(fbi)) { - DRM_DEV_ERROR(to_dma_dev(helper->dev), + DRM_DEV_ERROR(to_dma_dev(helper->drm), "failed to allocate fb info.\n"); return PTR_ERR(fbi); } @@ -90,7 +90,7 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) { struct exynos_drm_gem *exynos_gem; - struct drm_device *dev = helper->dev; + struct drm_device *dev = helper->drm; struct drm_mode_fb_cmd2 mode_cmd = { 0 }; unsigned long size; int ret; diff --git a/drivers/gpu/drm/gma500/fbdev.c b/drivers/gpu/drm/gma500/fbdev.c index cd5ca18750b4..dc8eb8ae7ab1 100644 --- a/drivers/gpu/drm/gma500/fbdev.c +++ b/drivers/gpu/drm/gma500/fbdev.c @@ -150,7 +150,7 @@ static const struct fb_ops psb_fbdev_fb_ops = { static int psb_fbdev_fb_probe(struct drm_fb_helper *fb_helper, struct drm_fb_helper_surface_size *sizes) { - struct drm_device *dev = fb_helper->dev; + struct drm_device *dev = fb_helper->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct pci_dev *pdev = to_pci_dev(dev->dev); struct fb_info *info; diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c index 1cc0ddc6a310..6091b47e93bb 100644 --- a/drivers/gpu/drm/i915/display/intel_fbdev.c +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c @@ -156,7 +156,7 @@ static int intelfb_alloc(struct drm_fb_helper *helper, { struct intel_fbdev *ifbdev = to_intel_fbdev(helper); struct drm_framebuffer *fb; - struct drm_device *dev = helper->dev; + struct drm_device *dev = helper->drm; struct drm_i915_private *dev_priv = to_i915(dev); struct drm_mode_fb_cmd2 mode_cmd = {}; struct drm_i915_gem_object *obj; @@ -213,7 +213,7 @@ static int intelfb_create(struct drm_fb_helper *helper, { struct intel_fbdev *ifbdev = to_intel_fbdev(helper); struct intel_framebuffer *intel_fb = ifbdev->fb; - struct drm_device *dev = helper->dev; + struct drm_device *dev = helper->drm; struct drm_i915_private *dev_priv = to_i915(dev); struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev); struct i915_ggtt *ggtt = to_gt(dev_priv)->ggtt; @@ -587,7 +587,7 @@ static void intel_fbdev_initial_config(void *data, async_cookie_t cookie) /* Due to peculiar init order wrt to hpd handling this is separate. */ if (drm_fb_helper_initial_config(&ifbdev->helper)) - intel_fbdev_unregister(to_i915(ifbdev->helper.dev)); + intel_fbdev_unregister(to_i915(ifbdev->helper.drm)); } void intel_fbdev_initial_config_async(struct drm_i915_private *dev_priv) diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c index 26bfcdc090e8..2fe73db64781 100644 --- a/drivers/gpu/drm/msm/msm_fbdev.c +++ b/drivers/gpu/drm/msm/msm_fbdev.c @@ -68,7 +68,7 @@ static const struct fb_ops msm_fb_ops = { static int msm_fbdev_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) { - struct drm_device *dev = helper->dev; + struct drm_device *dev = helper->drm; struct msm_drm_private *priv = dev->dev_private; struct drm_framebuffer *fb = NULL; struct drm_gem_object *bo; @@ -142,7 +142,7 @@ static int msm_fbdev_create(struct drm_fb_helper *helper, static int msm_fbdev_fb_dirty(struct drm_fb_helper *helper, struct drm_clip_rect *clip) { - struct drm_device *dev = helper->dev; + struct drm_device *dev = helper->drm; int ret; /* Call damage handlers only if necessary */ diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c index 933f2353d05e..9a2d19c8eff4 100644 --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c @@ -66,7 +66,7 @@ static int omap_fbdev_pan_display(struct fb_var_screeninfo *var, if (drm_can_sleep()) { pan_worker(&fbdev->work); } else { - struct omap_drm_private *priv = helper->dev->dev_private; + struct omap_drm_private *priv = helper->drm->dev_private; queue_work(priv->wq, &fbdev->work); } @@ -111,7 +111,7 @@ static int omap_fbdev_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) { struct omap_fbdev *fbdev = to_omap_fbdev(helper); - struct drm_device *dev = helper->dev; + struct drm_device *dev = helper->drm; struct omap_drm_private *priv = dev->dev_private; struct drm_framebuffer *fb = NULL; union omap_gem_size gsize; diff --git a/drivers/gpu/drm/radeon/radeon_fbdev.c b/drivers/gpu/drm/radeon/radeon_fbdev.c index 74f8a182b02d..7bad11abc7da 100644 --- a/drivers/gpu/drm/radeon/radeon_fbdev.c +++ b/drivers/gpu/drm/radeon/radeon_fbdev.c @@ -57,7 +57,7 @@ static int radeon_fbdev_create_pinned_object(struct drm_fb_helper *fb_helper, struct drm_gem_object **gobj_p) { const struct drm_format_info *info; - struct radeon_device *rdev = fb_helper->dev->dev_private; + struct radeon_device *rdev = fb_helper->drm->dev_private; struct drm_gem_object *gobj = NULL; struct radeon_bo *rbo = NULL; bool fb_tiled = false; /* useful for testing */ @@ -145,7 +145,7 @@ static int radeon_fbdev_create_pinned_object(struct drm_fb_helper *fb_helper, static int radeon_fbdev_fb_open(struct fb_info *info, int user) { struct drm_fb_helper *fb_helper = info->par; - struct radeon_device *rdev = fb_helper->dev->dev_private; + struct radeon_device *rdev = fb_helper->drm->dev_private; int ret; ret = pm_runtime_get_sync(rdev->ddev->dev); @@ -163,7 +163,7 @@ static int radeon_fbdev_fb_open(struct fb_info *info, int user) static int radeon_fbdev_fb_release(struct fb_info *info, int user) { struct drm_fb_helper *fb_helper = info->par; - struct radeon_device *rdev = fb_helper->dev->dev_private; + struct radeon_device *rdev = fb_helper->drm->dev_private; pm_runtime_mark_last_busy(rdev->ddev->dev); pm_runtime_put_autosuspend(rdev->ddev->dev); @@ -205,7 +205,7 @@ static const struct fb_ops radeon_fbdev_fb_ops = { static int radeon_fbdev_fb_helper_fb_probe(struct drm_fb_helper *fb_helper, struct drm_fb_helper_surface_size *sizes) { - struct radeon_device *rdev = fb_helper->dev->dev_private; + struct radeon_device *rdev = fb_helper->drm->dev_private; struct drm_mode_fb_cmd2 mode_cmd = { }; struct fb_info *info; struct drm_gem_object *gobj; @@ -299,7 +299,7 @@ static const struct drm_fb_helper_funcs radeon_fbdev_fb_helper_funcs = { static void radeon_fbdev_client_unregister(struct drm_client_dev *client) { struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client); - struct drm_device *dev = fb_helper->dev; + struct drm_device *dev = fb_helper->drm; struct radeon_device *rdev = dev->dev_private; if (fb_helper->info) { diff --git a/drivers/gpu/drm/tegra/fbdev.c b/drivers/gpu/drm/tegra/fbdev.c index 93a0f4021af5..b287d0d190fc 100644 --- a/drivers/gpu/drm/tegra/fbdev.c +++ b/drivers/gpu/drm/tegra/fbdev.c @@ -69,8 +69,8 @@ static const struct fb_ops tegra_fb_ops = { static int tegra_fbdev_probe(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) { - struct tegra_drm *tegra = helper->dev->dev_private; - struct drm_device *drm = helper->dev; + struct tegra_drm *tegra = helper->drm->dev_private; + struct drm_device *drm = helper->drm; struct drm_mode_fb_cmd2 cmd = { 0 }; unsigned int bytes_per_pixel; struct drm_framebuffer *fb; diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index 4863b0f8299e..84c73a32ea44 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h @@ -104,7 +104,7 @@ struct drm_fb_helper_funcs { /** * struct drm_fb_helper - main structure to emulate fbdev on top of KMS * @fb: Scanout framebuffer object - * @dev: DRM device + * @drm: DRM device * @funcs: driver callbacks for fb helper * @info: emulated fbdev device info struct * @pseudo_palette: fake palette of 16 colors @@ -135,7 +135,7 @@ struct drm_fb_helper { struct drm_client_buffer *buffer; struct drm_framebuffer *fb; - struct drm_device *dev; + struct drm_device *drm; const struct drm_fb_helper_funcs *funcs; struct fb_info *info; u32 pseudo_palette[17]; @@ -290,7 +290,7 @@ static inline int drm_fb_helper_init(struct drm_device *dev, struct drm_fb_helper *helper) { /* So drivers can use it to free the struct */ - helper->dev = dev; + helper->drm = dev; dev->fb_helper = helper; return 0; @@ -298,8 +298,8 @@ static inline int drm_fb_helper_init(struct drm_device *dev, static inline void drm_fb_helper_fini(struct drm_fb_helper *helper) { - if (helper && helper->dev) - helper->dev->fb_helper = NULL; + if (helper && helper->drm) + helper->drm->fb_helper = NULL; } static inline int drm_fb_helper_blank(int blank, struct fb_info *info) From patchwork Thu Jul 13 08:24:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311543 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A0F6FEB64DD for ; Thu, 13 Jul 2023 08:25:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C9CBF10E62C; Thu, 13 Jul 2023 08:25:10 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 15210882AF for ; Thu, 13 Jul 2023 08:25:05 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrcf-0005wd-SY; Thu, 13 Jul 2023 10:24:25 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrce-00E4jn-Va; Thu, 13 Jul 2023 10:24:24 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrcd-004VhK-UH; Thu, 13 Jul 2023 10:24:23 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 10/17] drm/framebuffer: Rename struct drm_framebuffer::dev to drm Date: Thu, 13 Jul 2023 10:24:01 +0200 Message-Id: <20230713082408.2266984-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=39521; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7jc7ZTixNdxPkSpxFCdYVchieH4T0tvxaZYeBTNQWq0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7SVtC9yBjBibL6dcl130sZn7Db4mArBAS8/0 MjtXcolgCWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0lQAKCRCPgPtYfRL+ Tv4UCACf80SCnLcCzm0K+DfPPM/SXO3zUuVFUPVLFCLsUP/OZ7ziJphUrZe5PFSJP21dx+DbRLX DbM697ftgdbxP/Fa0k8TTipgChXBZ4YDoKBmeDpmTkwitlVduiMrY90SgbZKXrIqix3/71y0X+F a9r/IQbPnR3Xw7EU3HpZ0vSx5w94gdtOVVM57H17B68mN7OahRYdBkZzRMJ5DJRQUCTXueToirf /VCDq+Q5dE6PImaWQ8+h/Cj8Trv99DP+4GxAK2LVedNFlqGao8ayqXY9o0qXawURPo9zHVsPWjg SJJCVNM2e7kTgsz99NdkGaoyQe7zFhfbTsbEflX7svHP+WV5 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 16 +++---- .../arm/display/komeda/komeda_framebuffer.c | 2 +- drivers/gpu/drm/drm_damage_helper.c | 6 +-- drivers/gpu/drm/drm_format_helper.c | 8 ++-- drivers/gpu/drm/drm_framebuffer.c | 18 ++++---- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 5 ++- drivers/gpu/drm/drm_mipi_dbi.c | 8 ++-- drivers/gpu/drm/drm_modeset_helper.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- drivers/gpu/drm/gud/gud_pipe.c | 4 +- drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 2 +- drivers/gpu/drm/i915/display/i9xx_plane.c | 2 +- drivers/gpu/drm/i915/display/intel_fb.c | 42 +++++++++---------- drivers/gpu/drm/i915/display/intel_fb_pin.c | 4 +- .../drm/i915/display/skl_universal_plane.c | 4 +- drivers/gpu/drm/loongson/lsdc_plane.c | 2 +- drivers/gpu/drm/msm/msm_fb.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 2 +- drivers/gpu/drm/nouveau/nouveau_display.c | 2 +- drivers/gpu/drm/omapdrm/omap_fb.c | 12 +++--- drivers/gpu/drm/qxl/qxl_display.c | 7 ++-- drivers/gpu/drm/solomon/ssd130x.c | 2 +- drivers/gpu/drm/tiny/gm12u320.c | 2 +- drivers/gpu/drm/tiny/ili9225.c | 7 ++-- drivers/gpu/drm/tiny/repaper.c | 4 +- drivers/gpu/drm/tiny/st7586.c | 7 ++-- drivers/gpu/drm/udl/udl_modeset.c | 2 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 2 +- drivers/gpu/drm/vkms/vkms_writeback.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 4 +- drivers/gpu/drm/xen/xen_drm_front_kms.c | 4 +- include/drm/drm_framebuffer.h | 4 +- 32 files changed, 99 insertions(+), 93 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index f28090ecc603..032290c459c3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -700,7 +700,7 @@ extract_render_dcc_offset(struct amdgpu_device *adev, static int convert_tiling_flags_to_modifier(struct amdgpu_framebuffer *afb) { - struct amdgpu_device *adev = drm_to_adev(afb->base.dev); + struct amdgpu_device *adev = drm_to_adev(afb->base.drm); uint64_t modifier = 0; int num_pipes = 0; int num_pkrs = 0; @@ -899,7 +899,7 @@ static int check_tiling_flags_gfx6(struct amdgpu_framebuffer *afb) case 3: /* RENDER */ return 0; default: - drm_dbg_kms(afb->base.dev, + drm_dbg_kms(afb->base.drm, "Micro tile mode %llu not supported for scanout\n", micro_tile_mode); return -EINVAL; @@ -964,13 +964,13 @@ static int amdgpu_display_verify_plane(struct amdgpu_framebuffer *rfb, int plane uint64_t size; if (rfb->base.pitches[plane] % block_pitch) { - drm_dbg_kms(rfb->base.dev, + drm_dbg_kms(rfb->base.drm, "pitch %d for plane %d is not a multiple of block pitch %d\n", rfb->base.pitches[plane], plane, block_pitch); return -EINVAL; } if (rfb->base.pitches[plane] < min_pitch) { - drm_dbg_kms(rfb->base.dev, + drm_dbg_kms(rfb->base.drm, "pitch %d for plane %d is less than minimum pitch %d\n", rfb->base.pitches[plane], plane, min_pitch); return -EINVAL; @@ -978,7 +978,7 @@ static int amdgpu_display_verify_plane(struct amdgpu_framebuffer *rfb, int plane /* Force at least natural alignment. */ if (rfb->base.offsets[plane] % block_size) { - drm_dbg_kms(rfb->base.dev, + drm_dbg_kms(rfb->base.drm, "offset 0x%x for plane %d is not a multiple of block pitch 0x%x\n", rfb->base.offsets[plane], plane, block_size); return -EINVAL; @@ -989,7 +989,7 @@ static int amdgpu_display_verify_plane(struct amdgpu_framebuffer *rfb, int plane block_size * DIV_ROUND_UP(height, block_height); if (rfb->base.obj[0]->size < size) { - drm_dbg_kms(rfb->base.dev, + drm_dbg_kms(rfb->base.drm, "BO size 0x%zx is less than 0x%llx required for plane %d\n", rfb->base.obj[0]->size, size, plane); return -EINVAL; @@ -1006,7 +1006,7 @@ static int amdgpu_display_verify_sizes(struct amdgpu_framebuffer *rfb) int ret; unsigned int i, block_width, block_height, block_size_log2; - if (rfb->base.dev->mode_config.fb_modifiers_not_supported) + if (rfb->base.drm->mode_config.fb_modifiers_not_supported) return 0; for (i = 0; i < format_info->num_planes; ++i) { @@ -1034,7 +1034,7 @@ static int amdgpu_display_verify_sizes(struct amdgpu_framebuffer *rfb) block_size_log2 = 18; break; default: - drm_dbg_kms(rfb->base.dev, + drm_dbg_kms(rfb->base.drm, "Swizzle mode with unknown block size: %d\n", swizzle); return -EINVAL; } diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c index df5da5a44755..78138427c210 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c @@ -268,7 +268,7 @@ bool komeda_fb_is_layer_supported(struct komeda_fb *kfb, u32 layer_type, u32 rot) { struct drm_framebuffer *fb = &kfb->base; - struct komeda_dev *mdev = fb->dev->dev_private; + struct komeda_dev *mdev = fb->drm->dev_private; u32 fourcc = fb->format->format; u64 modifier = fb->modifier; bool supported; diff --git a/drivers/gpu/drm/drm_damage_helper.c b/drivers/gpu/drm/drm_damage_helper.c index d8b2955e88fd..5381c57991c5 100644 --- a/drivers/gpu/drm/drm_damage_helper.c +++ b/drivers/gpu/drm/drm_damage_helper.c @@ -123,7 +123,7 @@ int drm_atomic_helper_dirtyfb(struct drm_framebuffer *fb, drm_modeset_acquire_init(&ctx, file_priv ? DRM_MODESET_ACQUIRE_INTERRUPTIBLE : 0); - state = drm_atomic_state_alloc(fb->dev); + state = drm_atomic_state_alloc(fb->drm); if (!state) { ret = -ENOMEM; goto out_drop_locks; @@ -145,7 +145,7 @@ int drm_atomic_helper_dirtyfb(struct drm_framebuffer *fb, } convert_clip_rect_to_rect(clips, rects, num_clips, inc); - damage = drm_property_create_blob(fb->dev, + damage = drm_property_create_blob(fb->drm, num_clips * sizeof(*rects), rects); if (IS_ERR(damage)) { @@ -156,7 +156,7 @@ int drm_atomic_helper_dirtyfb(struct drm_framebuffer *fb, } retry: - drm_for_each_plane(plane, fb->dev) { + drm_for_each_plane(plane, fb->drm) { struct drm_plane_state *plane_state; ret = drm_modeset_lock(&plane->mutex, state->acquire_ctx); diff --git a/drivers/gpu/drm/drm_format_helper.c b/drivers/gpu/drm/drm_format_helper.c index f93a4efcee90..cdc723856215 100644 --- a/drivers/gpu/drm/drm_format_helper.c +++ b/drivers/gpu/drm/drm_format_helper.c @@ -263,7 +263,8 @@ void drm_fb_swab(struct iosys_map *dst, const unsigned int *dst_pitch, swab_line = drm_fb_swab16_line; break; default: - drm_warn_once(fb->dev, "Format %p4cc has unsupported pixel size.\n", + drm_warn_once(fb->drm, + "Format %p4cc has unsupported pixel size.\n", &format->format); return; } @@ -946,7 +947,8 @@ int drm_fb_blit(struct iosys_map *dst, const unsigned int *dst_pitch, uint32_t d } } - drm_warn_once(fb->dev, "No conversion helper from %p4cc to %p4cc found.\n", + drm_warn_once(fb->drm, + "No conversion helper from %p4cc to %p4cc found.\n", &fb_format, &dst_format); return -EINVAL; @@ -1011,7 +1013,7 @@ void drm_fb_xrgb8888_to_mono(struct iosys_map *dst, const unsigned int *dst_pitc unsigned int lines = drm_rect_height(clip); unsigned int cpp = fb->format->cpp[0]; unsigned int len_src32 = linepixels * cpp; - struct drm_device *dev = fb->dev; + struct drm_device *dev = fb->drm; void *vaddr = src[0].vaddr; unsigned int dst_pitch_0; unsigned int y; diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 38a118e51a6f..882a8b1eaa16 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -87,7 +87,7 @@ int drm_framebuffer_check_src_coords(uint32_t src_x, uint32_t src_y, src_x > fb_width - src_w || src_h > fb_height || src_y > fb_height - src_h) { - drm_dbg_kms(fb->dev, "Invalid source coordinates " + drm_dbg_kms(fb->drm, "Invalid source coordinates " "%u.%06ux%u.%06u+%u.%06u+%u.%06u (fb %ux%u)\n", src_w >> 16, ((src_w & 0xffff) * 15625) >> 10, src_h >> 16, ((src_h & 0xffff) * 15625) >> 10, @@ -404,7 +404,7 @@ static void drm_mode_rmfb_work_fn(struct work_struct *w) struct drm_framebuffer *fb = list_first_entry(&arg->fbs, typeof(*fb), filp_head); - drm_dbg_kms(fb->dev, + drm_dbg_kms(fb->drm, "Removing [FB:%d] from all active usage due to RMFB ioctl\n", fb->base.id); list_del_init(&fb->filp_head); @@ -812,7 +812,7 @@ void drm_framebuffer_free(struct kref *kref) { struct drm_framebuffer *fb = container_of(kref, struct drm_framebuffer, base.refcount); - struct drm_device *dev = fb->dev; + struct drm_device *dev = fb->drm; /* * The lookup idr holds a weak reference, which has not necessarily been @@ -846,7 +846,7 @@ int drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb, { int ret; - if (WARN_ON_ONCE(fb->dev != dev || !fb->format)) + if (WARN_ON_ONCE(fb->drm != dev || !fb->format)) return -EINVAL; INIT_LIST_HEAD(&fb->filp_head); @@ -915,7 +915,7 @@ void drm_framebuffer_unregister_private(struct drm_framebuffer *fb) if (!fb) return; - dev = fb->dev; + dev = fb->drm; /* Mark fb as reaped and drop idr ref. */ drm_mode_object_unregister(dev, &fb->base); @@ -941,7 +941,7 @@ EXPORT_SYMBOL(drm_framebuffer_unregister_private); */ void drm_framebuffer_cleanup(struct drm_framebuffer *fb) { - struct drm_device *dev = fb->dev; + struct drm_device *dev = fb->drm; mutex_lock(&dev->mode_config.fb_lock); list_del(&fb->head); @@ -953,7 +953,7 @@ EXPORT_SYMBOL(drm_framebuffer_cleanup); static int atomic_remove_fb(struct drm_framebuffer *fb) { struct drm_modeset_acquire_ctx ctx; - struct drm_device *dev = fb->dev; + struct drm_device *dev = fb->drm; struct drm_atomic_state *state; struct drm_plane *plane; struct drm_connector *conn __maybe_unused; @@ -1056,7 +1056,7 @@ static int atomic_remove_fb(struct drm_framebuffer *fb) static void legacy_remove_fb(struct drm_framebuffer *fb) { - struct drm_device *dev = fb->dev; + struct drm_device *dev = fb->drm; struct drm_crtc *crtc; struct drm_plane *plane; @@ -1104,7 +1104,7 @@ void drm_framebuffer_remove(struct drm_framebuffer *fb) if (!fb) return; - dev = fb->dev; + dev = fb->drm; WARN_ON(!list_empty(&fb->filp_head)); diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c index b8a615a138cd..50cfcd7ec1c0 100644 --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -53,7 +53,7 @@ MODULE_IMPORT_NS(DMA_BUF); struct drm_gem_object *drm_gem_fb_get_obj(struct drm_framebuffer *fb, unsigned int plane) { - struct drm_device *dev = fb->dev; + struct drm_device *dev = fb->drm; if (drm_WARN_ON_ONCE(dev, plane >= ARRAY_SIZE(fb->obj))) return NULL; @@ -433,7 +433,8 @@ static void __drm_gem_fb_end_cpu_access(struct drm_framebuffer *fb, enum dma_dat continue; ret = dma_buf_end_cpu_access(import_attach->dmabuf, dir); if (ret) - drm_err(fb->dev, "dma_buf_end_cpu_access(%u, %d) failed: %d\n", + drm_err(fb->drm, + "dma_buf_end_cpu_access(%u, %d) failed: %d\n", ret, num_planes, dir); } } diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index bd8a3802583f..7b85ebaac7c8 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -223,7 +223,7 @@ int mipi_dbi_buf_copy(void *dst, struct iosys_map *src, struct drm_framebuffer * drm_fb_xrgb8888_to_rgb565(&dst_map, NULL, src, fb, clip, swap); break; default: - drm_err_once(fb->dev, "Format is not supported: %p4cc\n", + drm_err_once(fb->drm, "Format is not supported: %p4cc\n", &fb->format->format); ret = -EINVAL; } @@ -254,7 +254,7 @@ static void mipi_dbi_set_window_address(struct mipi_dbi_dev *dbidev, static void mipi_dbi_fb_dirty(struct iosys_map *src, struct drm_framebuffer *fb, struct drm_rect *rect) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->drm); unsigned int height = rect->y2 - rect->y1; unsigned int width = rect->x2 - rect->x1; struct mipi_dbi *dbi = &dbidev->dbi; @@ -284,7 +284,7 @@ static void mipi_dbi_fb_dirty(struct iosys_map *src, struct drm_framebuffer *fb, width * height * 2); err_msg: if (ret) - drm_err_once(fb->dev, "Failed to update display %d\n", ret); + drm_err_once(fb->drm, "Failed to update display %d\n", ret); } /** @@ -328,7 +328,7 @@ void mipi_dbi_pipe_update(struct drm_simple_display_pipe *pipe, if (WARN_ON(!fb)) return; - if (!drm_dev_enter(fb->dev, &idx)) + if (!drm_dev_enter(fb->drm, &idx)) return; if (drm_atomic_helper_damage_merged(old_state, state, &rect)) diff --git a/drivers/gpu/drm/drm_modeset_helper.c b/drivers/gpu/drm/drm_modeset_helper.c index f858dfedf2cf..14dc6b62868a 100644 --- a/drivers/gpu/drm/drm_modeset_helper.c +++ b/drivers/gpu/drm/drm_modeset_helper.c @@ -83,7 +83,7 @@ void drm_helper_mode_fill_fb_struct(struct drm_device *dev, { int i; - fb->dev = dev; + fb->drm = dev; fb->format = drm_get_format_info(dev, mode_cmd); fb->width = mode_cmd->width; fb->height = mode_cmd->height; diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 31955e948ea2..0b5ce24597ae 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -178,7 +178,7 @@ exynos_drm_plane_check_format(const struct exynos_drm_plane_config *config, struct exynos_drm_plane_state *state) { struct drm_framebuffer *fb = state->base.fb; - struct drm_device *dev = fb->dev; + struct drm_device *dev = fb->drm; switch (fb->modifier) { case DRM_FORMAT_MOD_SAMSUNG_64_32_TILE: diff --git a/drivers/gpu/drm/gud/gud_pipe.c b/drivers/gpu/drm/gud/gud_pipe.c index a87997c2c043..a6407b670c85 100644 --- a/drivers/gpu/drm/gud/gud_pipe.c +++ b/drivers/gpu/drm/gud/gud_pipe.c @@ -344,7 +344,7 @@ static void gud_flush_damage(struct gud_device *gdrm, struct drm_framebuffer *fb if (ret) { if (ret != -ENODEV && ret != -ECONNRESET && ret != -ESHUTDOWN && ret != -EPROTO) - dev_err_ratelimited(fb->dev->dev, + dev_err_ratelimited(fb->drm->dev, "Failed to flush framebuffer: error=%d\n", ret); gdrm->prev_flush_failed = true; break; @@ -543,7 +543,7 @@ int gud_pipe_check(struct drm_simple_display_pipe *pipe, num_properties++; } - if (drm_dev_enter(fb->dev, &idx)) { + if (drm_dev_enter(fb->drm, &idx)) { len = struct_size(req, properties, num_properties); ret = gud_usb_set(gdrm, GUD_REQ_SET_STATE_CHECK, 0, req, len); drm_dev_exit(idx); diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c index 3b614baf835f..2d93fb2ce6c0 100644 --- a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +++ b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c @@ -23,7 +23,7 @@ static int hyperv_blit_to_vram_rect(struct drm_framebuffer *fb, const struct iosys_map *vmap, struct drm_rect *rect) { - struct hyperv_drm_device *hv = to_hv(fb->dev); + struct hyperv_drm_device *hv = to_hv(fb->drm); struct iosys_map dst = IOSYS_MAP_INIT_VADDR_IOMEM(hv->vram); int idx; diff --git a/drivers/gpu/drm/i915/display/i9xx_plane.c b/drivers/gpu/drm/i915/display/i9xx_plane.c index d43430c4d539..be31ce8ebb10 100644 --- a/drivers/gpu/drm/i915/display/i9xx_plane.c +++ b/drivers/gpu/drm/i915/display/i9xx_plane.c @@ -999,7 +999,7 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc, fb = &intel_fb->base; - fb->dev = dev; + fb->drm = dev; val = intel_de_read(dev_priv, DSPCNTR(i9xx_plane)); diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c index 446bbf7986b6..4109c894abd3 100644 --- a/drivers/gpu/drm/i915/display/intel_fb.c +++ b/drivers/gpu/drm/i915/display/intel_fb.c @@ -542,7 +542,7 @@ int intel_fb_rc_ccs_cc_plane(const struct drm_framebuffer *fb) if (!md->ccs.cc_planes) return -1; - drm_WARN_ON_ONCE(fb->dev, hweight8(md->ccs.cc_planes) > 1); + drm_WARN_ON_ONCE(fb->drm, hweight8(md->ccs.cc_planes) > 1); return ilog2((int)md->ccs.cc_planes); } @@ -567,7 +567,7 @@ bool is_surface_linear(const struct drm_framebuffer *fb, int color_plane) int main_to_ccs_plane(const struct drm_framebuffer *fb, int main_plane) { - drm_WARN_ON(fb->dev, !intel_fb_is_ccs_modifier(fb->modifier) || + drm_WARN_ON(fb->drm, !intel_fb_is_ccs_modifier(fb->modifier) || (main_plane && main_plane >= fb->format->num_planes / 2)); return fb->format->num_planes / 2 + main_plane; @@ -575,7 +575,7 @@ int main_to_ccs_plane(const struct drm_framebuffer *fb, int main_plane) int skl_ccs_to_main_plane(const struct drm_framebuffer *fb, int ccs_plane) { - drm_WARN_ON(fb->dev, !intel_fb_is_ccs_modifier(fb->modifier) || + drm_WARN_ON(fb->drm, !intel_fb_is_ccs_modifier(fb->modifier) || ccs_plane < fb->format->num_planes / 2); if (is_gen12_ccs_cc_plane(fb, ccs_plane)) @@ -596,7 +596,7 @@ static unsigned int gen12_ccs_aux_stride(struct intel_framebuffer *fb, int ccs_p int skl_main_to_aux_plane(const struct drm_framebuffer *fb, int main_plane) { const struct intel_modifier_desc *md = lookup_modifier(fb->modifier); - struct drm_i915_private *i915 = to_i915(fb->dev); + struct drm_i915_private *i915 = to_i915(fb->drm); if (md->ccs.packed_aux_planes | md->ccs.planar_aux_planes) return main_to_ccs_plane(fb, main_plane); @@ -615,7 +615,7 @@ unsigned int intel_tile_size(const struct drm_i915_private *i915) unsigned int intel_tile_width_bytes(const struct drm_framebuffer *fb, int color_plane) { - struct drm_i915_private *dev_priv = to_i915(fb->dev); + struct drm_i915_private *dev_priv = to_i915(fb->drm); unsigned int cpp = fb->format->cpp[color_plane]; switch (fb->modifier) { @@ -681,7 +681,7 @@ intel_tile_width_bytes(const struct drm_framebuffer *fb, int color_plane) unsigned int intel_tile_height(const struct drm_framebuffer *fb, int color_plane) { - return intel_tile_size(to_i915(fb->dev)) / + return intel_tile_size(to_i915(fb->drm)) / intel_tile_width_bytes(fb, color_plane); } @@ -760,8 +760,8 @@ bool intel_fb_modifier_uses_dpt(struct drm_i915_private *i915, u64 modifier) bool intel_fb_uses_dpt(const struct drm_framebuffer *fb) { - return fb && to_i915(fb->dev)->params.enable_dpt && - intel_fb_modifier_uses_dpt(to_i915(fb->dev), fb->modifier); + return fb && to_i915(fb->drm)->params.enable_dpt && + intel_fb_modifier_uses_dpt(to_i915(fb->drm), fb->modifier); } unsigned int intel_cursor_alignment(const struct drm_i915_private *i915) @@ -792,7 +792,7 @@ static unsigned int intel_linear_alignment(const struct drm_i915_private *dev_pr unsigned int intel_surf_alignment(const struct drm_framebuffer *fb, int color_plane) { - struct drm_i915_private *dev_priv = to_i915(fb->dev); + struct drm_i915_private *dev_priv = to_i915(fb->drm); if (intel_fb_uses_dpt(fb)) return 512 * 4096; @@ -954,7 +954,7 @@ static u32 intel_adjust_aligned_offset(int *x, int *y, unsigned int pitch, u32 old_offset, u32 new_offset) { - struct drm_i915_private *i915 = to_i915(fb->dev); + struct drm_i915_private *i915 = to_i915(fb->drm); unsigned int cpp = fb->format->cpp[color_plane]; drm_WARN_ON(&i915->drm, new_offset > old_offset); @@ -1093,7 +1093,7 @@ static int intel_fb_offset_to_xy(int *x, int *y, const struct drm_framebuffer *fb, int color_plane) { - struct drm_i915_private *i915 = to_i915(fb->dev); + struct drm_i915_private *i915 = to_i915(fb->drm); unsigned int height; u32 alignment; @@ -1139,7 +1139,7 @@ static int intel_fb_offset_to_xy(int *x, int *y, static int intel_fb_check_ccs_xy(const struct drm_framebuffer *fb, int ccs_plane, int x, int y) { - struct drm_i915_private *i915 = to_i915(fb->dev); + struct drm_i915_private *i915 = to_i915(fb->drm); const struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); int main_plane; int hsub, vsub; @@ -1228,7 +1228,7 @@ static bool intel_plane_can_remap(const struct intel_plane_state *plane_state) bool intel_fb_needs_pot_stride_remap(const struct intel_framebuffer *fb) { - struct drm_i915_private *i915 = to_i915(fb->base.dev); + struct drm_i915_private *i915 = to_i915(fb->base.drm); return (IS_ALDERLAKE_P(i915) || DISPLAY_VER(i915) >= 14) && intel_fb_uses_dpt(&fb->base); @@ -1280,7 +1280,7 @@ static int convert_plane_offset_to_xy(const struct intel_framebuffer *fb, int co ret = intel_fb_offset_to_xy(x, y, &fb->base, color_plane); if (ret) { - drm_dbg_kms(fb->base.dev, + drm_dbg_kms(fb->base.drm, "bad fb plane %d offset: 0x%x\n", color_plane, fb->base.offsets[color_plane]); return ret; @@ -1301,7 +1301,7 @@ static int convert_plane_offset_to_xy(const struct intel_framebuffer *fb, int co */ if (color_plane == 0 && i915_gem_object_is_tiled(obj) && (*x + plane_width) * fb->base.format->cpp[color_plane] > fb->base.pitches[color_plane]) { - drm_dbg_kms(fb->base.dev, + drm_dbg_kms(fb->base.drm, "bad fb plane %d offset: 0x%x\n", color_plane, fb->base.offsets[color_plane]); return -EINVAL; @@ -1312,7 +1312,7 @@ static int convert_plane_offset_to_xy(const struct intel_framebuffer *fb, int co static u32 calc_plane_aligned_offset(const struct intel_framebuffer *fb, int color_plane, int *x, int *y) { - struct drm_i915_private *i915 = to_i915(fb->base.dev); + struct drm_i915_private *i915 = to_i915(fb->base.drm); unsigned int tile_size = intel_tile_size(i915); u32 offset; @@ -1367,7 +1367,7 @@ plane_view_scanout_stride(const struct intel_framebuffer *fb, int color_plane, unsigned int tile_width, unsigned int src_stride_tiles, unsigned int dst_stride_tiles) { - struct drm_i915_private *i915 = to_i915(fb->base.dev); + struct drm_i915_private *i915 = to_i915(fb->base.drm); unsigned int stride_tiles; if (IS_ALDERLAKE_P(i915) || DISPLAY_VER(i915) >= 14) @@ -1399,7 +1399,7 @@ plane_view_linear_tiles(const struct intel_framebuffer *fb, int color_plane, const struct fb_plane_view_dims *dims, int x, int y) { - struct drm_i915_private *i915 = to_i915(fb->base.dev); + struct drm_i915_private *i915 = to_i915(fb->base.drm); unsigned int size; size = (y + dims->height) * fb->base.pitches[color_plane] + @@ -1424,7 +1424,7 @@ static u32 calc_plane_remap_info(const struct intel_framebuffer *fb, int color_p u32 obj_offset, u32 gtt_offset, int x, int y, struct intel_fb_view *view) { - struct drm_i915_private *i915 = to_i915(fb->base.dev); + struct drm_i915_private *i915 = to_i915(fb->base.drm); struct intel_remapped_plane_info *remap_info = &view->gtt.remapped.plane[color_plane]; struct i915_color_plane_view *color_plane_info = &view->color_plane[color_plane]; unsigned int tile_width = dims->tile_width; @@ -1571,7 +1571,7 @@ static void intel_fb_view_init(struct drm_i915_private *i915, struct intel_fb_vi bool intel_fb_supports_90_270_rotation(const struct intel_framebuffer *fb) { - if (DISPLAY_VER(to_i915(fb->base.dev)) >= 13) + if (DISPLAY_VER(to_i915(fb->base.drm)) >= 13) return false; return fb->base.modifier == I915_FORMAT_MOD_Y_TILED || @@ -1759,7 +1759,7 @@ u32 intel_fb_max_stride(struct drm_i915_private *dev_priv, static u32 intel_fb_stride_alignment(const struct drm_framebuffer *fb, int color_plane) { - struct drm_i915_private *dev_priv = to_i915(fb->dev); + struct drm_i915_private *dev_priv = to_i915(fb->drm); u32 tile_width; if (is_surface_linear(fb, color_plane)) { diff --git a/drivers/gpu/drm/i915/display/intel_fb_pin.c b/drivers/gpu/drm/i915/display/intel_fb_pin.c index fffd568070d4..bee4ee229182 100644 --- a/drivers/gpu/drm/i915/display/intel_fb_pin.c +++ b/drivers/gpu/drm/i915/display/intel_fb_pin.c @@ -23,7 +23,7 @@ intel_pin_fb_obj_dpt(struct drm_framebuffer *fb, unsigned long *out_flags, struct i915_address_space *vm) { - struct drm_device *dev = fb->dev; + struct drm_device *dev = fb->drm; struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_gem_object *obj = intel_fb_obj(fb); struct i915_gem_ww_ctx ww; @@ -109,7 +109,7 @@ intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb, bool uses_fence, unsigned long *out_flags) { - struct drm_device *dev = fb->dev; + struct drm_device *dev = fb->drm; struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_gem_object *obj = intel_fb_obj(fb); intel_wakeref_t wakeref; diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c index f60e17d3e019..e4a398224b91 100644 --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c @@ -1847,7 +1847,7 @@ static bool skl_fb_scalable(const struct drm_framebuffer *fb) case DRM_FORMAT_ARGB16161616F: case DRM_FORMAT_XBGR16161616F: case DRM_FORMAT_ABGR16161616F: - return DISPLAY_VER(to_i915(fb->dev)) >= 11; + return DISPLAY_VER(to_i915(fb->drm)) >= 11; default: return true; } @@ -2420,7 +2420,7 @@ skl_get_initial_plane_config(struct intel_crtc *crtc, fb = &intel_fb->base; - fb->dev = dev; + fb->drm = dev; val = intel_de_read(dev_priv, PLANE_CTL(pipe, plane_id)); diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c b/drivers/gpu/drm/loongson/lsdc_plane.c index 2ab3db982aa3..bd8a27106d16 100644 --- a/drivers/gpu/drm/loongson/lsdc_plane.c +++ b/drivers/gpu/drm/loongson/lsdc_plane.c @@ -41,7 +41,7 @@ static unsigned int lsdc_get_fb_offset(struct drm_framebuffer *fb, static u64 lsdc_fb_base_addr(struct drm_framebuffer *fb) { - struct lsdc_device *ldev = to_lsdc(fb->dev); + struct lsdc_device *ldev = to_lsdc(fb->drm); struct lsdc_bo *lbo = gem_to_lsdc_bo(fb->obj[0]); return lsdc_bo_gpu_offset(lbo) + ldev->vram_base; diff --git a/drivers/gpu/drm/msm/msm_fb.c b/drivers/gpu/drm/msm/msm_fb.c index e3f61c39df69..5235c908b13a 100644 --- a/drivers/gpu/drm/msm/msm_fb.c +++ b/drivers/gpu/drm/msm/msm_fb.c @@ -89,7 +89,7 @@ int msm_framebuffer_prepare(struct drm_framebuffer *fb, for (i = 0; i < n; i++) { ret = msm_gem_get_and_pin_iova(fb->obj[i], aspace, &msm_fb->iova[i]); - drm_dbg_state(fb->dev, "FB[%u]: iova[%d]: %08llx (%d)", + drm_dbg_state(fb->drm, "FB[%u]: iova[%d]: %08llx (%d)", fb->base.id, i, msm_fb->iova[i], ret); if (ret) return ret; diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.c b/drivers/gpu/drm/nouveau/dispnv50/wndw.c index 7a2cceaee6e9..0f48af3f2008 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c @@ -50,7 +50,7 @@ nv50_wndw_ctxdma_del(struct nv50_wndw_ctxdma *ctxdma) static struct nv50_wndw_ctxdma * nv50_wndw_ctxdma_new(struct nv50_wndw *wndw, struct drm_framebuffer *fb) { - struct nouveau_drm *drm = nouveau_drm(fb->dev); + struct nouveau_drm *drm = nouveau_drm(fb->drm); struct nv50_wndw_ctxdma *ctxdma; u32 handle; u32 unused; diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 1d005473a488..5dff54f83f46 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -165,7 +165,7 @@ nouveau_framebuffer_get_layout(struct drm_framebuffer *fb, uint8_t *kind) { if (fb->flags & DRM_MODE_FB_MODIFIERS) { - struct nouveau_drm *drm = nouveau_drm(fb->dev); + struct nouveau_drm *drm = nouveau_drm(fb->drm); nouveau_decode_mod(drm, fb->modifier, tile_mode, kind); } else { diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index 1d414b33fee3..01b7a4bef3ec 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/drivers/gpu/drm/omapdrm/omap_fb.c @@ -65,12 +65,12 @@ static int omap_framebuffer_dirty(struct drm_framebuffer *fb, { struct drm_crtc *crtc; - drm_modeset_lock_all(fb->dev); + drm_modeset_lock_all(fb->drm); - drm_for_each_crtc(crtc, fb->dev) + drm_for_each_crtc(crtc, fb->drm) omap_crtc_flush(crtc); - drm_modeset_unlock_all(fb->dev); + drm_modeset_unlock_all(fb->drm); return 0; } @@ -196,9 +196,9 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, break; default: - dev_warn(fb->dev->dev, - "rotation '%d' ignored for non-tiled fb\n", - state->rotation); + dev_warn(fb->drm->dev, + "rotation '%d' ignored for non-tiled fb\n", + state->rotation); break; } diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 3f86e1072f6a..d123a59c0c9f 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -407,14 +407,15 @@ static int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb, unsigned int num_clips) { /* TODO: vmwgfx where this was cribbed from had locking. Why? */ - struct qxl_device *qdev = to_qxl(fb->dev); + struct qxl_device *qdev = to_qxl(fb->drm); struct drm_clip_rect norect; struct qxl_bo *qobj; struct drm_modeset_acquire_ctx ctx; bool is_primary; int inc = 1, ret; - DRM_MODESET_LOCK_ALL_BEGIN(fb->dev, ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE, ret); + DRM_MODESET_LOCK_ALL_BEGIN(fb->drm, ctx, + DRM_MODESET_ACQUIRE_INTERRUPTIBLE, ret); qobj = gem_to_qxl_bo(fb->obj[0]); /* if we aren't primary surface ignore this */ @@ -437,7 +438,7 @@ static int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb, clips, num_clips, inc, 0); out_lock_end: - DRM_MODESET_LOCK_ALL_END(fb->dev, ctx, ret); + DRM_MODESET_LOCK_ALL_END(fb->drm, ctx, ret); return 0; } diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c index 251d0a11ed86..5d94b494a545 100644 --- a/drivers/gpu/drm/solomon/ssd130x.c +++ b/drivers/gpu/drm/solomon/ssd130x.c @@ -582,7 +582,7 @@ static void ssd130x_clear_screen(struct ssd130x_device *ssd130x) static int ssd130x_fb_blit_rect(struct drm_framebuffer *fb, const struct iosys_map *vmap, struct drm_rect *rect) { - struct ssd130x_device *ssd130x = drm_to_ssd130x(fb->dev); + struct ssd130x_device *ssd130x = drm_to_ssd130x(fb->drm); unsigned int page_height = ssd130x->device_info->page_height; struct iosys_map dst; unsigned int dst_pitch; diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c index e6279a9916ef..7e839cae9bdd 100644 --- a/drivers/gpu/drm/tiny/gm12u320.c +++ b/drivers/gpu/drm/tiny/gm12u320.c @@ -402,7 +402,7 @@ static void gm12u320_fb_mark_dirty(struct drm_framebuffer *fb, const struct iosys_map *map, struct drm_rect *dirty) { - struct gm12u320_device *gm12u320 = to_gm12u320(fb->dev); + struct gm12u320_device *gm12u320 = to_gm12u320(fb->drm); struct drm_framebuffer *old_fb = NULL; bool wakeup = false; diff --git a/drivers/gpu/drm/tiny/ili9225.c b/drivers/gpu/drm/tiny/ili9225.c index ec33dc530a17..f44667cf0f7b 100644 --- a/drivers/gpu/drm/tiny/ili9225.c +++ b/drivers/gpu/drm/tiny/ili9225.c @@ -80,7 +80,7 @@ static inline int ili9225_command(struct mipi_dbi *dbi, u8 cmd, u16 data) static void ili9225_fb_dirty(struct iosys_map *src, struct drm_framebuffer *fb, struct drm_rect *rect) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->drm); unsigned int height = rect->y2 - rect->y1; unsigned int width = rect->x2 - rect->x1; struct mipi_dbi *dbi = &dbidev->dbi; @@ -152,7 +152,8 @@ static void ili9225_fb_dirty(struct iosys_map *src, struct drm_framebuffer *fb, width * height * 2); err_msg: if (ret) - dev_err_once(fb->dev->dev, "Failed to update display %d\n", ret); + dev_err_once(fb->drm->dev, "Failed to update display %d\n", + ret); } static void ili9225_pipe_update(struct drm_simple_display_pipe *pipe, @@ -167,7 +168,7 @@ static void ili9225_pipe_update(struct drm_simple_display_pipe *pipe, if (!pipe->crtc.state->active) return; - if (!drm_dev_enter(fb->dev, &idx)) + if (!drm_dev_enter(fb->drm, &idx)) return; if (drm_atomic_helper_damage_merged(old_state, state, &rect)) diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c index 2a459960d10c..156468a473df 100644 --- a/drivers/gpu/drm/tiny/repaper.c +++ b/drivers/gpu/drm/tiny/repaper.c @@ -512,14 +512,14 @@ static void repaper_get_temperature(struct repaper_epd *epd) static int repaper_fb_dirty(struct drm_framebuffer *fb) { struct drm_gem_dma_object *dma_obj = drm_fb_dma_get_gem_obj(fb, 0); - struct repaper_epd *epd = drm_to_epd(fb->dev); + struct repaper_epd *epd = drm_to_epd(fb->drm); unsigned int dst_pitch = 0; struct iosys_map dst, vmap; struct drm_rect clip; int idx, ret = 0; u8 *buf = NULL; - if (!drm_dev_enter(fb->dev, &idx)) + if (!drm_dev_enter(fb->drm, &idx)) return -ENODEV; /* repaper can't do partial updates */ diff --git a/drivers/gpu/drm/tiny/st7586.c b/drivers/gpu/drm/tiny/st7586.c index 493dee2446d8..1240b9d5809f 100644 --- a/drivers/gpu/drm/tiny/st7586.c +++ b/drivers/gpu/drm/tiny/st7586.c @@ -111,7 +111,7 @@ static int st7586_buf_copy(void *dst, struct iosys_map *src, struct drm_framebuf static void st7586_fb_dirty(struct iosys_map *src, struct drm_framebuffer *fb, struct drm_rect *rect) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->drm); struct mipi_dbi *dbi = &dbidev->dbi; int start, end, ret = 0; @@ -141,7 +141,8 @@ static void st7586_fb_dirty(struct iosys_map *src, struct drm_framebuffer *fb, (end - start) * (rect->y2 - rect->y1)); err_msg: if (ret) - dev_err_once(fb->dev->dev, "Failed to update display %d\n", ret); + dev_err_once(fb->drm->dev, "Failed to update display %d\n", + ret); } static void st7586_pipe_update(struct drm_simple_display_pipe *pipe, @@ -156,7 +157,7 @@ static void st7586_pipe_update(struct drm_simple_display_pipe *pipe, if (!pipe->crtc.state->active) return; - if (!drm_dev_enter(fb->dev, &idx)) + if (!drm_dev_enter(fb->drm, &idx)) return; if (drm_atomic_helper_damage_merged(old_state, state, &rect)) diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c index 5a36bb90dbd3..bc0accd155c6 100644 --- a/drivers/gpu/drm/udl/udl_modeset.c +++ b/drivers/gpu/drm/udl/udl_modeset.c @@ -203,7 +203,7 @@ static int udl_handle_damage(struct drm_framebuffer *fb, const struct iosys_map *map, const struct drm_rect *clip) { - struct drm_device *dev = fb->dev; + struct drm_device *dev = fb->drm; void *vaddr = map->vaddr; /* TODO: Use mapping abstraction properly */ int i, ret; char *cmd; diff --git a/drivers/gpu/drm/vboxvideo/vbox_mode.c b/drivers/gpu/drm/vboxvideo/vbox_mode.c index ea5ceb51bd70..f8f2dc3d3b1b 100644 --- a/drivers/gpu/drm/vboxvideo/vbox_mode.c +++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c @@ -281,7 +281,7 @@ static void vbox_primary_atomic_update(struct drm_plane *plane, plane); struct drm_crtc *crtc = new_state->crtc; struct drm_framebuffer *fb = new_state->fb; - struct vbox_private *vbox = to_vbox_dev(fb->dev); + struct vbox_private *vbox = to_vbox_dev(fb->drm); struct drm_mode_rect *clips; uint32_t num_clips, i; diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c b/drivers/gpu/drm/vkms/vkms_writeback.c index 9850ed02ac76..a4f669f49f6c 100644 --- a/drivers/gpu/drm/vkms/vkms_writeback.c +++ b/drivers/gpu/drm/vkms/vkms_writeback.c @@ -111,7 +111,7 @@ static void vkms_wb_cleanup_job(struct drm_writeback_connector *connector, drm_framebuffer_put(vkmsjob->wb_frame_info.fb); - vkmsdev = drm_device_to_vkms_device(job->fb->dev); + vkmsdev = drm_device_to_vkms_device(job->fb->drm); vkms_set_composer(&vkmsdev->output, false); kfree(vkmsjob); } diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c index a82fa9700370..289165b1b976 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c @@ -142,7 +142,7 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv) */ static int vmw_ldu_fb_pin(struct vmw_framebuffer *vfb) { - struct vmw_private *dev_priv = vmw_priv(vfb->base.dev); + struct vmw_private *dev_priv = vmw_priv(vfb->base.drm); struct vmw_bo *buf; int ret; @@ -165,7 +165,7 @@ static int vmw_ldu_fb_pin(struct vmw_framebuffer *vfb) static int vmw_ldu_fb_unpin(struct vmw_framebuffer *vfb) { - struct vmw_private *dev_priv = vmw_priv(vfb->base.dev); + struct vmw_private *dev_priv = vmw_priv(vfb->base.drm); struct vmw_bo *buf; buf = vfb->bo ? vmw_framebuffer_to_vfbd(&vfb->base)->buffer : diff --git a/drivers/gpu/drm/xen/xen_drm_front_kms.c b/drivers/gpu/drm/xen/xen_drm_front_kms.c index da01d713b87f..65d53f0f992e 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_kms.c +++ b/drivers/gpu/drm/xen/xen_drm_front_kms.c @@ -37,10 +37,10 @@ to_xen_drm_pipeline(struct drm_simple_display_pipe *pipe) static void fb_destroy(struct drm_framebuffer *fb) { - struct xen_drm_front_drm_info *drm_info = fb->dev->dev_private; + struct xen_drm_front_drm_info *drm_info = fb->drm->dev_private; int idx; - if (drm_dev_enter(fb->dev, &idx)) { + if (drm_dev_enter(fb->drm, &idx)) { xen_drm_front_fb_detach(drm_info->front_info, xen_drm_front_fb_to_cookie(fb)); drm_dev_exit(idx); diff --git a/include/drm/drm_framebuffer.h b/include/drm/drm_framebuffer.h index 0dcc07b68654..cb20de345776 100644 --- a/include/drm/drm_framebuffer.h +++ b/include/drm/drm_framebuffer.h @@ -116,9 +116,9 @@ struct drm_framebuffer_funcs { */ struct drm_framebuffer { /** - * @dev: DRM device this framebuffer belongs to + * @drm: DRM device this framebuffer belongs to */ - struct drm_device *dev; + struct drm_device *drm; /** * @head: Place on the &drm_mode_config.fb_list, access protected by * &drm_mode_config.fb_lock. From patchwork Thu Jul 13 08:24:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311546 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AA02BEB64DD for ; Thu, 13 Jul 2023 08:25:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AE0D010E627; Thu, 13 Jul 2023 08:25:29 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id ABA4910E632 for ; Thu, 13 Jul 2023 08:25:24 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrcg-0005yT-KS; Thu, 13 Jul 2023 10:24:26 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrcf-00E4jx-M9; Thu, 13 Jul 2023 10:24:25 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrce-004VhO-8g; Thu, 13 Jul 2023 10:24:24 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 11/17] drm/gem_object: Rename struct drm_gem_object::dev to drm Date: Thu, 13 Jul 2023 10:24:02 +0200 Message-Id: <20230713082408.2266984-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=126676; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=diGv+3Zczl6ixPSF8uZ0PHnLj9OFOFPKrUZPiosht2Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7SWS5Ooz7U4zLRIYsdpOr3SBVU8FaQJtSLja 4MLSNDIQamJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0lgAKCRCPgPtYfRL+ TrKMB/0cRjAH9h5ZO8Xr9wyWt0bQ5Fh9wwQThPjeyrcdHCC7wMRzXad3FGlR5nObMV4+CxrsTMw vfEPZI8sCRJRlrgbFNlAhFY76lDTFhnAM1jM5tl5V176vz/DtqVBogNYRHfCf++Rgywxd4u/3e3 Iw/UhlfyOtKXuk9J89BzEYKJiFryFfeORl5WGVxKS+MZbcATK+zMyHjXUuVf+v9QDFTPmHg0pr/ RoKeFw3FUIZ+eRkolSnHktsyM6Re1uwCJqVwiyPiUZvIHs5Qic+v/kt5L8WsJDBxgeyaXJG5vRK 8eI6yfWi7i00V2wTDauV7Rkui/GOwG+Gx3q47Ht71CFNbWve X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- drivers/accel/ivpu/ivpu_gem.c | 2 +- drivers/accel/ivpu/ivpu_gem.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- drivers/gpu/drm/armada/armada_gem.c | 6 +-- drivers/gpu/drm/drm_gem.c | 14 +++--- drivers/gpu/drm/drm_gem_dma_helper.c | 11 ++--- drivers/gpu/drm/drm_gem_shmem_helper.c | 39 +++++++++-------- drivers/gpu/drm/drm_gem_vram_helper.c | 4 +- drivers/gpu/drm/drm_prime.c | 12 +++--- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 18 ++++---- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_gem.c | 15 ++++--- drivers/gpu/drm/gma500/gem.c | 6 +-- drivers/gpu/drm/i915/display/intel_dpt.c | 2 +- drivers/gpu/drm/i915/display/intel_fb.c | 6 +-- .../gpu/drm/i915/display/intel_frontbuffer.c | 18 ++++---- .../drm/i915/display/skl_universal_plane.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_clflush.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 8 ++-- drivers/gpu/drm/i915/gem/i915_gem_domain.c | 6 +-- drivers/gpu/drm/i915/gem/i915_gem_internal.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 18 ++++---- drivers/gpu/drm/i915/gem/i915_gem_object.c | 26 +++++------ drivers/gpu/drm/i915/gem/i915_gem_object.h | 2 +- drivers/gpu/drm/i915/gem/i915_gem_pages.c | 8 ++-- drivers/gpu/drm/i915/gem/i915_gem_phys.c | 12 +++--- drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 8 ++-- drivers/gpu/drm/i915/gem/i915_gem_tiling.c | 8 ++-- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 24 +++++------ drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 10 ++--- .../gpu/drm/i915/gem/selftests/huge_pages.c | 4 +- .../i915/gem/selftests/i915_gem_client_blt.c | 2 +- .../drm/i915/gem/selftests/i915_gem_context.c | 4 +- .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 4 +- .../drm/i915/gem/selftests/i915_gem_migrate.c | 2 +- .../drm/i915/gem/selftests/i915_gem_mman.c | 8 ++-- drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c | 2 +- drivers/gpu/drm/i915/gt/shmem_utils.c | 2 +- drivers/gpu/drm/i915/gvt/dmabuf.c | 2 +- drivers/gpu/drm/i915/i915_gem.c | 12 +++--- drivers/gpu/drm/i915/i915_gem_gtt.c | 6 +-- drivers/gpu/drm/i915/i915_vma.c | 10 ++--- drivers/gpu/drm/lima/lima_gem.c | 4 +- drivers/gpu/drm/loongson/lsdc_gem.c | 12 +++--- drivers/gpu/drm/loongson/lsdc_ttm.c | 6 +-- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 6 +-- drivers/gpu/drm/msm/msm_gem.c | 42 +++++++++--------- drivers/gpu/drm/msm/msm_gem_prime.c | 2 +- drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +- drivers/gpu/drm/nouveau/nouveau_prime.c | 2 +- drivers/gpu/drm/omapdrm/omap_gem.c | 43 ++++++++++--------- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 4 +- drivers/gpu/drm/panfrost/panfrost_gem.c | 2 +- drivers/gpu/drm/panfrost/panfrost_mmu.c | 4 +- drivers/gpu/drm/qxl/qxl_gem.c | 2 +- drivers/gpu/drm/qxl/qxl_object.c | 4 +- drivers/gpu/drm/qxl/qxl_object.h | 2 +- drivers/gpu/drm/qxl/qxl_release.c | 2 +- drivers/gpu/drm/qxl/qxl_ttm.c | 2 +- drivers/gpu/drm/radeon/radeon_prime.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 23 +++++----- drivers/gpu/drm/tegra/gem.c | 21 ++++----- drivers/gpu/drm/ttm/ttm_bo_util.c | 2 +- drivers/gpu/drm/ttm/ttm_bo_vm.c | 4 +- drivers/gpu/drm/v3d/v3d_bo.c | 4 +- drivers/gpu/drm/v3d/v3d_mmu.c | 4 +- drivers/gpu/drm/vc4/vc4_bo.c | 20 ++++----- drivers/gpu/drm/vc4/vc4_validate.c | 2 +- drivers/gpu/drm/vc4/vc4_validate_shaders.c | 2 +- drivers/gpu/drm/virtio/virtgpu_gem.c | 6 +-- drivers/gpu/drm/virtio/virtgpu_object.c | 4 +- drivers/gpu/drm/virtio/virtgpu_prime.c | 6 +-- drivers/gpu/drm/virtio/virtgpu_vram.c | 8 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 3 +- drivers/gpu/drm/xen/xen_drm_front.c | 4 +- drivers/gpu/drm/xen/xen_drm_front_gem.c | 2 +- include/drm/drm_gem.h | 4 +- 81 files changed, 319 insertions(+), 312 deletions(-) diff --git a/drivers/accel/ivpu/ivpu_gem.c b/drivers/accel/ivpu/ivpu_gem.c index 52b339aefadc..75b78e63acc3 100644 --- a/drivers/accel/ivpu/ivpu_gem.c +++ b/drivers/accel/ivpu/ivpu_gem.c @@ -464,7 +464,7 @@ static struct sg_table *ivpu_bo_get_sg_table(struct drm_gem_object *obj) if (ret) return ERR_PTR(ret); - return drm_prime_pages_to_sg(obj->dev, bo->pages, npages); + return drm_prime_pages_to_sg(obj->drm, bo->pages, npages); } static vm_fault_t ivpu_vm_fault(struct vm_fault *vmf) diff --git a/drivers/accel/ivpu/ivpu_gem.h b/drivers/accel/ivpu/ivpu_gem.h index 6b0ceda5f253..ae6252513fbb 100644 --- a/drivers/accel/ivpu/ivpu_gem.h +++ b/drivers/accel/ivpu/ivpu_gem.h @@ -99,7 +99,7 @@ static inline pgprot_t ivpu_bo_pgprot(struct ivpu_bo *bo, pgprot_t prot) static inline struct ivpu_device *ivpu_bo_to_vdev(struct ivpu_bo *bo) { - return to_ivpu_device(bo->base.dev); + return to_ivpu_device(bo->base.drm); } static inline void *ivpu_to_cpu_addr(struct ivpu_bo *bo, u32 vpu_addr) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c index b4fcad0e62f7..8f7fee850cde 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c @@ -524,11 +524,11 @@ int amdgpu_amdkfd_get_dmabuf_info(struct amdgpu_device *adev, int dma_buf_fd, goto out_put; obj = dma_buf->priv; - if (obj->dev->driver != adev_to_drm(adev)->driver) + if (obj->drm->driver != adev_to_drm(adev)->driver) /* Can't handle buffers from different drivers */ goto out_put; - adev = drm_to_adev(obj->dev); + adev = drm_to_adev(obj->drm); bo = gem_to_amdgpu_bo(obj); if (!(bo->preferred_domains & (AMDGPU_GEM_DOMAIN_VRAM | AMDGPU_GEM_DOMAIN_GTT))) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c index 12210598e5b8..9461cc8c3257 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c @@ -168,7 +168,7 @@ static struct sg_table *amdgpu_dma_buf_map(struct dma_buf_attachment *attach, switch (bo->tbo.resource->mem_type) { case TTM_PL_TT: - sgt = drm_prime_pages_to_sg(obj->dev, + sgt = drm_prime_pages_to_sg(obj->drm, bo->tbo.ttm->pages, bo->tbo.ttm->num_pages); if (IS_ERR(sgt)) @@ -438,7 +438,7 @@ struct drm_gem_object *amdgpu_gem_prime_import(struct drm_device *dev, if (dma_buf->ops == &amdgpu_dmabuf_ops) { obj = dma_buf->priv; - if (obj->dev == dev) { + if (obj->drm == dev) { /* * Importing dmabuf exported from out own gem increases * refcount on gem itself instead of f_count of dmabuf. diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 7da871972a8e..b3340d080e0b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -48,7 +48,7 @@ static const struct drm_gem_object_funcs amdgpu_gem_object_funcs; static vm_fault_t amdgpu_gem_fault(struct vm_fault *vmf) { struct ttm_buffer_object *bo = vmf->vma->vm_private_data; - struct drm_device *ddev = bo->base.dev; + struct drm_device *ddev = bo->base.drm; vm_fault_t ret; int idx; diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c index 26d10065d534..9d1768da4c14 100644 --- a/drivers/gpu/drm/armada/armada_gem.c +++ b/drivers/gpu/drm/armada/armada_gem.c @@ -41,7 +41,7 @@ static size_t roundup_gem_size(size_t size) void armada_gem_free_object(struct drm_gem_object *obj) { struct armada_gem_object *dobj = drm_to_armada_gem(obj); - struct armada_private *priv = drm_to_armada_dev(obj->dev); + struct armada_private *priv = drm_to_armada_dev(obj->drm); DRM_DEBUG_DRIVER("release obj %p\n", dobj); @@ -493,7 +493,7 @@ armada_gem_prime_export(struct drm_gem_object *obj, int flags) exp_info.flags = O_RDWR; exp_info.priv = obj; - return drm_gem_dmabuf_export(obj->dev, &exp_info); + return drm_gem_dmabuf_export(obj->drm, &exp_info); } struct drm_gem_object * @@ -504,7 +504,7 @@ armada_gem_prime_import(struct drm_device *dev, struct dma_buf *buf) if (buf->ops == &armada_gem_prime_dmabuf_ops) { struct drm_gem_object *obj = buf->priv; - if (obj->dev == dev) { + if (obj->drm == dev) { /* * Importing our own dmabuf(s) increases the * refcount on the gem object itself. diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index c18686f434d4..ce9a8a3d281c 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -154,7 +154,7 @@ void drm_gem_private_object_init(struct drm_device *dev, { BUG_ON((size & (PAGE_SIZE - 1)) != 0); - obj->dev = dev; + obj->drm = dev; obj->filp = NULL; kref_init(&obj->refcount); @@ -195,7 +195,7 @@ EXPORT_SYMBOL(drm_gem_private_object_fini); */ static void drm_gem_object_handle_free(struct drm_gem_object *obj) { - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; /* Remove any name for this object */ if (obj->name) { @@ -216,7 +216,7 @@ static void drm_gem_object_exported_dma_buf_free(struct drm_gem_object *obj) static void drm_gem_object_handle_put_unlocked(struct drm_gem_object *obj) { - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; bool final = false; if (WARN_ON(READ_ONCE(obj->handle_count) == 0)) @@ -355,7 +355,7 @@ drm_gem_handle_create_tail(struct drm_file *file_priv, struct drm_gem_object *obj, u32 *handlep) { - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; u32 handle; int ret; @@ -422,7 +422,7 @@ int drm_gem_handle_create(struct drm_file *file_priv, struct drm_gem_object *obj, u32 *handlep) { - mutex_lock(&obj->dev->object_name_lock); + mutex_lock(&obj->drm->object_name_lock); return drm_gem_handle_create_tail(file_priv, obj, handlep); } @@ -442,7 +442,7 @@ EXPORT_SYMBOL(drm_gem_handle_create); void drm_gem_free_mmap_offset(struct drm_gem_object *obj) { - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; drm_vma_offset_remove(dev->vma_offset_manager, &obj->vma_node); } @@ -468,7 +468,7 @@ EXPORT_SYMBOL(drm_gem_free_mmap_offset); int drm_gem_create_mmap_offset_size(struct drm_gem_object *obj, size_t size) { - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; return drm_vma_offset_add(dev->vma_offset_manager, &obj->vma_node, size / PAGE_SIZE); diff --git a/drivers/gpu/drm/drm_gem_dma_helper.c b/drivers/gpu/drm/drm_gem_dma_helper.c index 870b90b78bc4..ff328191cfa5 100644 --- a/drivers/gpu/drm/drm_gem_dma_helper.c +++ b/drivers/gpu/drm/drm_gem_dma_helper.c @@ -234,11 +234,12 @@ void drm_gem_dma_free(struct drm_gem_dma_object *dma_obj) drm_prime_gem_destroy(gem_obj, dma_obj->sgt); } else if (dma_obj->vaddr) { if (dma_obj->map_noncoherent) - dma_free_noncoherent(gem_obj->dev->dev, dma_obj->base.size, + dma_free_noncoherent(gem_obj->drm->dev, + dma_obj->base.size, dma_obj->vaddr, dma_obj->dma_addr, DMA_TO_DEVICE); else - dma_free_wc(gem_obj->dev->dev, dma_obj->base.size, + dma_free_wc(gem_obj->drm->dev, dma_obj->base.size, dma_obj->vaddr, dma_obj->dma_addr); } @@ -428,7 +429,7 @@ struct sg_table *drm_gem_dma_get_sg_table(struct drm_gem_dma_object *dma_obj) if (!sgt) return ERR_PTR(-ENOMEM); - ret = dma_get_sgtable(obj->dev->dev, sgt, dma_obj->vaddr, + ret = dma_get_sgtable(obj->drm->dev, sgt, dma_obj->vaddr, dma_obj->dma_addr, obj->size); if (ret < 0) goto out; @@ -535,11 +536,11 @@ int drm_gem_dma_mmap(struct drm_gem_dma_object *dma_obj, struct vm_area_struct * if (dma_obj->map_noncoherent) { vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); - ret = dma_mmap_pages(dma_obj->base.dev->dev, + ret = dma_mmap_pages(dma_obj->base.drm->dev, vma, vma->vm_end - vma->vm_start, virt_to_page(dma_obj->vaddr)); } else { - ret = dma_mmap_wc(dma_obj->base.dev->dev, vma, dma_obj->vaddr, + ret = dma_mmap_wc(dma_obj->base.drm->dev, vma, dma_obj->vaddr, dma_obj->dma_addr, vma->vm_end - vma->vm_start); } diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index a783d2245599..7c0478f06558 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -144,10 +144,10 @@ void drm_gem_shmem_free(struct drm_gem_shmem_object *shmem) } else { dma_resv_lock(shmem->base.resv, NULL); - drm_WARN_ON(obj->dev, shmem->vmap_use_count); + drm_WARN_ON(obj->drm, shmem->vmap_use_count); if (shmem->sgt) { - dma_unmap_sgtable(obj->dev->dev, shmem->sgt, + dma_unmap_sgtable(obj->drm->dev, shmem->sgt, DMA_BIDIRECTIONAL, 0); sg_free_table(shmem->sgt); kfree(shmem->sgt); @@ -155,7 +155,7 @@ void drm_gem_shmem_free(struct drm_gem_shmem_object *shmem) if (shmem->pages) drm_gem_shmem_put_pages(shmem); - drm_WARN_ON(obj->dev, shmem->pages_use_count); + drm_WARN_ON(obj->drm, shmem->pages_use_count); dma_resv_unlock(shmem->base.resv); } @@ -177,7 +177,7 @@ static int drm_gem_shmem_get_pages(struct drm_gem_shmem_object *shmem) pages = drm_gem_get_pages(obj); if (IS_ERR(pages)) { - drm_dbg_kms(obj->dev, "Failed to get pages (%ld)\n", + drm_dbg_kms(obj->drm, "Failed to get pages (%ld)\n", PTR_ERR(pages)); shmem->pages_use_count = 0; return PTR_ERR(pages); @@ -210,7 +210,7 @@ void drm_gem_shmem_put_pages(struct drm_gem_shmem_object *shmem) dma_resv_assert_held(shmem->base.resv); - if (drm_WARN_ON_ONCE(obj->dev, !shmem->pages_use_count)) + if (drm_WARN_ON_ONCE(obj->drm, !shmem->pages_use_count)) return; if (--shmem->pages_use_count > 0) @@ -261,7 +261,7 @@ int drm_gem_shmem_pin(struct drm_gem_shmem_object *shmem) struct drm_gem_object *obj = &shmem->base; int ret; - drm_WARN_ON(obj->dev, obj->import_attach); + drm_WARN_ON(obj->drm, obj->import_attach); ret = dma_resv_lock_interruptible(shmem->base.resv, NULL); if (ret) @@ -284,7 +284,7 @@ void drm_gem_shmem_unpin(struct drm_gem_shmem_object *shmem) { struct drm_gem_object *obj = &shmem->base; - drm_WARN_ON(obj->dev, obj->import_attach); + drm_WARN_ON(obj->drm, obj->import_attach); dma_resv_lock(shmem->base.resv, NULL); drm_gem_shmem_unpin_locked(shmem); @@ -316,7 +316,7 @@ int drm_gem_shmem_vmap(struct drm_gem_shmem_object *shmem, if (obj->import_attach) { ret = dma_buf_vmap(obj->import_attach->dmabuf, map); if (!ret) { - if (drm_WARN_ON(obj->dev, map->is_iomem)) { + if (drm_WARN_ON(obj->drm, map->is_iomem)) { dma_buf_vunmap(obj->import_attach->dmabuf, map); return -EIO; } @@ -346,7 +346,7 @@ int drm_gem_shmem_vmap(struct drm_gem_shmem_object *shmem, } if (ret) { - drm_dbg_kms(obj->dev, "Failed to vmap pages, error %d\n", ret); + drm_dbg_kms(obj->drm, "Failed to vmap pages, error %d\n", ret); goto err_put_pages; } @@ -384,7 +384,7 @@ void drm_gem_shmem_vunmap(struct drm_gem_shmem_object *shmem, } else { dma_resv_assert_held(shmem->base.resv); - if (drm_WARN_ON_ONCE(obj->dev, !shmem->vmap_use_count)) + if (drm_WARN_ON_ONCE(obj->drm, !shmem->vmap_use_count)) return; if (--shmem->vmap_use_count > 0) @@ -440,11 +440,11 @@ EXPORT_SYMBOL(drm_gem_shmem_madvise); void drm_gem_shmem_purge(struct drm_gem_shmem_object *shmem) { struct drm_gem_object *obj = &shmem->base; - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; dma_resv_assert_held(shmem->base.resv); - drm_WARN_ON(obj->dev, !drm_gem_shmem_is_purgeable(shmem)); + drm_WARN_ON(obj->drm, !drm_gem_shmem_is_purgeable(shmem)); dma_unmap_sgtable(dev->dev, shmem->sgt, DMA_BIDIRECTIONAL, 0); sg_free_table(shmem->sgt); @@ -522,7 +522,7 @@ static vm_fault_t drm_gem_shmem_fault(struct vm_fault *vmf) dma_resv_lock(shmem->base.resv, NULL); if (page_offset >= num_pages || - drm_WARN_ON_ONCE(obj->dev, !shmem->pages) || + drm_WARN_ON_ONCE(obj->drm, !shmem->pages) || shmem->madv < 0) { ret = VM_FAULT_SIGBUS; } else { @@ -541,7 +541,7 @@ static void drm_gem_shmem_vm_open(struct vm_area_struct *vma) struct drm_gem_object *obj = vma->vm_private_data; struct drm_gem_shmem_object *shmem = to_drm_gem_shmem_obj(obj); - drm_WARN_ON(obj->dev, obj->import_attach); + drm_WARN_ON(obj->drm, obj->import_attach); dma_resv_lock(shmem->base.resv, NULL); @@ -550,7 +550,7 @@ static void drm_gem_shmem_vm_open(struct vm_area_struct *vma) * mmap'd, vm_open() just grabs an additional reference for the new * mm the vma is getting copied into (ie. on fork()). */ - if (!drm_WARN_ON_ONCE(obj->dev, !shmem->pages_use_count)) + if (!drm_WARN_ON_ONCE(obj->drm, !shmem->pages_use_count)) shmem->pages_use_count++; dma_resv_unlock(shmem->base.resv); @@ -656,9 +656,10 @@ struct sg_table *drm_gem_shmem_get_sg_table(struct drm_gem_shmem_object *shmem) { struct drm_gem_object *obj = &shmem->base; - drm_WARN_ON(obj->dev, obj->import_attach); + drm_WARN_ON(obj->drm, obj->import_attach); - return drm_prime_pages_to_sg(obj->dev, shmem->pages, obj->size >> PAGE_SHIFT); + return drm_prime_pages_to_sg(obj->drm, shmem->pages, + obj->size >> PAGE_SHIFT); } EXPORT_SYMBOL_GPL(drm_gem_shmem_get_sg_table); @@ -671,7 +672,7 @@ static struct sg_table *drm_gem_shmem_get_pages_sgt_locked(struct drm_gem_shmem_ if (shmem->sgt) return shmem->sgt; - drm_WARN_ON(obj->dev, obj->import_attach); + drm_WARN_ON(obj->drm, obj->import_attach); ret = drm_gem_shmem_get_pages(shmem); if (ret) @@ -683,7 +684,7 @@ static struct sg_table *drm_gem_shmem_get_pages_sgt_locked(struct drm_gem_shmem_ goto err_put_pages; } /* Map the pages for use by the h/w. */ - ret = dma_map_sgtable(obj->dev->dev, sgt, DMA_BIDIRECTIONAL, 0); + ret = dma_map_sgtable(obj->drm->dev, sgt, DMA_BIDIRECTIONAL, 0); if (ret) goto err_free_sgt; diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index fc45a65708b7..54e53ca19482 100644 --- a/drivers/gpu/drm/drm_gem_vram_helper.c +++ b/drivers/gpu/drm/drm_gem_vram_helper.c @@ -395,7 +395,7 @@ static int drm_gem_vram_kmap_locked(struct drm_gem_vram_object *gbo, static void drm_gem_vram_kunmap_locked(struct drm_gem_vram_object *gbo, struct iosys_map *map) { - struct drm_device *dev = gbo->bo.base.dev; + struct drm_device *dev = gbo->bo.base.drm; if (drm_WARN_ON_ONCE(dev, !gbo->vmap_use_count)) return; @@ -552,7 +552,7 @@ static void drm_gem_vram_bo_driver_evict_flags(struct drm_gem_vram_object *gbo, static void drm_gem_vram_bo_driver_move_notify(struct drm_gem_vram_object *gbo) { struct ttm_buffer_object *bo = &gbo->bo; - struct drm_device *dev = bo->base.dev; + struct drm_device *dev = bo->base.drm; if (drm_WARN_ON_ONCE(dev, gbo->vmap_use_count)) return; diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 63b709a67471..f8cc88084be6 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -251,7 +251,7 @@ struct dma_buf *drm_gem_dmabuf_export(struct drm_device *dev, drm_dev_get(dev); drm_gem_object_get(obj); - dma_buf->file->f_mapping = obj->dev->anon_inode->i_mapping; + dma_buf->file->f_mapping = obj->drm->anon_inode->i_mapping; return dma_buf; } @@ -269,7 +269,7 @@ EXPORT_SYMBOL(drm_gem_dmabuf_export); void drm_gem_dmabuf_release(struct dma_buf *dma_buf) { struct drm_gem_object *obj = dma_buf->priv; - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; /* drop the reference on the export fd holds */ drm_gem_object_put(obj); @@ -742,14 +742,14 @@ int drm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) } /* Used by drm_gem_mmap() to lookup the GEM object */ - priv->minor = obj->dev->primary; + priv->minor = obj->drm->primary; fil->private_data = priv; ret = drm_vma_node_allow(&obj->vma_node, priv); if (ret) goto out; - ret = obj->dev->driver->fops->mmap(fil, vma); + ret = obj->drm->driver->fops->mmap(fil, vma); drm_vma_node_revoke(&obj->vma_node, priv); out: @@ -871,7 +871,7 @@ EXPORT_SYMBOL(drm_prime_get_contiguous_size); struct dma_buf *drm_gem_prime_export(struct drm_gem_object *obj, int flags) { - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; struct dma_buf_export_info exp_info = { .exp_name = KBUILD_MODNAME, /* white lie for debug */ .owner = dev->driver->fops->owner, @@ -911,7 +911,7 @@ struct drm_gem_object *drm_gem_prime_import_dev(struct drm_device *dev, if (dma_buf->ops == &drm_gem_prime_dmabuf_ops) { obj = dma_buf->priv; - if (obj->dev == dev) { + if (obj->drm == dev) { /* * Importing dmabuf exported from our own gem increases * refcount on gem itself instead of f_count of dmabuf. diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c index b5f73502e3dd..95827f55ce2b 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c @@ -19,7 +19,7 @@ static struct lock_class_key etnaviv_userptr_lock_class; static void etnaviv_gem_scatter_map(struct etnaviv_gem_object *etnaviv_obj) { - struct drm_device *dev = etnaviv_obj->base.dev; + struct drm_device *dev = etnaviv_obj->base.drm; struct sg_table *sgt = etnaviv_obj->sgt; /* @@ -32,7 +32,7 @@ static void etnaviv_gem_scatter_map(struct etnaviv_gem_object *etnaviv_obj) static void etnaviv_gem_scatterlist_unmap(struct etnaviv_gem_object *etnaviv_obj) { - struct drm_device *dev = etnaviv_obj->base.dev; + struct drm_device *dev = etnaviv_obj->base.drm; struct sg_table *sgt = etnaviv_obj->sgt; /* @@ -57,7 +57,7 @@ static void etnaviv_gem_scatterlist_unmap(struct etnaviv_gem_object *etnaviv_obj /* called with etnaviv_obj->lock held */ static int etnaviv_gem_shmem_get_pages(struct etnaviv_gem_object *etnaviv_obj) { - struct drm_device *dev = etnaviv_obj->base.dev; + struct drm_device *dev = etnaviv_obj->base.drm; struct page **p = drm_gem_get_pages(&etnaviv_obj->base); if (IS_ERR(p)) { @@ -99,11 +99,11 @@ struct page **etnaviv_gem_get_pages(struct etnaviv_gem_object *etnaviv_obj) } if (!etnaviv_obj->sgt) { - struct drm_device *dev = etnaviv_obj->base.dev; + struct drm_device *dev = etnaviv_obj->base.drm; int npages = etnaviv_obj->base.size >> PAGE_SHIFT; struct sg_table *sgt; - sgt = drm_prime_pages_to_sg(etnaviv_obj->base.dev, + sgt = drm_prime_pages_to_sg(etnaviv_obj->base.drm, etnaviv_obj->pages, npages); if (IS_ERR(sgt)) { dev_err(dev->dev, "failed to allocate sgt: %ld\n", @@ -205,7 +205,7 @@ int etnaviv_gem_mmap_offset(struct drm_gem_object *obj, u64 *offset) /* Make it mmapable */ ret = drm_gem_create_mmap_offset(obj); if (ret) - dev_err(obj->dev->dev, "could not allocate mmap offset\n"); + dev_err(obj->drm->dev, "could not allocate mmap offset\n"); else *offset = drm_vma_node_offset_addr(&obj->vma_node); @@ -368,7 +368,7 @@ int etnaviv_gem_cpu_prep(struct drm_gem_object *obj, u32 op, struct drm_etnaviv_timespec *timeout) { struct etnaviv_gem_object *etnaviv_obj = to_etnaviv_bo(obj); - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; bool write = !!(op & ETNA_PREP_WRITE); int ret; @@ -406,7 +406,7 @@ int etnaviv_gem_cpu_prep(struct drm_gem_object *obj, u32 op, int etnaviv_gem_cpu_fini(struct drm_gem_object *obj) { - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; struct etnaviv_gem_object *etnaviv_obj = to_etnaviv_bo(obj); if (etnaviv_obj->flags & ETNA_BO_CACHED) { @@ -487,7 +487,7 @@ static const struct etnaviv_gem_ops etnaviv_gem_shmem_ops = { void etnaviv_gem_free_object(struct drm_gem_object *obj) { struct etnaviv_gem_object *etnaviv_obj = to_etnaviv_bo(obj); - struct etnaviv_drm_private *priv = obj->dev->dev_private; + struct etnaviv_drm_private *priv = obj->drm->dev_private; struct etnaviv_vram_mapping *mapping, *tmp; /* object should not be active */ diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c index 3524b5811682..5bf4d1ee977f 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c @@ -22,7 +22,7 @@ struct sg_table *etnaviv_gem_prime_get_sg_table(struct drm_gem_object *obj) if (WARN_ON(!etnaviv_obj->pages)) /* should have already pinned! */ return ERR_PTR(-EINVAL); - return drm_prime_pages_to_sg(obj->dev, etnaviv_obj->pages, npages); + return drm_prime_pages_to_sg(obj->drm, etnaviv_obj->pages, npages); } int etnaviv_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 638ca96830e9..8ab968881110 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -24,7 +24,7 @@ static int exynos_drm_gem_mmap(struct drm_gem_object *obj, struct vm_area_struct static int exynos_drm_alloc_buf(struct exynos_drm_gem *exynos_gem, bool kvmap) { - struct drm_device *dev = exynos_gem->base.dev; + struct drm_device *dev = exynos_gem->base.drm; unsigned long attr = 0; if (exynos_gem->dma_addr) { @@ -71,7 +71,7 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem *exynos_gem, bool kvmap) static void exynos_drm_free_buf(struct exynos_drm_gem *exynos_gem) { - struct drm_device *dev = exynos_gem->base.dev; + struct drm_device *dev = exynos_gem->base.drm; if (!exynos_gem->dma_addr) { DRM_DEV_DEBUG_KMS(dev->dev, "dma_addr is invalid.\n"); @@ -100,7 +100,8 @@ static int exynos_drm_gem_handle_create(struct drm_gem_object *obj, if (ret) return ret; - DRM_DEV_DEBUG_KMS(to_dma_dev(obj->dev), "gem handle = 0x%x\n", *handle); + DRM_DEV_DEBUG_KMS(to_dma_dev(obj->drm), "gem handle = 0x%x\n", + *handle); /* drop reference from allocate - handle holds it now. */ drm_gem_object_put(obj); @@ -112,7 +113,7 @@ void exynos_drm_gem_destroy(struct exynos_drm_gem *exynos_gem) { struct drm_gem_object *obj = &exynos_gem->base; - DRM_DEV_DEBUG_KMS(to_dma_dev(obj->dev), "handle count = %d\n", + DRM_DEV_DEBUG_KMS(to_dma_dev(obj->drm), "handle count = %d\n", obj->handle_count); /* @@ -270,7 +271,7 @@ struct exynos_drm_gem *exynos_drm_gem_get(struct drm_file *filp, static int exynos_drm_gem_mmap_buffer(struct exynos_drm_gem *exynos_gem, struct vm_area_struct *vma) { - struct drm_device *drm_dev = exynos_gem->base.dev; + struct drm_device *drm_dev = exynos_gem->base.drm; unsigned long vm_size; int ret; @@ -370,7 +371,7 @@ static int exynos_drm_gem_mmap(struct drm_gem_object *obj, struct vm_area_struct vm_flags_set(vma, VM_IO | VM_DONTEXPAND | VM_DONTDUMP); - DRM_DEV_DEBUG_KMS(to_dma_dev(obj->dev), "flags = 0x%x\n", + DRM_DEV_DEBUG_KMS(to_dma_dev(obj->drm), "flags = 0x%x\n", exynos_gem->flags); /* non-cachable as default. */ @@ -405,7 +406,7 @@ struct drm_gem_object *exynos_drm_gem_prime_import(struct drm_device *dev, struct sg_table *exynos_drm_gem_prime_get_sg_table(struct drm_gem_object *obj) { struct exynos_drm_gem *exynos_gem = to_exynos_gem(obj); - struct drm_device *drm_dev = obj->dev; + struct drm_device *drm_dev = obj->drm; struct sg_table *sgt; int ret; diff --git a/drivers/gpu/drm/gma500/gem.c b/drivers/gpu/drm/gma500/gem.c index 4b7627a72637..70d74ae54d56 100644 --- a/drivers/gpu/drm/gma500/gem.c +++ b/drivers/gpu/drm/gma500/gem.c @@ -28,7 +28,7 @@ int psb_gem_pin(struct psb_gem_object *pobj) { struct drm_gem_object *obj = &pobj->base; - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); u32 gpu_base = dev_priv->gtt.gatt_start; struct page **pages; @@ -73,7 +73,7 @@ int psb_gem_pin(struct psb_gem_object *pobj) void psb_gem_unpin(struct psb_gem_object *pobj) { struct drm_gem_object *obj = &pobj->base; - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); u32 gpu_base = dev_priv->gtt.gatt_start; unsigned long npages; @@ -264,7 +264,7 @@ static vm_fault_t psb_gem_fault(struct vm_fault *vmf) struct drm_psb_private *dev_priv; obj = vma->vm_private_data; /* GEM object */ - dev = obj->dev; + dev = obj->drm; dev_priv = to_drm_psb_private(dev); pobj = to_psb_gem_object(obj); diff --git a/drivers/gpu/drm/i915/display/intel_dpt.c b/drivers/gpu/drm/i915/display/intel_dpt.c index b70dd87ab7fb..6122d2fd2115 100644 --- a/drivers/gpu/drm/i915/display/intel_dpt.c +++ b/drivers/gpu/drm/i915/display/intel_dpt.c @@ -242,7 +242,7 @@ struct i915_address_space * intel_dpt_create(struct intel_framebuffer *fb) { struct drm_gem_object *obj = &intel_fb_obj(&fb->base)->base; - struct drm_i915_private *i915 = to_i915(obj->dev); + struct drm_i915_private *i915 = to_i915(obj->drm); struct drm_i915_gem_object *dpt_obj; struct i915_address_space *vm; struct i915_dpt *dpt; diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c index 4109c894abd3..e870a46ce12a 100644 --- a/drivers/gpu/drm/i915/display/intel_fb.c +++ b/drivers/gpu/drm/i915/display/intel_fb.c @@ -1885,7 +1885,7 @@ static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb, unsigned int *handle) { struct drm_i915_gem_object *obj = intel_fb_obj(fb); - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); if (i915_gem_object_is_userptr(obj)) { drm_dbg(&i915->drm, @@ -1920,7 +1920,7 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb, struct drm_i915_gem_object *obj, struct drm_mode_fb_cmd2 *mode_cmd) { - struct drm_i915_private *dev_priv = to_i915(obj->base.dev); + struct drm_i915_private *dev_priv = to_i915(obj->base.drm); struct drm_framebuffer *fb = &intel_fb->base; u32 max_stride; unsigned int tiling, stride; @@ -2089,7 +2089,7 @@ intel_user_framebuffer_create(struct drm_device *dev, return ERR_PTR(-ENOENT); /* object is backed with LMEM for discrete */ - i915 = to_i915(obj->base.dev); + i915 = to_i915(obj->base.drm); if (HAS_LMEM(i915) && !i915_gem_object_can_migrate(obj, INTEL_REGION_LMEM_0)) { /* object is "remote", not in local memory */ i915_gem_object_put(obj); diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c b/drivers/gpu/drm/i915/display/intel_frontbuffer.c index 17a7aa8b28c2..40d4a1e70c96 100644 --- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c +++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c @@ -167,7 +167,7 @@ void __intel_fb_invalidate(struct intel_frontbuffer *front, enum fb_op_origin origin, unsigned int frontbuffer_bits) { - struct drm_i915_private *i915 = to_i915(front->obj->base.dev); + struct drm_i915_private *i915 = to_i915(front->obj->base.drm); if (origin == ORIGIN_CS) { spin_lock(&i915->display.fb_tracking.lock); @@ -188,7 +188,7 @@ void __intel_fb_flush(struct intel_frontbuffer *front, enum fb_op_origin origin, unsigned int frontbuffer_bits) { - struct drm_i915_private *i915 = to_i915(front->obj->base.dev); + struct drm_i915_private *i915 = to_i915(front->obj->base.drm); if (origin == ORIGIN_CS) { spin_lock(&i915->display.fb_tracking.lock); @@ -221,14 +221,14 @@ static void frontbuffer_retire(struct i915_active *ref) } static void frontbuffer_release(struct kref *ref) - __releases(&to_i915(front->obj->base.dev)->display.fb_tracking.lock) + __releases(&to_i915(front->obj->base.drm)->display.fb_tracking.lock) { struct intel_frontbuffer *front = container_of(ref, typeof(*front), ref); struct drm_i915_gem_object *obj = front->obj; struct i915_vma *vma; - drm_WARN_ON(obj->base.dev, atomic_read(&front->bits)); + drm_WARN_ON(obj->base.drm, atomic_read(&front->bits)); spin_lock(&obj->vma.lock); for_each_ggtt_vma(vma, obj) { @@ -238,7 +238,7 @@ static void frontbuffer_release(struct kref *ref) spin_unlock(&obj->vma.lock); RCU_INIT_POINTER(obj->frontbuffer, NULL); - spin_unlock(&to_i915(obj->base.dev)->display.fb_tracking.lock); + spin_unlock(&to_i915(obj->base.drm)->display.fb_tracking.lock); i915_active_fini(&front->write); @@ -249,7 +249,7 @@ static void frontbuffer_release(struct kref *ref) struct intel_frontbuffer * intel_frontbuffer_get(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct intel_frontbuffer *front; front = __intel_frontbuffer_get(obj); @@ -286,7 +286,7 @@ void intel_frontbuffer_put(struct intel_frontbuffer *front) { kref_put_lock(&front->ref, frontbuffer_release, - &to_i915(front->obj->base.dev)->display.fb_tracking.lock); + &to_i915(front->obj->base.drm)->display.fb_tracking.lock); } /** @@ -315,13 +315,13 @@ void intel_frontbuffer_track(struct intel_frontbuffer *old, BUILD_BUG_ON(I915_MAX_PLANES > INTEL_FRONTBUFFER_BITS_PER_PIPE); if (old) { - drm_WARN_ON(old->obj->base.dev, + drm_WARN_ON(old->obj->base.drm, !(atomic_read(&old->bits) & frontbuffer_bits)); atomic_andnot(frontbuffer_bits, &old->bits); } if (new) { - drm_WARN_ON(new->obj->base.dev, + drm_WARN_ON(new->obj->base.drm, atomic_read(&new->bits) & frontbuffer_bits); atomic_or(frontbuffer_bits, &new->bits); } diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c index e4a398224b91..5c02b9b805e2 100644 --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c @@ -1855,7 +1855,7 @@ static bool skl_fb_scalable(const struct drm_framebuffer *fb) static bool bo_has_valid_encryption(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); return intel_pxp_key_check(i915->pxp, obj, false) == 0; } diff --git a/drivers/gpu/drm/i915/gem/i915_gem_clflush.c b/drivers/gpu/drm/i915/gem/i915_gem_clflush.c index 385ffc575b48..9086f474c386 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_clflush.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_clflush.c @@ -72,7 +72,7 @@ static struct clflush *clflush_work_create(struct drm_i915_gem_object *obj) bool i915_gem_clflush_object(struct drm_i915_gem_object *obj, unsigned int flags) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct clflush *clflush; assert_object_held(obj); diff --git a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c index 1df74f7aa3dc..e1b4fe3ca5f1 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c @@ -94,7 +94,7 @@ static void i915_gem_dmabuf_vunmap(struct dma_buf *dma_buf, static int i915_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma) { struct drm_i915_gem_object *obj = dma_buf_to_obj(dma_buf); - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); int ret; if (obj->base.size < vma->vm_end - vma->vm_start) @@ -231,12 +231,12 @@ struct dma_buf *i915_gem_prime_export(struct drm_gem_object *gem_obj, int flags) return ERR_PTR(ret); } - return drm_gem_dmabuf_export(gem_obj->dev, &exp_info); + return drm_gem_dmabuf_export(gem_obj->drm, &exp_info); } static int i915_gem_object_get_pages_dmabuf(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct sg_table *sgt; assert_object_held(obj); @@ -291,7 +291,7 @@ struct drm_gem_object *i915_gem_prime_import(struct drm_device *dev, if (dma_buf->ops == &i915_dmabuf_ops) { obj = dma_buf_to_obj(dma_buf); /* is it from our device? */ - if (obj->base.dev == dev && + if (obj->base.drm == dev && !I915_SELFTEST_ONLY(force_different_devices)) { /* * Importing dmabuf exported from out own gem increases diff --git a/drivers/gpu/drm/i915/gem/i915_gem_domain.c b/drivers/gpu/drm/i915/gem/i915_gem_domain.c index dfaaa8b66ac3..167c0272865a 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_domain.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_domain.c @@ -22,7 +22,7 @@ static bool gpu_write_needs_clflush(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); if (IS_DGFX(i915)) return false; @@ -40,7 +40,7 @@ static bool gpu_write_needs_clflush(struct drm_i915_gem_object *obj) bool i915_gem_cpu_write_needs_clflush(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); if (obj->cache_dirty) return false; @@ -430,7 +430,7 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj, const struct i915_gtt_view *view, unsigned int flags) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct i915_vma *vma; int ret; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_internal.c b/drivers/gpu/drm/i915/gem/i915_gem_internal.c index 6bc26b4b06b8..28e5e6f74c8e 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_internal.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_internal.c @@ -32,7 +32,7 @@ static void internal_free_pages(struct sg_table *st) static int i915_gem_object_get_pages_internal(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct sg_table *st; struct scatterlist *sg; unsigned int npages; /* restricted by sg_alloc_table */ diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c index 4e7a838ab7bd..89ef6b44aa03 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c @@ -295,7 +295,7 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf) struct vm_area_struct *area = vmf->vma; struct i915_mmap_offset *mmo = area->vm_private_data; struct drm_i915_gem_object *obj = mmo->obj; - struct drm_device *dev = obj->base.dev; + struct drm_device *dev = obj->base.drm; struct drm_i915_private *i915 = to_i915(dev); struct intel_runtime_pm *rpm = &i915->runtime_pm; struct i915_ggtt *ggtt = to_gt(i915)->ggtt; @@ -524,7 +524,7 @@ void __i915_gem_object_release_mmap_gtt(struct drm_i915_gem_object *obj) */ void i915_gem_object_release_mmap_gtt(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); intel_wakeref_t wakeref; /* @@ -594,7 +594,7 @@ void i915_gem_object_release_mmap_offset(struct drm_i915_gem_object *obj) spin_unlock(&obj->mmo.lock); drm_vma_node_unmap(&mmo->vma_node, - obj->base.dev->anon_inode->i_mapping); + obj->base.drm->anon_inode->i_mapping); spin_lock(&obj->mmo.lock); } spin_unlock(&obj->mmo.lock); @@ -643,7 +643,7 @@ insert_mmo(struct drm_i915_gem_object *obj, struct i915_mmap_offset *mmo) if (pos->mmap_type == mmo->mmap_type) { spin_unlock(&obj->mmo.lock); - drm_vma_offset_remove(obj->base.dev->vma_offset_manager, + drm_vma_offset_remove(obj->base.drm->vma_offset_manager, &mmo->vma_node); kfree(mmo); return pos; @@ -666,7 +666,7 @@ mmap_offset_attach(struct drm_i915_gem_object *obj, enum i915_mmap_type mmap_type, struct drm_file *file) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct i915_mmap_offset *mmo; int err; @@ -684,7 +684,7 @@ mmap_offset_attach(struct drm_i915_gem_object *obj, mmo->mmap_type = mmap_type; drm_vma_node_reset(&mmo->vma_node); - err = drm_vma_offset_add(obj->base.dev->vma_offset_manager, + err = drm_vma_offset_add(obj->base.drm->vma_offset_manager, &mmo->vma_node, obj->base.size / PAGE_SIZE); if (likely(!err)) goto insert; @@ -696,7 +696,7 @@ mmap_offset_attach(struct drm_i915_gem_object *obj, goto err; i915_gem_drain_freed_objects(i915); - err = drm_vma_offset_add(obj->base.dev->vma_offset_manager, + err = drm_vma_offset_add(obj->base.drm->vma_offset_manager, &mmo->vma_node, obj->base.size / PAGE_SIZE); if (err) goto err; @@ -941,7 +941,7 @@ i915_gem_object_mmap(struct drm_i915_gem_object *obj, struct i915_mmap_offset *mmo, struct vm_area_struct *vma) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct drm_device *dev = &i915->drm; struct file *anon; @@ -1065,7 +1065,7 @@ int i915_gem_mmap(struct file *filp, struct vm_area_struct *vma) int i915_gem_fb_mmap(struct drm_i915_gem_object *obj, struct vm_area_struct *vma) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct drm_device *dev = &i915->drm; struct i915_mmap_offset *mmo = NULL; enum i915_mmap_type mmap_type; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c index 97ac6fb37958..8364fcf66a13 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c @@ -149,7 +149,7 @@ void __i915_gem_object_fini(struct drm_i915_gem_object *obj) void i915_gem_object_set_cache_coherency(struct drm_i915_gem_object *obj, unsigned int cache_level) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); obj->pat_index = i915_gem_get_pat_index(i915, cache_level); @@ -177,7 +177,7 @@ void i915_gem_object_set_cache_coherency(struct drm_i915_gem_object *obj, void i915_gem_object_set_pat_index(struct drm_i915_gem_object *obj, unsigned int pat_index) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); if (obj->pat_index == pat_index) return; @@ -199,7 +199,7 @@ void i915_gem_object_set_pat_index(struct drm_i915_gem_object *obj, bool i915_gem_object_can_bypass_llc(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); /* * This is purely from a security perspective, so we simply don't care @@ -290,7 +290,7 @@ void __i915_gem_free_object_rcu(struct rcu_head *head) { struct drm_i915_gem_object *obj = container_of(head, typeof(*obj), rcu); - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); i915_gem_object_free(obj); @@ -302,7 +302,7 @@ static void __i915_gem_object_free_mmaps(struct drm_i915_gem_object *obj) { /* Skip serialisation and waking the device if known to be not used. */ - if (obj->userfault_count && !IS_DGFX(to_i915(obj->base.dev))) + if (obj->userfault_count && !IS_DGFX(to_i915(obj->base.drm))) i915_gem_object_release_mmap_gtt(obj); if (!RB_EMPTY_ROOT(&obj->mmo.offsets)) { @@ -313,7 +313,7 @@ static void __i915_gem_object_free_mmaps(struct drm_i915_gem_object *obj) rbtree_postorder_for_each_entry_safe(mmo, mn, &obj->mmo.offsets, offset) { - drm_vma_offset_remove(obj->base.dev->vma_offset_manager, + drm_vma_offset_remove(obj->base.drm->vma_offset_manager, &mmo->vma_node); kfree(mmo); } @@ -437,7 +437,7 @@ static void __i915_gem_free_work(struct work_struct *work) static void i915_gem_free_object(struct drm_gem_object *gem_obj) { struct drm_i915_gem_object *obj = to_intel_bo(gem_obj); - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); GEM_BUG_ON(i915_gem_object_is_framebuffer(obj)); @@ -528,7 +528,7 @@ static bool object_has_mappable_iomem(struct drm_i915_gem_object *obj) { GEM_BUG_ON(!i915_gem_object_has_iomem(obj)); - if (IS_DGFX(to_i915(obj->base.dev))) + if (IS_DGFX(to_i915(obj->base.drm))) return i915_ttm_resource_mappable(i915_gem_to_ttm(obj)->resource); return true; @@ -631,7 +631,7 @@ bool i915_gem_object_migratable(struct drm_i915_gem_object *obj) bool i915_gem_object_has_struct_page(const struct drm_i915_gem_object *obj) { #ifdef CONFIG_LOCKDEP - if (IS_DGFX(to_i915(obj->base.dev)) && + if (IS_DGFX(to_i915(obj->base.drm)) && i915_gem_object_evictable((void __force *)obj)) assert_object_held_shared(obj); #endif @@ -650,7 +650,7 @@ bool i915_gem_object_has_struct_page(const struct drm_i915_gem_object *obj) bool i915_gem_object_has_iomem(const struct drm_i915_gem_object *obj) { #ifdef CONFIG_LOCKDEP - if (IS_DGFX(to_i915(obj->base.dev)) && + if (IS_DGFX(to_i915(obj->base.drm)) && i915_gem_object_evictable((void __force *)obj)) assert_object_held_shared(obj); #endif @@ -677,7 +677,7 @@ bool i915_gem_object_has_iomem(const struct drm_i915_gem_object *obj) bool i915_gem_object_can_migrate(struct drm_i915_gem_object *obj, enum intel_region_id id) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); unsigned int num_allowed = obj->mm.n_placements; struct intel_memory_region *mr; unsigned int i; @@ -779,7 +779,7 @@ int __i915_gem_object_migrate(struct drm_i915_gem_object *obj, enum intel_region_id id, unsigned int flags) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct intel_memory_region *mr; GEM_BUG_ON(id >= INTEL_REGION_UNKNOWN); @@ -849,7 +849,7 @@ bool i915_gem_object_needs_ccs_pages(struct drm_i915_gem_object *obj) bool lmem_placement = false; int i; - if (!HAS_FLAT_CCS(to_i915(obj->base.dev))) + if (!HAS_FLAT_CCS(to_i915(obj->base.drm))) return false; if (obj->flags & I915_BO_ALLOC_CCS_AUX) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h index 884a17275b3a..1ee051c25205 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object.h +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h @@ -20,7 +20,7 @@ enum intel_region_id; -#define obj_to_i915(obj__) to_i915((obj__)->base.dev) +#define obj_to_i915(obj__) to_i915((obj__)->base.drm) static inline bool i915_gem_object_size_2big(u64 size) { diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pages.c b/drivers/gpu/drm/i915/gem/i915_gem_pages.c index 89fc8ea6bcfc..8ea50a3933f3 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_pages.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_pages.c @@ -18,7 +18,7 @@ void __i915_gem_object_set_pages(struct drm_i915_gem_object *obj, struct sg_table *pages) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); unsigned long supported = RUNTIME_INFO(i915)->page_sizes; bool shrinkable; int i; @@ -96,7 +96,7 @@ void __i915_gem_object_set_pages(struct drm_i915_gem_object *obj, int ____i915_gem_object_get_pages(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); int err; assert_object_held_shared(obj); @@ -192,7 +192,7 @@ static void unmap_object(struct drm_i915_gem_object *obj, void *ptr) static void flush_tlb_invalidate(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct intel_gt *gt = to_gt(i915); if (!obj->mm.tlb) @@ -411,7 +411,7 @@ void *i915_gem_object_pin_map(struct drm_i915_gem_object *obj, } type = I915_MAP_WC; - } else if (IS_DGFX(to_i915(obj->base.dev))) { + } else if (IS_DGFX(to_i915(obj->base.drm))) { type = I915_MAP_WB; } diff --git a/drivers/gpu/drm/i915/gem/i915_gem_phys.c b/drivers/gpu/drm/i915/gem/i915_gem_phys.c index 76efe98eaa14..e93af6786995 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_phys.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_phys.c @@ -20,7 +20,7 @@ static int i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj) { struct address_space *mapping = obj->base.filp->f_mapping; - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct scatterlist *sg; struct sg_table *st; dma_addr_t dma; @@ -40,7 +40,7 @@ static int i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj) * to handle all possible callers, and given typical object sizes, * the alignment of the buddy allocation will naturally match. */ - vaddr = dma_alloc_coherent(obj->base.dev->dev, + vaddr = dma_alloc_coherent(obj->base.drm->dev, roundup_pow_of_two(obj->base.size), &dma, GFP_KERNEL); if (!vaddr) @@ -90,7 +90,7 @@ static int i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj) err_st: kfree(st); err_pci: - dma_free_coherent(obj->base.dev->dev, + dma_free_coherent(obj->base.drm->dev, roundup_pow_of_two(obj->base.size), vaddr, dma); return -ENOMEM; @@ -136,7 +136,7 @@ i915_gem_object_put_pages_phys(struct drm_i915_gem_object *obj, sg_free_table(pages); kfree(pages); - dma_free_coherent(obj->base.dev->dev, + dma_free_coherent(obj->base.drm->dev, roundup_pow_of_two(obj->base.size), vaddr, dma); } @@ -146,7 +146,7 @@ int i915_gem_object_pwrite_phys(struct drm_i915_gem_object *obj, { void *vaddr = sg_page(obj->mm.pages->sgl) + args->offset; char __user *user_data = u64_to_user_ptr(args->data_ptr); - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); int err; err = i915_gem_object_wait(obj, @@ -247,7 +247,7 @@ int i915_gem_object_attach_phys(struct drm_i915_gem_object *obj, int align) return -EBUSY; if (unlikely(obj->mm.madv != I915_MADV_WILLNEED)) { - drm_dbg(obj->base.dev, + drm_dbg(obj->base.drm, "Attempting to obtain a purgeable object\n"); return -EFAULT; } diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c index 33d5d5178103..e127e271ca6f 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c @@ -194,7 +194,7 @@ int shmem_sg_alloc_table(struct drm_i915_private *i915, struct sg_table *st, static int shmem_get_pages(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct intel_memory_region *mem = obj->mm.region; struct address_space *mapping = obj->base.filp->f_mapping; unsigned int max_segment = i915_sg_segment_size(i915->drm.dev); @@ -358,7 +358,7 @@ __i915_gem_object_release_shmem(struct drm_i915_gem_object *obj, struct sg_table *pages, bool needs_clflush) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); GEM_BUG_ON(obj->mm.madv == __I915_MADV_PURGED); diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c index 3b094d36a0b0..b92faa05abda 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c @@ -621,9 +621,9 @@ i915_pages_create_for_stolen(struct drm_device *dev, static int i915_gem_object_get_pages_stolen(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct sg_table *pages = - i915_pages_create_for_stolen(obj->base.dev, + i915_pages_create_for_stolen(obj->base.drm, obj->stolen->start, obj->stolen->size); if (IS_ERR(pages)) @@ -642,7 +642,7 @@ static int i915_gem_object_get_pages_stolen(struct drm_i915_gem_object *obj) static void i915_gem_object_put_pages_stolen(struct drm_i915_gem_object *obj, struct sg_table *pages) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); /* Should only be called from i915_gem_object_release_stolen() */ dbg_poison(to_gt(i915)->ggtt, @@ -657,7 +657,7 @@ static void i915_gem_object_put_pages_stolen(struct drm_i915_gem_object *obj, static void i915_gem_object_release_stolen(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct drm_mm_node *stolen = fetch_and_zero(&obj->stolen); GEM_BUG_ON(!stolen); diff --git a/drivers/gpu/drm/i915/gem/i915_gem_tiling.c b/drivers/gpu/drm/i915/gem/i915_gem_tiling.c index a049ca0b7980..754080930d3e 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_tiling.c @@ -119,7 +119,7 @@ static bool i915_tiling_ok(struct drm_i915_gem_object *obj, unsigned int tiling, unsigned int stride) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); unsigned int tile_width; /* Linear is always fine */ @@ -183,7 +183,7 @@ static int i915_gem_object_fence_prepare(struct drm_i915_gem_object *obj, int tiling_mode, unsigned int stride) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct i915_ggtt *ggtt = to_gt(i915)->ggtt; struct i915_vma *vma, *vn; LIST_HEAD(unbind); @@ -221,7 +221,7 @@ i915_gem_object_fence_prepare(struct drm_i915_gem_object *obj, bool i915_gem_object_needs_bit17_swizzle(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); return to_gt(i915)->ggtt->bit_6_swizzle_x == I915_BIT_6_SWIZZLE_9_10_17 && i915_gem_object_is_tiled(obj); @@ -231,7 +231,7 @@ int i915_gem_object_set_tiling(struct drm_i915_gem_object *obj, unsigned int tiling, unsigned int stride) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct i915_vma *vma; int err; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c index 9227f8146a58..ad778c7c42e3 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c @@ -310,7 +310,7 @@ static struct ttm_tt *i915_ttm_tt_create(struct ttm_buffer_object *bo, __i915_refct_sgt_init(&i915_tt->cached_rsgt, bo->base.size, &tt_rsgt_ops); - i915_tt->dev = obj->base.dev->dev; + i915_tt->dev = obj->base.drm->dev; return &i915_tt->ttm; @@ -1042,7 +1042,7 @@ static vm_fault_t vm_fault_ttm(struct vm_fault *vmf) { struct vm_area_struct *area = vmf->vma; struct ttm_buffer_object *bo = area->vm_private_data; - struct drm_device *dev = bo->base.dev; + struct drm_device *dev = bo->base.drm; struct drm_i915_gem_object *obj = i915_ttm_to_gem(bo); intel_wakeref_t wakeref = 0; vm_fault_t ret; @@ -1110,7 +1110,7 @@ static vm_fault_t vm_fault_ttm(struct vm_fault *vmf) } if (i915_ttm_cpu_maps_iomem(bo->resource)) - wakeref = intel_runtime_pm_get(&to_i915(obj->base.dev)->runtime_pm); + wakeref = intel_runtime_pm_get(&to_i915(obj->base.drm)->runtime_pm); if (drm_dev_enter(dev, &idx)) { ret = ttm_bo_vm_fault_reserved(vmf, vmf->vma->vm_page_prot, @@ -1129,15 +1129,15 @@ static vm_fault_t vm_fault_ttm(struct vm_fault *vmf) */ if (ret == VM_FAULT_NOPAGE && wakeref && !obj->userfault_count) { obj->userfault_count = 1; - spin_lock(&to_i915(obj->base.dev)->runtime_pm.lmem_userfault_lock); - list_add(&obj->userfault_link, &to_i915(obj->base.dev)->runtime_pm.lmem_userfault_list); - spin_unlock(&to_i915(obj->base.dev)->runtime_pm.lmem_userfault_lock); + spin_lock(&to_i915(obj->base.drm)->runtime_pm.lmem_userfault_lock); + list_add(&obj->userfault_link, &to_i915(obj->base.drm)->runtime_pm.lmem_userfault_list); + spin_unlock(&to_i915(obj->base.drm)->runtime_pm.lmem_userfault_lock); GEM_WARN_ON(!i915_ttm_cpu_maps_iomem(bo->resource)); } if (wakeref & CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND) - intel_wakeref_auto(&to_i915(obj->base.dev)->runtime_pm.userfault_wakeref, + intel_wakeref_auto(&to_i915(obj->base.drm)->runtime_pm.userfault_wakeref, msecs_to_jiffies_timeout(CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND)); i915_ttm_adjust_lru(obj); @@ -1146,7 +1146,7 @@ static vm_fault_t vm_fault_ttm(struct vm_fault *vmf) out_rpm: if (wakeref) - intel_runtime_pm_put(&to_i915(obj->base.dev)->runtime_pm, wakeref); + intel_runtime_pm_put(&to_i915(obj->base.drm)->runtime_pm, wakeref); return ret; } @@ -1205,13 +1205,13 @@ static void i915_ttm_unmap_virtual(struct drm_i915_gem_object *obj) assert_object_held_shared(obj); if (i915_ttm_cpu_maps_iomem(bo->resource)) { - wakeref = intel_runtime_pm_get(&to_i915(obj->base.dev)->runtime_pm); + wakeref = intel_runtime_pm_get(&to_i915(obj->base.drm)->runtime_pm); /* userfault_count is protected by obj lock and rpm wakeref. */ if (obj->userfault_count) { - spin_lock(&to_i915(obj->base.dev)->runtime_pm.lmem_userfault_lock); + spin_lock(&to_i915(obj->base.drm)->runtime_pm.lmem_userfault_lock); list_del(&obj->userfault_link); - spin_unlock(&to_i915(obj->base.dev)->runtime_pm.lmem_userfault_lock); + spin_unlock(&to_i915(obj->base.drm)->runtime_pm.lmem_userfault_lock); obj->userfault_count = 0; } } @@ -1221,7 +1221,7 @@ static void i915_ttm_unmap_virtual(struct drm_i915_gem_object *obj) ttm_bo_unmap_virtual(i915_gem_to_ttm(obj)); if (wakeref) - intel_runtime_pm_put(&to_i915(obj->base.dev)->runtime_pm, wakeref); + intel_runtime_pm_put(&to_i915(obj->base.drm)->runtime_pm, wakeref); } static const struct drm_i915_gem_object_ops i915_gem_ttm_obj_ops = { diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c index 7078af2f8f79..87d9987be741 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c @@ -121,7 +121,7 @@ void i915_ttm_adjust_gem_after_move(struct drm_i915_gem_object *obj) mem_flags = i915_ttm_cpu_maps_iomem(bo->resource) ? I915_BO_FLAG_IOMEM : I915_BO_FLAG_STRUCT_PAGE; mem_type = bo->resource->mem_type; - cache_level = i915_ttm_cache_level(to_i915(bo->base.dev), bo->resource, + cache_level = i915_ttm_cache_level(to_i915(bo->base.drm), bo->resource, bo->ttm); } @@ -473,7 +473,7 @@ __i915_ttm_move(struct ttm_buffer_object *bo, { const bool memcpy_allowed = i915_ttm_memcpy_allowed(bo, dst_mem); struct drm_i915_gem_object *obj = i915_ttm_to_gem(bo); - struct drm_i915_private *i915 = to_i915(bo->base.dev); + struct drm_i915_private *i915 = to_i915(bo->base.drm); struct i915_ttm_memcpy_work *copy_work = NULL; struct i915_ttm_memcpy_arg _arg, *arg = &_arg; struct dma_fence *fence = ERR_PTR(-EINVAL); diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c index 1d3ebdf4069b..a0a313e75af9 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c @@ -62,7 +62,7 @@ static bool i915_gem_userptr_invalidate(struct mmu_interval_notifier *mni, unsigned long cur_seq) { struct drm_i915_gem_object *obj = container_of(mni, struct drm_i915_gem_object, userptr.notifier); - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); long r; if (!mmu_notifier_range_blockable(range)) @@ -128,7 +128,7 @@ static void i915_gem_object_userptr_drop_ref(struct drm_i915_gem_object *obj) static int i915_gem_userptr_get_pages(struct drm_i915_gem_object *obj) { - unsigned int max_segment = i915_sg_segment_size(obj->base.dev->dev); + unsigned int max_segment = i915_sg_segment_size(obj->base.drm->dev); struct sg_table *st; struct page **pvec; unsigned int num_pages; /* limited by sg_alloc_table_from_pages_segment */ @@ -386,7 +386,7 @@ i915_gem_userptr_release(struct drm_i915_gem_object *obj) static int i915_gem_userptr_dmabuf_export(struct drm_i915_gem_object *obj) { - drm_dbg(obj->base.dev, "Exporting userptr no longer allowed\n"); + drm_dbg(obj->base.drm, "Exporting userptr no longer allowed\n"); return -EINVAL; } @@ -395,7 +395,7 @@ static int i915_gem_userptr_pwrite(struct drm_i915_gem_object *obj, const struct drm_i915_gem_pwrite *args) { - drm_dbg(obj->base.dev, "pwrite to userptr no longer allowed\n"); + drm_dbg(obj->base.drm, "pwrite to userptr no longer allowed\n"); return -EINVAL; } @@ -404,7 +404,7 @@ static int i915_gem_userptr_pread(struct drm_i915_gem_object *obj, const struct drm_i915_gem_pread *args) { - drm_dbg(obj->base.dev, "pread from userptr no longer allowed\n"); + drm_dbg(obj->base.drm, "pread from userptr no longer allowed\n"); return -EINVAL; } diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c index df6c9a84252c..90778bc07d67 100644 --- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c +++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c @@ -210,7 +210,7 @@ huge_pages_object(struct drm_i915_private *i915, static int fake_get_huge_pages(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); const u64 max_len = rounddown_pow_of_two(UINT_MAX); struct sg_table *st; struct scatterlist *sg; @@ -265,7 +265,7 @@ static int fake_get_huge_pages(struct drm_i915_gem_object *obj) static int fake_get_huge_pages_single(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct sg_table *st; struct scatterlist *sg; unsigned int page_size; diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c index ff81af4c8202..ce58ec31da89 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c @@ -142,7 +142,7 @@ static int prepare_blit(const struct tiled_blits *t, struct blit_buffer *src, struct drm_i915_gem_object *batch) { - const int ver = GRAPHICS_VER(to_i915(batch->base.dev)); + const int ver = GRAPHICS_VER(to_i915(batch->base.drm)); bool use_64b_reloc = ver >= 8; u32 src_pitch, dst_pitch; u32 cmd, *cs; diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c index 7021b6e9b219..4a3ad4c6f522 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c @@ -476,7 +476,7 @@ static int gpu_fill(struct intel_context *ce, static int cpu_fill(struct drm_i915_gem_object *obj, u32 value) { - const bool has_llc = HAS_LLC(to_i915(obj->base.dev)); + const bool has_llc = HAS_LLC(to_i915(obj->base.drm)); unsigned int need_flush; unsigned long n, m; int err; @@ -941,7 +941,7 @@ emit_rpcs_query(struct drm_i915_gem_object *obj, struct intel_context *ce, struct i915_request **rq_out) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct i915_request *rq; struct i915_gem_ww_ctx ww; struct i915_vma *batch; diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c index e57f9390076c..84db924e560e 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c @@ -284,7 +284,7 @@ static int igt_dmabuf_import_same_driver(struct drm_i915_private *i915, goto out_import; /* Now try a fake an importer */ - import_attach = dma_buf_attach(dmabuf, obj->base.dev->dev); + import_attach = dma_buf_attach(dmabuf, obj->base.drm->dev); if (IS_ERR(import_attach)) { err = PTR_ERR(import_attach); goto out_import; @@ -360,7 +360,7 @@ static int igt_dmabuf_import(void *arg) goto out_dmabuf; } - if (obj->base.dev != &i915->drm) { + if (obj->base.drm != &i915->drm) { pr_err("i915_gem_prime_import created a non-i915 object!\n"); err = -EINVAL; goto out_obj; diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c index a93a90b15907..97e73c1c21f2 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c @@ -15,7 +15,7 @@ static int igt_fill_check_buffer(struct drm_i915_gem_object *obj, bool fill) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); unsigned int i, count = obj->base.size / sizeof(u32); enum i915_map_type map_type = i915_coherent_map_type(i915, obj, false); diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c index a93d8f9f8bc1..2641a532fd84 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c @@ -94,7 +94,7 @@ static int check_partial_mapping(struct drm_i915_gem_object *obj, struct rnd_state *prng) { const unsigned long npages = obj->base.size / PAGE_SIZE; - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct i915_gtt_view view; struct i915_vma *vma; unsigned long offset; @@ -188,7 +188,7 @@ static int check_partial_mappings(struct drm_i915_gem_object *obj, { const unsigned int nreal = obj->scratch / PAGE_SIZE; const unsigned long npages = obj->base.size / PAGE_SIZE; - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct i915_vma *vma; unsigned long page; int err; @@ -539,7 +539,7 @@ static int igt_smoke_tiling(void *arg) static int make_obj_busy(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct intel_engine_cs *engine; for_each_uabi_engine(engine, i915) { @@ -868,7 +868,7 @@ static int wc_check(struct drm_i915_gem_object *obj) static bool can_mmap(struct drm_i915_gem_object *obj, enum i915_mmap_type type) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); bool no_map; if (obj->ops->mmap_offset) diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c b/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c index 37d0b0fe791d..78f11da72393 100644 --- a/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c +++ b/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c @@ -818,7 +818,7 @@ i915_gem_object_save_bit_17_swizzle(struct drm_i915_gem_object *obj, if (obj->bit_17 == NULL) { obj->bit_17 = bitmap_zalloc(page_count, GFP_KERNEL); if (obj->bit_17 == NULL) { - drm_err(&to_i915(obj->base.dev)->drm, + drm_err(&to_i915(obj->base.drm)->drm, "Failed to allocate memory for bit 17 record\n"); return; } diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.c b/drivers/gpu/drm/i915/gt/shmem_utils.c index 449c9ed44382..e0522222e0be 100644 --- a/drivers/gpu/drm/i915/gt/shmem_utils.c +++ b/drivers/gpu/drm/i915/gt/shmem_utils.c @@ -33,7 +33,7 @@ struct file *shmem_create_from_data(const char *name, void *data, size_t len) struct file *shmem_create_from_object(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); enum i915_map_type map_type; struct file *file; void *ptr; diff --git a/drivers/gpu/drm/i915/gvt/dmabuf.c b/drivers/gpu/drm/i915/gvt/dmabuf.c index 6834f9fe40cf..c6fb1a0366dc 100644 --- a/drivers/gpu/drm/i915/gvt/dmabuf.c +++ b/drivers/gpu/drm/i915/gvt/dmabuf.c @@ -44,7 +44,7 @@ static int vgpu_gem_get_pages(struct drm_i915_gem_object *obj) { - struct drm_i915_private *dev_priv = to_i915(obj->base.dev); + struct drm_i915_private *dev_priv = to_i915(obj->base.drm); struct intel_vgpu *vgpu; struct sg_table *st; struct scatterlist *sg; diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 1f65bb33dd21..bf7c85874110 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -117,7 +117,7 @@ i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data, int i915_gem_object_unbind(struct drm_i915_gem_object *obj, unsigned long flags) { - struct intel_runtime_pm *rpm = &to_i915(obj->base.dev)->runtime_pm; + struct intel_runtime_pm *rpm = &to_i915(obj->base.drm)->runtime_pm; bool vm_trylock = !!(flags & I915_GEM_OBJECT_UNBIND_VM_TRYLOCK); LIST_HEAD(still_in_list); intel_wakeref_t wakeref; @@ -305,7 +305,7 @@ static struct i915_vma *i915_gem_gtt_prepare(struct drm_i915_gem_object *obj, struct drm_mm_node *node, bool write) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct i915_ggtt *ggtt = to_gt(i915)->ggtt; struct i915_vma *vma; struct i915_gem_ww_ctx ww; @@ -366,7 +366,7 @@ static void i915_gem_gtt_cleanup(struct drm_i915_gem_object *obj, struct drm_mm_node *node, struct i915_vma *vma) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct i915_ggtt *ggtt = to_gt(i915)->ggtt; i915_gem_object_unpin_pages(obj); @@ -382,7 +382,7 @@ static int i915_gem_gtt_pread(struct drm_i915_gem_object *obj, const struct drm_i915_gem_pread *args) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct i915_ggtt *ggtt = to_gt(i915)->ggtt; unsigned long remain, offset; intel_wakeref_t wakeref; @@ -545,7 +545,7 @@ static int i915_gem_gtt_pwrite_fast(struct drm_i915_gem_object *obj, const struct drm_i915_gem_pwrite *args) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct i915_ggtt *ggtt = to_gt(i915)->ggtt; struct intel_runtime_pm *rpm = &i915->runtime_pm; unsigned long remain, offset; @@ -908,7 +908,7 @@ i915_gem_object_ggtt_pin_ww(struct drm_i915_gem_object *obj, const struct i915_gtt_view *view, u64 size, u64 alignment, u64 flags) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct i915_ggtt *ggtt = to_gt(i915)->ggtt; struct i915_vma *vma; int ret; diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 7bd1861ddbdf..d1891306fa28 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -29,7 +29,7 @@ int i915_gem_gtt_prepare_pages(struct drm_i915_gem_object *obj, struct sg_table *pages) { do { - if (dma_map_sg_attrs(obj->base.dev->dev, + if (dma_map_sg_attrs(obj->base.drm->dev, pages->sgl, pages->nents, DMA_BIDIRECTIONAL, DMA_ATTR_SKIP_CPU_SYNC | @@ -45,7 +45,7 @@ int i915_gem_gtt_prepare_pages(struct drm_i915_gem_object *obj, * the DMA remapper, i915_gem_shrink will return 0. */ GEM_BUG_ON(obj->mm.pages == pages); - } while (i915_gem_shrink(NULL, to_i915(obj->base.dev), + } while (i915_gem_shrink(NULL, to_i915(obj->base.drm), obj->base.size >> PAGE_SHIFT, NULL, I915_SHRINK_BOUND | I915_SHRINK_UNBOUND)); @@ -56,7 +56,7 @@ int i915_gem_gtt_prepare_pages(struct drm_i915_gem_object *obj, void i915_gem_gtt_finish_pages(struct drm_i915_gem_object *obj, struct sg_table *pages) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct i915_ggtt *ggtt = to_gt(i915)->ggtt; /* XXX This does not prevent more requests being submitted! */ diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c index ffb425ba591c..1acff7929fd2 100644 --- a/drivers/gpu/drm/i915/i915_vma.c +++ b/drivers/gpu/drm/i915/i915_vma.c @@ -74,14 +74,14 @@ static void vma_print_allocator(struct i915_vma *vma, const char *reason) char buf[512]; if (!vma->node.stack) { - drm_dbg(&to_i915(vma->obj->base.dev)->drm, + drm_dbg(&to_i915(vma->obj->base.drm)->drm, "vma.node [%08llx + %08llx] %s: unknown owner\n", vma->node.start, vma->node.size, reason); return; } stack_depot_snprint(vma->node.stack, buf, sizeof(buf), 0); - drm_dbg(&to_i915(vma->obj->base.dev)->drm, + drm_dbg(&to_i915(vma->obj->base.drm)->drm, "vma.node [%08llx + %08llx] %s: inserted at %s\n", vma->node.start, vma->node.size, reason, buf); } @@ -805,7 +805,7 @@ i915_vma_insert(struct i915_vma *vma, struct i915_gem_ww_ctx *ww, * attempt to find space. */ if (size > end - 2 * guard) { - drm_dbg(&to_i915(vma->obj->base.dev)->drm, + drm_dbg(&to_i915(vma->obj->base.drm)->drm, "Attempting to bind an object larger than the aperture: request=%llu > %s aperture=%llu\n", size, flags & PIN_MAPPABLE ? "mappable" : "total", end); return -ENOSPC; @@ -985,7 +985,7 @@ intel_rotate_pages(struct intel_rotation_info *rot_info, struct drm_i915_gem_object *obj) { unsigned int size = intel_rotation_info_size(rot_info); - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct sg_table *st; struct scatterlist *sg; int ret = -ENOMEM; @@ -1194,7 +1194,7 @@ intel_remap_pages(struct intel_remapped_info *rem_info, struct drm_i915_gem_object *obj) { unsigned int size = intel_remapped_info_size(rem_info); - struct drm_i915_private *i915 = to_i915(obj->base.dev); + struct drm_i915_private *i915 = to_i915(obj->base.drm); struct sg_table *st; struct scatterlist *sg; unsigned int gtt_offset = 0; diff --git a/drivers/gpu/drm/lima/lima_gem.c b/drivers/gpu/drm/lima/lima_gem.c index 4f9736e5f929..280311199263 100644 --- a/drivers/gpu/drm/lima/lima_gem.c +++ b/drivers/gpu/drm/lima/lima_gem.c @@ -22,7 +22,7 @@ int lima_heap_alloc(struct lima_bo *bo, struct lima_vm *vm) { struct page **pages; struct address_space *mapping = bo->base.base.filp->f_mapping; - struct device *dev = bo->base.base.dev->dev; + struct device *dev = bo->base.base.drm->dev; size_t old_size = bo->heap_size; size_t new_size = bo->heap_size ? bo->heap_size * 2 : (lima_heap_init_nr_pages << PAGE_SHIFT); @@ -150,7 +150,7 @@ static void lima_gem_free_object(struct drm_gem_object *obj) struct lima_bo *bo = to_lima_bo(obj); if (!list_empty(&bo->va)) - dev_err(obj->dev->dev, "lima gem free bo still has va\n"); + dev_err(obj->drm->dev, "lima gem free bo still has va\n"); drm_gem_shmem_free(&bo->base); } diff --git a/drivers/gpu/drm/loongson/lsdc_gem.c b/drivers/gpu/drm/loongson/lsdc_gem.c index 04293df2f0de..a4029fd72df9 100644 --- a/drivers/gpu/drm/loongson/lsdc_gem.c +++ b/drivers/gpu/drm/loongson/lsdc_gem.c @@ -54,11 +54,11 @@ static struct sg_table *lsdc_gem_prime_get_sg_table(struct drm_gem_object *obj) struct ttm_tt *tt = tbo->ttm; if (!tt) { - drm_err(obj->dev, "sharing a buffer without backing memory\n"); + drm_err(obj->drm, "sharing a buffer without backing memory\n"); return ERR_PTR(-ENOMEM); } - return drm_prime_pages_to_sg(obj->dev, tt->pages, tt->num_pages); + return drm_prime_pages_to_sg(obj->drm, tt->pages, tt->num_pages); } static void lsdc_gem_object_free(struct drm_gem_object *obj) @@ -82,13 +82,13 @@ static int lsdc_gem_object_vmap(struct drm_gem_object *obj, struct iosys_map *ma ret = lsdc_bo_pin(lbo, 0, NULL); if (unlikely(ret)) { - drm_err(obj->dev, "pin %p for vmap failed\n", lbo); + drm_err(obj->drm, "pin %p for vmap failed\n", lbo); return ret; } ret = ttm_bo_vmap(tbo, &lbo->map); if (ret) { - drm_err(obj->dev, "ttm bo vmap failed\n"); + drm_err(obj->drm, "ttm bo vmap failed\n"); lsdc_bo_unpin(lbo); return ret; } @@ -107,7 +107,7 @@ static void lsdc_gem_object_vunmap(struct drm_gem_object *obj, struct iosys_map struct lsdc_bo *lbo = to_lsdc_bo(tbo); if (unlikely(!lbo->vmap_count)) { - drm_warn(obj->dev, "%p is not mapped\n", lbo); + drm_warn(obj->drm, "%p is not mapped\n", lbo); return; } @@ -126,7 +126,7 @@ static int lsdc_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_struc ret = ttm_bo_mmap_obj(vma, tbo); if (unlikely(ret)) { - drm_warn(obj->dev, "mmap %p failed\n", tbo); + drm_warn(obj->drm, "mmap %p failed\n", tbo); return ret; } diff --git a/drivers/gpu/drm/loongson/lsdc_ttm.c b/drivers/gpu/drm/loongson/lsdc_ttm.c index bb0c8fd43a75..8674b7d9b678 100644 --- a/drivers/gpu/drm/loongson/lsdc_ttm.c +++ b/drivers/gpu/drm/loongson/lsdc_ttm.c @@ -163,7 +163,7 @@ static int lsdc_bo_move(struct ttm_buffer_object *tbo, struct ttm_resource *new_mem, struct ttm_place *hop) { - struct drm_device *ddev = tbo->base.dev; + struct drm_device *ddev = tbo->base.drm; struct ttm_resource *old_mem = tbo->resource; struct lsdc_bo *lbo = to_lsdc_bo(tbo); int ret; @@ -254,7 +254,7 @@ static struct ttm_device_funcs lsdc_bo_driver = { u64 lsdc_bo_gpu_offset(struct lsdc_bo *lbo) { struct ttm_buffer_object *tbo = &lbo->tbo; - struct drm_device *ddev = tbo->base.dev; + struct drm_device *ddev = tbo->base.drm; struct ttm_resource *resource = tbo->resource; if (unlikely(!tbo->pin_count)) { @@ -359,7 +359,7 @@ int lsdc_bo_kmap(struct lsdc_bo *lbo) { struct ttm_buffer_object *tbo = &lbo->tbo; struct drm_gem_object *gem = &tbo->base; - struct drm_device *ddev = gem->dev; + struct drm_device *ddev = gem->drm; long ret; int err; diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c index a25b28d3ee90..852f1cdaf31c 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c @@ -100,7 +100,7 @@ struct mtk_drm_gem_obj *mtk_drm_gem_create(struct drm_device *dev, void mtk_drm_gem_free_object(struct drm_gem_object *obj) { struct mtk_drm_gem_obj *mtk_gem = to_mtk_gem_obj(obj); - struct mtk_drm_private *priv = obj->dev->dev_private; + struct mtk_drm_private *priv = obj->drm->dev_private; if (mtk_gem->sg) drm_prime_gem_destroy(obj, mtk_gem->sg); @@ -151,7 +151,7 @@ static int mtk_drm_gem_object_mmap(struct drm_gem_object *obj, { int ret; struct mtk_drm_gem_obj *mtk_gem = to_mtk_gem_obj(obj); - struct mtk_drm_private *priv = obj->dev->dev_private; + struct mtk_drm_private *priv = obj->drm->dev_private; /* * Set vm_pgoff (used as a fake buffer offset by DRM) to 0 and map the @@ -182,7 +182,7 @@ static int mtk_drm_gem_object_mmap(struct drm_gem_object *obj, struct sg_table *mtk_gem_prime_get_sg_table(struct drm_gem_object *obj) { struct mtk_drm_gem_obj *mtk_gem = to_mtk_gem_obj(obj); - struct mtk_drm_private *priv = obj->dev->dev_private; + struct mtk_drm_private *priv = obj->drm->dev_private; struct sg_table *sgt; int ret; diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index 635744bc4765..8866fe7297ee 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -22,7 +22,7 @@ static dma_addr_t physaddr(struct drm_gem_object *obj) { struct msm_gem_object *msm_obj = to_msm_bo(obj); - struct msm_drm_private *priv = obj->dev->dev_private; + struct msm_drm_private *priv = obj->drm->dev_private; return (((dma_addr_t)msm_obj->vram_node->start) << PAGE_SHIFT) + priv->vram.paddr; } @@ -49,21 +49,21 @@ static bool use_pages(struct drm_gem_object *obj) static void sync_for_device(struct msm_gem_object *msm_obj) { - struct device *dev = msm_obj->base.dev->dev; + struct device *dev = msm_obj->base.drm->dev; dma_map_sgtable(dev, msm_obj->sgt, DMA_BIDIRECTIONAL, 0); } static void sync_for_cpu(struct msm_gem_object *msm_obj) { - struct device *dev = msm_obj->base.dev->dev; + struct device *dev = msm_obj->base.drm->dev; dma_unmap_sgtable(dev, msm_obj->sgt, DMA_BIDIRECTIONAL, 0); } static void update_lru_active(struct drm_gem_object *obj) { - struct msm_drm_private *priv = obj->dev->dev_private; + struct msm_drm_private *priv = obj->drm->dev_private; struct msm_gem_object *msm_obj = to_msm_bo(obj); GEM_WARN_ON(!msm_obj->pages); @@ -81,7 +81,7 @@ static void update_lru_active(struct drm_gem_object *obj) static void update_lru_locked(struct drm_gem_object *obj) { - struct msm_drm_private *priv = obj->dev->dev_private; + struct msm_drm_private *priv = obj->drm->dev_private; struct msm_gem_object *msm_obj = to_msm_bo(obj); msm_gem_assert_locked(&msm_obj->base); @@ -97,7 +97,7 @@ static void update_lru_locked(struct drm_gem_object *obj) static void update_lru(struct drm_gem_object *obj) { - struct msm_drm_private *priv = obj->dev->dev_private; + struct msm_drm_private *priv = obj->drm->dev_private; mutex_lock(&priv->lru.lock); update_lru_locked(obj); @@ -108,7 +108,7 @@ static void update_lru(struct drm_gem_object *obj) static struct page **get_pages_vram(struct drm_gem_object *obj, int npages) { struct msm_gem_object *msm_obj = to_msm_bo(obj); - struct msm_drm_private *priv = obj->dev->dev_private; + struct msm_drm_private *priv = obj->drm->dev_private; dma_addr_t paddr; struct page **p; int ret, i; @@ -141,7 +141,7 @@ static struct page **get_pages(struct drm_gem_object *obj) msm_gem_assert_locked(obj); if (!msm_obj->pages) { - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; struct page **p; int npages = obj->size >> PAGE_SHIFT; @@ -158,7 +158,7 @@ static struct page **get_pages(struct drm_gem_object *obj) msm_obj->pages = p; - msm_obj->sgt = drm_prime_pages_to_sg(obj->dev, p, npages); + msm_obj->sgt = drm_prime_pages_to_sg(obj->drm, p, npages); if (IS_ERR(msm_obj->sgt)) { void *ptr = ERR_CAST(msm_obj->sgt); @@ -182,7 +182,7 @@ static struct page **get_pages(struct drm_gem_object *obj) static void put_pages_vram(struct drm_gem_object *obj) { struct msm_gem_object *msm_obj = to_msm_bo(obj); - struct msm_drm_private *priv = obj->dev->dev_private; + struct msm_drm_private *priv = obj->drm->dev_private; spin_lock(&priv->vram.lock); drm_mm_remove_node(msm_obj->vram_node); @@ -222,15 +222,15 @@ static void put_pages(struct drm_gem_object *obj) static struct page **msm_gem_pin_pages_locked(struct drm_gem_object *obj, unsigned madv) { - struct msm_drm_private *priv = obj->dev->dev_private; + struct msm_drm_private *priv = obj->drm->dev_private; struct msm_gem_object *msm_obj = to_msm_bo(obj); struct page **p; msm_gem_assert_locked(obj); if (GEM_WARN_ON(msm_obj->madv > madv)) { - DRM_DEV_ERROR(obj->dev->dev, "Invalid madv state: %u vs %u\n", - msm_obj->madv, madv); + DRM_DEV_ERROR(obj->drm->dev, "Invalid madv state: %u vs %u\n", + msm_obj->madv, madv); return ERR_PTR(-EBUSY); } @@ -323,7 +323,7 @@ static vm_fault_t msm_gem_fault(struct vm_fault *vmf) /** get mmap offset */ static uint64_t mmap_offset(struct drm_gem_object *obj) { - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; int ret; msm_gem_assert_locked(obj); @@ -489,7 +489,7 @@ int msm_gem_pin_vma_locked(struct drm_gem_object *obj, struct msm_gem_vma *vma) void msm_gem_unpin_locked(struct drm_gem_object *obj) { - struct msm_drm_private *priv = obj->dev->dev_private; + struct msm_drm_private *priv = obj->drm->dev_private; struct msm_gem_object *msm_obj = to_msm_bo(obj); msm_gem_assert_locked(obj); @@ -509,7 +509,7 @@ void msm_gem_unpin_locked(struct drm_gem_object *obj) */ void msm_gem_unpin_active(struct drm_gem_object *obj) { - struct msm_drm_private *priv = obj->dev->dev_private; + struct msm_drm_private *priv = obj->drm->dev_private; struct msm_gem_object *msm_obj = to_msm_bo(obj); mutex_lock(&priv->lru.lock); @@ -778,7 +778,7 @@ void msm_gem_put_vaddr(struct drm_gem_object *obj) */ int msm_gem_madvise(struct drm_gem_object *obj, unsigned madv) { - struct msm_drm_private *priv = obj->dev->dev_private; + struct msm_drm_private *priv = obj->drm->dev_private; struct msm_gem_object *msm_obj = to_msm_bo(obj); msm_gem_lock(obj); @@ -804,8 +804,8 @@ int msm_gem_madvise(struct drm_gem_object *obj, unsigned madv) void msm_gem_purge(struct drm_gem_object *obj) { - struct drm_device *dev = obj->dev; - struct msm_drm_private *priv = obj->dev->dev_private; + struct drm_device *dev = obj->drm; + struct msm_drm_private *priv = obj->drm->dev_private; struct msm_gem_object *msm_obj = to_msm_bo(obj); msm_gem_assert_locked(obj); @@ -845,7 +845,7 @@ void msm_gem_purge(struct drm_gem_object *obj) */ void msm_gem_evict(struct drm_gem_object *obj) { - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; struct msm_gem_object *msm_obj = to_msm_bo(obj); msm_gem_assert_locked(obj); @@ -1025,7 +1025,7 @@ void msm_gem_describe_objects(struct list_head *list, struct seq_file *m) static void msm_gem_free_object(struct drm_gem_object *obj) { struct msm_gem_object *msm_obj = to_msm_bo(obj); - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; struct msm_drm_private *priv = dev->dev_private; mutex_lock(&priv->obj_lock); diff --git a/drivers/gpu/drm/msm/msm_gem_prime.c b/drivers/gpu/drm/msm/msm_gem_prime.c index 5f68e31a3e4e..94f587465435 100644 --- a/drivers/gpu/drm/msm/msm_gem_prime.c +++ b/drivers/gpu/drm/msm/msm_gem_prime.c @@ -19,7 +19,7 @@ struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj) if (WARN_ON(!msm_obj->pages)) /* should have already pinned! */ return ERR_PTR(-ENOMEM); - return drm_prime_pages_to_sg(obj->dev, msm_obj->pages, npages); + return drm_prime_pages_to_sg(obj->drm, msm_obj->pages, npages); } int msm_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index c2ec91cc845d..99ca043c6da4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -148,7 +148,7 @@ nouveau_bo_del_ttm(struct ttm_buffer_object *bo) * If nouveau_bo_new() allocated this buffer, the GEM object was never * initialized, so don't attempt to release it. */ - if (bo->base.dev) + if (bo->base.drm) drm_gem_object_release(&bo->base); else dma_resv_fini(&bo->base._resv); diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c index f42c2b1b0363..b90570f26350 100644 --- a/drivers/gpu/drm/nouveau/nouveau_prime.c +++ b/drivers/gpu/drm/nouveau/nouveau_prime.c @@ -32,7 +32,7 @@ struct sg_table *nouveau_gem_prime_get_sg_table(struct drm_gem_object *obj) { struct nouveau_bo *nvbo = nouveau_gem_object(obj); - return drm_prime_pages_to_sg(obj->dev, nvbo->bo.ttm->pages, + return drm_prime_pages_to_sg(obj->drm, nvbo->bo.ttm->pages, nvbo->bo.ttm->num_pages); } diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index 6b58a5bb7b44..b2b49819484d 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -133,7 +133,7 @@ struct omap_drm_usergart { /** get mmap offset */ u64 omap_gem_mmap_offset(struct drm_gem_object *obj) { - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; int ret; size_t size; @@ -167,7 +167,7 @@ static void omap_gem_evict_entry(struct drm_gem_object *obj, enum tiler_fmt fmt, struct omap_drm_usergart_entry *entry) { struct omap_gem_object *omap_obj = to_omap_bo(obj); - struct omap_drm_private *priv = obj->dev->dev_private; + struct omap_drm_private *priv = obj->drm->dev_private; int n = priv->usergart[fmt].height; size_t size = PAGE_SIZE * n; loff_t off = omap_gem_mmap_offset(obj) + @@ -178,12 +178,12 @@ static void omap_gem_evict_entry(struct drm_gem_object *obj, int i; /* if stride > than PAGE_SIZE then sparse mapping: */ for (i = n; i > 0; i--) { - unmap_mapping_range(obj->dev->anon_inode->i_mapping, + unmap_mapping_range(obj->drm->anon_inode->i_mapping, off, PAGE_SIZE, 1); off += PAGE_SIZE * m; } } else { - unmap_mapping_range(obj->dev->anon_inode->i_mapping, + unmap_mapping_range(obj->drm->anon_inode->i_mapping, off, size, 1); } @@ -194,7 +194,7 @@ static void omap_gem_evict_entry(struct drm_gem_object *obj, static void omap_gem_evict(struct drm_gem_object *obj) { struct omap_gem_object *omap_obj = to_omap_bo(obj); - struct omap_drm_private *priv = obj->dev->dev_private; + struct omap_drm_private *priv = obj->drm->dev_private; if (omap_obj->flags & OMAP_BO_TILED_MASK) { enum tiler_fmt fmt = gem2fmt(omap_obj->flags); @@ -220,7 +220,7 @@ static void omap_gem_evict(struct drm_gem_object *obj) */ static int omap_gem_attach_pages(struct drm_gem_object *obj) { - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; struct omap_gem_object *omap_obj = to_omap_bo(obj); struct page **pages; int npages = obj->size >> PAGE_SHIFT; @@ -238,7 +238,8 @@ static int omap_gem_attach_pages(struct drm_gem_object *obj) pages = drm_gem_get_pages(obj); if (IS_ERR(pages)) { - dev_err(obj->dev->dev, "could not get pages: %ld\n", PTR_ERR(pages)); + dev_err(obj->drm->dev, "could not get pages: %ld\n", + PTR_ERR(pages)); return PTR_ERR(pages); } @@ -301,7 +302,7 @@ static void omap_gem_detach_pages(struct drm_gem_object *obj) for (i = 0; i < npages; i++) { if (omap_obj->dma_addrs[i]) - dma_unmap_page(obj->dev->dev, omap_obj->dma_addrs[i], + dma_unmap_page(obj->drm->dev, omap_obj->dma_addrs[i], PAGE_SIZE, DMA_TO_DEVICE); } @@ -373,7 +374,7 @@ static vm_fault_t omap_gem_fault_2d(struct drm_gem_object *obj, struct vm_area_struct *vma, struct vm_fault *vmf) { struct omap_gem_object *omap_obj = to_omap_bo(obj); - struct omap_drm_private *priv = obj->dev->dev_private; + struct omap_drm_private *priv = obj->drm->dev_private; struct omap_drm_usergart_entry *entry; enum tiler_fmt fmt = gem2fmt(omap_obj->flags); struct page *pages[64]; /* XXX is this too much to have on stack? */ @@ -450,7 +451,7 @@ static vm_fault_t omap_gem_fault_2d(struct drm_gem_object *obj, err = tiler_pin(entry->block, pages, ARRAY_SIZE(pages), 0, true); if (err) { ret = vmf_error(err); - dev_err(obj->dev->dev, "failed to pin: %d\n", err); + dev_err(obj->drm->dev, "failed to pin: %d\n", err); return ret; } @@ -647,7 +648,7 @@ int omap_gem_roll(struct drm_gem_object *obj, u32 roll) int ret = 0; if (roll > npages) { - dev_err(obj->dev->dev, "invalid roll: %d\n", roll); + dev_err(obj->drm->dev, "invalid roll: %d\n", roll); return -EINVAL; } @@ -664,7 +665,7 @@ int omap_gem_roll(struct drm_gem_object *obj, u32 roll) ret = tiler_pin(omap_obj->block, omap_obj->pages, npages, roll, true); if (ret) - dev_err(obj->dev->dev, "could not repin: %d\n", ret); + dev_err(obj->drm->dev, "could not repin: %d\n", ret); } fail: @@ -700,7 +701,7 @@ static inline bool omap_gem_is_cached_coherent(struct drm_gem_object *obj) */ void omap_gem_cpu_sync_page(struct drm_gem_object *obj, int pgoff) { - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; struct omap_gem_object *omap_obj = to_omap_bo(obj); if (omap_gem_is_cached_coherent(obj)) @@ -717,7 +718,7 @@ void omap_gem_cpu_sync_page(struct drm_gem_object *obj, int pgoff) void omap_gem_dma_sync_buffer(struct drm_gem_object *obj, enum dma_data_direction dir) { - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; struct omap_gem_object *omap_obj = to_omap_bo(obj); int i, npages = obj->size >> PAGE_SHIFT; struct page **pages = omap_obj->pages; @@ -768,7 +769,7 @@ static int omap_gem_pin_tiler(struct drm_gem_object *obj) if (IS_ERR(block)) { ret = PTR_ERR(block); - dev_err(obj->dev->dev, "could not remap: %d (%d)\n", ret, fmt); + dev_err(obj->drm->dev, "could not remap: %d (%d)\n", ret, fmt); goto fail; } @@ -776,7 +777,7 @@ static int omap_gem_pin_tiler(struct drm_gem_object *obj) ret = tiler_pin(block, omap_obj->pages, npages, omap_obj->roll, true); if (ret) { tiler_release(block); - dev_err(obj->dev->dev, "could not pin: %d\n", ret); + dev_err(obj->drm->dev, "could not pin: %d\n", ret); goto fail; } @@ -805,7 +806,7 @@ static int omap_gem_pin_tiler(struct drm_gem_object *obj) */ int omap_gem_pin(struct drm_gem_object *obj, dma_addr_t *dma_addr) { - struct omap_drm_private *priv = obj->dev->dev_private; + struct omap_drm_private *priv = obj->drm->dev_private; struct omap_gem_object *omap_obj = to_omap_bo(obj); int ret = 0; @@ -849,7 +850,7 @@ int omap_gem_pin(struct drm_gem_object *obj, dma_addr_t *dma_addr) */ static void omap_gem_unpin_locked(struct drm_gem_object *obj) { - struct omap_drm_private *priv = obj->dev->dev_private; + struct omap_drm_private *priv = obj->drm->dev_private; struct omap_gem_object *omap_obj = to_omap_bo(obj); int ret; @@ -867,12 +868,12 @@ static void omap_gem_unpin_locked(struct drm_gem_object *obj) if (priv->has_dmm) { ret = tiler_unpin(omap_obj->block); if (ret) { - dev_err(obj->dev->dev, + dev_err(obj->drm->dev, "could not unpin pages: %d\n", ret); } ret = tiler_release(omap_obj->block); if (ret) { - dev_err(obj->dev->dev, + dev_err(obj->drm->dev, "could not release unmap: %d\n", ret); } omap_obj->dma_addr = 0; @@ -1195,7 +1196,7 @@ void omap_gem_describe_objects(struct list_head *list, struct seq_file *m) static void omap_gem_free_object(struct drm_gem_object *obj) { - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; struct omap_drm_private *priv = dev->dev_private; struct omap_gem_object *omap_obj = to_omap_bo(obj); diff --git a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c index 8e194dbc9506..f00a811d716a 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c +++ b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c @@ -92,7 +92,7 @@ struct dma_buf *omap_gem_prime_export(struct drm_gem_object *obj, int flags) exp_info.priv = obj; exp_info.resv = obj->resv; - return drm_gem_dmabuf_export(obj->dev, &exp_info); + return drm_gem_dmabuf_export(obj->drm, &exp_info); } /* ----------------------------------------------------------------------------- @@ -109,7 +109,7 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev, if (dma_buf->ops == &omap_dmabuf_ops) { obj = dma_buf->priv; - if (obj->dev == dev) { + if (obj->drm == dev) { /* * Importing dmabuf exported from out own gem increases * refcount on gem itself instead of f_count of dmabuf. diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c index 3c812fbd126f..8c3eebcad5a5 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gem.c +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c @@ -17,7 +17,7 @@ static void panfrost_gem_free_object(struct drm_gem_object *obj) { struct panfrost_gem_object *bo = to_panfrost_bo(obj); - struct panfrost_device *pfdev = obj->dev->dev_private; + struct panfrost_device *pfdev = obj->drm->dev_private; /* * Make sure the BO is no longer inserted in the shrinker list before diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index c0123d09f699..8d4e94725310 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -323,7 +323,7 @@ int panfrost_mmu_map(struct panfrost_gem_mapping *mapping) struct panfrost_gem_object *bo = mapping->obj; struct drm_gem_shmem_object *shmem = &bo->base; struct drm_gem_object *obj = &shmem->base; - struct panfrost_device *pfdev = to_panfrost_device(obj->dev); + struct panfrost_device *pfdev = to_panfrost_device(obj->drm); struct sg_table *sgt; int prot = IOMMU_READ | IOMMU_WRITE; @@ -348,7 +348,7 @@ void panfrost_mmu_unmap(struct panfrost_gem_mapping *mapping) { struct panfrost_gem_object *bo = mapping->obj; struct drm_gem_object *obj = &bo->base.base; - struct panfrost_device *pfdev = to_panfrost_device(obj->dev); + struct panfrost_device *pfdev = to_panfrost_device(obj->drm); struct io_pgtable_ops *ops = mapping->mmu->pgtbl_ops; u64 iova = mapping->mmnode.start << PAGE_SHIFT; size_t len = mapping->mmnode.size << PAGE_SHIFT; diff --git a/drivers/gpu/drm/qxl/qxl_gem.c b/drivers/gpu/drm/qxl/qxl_gem.c index a08da0bd9098..d3b8dae3e55e 100644 --- a/drivers/gpu/drm/qxl/qxl_gem.c +++ b/drivers/gpu/drm/qxl/qxl_gem.c @@ -34,7 +34,7 @@ void qxl_gem_object_free(struct drm_gem_object *gobj) struct qxl_device *qdev; struct ttm_buffer_object *tbo; - qdev = to_qxl(gobj->dev); + qdev = to_qxl(gobj->drm); qxl_surface_evict(qdev, qobj, false); diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c index 06a58dad5f5c..4d3f5cec26ce 100644 --- a/drivers/gpu/drm/qxl/qxl_object.c +++ b/drivers/gpu/drm/qxl/qxl_object.c @@ -38,7 +38,7 @@ static void qxl_ttm_bo_destroy(struct ttm_buffer_object *tbo) struct qxl_device *qdev; bo = to_qxl_bo(tbo); - qdev = to_qxl(bo->tbo.base.dev); + qdev = to_qxl(bo->tbo.base.drm); qxl_surface_evict(qdev, bo, false); WARN_ON_ONCE(bo->map_count > 0); @@ -295,7 +295,7 @@ struct qxl_bo *qxl_bo_ref(struct qxl_bo *bo) static int __qxl_bo_pin(struct qxl_bo *bo) { struct ttm_operation_ctx ctx = { false, false }; - struct drm_device *ddev = bo->tbo.base.dev; + struct drm_device *ddev = bo->tbo.base.drm; int r; if (bo->tbo.pin_count) { diff --git a/drivers/gpu/drm/qxl/qxl_object.h b/drivers/gpu/drm/qxl/qxl_object.h index 53392cb90eec..1cc9e9d2e432 100644 --- a/drivers/gpu/drm/qxl/qxl_object.h +++ b/drivers/gpu/drm/qxl/qxl_object.h @@ -34,7 +34,7 @@ static inline int qxl_bo_reserve(struct qxl_bo *bo) r = ttm_bo_reserve(&bo->tbo, true, false, NULL); if (unlikely(r != 0)) { if (r != -ERESTARTSYS) { - struct drm_device *ddev = bo->tbo.base.dev; + struct drm_device *ddev = bo->tbo.base.drm; dev_err(ddev->dev, "%p reserve failed\n", bo); } diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c index 368d26da0d6a..e82d959a9517 100644 --- a/drivers/gpu/drm/qxl/qxl_release.c +++ b/drivers/gpu/drm/qxl/qxl_release.c @@ -205,7 +205,7 @@ static int qxl_release_validate_bo(struct qxl_bo *bo) return ret; /* allocate a surface for reserved + validated buffers */ - ret = qxl_bo_check_id(to_qxl(bo->tbo.base.dev), bo); + ret = qxl_bo_check_id(to_qxl(bo->tbo.base.drm), bo); if (ret) return ret; return 0; diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c index 1a82629bce3f..708ef211be07 100644 --- a/drivers/gpu/drm/qxl/qxl_ttm.c +++ b/drivers/gpu/drm/qxl/qxl_ttm.c @@ -129,7 +129,7 @@ static void qxl_bo_move_notify(struct ttm_buffer_object *bo, if (!qxl_ttm_bo_is_qxl_bo(bo) || !bo->resource) return; qbo = to_qxl_bo(bo); - qdev = to_qxl(qbo->tbo.base.dev); + qdev = to_qxl(qbo->tbo.base.drm); if (bo->resource->mem_type == TTM_PL_PRIV && qbo->surface_id) qxl_surface_evict(qdev, qbo, new_mem ? true : false); diff --git a/drivers/gpu/drm/radeon/radeon_prime.c b/drivers/gpu/drm/radeon/radeon_prime.c index b3cfc99f4d7e..8b2342c20909 100644 --- a/drivers/gpu/drm/radeon/radeon_prime.c +++ b/drivers/gpu/drm/radeon/radeon_prime.c @@ -38,7 +38,7 @@ struct sg_table *radeon_gem_prime_get_sg_table(struct drm_gem_object *obj) { struct radeon_bo *bo = gem_to_radeon_bo(obj); - return drm_prime_pages_to_sg(obj->dev, bo->tbo.ttm->pages, + return drm_prime_pages_to_sg(obj->drm, bo->tbo.ttm->pages, bo->tbo.ttm->num_pages); } diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index b8f8b45ebf59..fa91155a7dc0 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -20,7 +20,7 @@ static int rockchip_gem_iommu_map(struct rockchip_gem_object *rk_obj) { - struct drm_device *drm = rk_obj->base.dev; + struct drm_device *drm = rk_obj->base.drm; struct rockchip_drm_private *private = drm->dev_private; int prot = IOMMU_READ | IOMMU_WRITE; ssize_t ret; @@ -61,7 +61,7 @@ static int rockchip_gem_iommu_map(struct rockchip_gem_object *rk_obj) static int rockchip_gem_iommu_unmap(struct rockchip_gem_object *rk_obj) { - struct drm_device *drm = rk_obj->base.dev; + struct drm_device *drm = rk_obj->base.drm; struct rockchip_drm_private *private = drm->dev_private; iommu_unmap(private->domain, rk_obj->dma_addr, rk_obj->size); @@ -77,7 +77,7 @@ static int rockchip_gem_iommu_unmap(struct rockchip_gem_object *rk_obj) static int rockchip_gem_get_pages(struct rockchip_gem_object *rk_obj) { - struct drm_device *drm = rk_obj->base.dev; + struct drm_device *drm = rk_obj->base.drm; int ret, i; struct scatterlist *s; @@ -87,7 +87,7 @@ static int rockchip_gem_get_pages(struct rockchip_gem_object *rk_obj) rk_obj->num_pages = rk_obj->base.size >> PAGE_SHIFT; - rk_obj->sgt = drm_prime_pages_to_sg(rk_obj->base.dev, + rk_obj->sgt = drm_prime_pages_to_sg(rk_obj->base.drm, rk_obj->pages, rk_obj->num_pages); if (IS_ERR(rk_obj->sgt)) { ret = PTR_ERR(rk_obj->sgt); @@ -157,7 +157,7 @@ static int rockchip_gem_alloc_dma(struct rockchip_gem_object *rk_obj, bool alloc_kmap) { struct drm_gem_object *obj = &rk_obj->base; - struct drm_device *drm = obj->dev; + struct drm_device *drm = obj->drm; rk_obj->dma_attrs = DMA_ATTR_WRITE_COMBINE; @@ -179,7 +179,7 @@ static int rockchip_gem_alloc_buf(struct rockchip_gem_object *rk_obj, bool alloc_kmap) { struct drm_gem_object *obj = &rk_obj->base; - struct drm_device *drm = obj->dev; + struct drm_device *drm = obj->drm; struct rockchip_drm_private *private = drm->dev_private; if (private->domain) @@ -198,7 +198,7 @@ static void rockchip_gem_free_iommu(struct rockchip_gem_object *rk_obj) static void rockchip_gem_free_dma(struct rockchip_gem_object *rk_obj) { struct drm_gem_object *obj = &rk_obj->base; - struct drm_device *drm = obj->dev; + struct drm_device *drm = obj->drm; dma_free_attrs(drm->dev, obj->size, rk_obj->kvaddr, rk_obj->dma_addr, rk_obj->dma_attrs); @@ -229,7 +229,7 @@ static int rockchip_drm_gem_object_mmap_dma(struct drm_gem_object *obj, struct vm_area_struct *vma) { struct rockchip_gem_object *rk_obj = to_rockchip_obj(obj); - struct drm_device *drm = obj->dev; + struct drm_device *drm = obj->drm; return dma_mmap_attrs(drm->dev, vma, rk_obj->kvaddr, rk_obj->dma_addr, obj->size, rk_obj->dma_attrs); @@ -328,7 +328,7 @@ rockchip_gem_create_object(struct drm_device *drm, unsigned int size, */ void rockchip_gem_free_object(struct drm_gem_object *obj) { - struct drm_device *drm = obj->dev; + struct drm_device *drm = obj->drm; struct rockchip_drm_private *private = drm->dev_private; struct rockchip_gem_object *rk_obj = to_rockchip_obj(obj); @@ -426,12 +426,13 @@ int rockchip_gem_dumb_create(struct drm_file *file_priv, struct sg_table *rockchip_gem_prime_get_sg_table(struct drm_gem_object *obj) { struct rockchip_gem_object *rk_obj = to_rockchip_obj(obj); - struct drm_device *drm = obj->dev; + struct drm_device *drm = obj->drm; struct sg_table *sgt; int ret; if (rk_obj->pages) - return drm_prime_pages_to_sg(obj->dev, rk_obj->pages, rk_obj->num_pages); + return drm_prime_pages_to_sg(obj->drm, rk_obj->pages, + rk_obj->num_pages); sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); if (!sgt) diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index a4023163493d..2cb60cafdf43 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -340,7 +340,7 @@ static int tegra_bo_get_pages(struct drm_device *drm, struct tegra_bo *bo) bo->num_pages = bo->gem.size >> PAGE_SHIFT; - bo->sgt = drm_prime_pages_to_sg(bo->gem.dev, bo->pages, bo->num_pages); + bo->sgt = drm_prime_pages_to_sg(bo->gem.drm, bo->pages, bo->num_pages); if (IS_ERR(bo->sgt)) { err = PTR_ERR(bo->sgt); goto put_pages; @@ -493,7 +493,7 @@ static struct tegra_bo *tegra_bo_import(struct drm_device *drm, void tegra_bo_free_object(struct drm_gem_object *gem) { - struct tegra_drm *tegra = gem->dev->dev_private; + struct tegra_drm *tegra = gem->drm->dev_private; struct host1x_bo_mapping *mapping, *tmp; struct tegra_bo *bo = to_tegra_bo(gem); @@ -502,7 +502,8 @@ void tegra_bo_free_object(struct drm_gem_object *gem) if (mapping->cache) host1x_bo_unpin(mapping); else - dev_err(gem->dev->dev, "mapping %p stale for device %s\n", mapping, + dev_err(gem->drm->dev, + "mapping %p stale for device %s\n", mapping, dev_name(mapping->dev)); } @@ -514,7 +515,7 @@ void tegra_bo_free_object(struct drm_gem_object *gem) DMA_TO_DEVICE); drm_prime_gem_destroy(gem, NULL); } else { - tegra_bo_free(gem->dev, bo); + tegra_bo_free(gem->drm, bo); } drm_gem_object_release(gem); @@ -578,7 +579,7 @@ int __tegra_gem_mmap(struct drm_gem_object *gem, struct vm_area_struct *vma) vm_flags_clear(vma, VM_PFNMAP); vma->vm_pgoff = 0; - err = dma_mmap_wc(gem->dev->dev, vma, bo->vaddr, bo->iova, + err = dma_mmap_wc(gem->drm->dev, vma, bo->vaddr, bo->iova, gem->size); if (err < 0) { drm_gem_vm_close(vma); @@ -668,7 +669,7 @@ static int tegra_gem_prime_begin_cpu_access(struct dma_buf *buf, { struct drm_gem_object *gem = buf->priv; struct tegra_bo *bo = to_tegra_bo(gem); - struct drm_device *drm = gem->dev; + struct drm_device *drm = gem->drm; if (bo->pages) dma_sync_sgtable_for_cpu(drm->dev, bo->sgt, DMA_FROM_DEVICE); @@ -681,7 +682,7 @@ static int tegra_gem_prime_end_cpu_access(struct dma_buf *buf, { struct drm_gem_object *gem = buf->priv; struct tegra_bo *bo = to_tegra_bo(gem); - struct drm_device *drm = gem->dev; + struct drm_device *drm = gem->drm; if (bo->pages) dma_sync_sgtable_for_device(drm->dev, bo->sgt, DMA_TO_DEVICE); @@ -741,13 +742,13 @@ struct dma_buf *tegra_gem_prime_export(struct drm_gem_object *gem, DEFINE_DMA_BUF_EXPORT_INFO(exp_info); exp_info.exp_name = KBUILD_MODNAME; - exp_info.owner = gem->dev->driver->fops->owner; + exp_info.owner = gem->drm->driver->fops->owner; exp_info.ops = &tegra_gem_prime_dmabuf_ops; exp_info.size = gem->size; exp_info.flags = flags; exp_info.priv = gem; - return drm_gem_dmabuf_export(gem->dev, &exp_info); + return drm_gem_dmabuf_export(gem->drm, &exp_info); } struct drm_gem_object *tegra_gem_prime_import(struct drm_device *drm, @@ -758,7 +759,7 @@ struct drm_gem_object *tegra_gem_prime_import(struct drm_device *drm, if (buf->ops == &tegra_gem_prime_dmabuf_ops) { struct drm_gem_object *gem = buf->priv; - if (gem->dev == drm) { + if (gem->drm == drm) { drm_gem_object_get(gem); return gem; } diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index fd9fd3d15101..3637af18b867 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -250,7 +250,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, fbo->base.base.resv = &fbo->base.base._resv; dma_resv_init(&fbo->base.base._resv); - fbo->base.base.dev = NULL; + fbo->base.base.drm = NULL; ret = dma_resv_trylock(&fbo->base.base._resv); WARN_ON(!ret); diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c index 4212b8c91dd4..c2e9d1f777ea 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c @@ -292,7 +292,7 @@ vm_fault_t ttm_bo_vm_dummy_page(struct vm_fault *vmf, pgprot_t prot) { struct vm_area_struct *vma = vmf->vma; struct ttm_buffer_object *bo = vma->vm_private_data; - struct drm_device *ddev = bo->base.dev; + struct drm_device *ddev = bo->base.drm; vm_fault_t ret = VM_FAULT_NOPAGE; unsigned long address; unsigned long pfn; @@ -323,7 +323,7 @@ vm_fault_t ttm_bo_vm_fault(struct vm_fault *vmf) struct vm_area_struct *vma = vmf->vma; pgprot_t prot; struct ttm_buffer_object *bo = vma->vm_private_data; - struct drm_device *ddev = bo->base.dev; + struct drm_device *ddev = bo->base.drm; vm_fault_t ret; int idx; diff --git a/drivers/gpu/drm/v3d/v3d_bo.c b/drivers/gpu/drm/v3d/v3d_bo.c index 8b3229a37c6d..8fb1c38424f8 100644 --- a/drivers/gpu/drm/v3d/v3d_bo.c +++ b/drivers/gpu/drm/v3d/v3d_bo.c @@ -30,7 +30,7 @@ */ void v3d_free_object(struct drm_gem_object *obj) { - struct v3d_dev *v3d = to_v3d_dev(obj->dev); + struct v3d_dev *v3d = to_v3d_dev(obj->drm); struct v3d_bo *bo = to_v3d_bo(obj); v3d_mmu_remove_ptes(bo); @@ -88,7 +88,7 @@ struct drm_gem_object *v3d_create_object(struct drm_device *dev, size_t size) static int v3d_bo_create_finish(struct drm_gem_object *obj) { - struct v3d_dev *v3d = to_v3d_dev(obj->dev); + struct v3d_dev *v3d = to_v3d_dev(obj->drm); struct v3d_bo *bo = to_v3d_bo(obj); struct sg_table *sgt; int ret; diff --git a/drivers/gpu/drm/v3d/v3d_mmu.c b/drivers/gpu/drm/v3d/v3d_mmu.c index 5a453532901f..efea2273ab93 100644 --- a/drivers/gpu/drm/v3d/v3d_mmu.c +++ b/drivers/gpu/drm/v3d/v3d_mmu.c @@ -87,7 +87,7 @@ int v3d_mmu_set_page_table(struct v3d_dev *v3d) void v3d_mmu_insert_ptes(struct v3d_bo *bo) { struct drm_gem_shmem_object *shmem_obj = &bo->base; - struct v3d_dev *v3d = to_v3d_dev(shmem_obj->base.dev); + struct v3d_dev *v3d = to_v3d_dev(shmem_obj->base.drm); u32 page = bo->node.start; u32 page_prot = V3D_PTE_WRITEABLE | V3D_PTE_VALID; struct sg_dma_page_iter dma_iter; @@ -113,7 +113,7 @@ void v3d_mmu_insert_ptes(struct v3d_bo *bo) void v3d_mmu_remove_ptes(struct v3d_bo *bo) { - struct v3d_dev *v3d = to_v3d_dev(bo->base.base.dev); + struct v3d_dev *v3d = to_v3d_dev(bo->base.base.drm); u32 npages = bo->base.base.size >> V3D_MMU_PAGE_SHIFT; u32 page; diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c index 71a6f5e47817..54ff7922ae4d 100644 --- a/drivers/gpu/drm/vc4/vc4_bo.c +++ b/drivers/gpu/drm/vc4/vc4_bo.c @@ -132,7 +132,7 @@ static int vc4_get_user_label(struct vc4_dev *vc4, const char *name) static void vc4_bo_set_label(struct drm_gem_object *gem_obj, int label) { struct vc4_bo *bo = to_vc4_bo(gem_obj); - struct vc4_dev *vc4 = to_vc4_dev(gem_obj->dev); + struct vc4_dev *vc4 = to_vc4_dev(gem_obj->drm); lockdep_assert_held(&vc4->bo_lock); @@ -166,7 +166,7 @@ static uint32_t bo_page_index(size_t size) static void vc4_bo_destroy(struct vc4_bo *bo) { struct drm_gem_object *obj = &bo->base.base; - struct vc4_dev *vc4 = to_vc4_dev(obj->dev); + struct vc4_dev *vc4 = to_vc4_dev(obj->drm); lockdep_assert_held(&vc4->bo_lock); @@ -185,7 +185,7 @@ static void vc4_bo_destroy(struct vc4_bo *bo) static void vc4_bo_remove_from_cache(struct vc4_bo *bo) { - struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.dev); + struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.drm); lockdep_assert_held(&vc4->bo_lock); list_del(&bo->unref_head); @@ -249,7 +249,7 @@ static void vc4_bo_cache_purge(struct drm_device *dev) void vc4_bo_add_to_purgeable_pool(struct vc4_bo *bo) { - struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.dev); + struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.drm); if (WARN_ON_ONCE(vc4->is_vc5)) return; @@ -263,7 +263,7 @@ void vc4_bo_add_to_purgeable_pool(struct vc4_bo *bo) static void vc4_bo_remove_from_purgeable_pool_locked(struct vc4_bo *bo) { - struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.dev); + struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.drm); if (WARN_ON_ONCE(vc4->is_vc5)) return; @@ -287,7 +287,7 @@ static void vc4_bo_remove_from_purgeable_pool_locked(struct vc4_bo *bo) void vc4_bo_remove_from_purgeable_pool(struct vc4_bo *bo) { - struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.dev); + struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.drm); mutex_lock(&vc4->purgeable.lock); vc4_bo_remove_from_purgeable_pool_locked(bo); @@ -297,7 +297,7 @@ void vc4_bo_remove_from_purgeable_pool(struct vc4_bo *bo) static void vc4_bo_purge(struct drm_gem_object *obj) { struct vc4_bo *bo = to_vc4_bo(obj); - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; WARN_ON(!mutex_is_locked(&bo->madv_lock)); WARN_ON(bo->madv != VC4_MADV_DONTNEED); @@ -542,7 +542,7 @@ static void vc4_bo_cache_free_old(struct drm_device *dev) */ static void vc4_free_object(struct drm_gem_object *gem_bo) { - struct drm_device *dev = gem_bo->dev; + struct drm_device *dev = gem_bo->drm; struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_bo *bo = to_vc4_bo(gem_bo); struct list_head *cache_list; @@ -619,7 +619,7 @@ static void vc4_bo_cache_time_work(struct work_struct *work) int vc4_bo_inc_usecnt(struct vc4_bo *bo) { - struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.dev); + struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.drm); int ret; if (WARN_ON_ONCE(vc4->is_vc5)) @@ -659,7 +659,7 @@ int vc4_bo_inc_usecnt(struct vc4_bo *bo) void vc4_bo_dec_usecnt(struct vc4_bo *bo) { - struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.dev); + struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.drm); if (WARN_ON_ONCE(vc4->is_vc5)) return; diff --git a/drivers/gpu/drm/vc4/vc4_validate.c b/drivers/gpu/drm/vc4/vc4_validate.c index 7dff3ca5af6b..1a279455e67b 100644 --- a/drivers/gpu/drm/vc4/vc4_validate.c +++ b/drivers/gpu/drm/vc4/vc4_validate.c @@ -356,7 +356,7 @@ validate_gl_shader_state(VALIDATE_ARGS) static int validate_tile_binning_config(VALIDATE_ARGS) { - struct drm_device *dev = exec->exec_bo->base.dev; + struct drm_device *dev = exec->exec_bo->base.drm; struct vc4_dev *vc4 = to_vc4_dev(dev); uint8_t flags; uint32_t tile_state_size; diff --git a/drivers/gpu/drm/vc4/vc4_validate_shaders.c b/drivers/gpu/drm/vc4/vc4_validate_shaders.c index 9745f8810eca..a9aea68a6441 100644 --- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c +++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c @@ -778,7 +778,7 @@ vc4_handle_branch_target(struct vc4_shader_validation_state *validation_state) struct vc4_validated_shader_info * vc4_validate_shader(struct drm_gem_dma_object *shader_obj) { - struct vc4_dev *vc4 = to_vc4_dev(shader_obj->base.dev); + struct vc4_dev *vc4 = to_vc4_dev(shader_obj->base.drm); bool found_shader_end = false; int shader_end_ip = 0; uint32_t last_thread_switch_ip = -3; diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index 7db48d17ee3a..f7e9521dda34 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -117,7 +117,7 @@ int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv, int virtio_gpu_gem_object_open(struct drm_gem_object *obj, struct drm_file *file) { - struct virtio_gpu_device *vgdev = obj->dev->dev_private; + struct virtio_gpu_device *vgdev = obj->drm->dev_private; struct virtio_gpu_fpriv *vfpriv = file->driver_priv; struct virtio_gpu_object_array *objs; @@ -127,7 +127,7 @@ int virtio_gpu_gem_object_open(struct drm_gem_object *obj, /* the context might still be missing when the first ioctl is * DRM_IOCTL_MODE_CREATE_DUMB or DRM_IOCTL_PRIME_FD_TO_HANDLE */ - virtio_gpu_create_context(obj->dev, file); + virtio_gpu_create_context(obj->drm, file); objs = virtio_gpu_array_alloc(1); if (!objs) @@ -144,7 +144,7 @@ int virtio_gpu_gem_object_open(struct drm_gem_object *obj, void virtio_gpu_gem_object_close(struct drm_gem_object *obj, struct drm_file *file) { - struct virtio_gpu_device *vgdev = obj->dev->dev_private; + struct virtio_gpu_device *vgdev = obj->drm->dev_private; struct virtio_gpu_fpriv *vfpriv = file->driver_priv; struct virtio_gpu_object_array *objs; diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c index c7e74cf13022..ced5a9240456 100644 --- a/drivers/gpu/drm/virtio/virtgpu_object.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -63,7 +63,7 @@ static void virtio_gpu_resource_id_put(struct virtio_gpu_device *vgdev, uint32_t void virtio_gpu_cleanup_object(struct virtio_gpu_object *bo) { - struct virtio_gpu_device *vgdev = bo->base.base.dev->dev_private; + struct virtio_gpu_device *vgdev = bo->base.base.drm->dev_private; virtio_gpu_resource_id_put(vgdev, bo->hw_res_handle); if (virtio_gpu_is_shmem(bo)) { @@ -86,7 +86,7 @@ void virtio_gpu_cleanup_object(struct virtio_gpu_object *bo) static void virtio_gpu_free_object(struct drm_gem_object *obj) { struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj); - struct virtio_gpu_device *vgdev = bo->base.base.dev->dev_private; + struct virtio_gpu_device *vgdev = bo->base.base.drm->dev_private; if (bo->created) { virtio_gpu_cmd_unref_resource(vgdev, bo); diff --git a/drivers/gpu/drm/virtio/virtgpu_prime.c b/drivers/gpu/drm/virtio/virtgpu_prime.c index 44425f20d91a..29570a41fe7f 100644 --- a/drivers/gpu/drm/virtio/virtgpu_prime.c +++ b/drivers/gpu/drm/virtio/virtgpu_prime.c @@ -32,7 +32,7 @@ static int virtgpu_virtio_get_uuid(struct dma_buf *buf, { struct drm_gem_object *obj = buf->priv; struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj); - struct virtio_gpu_device *vgdev = obj->dev->dev_private; + struct virtio_gpu_device *vgdev = obj->drm->dev_private; wait_event(vgdev->resp_wq, bo->uuid_state != STATE_INITIALIZING); if (bo->uuid_state != STATE_OK) @@ -105,7 +105,7 @@ struct dma_buf *virtgpu_gem_prime_export(struct drm_gem_object *obj, int flags) { struct dma_buf *buf; - struct drm_device *dev = obj->dev; + struct drm_device *dev = obj->drm; struct virtio_gpu_device *vgdev = dev->dev_private; struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj); int ret = 0; @@ -149,7 +149,7 @@ struct drm_gem_object *virtgpu_gem_prime_import(struct drm_device *dev, if (buf->ops == &virtgpu_dmabuf_ops.ops) { obj = buf->priv; - if (obj->dev == dev) { + if (obj->drm == dev) { /* * Importing dmabuf exported from our own gem increases * refcount on gem itself instead of f_count of dmabuf. diff --git a/drivers/gpu/drm/virtio/virtgpu_vram.c b/drivers/gpu/drm/virtio/virtgpu_vram.c index 25df81c02783..41b46d2f5bfd 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vram.c +++ b/drivers/gpu/drm/virtio/virtgpu_vram.c @@ -6,7 +6,7 @@ static void virtio_gpu_vram_free(struct drm_gem_object *obj) { struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj); - struct virtio_gpu_device *vgdev = obj->dev->dev_private; + struct virtio_gpu_device *vgdev = obj->drm->dev_private; struct virtio_gpu_object_vram *vram = to_virtio_gpu_vram(bo); bool unmap; @@ -33,7 +33,7 @@ static int virtio_gpu_vram_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) { int ret; - struct virtio_gpu_device *vgdev = obj->dev->dev_private; + struct virtio_gpu_device *vgdev = obj->drm->dev_private; struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj); struct virtio_gpu_object_vram *vram = to_virtio_gpu_vram(bo); unsigned long vm_size = vma->vm_end - vma->vm_start; @@ -70,7 +70,7 @@ struct sg_table *virtio_gpu_vram_map_dma_buf(struct virtio_gpu_object *bo, struct device *dev, enum dma_data_direction dir) { - struct virtio_gpu_device *vgdev = bo->base.base.dev->dev_private; + struct virtio_gpu_device *vgdev = bo->base.base.drm->dev_private; struct virtio_gpu_object_vram *vram = to_virtio_gpu_vram(bo); struct sg_table *sgt; dma_addr_t addr; @@ -143,7 +143,7 @@ static int virtio_gpu_vram_map(struct virtio_gpu_object *bo) int ret; uint64_t offset; struct virtio_gpu_object_array *objs; - struct virtio_gpu_device *vgdev = bo->base.base.dev->dev_private; + struct virtio_gpu_device *vgdev = bo->base.base.drm->dev_private; struct virtio_gpu_object_vram *vram = to_virtio_gpu_vram(bo); if (!vgdev->has_host_visible) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c index c0da89e16e6f..2270c0f33b74 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c @@ -86,7 +86,8 @@ static struct sg_table *vmw_gem_object_get_sg_table(struct drm_gem_object *obj) if (vmw_tt->vsgt.sgt) return vmw_tt->vsgt.sgt; - return drm_prime_pages_to_sg(obj->dev, vmw_tt->dma_ttm.pages, vmw_tt->dma_ttm.num_pages); + return drm_prime_pages_to_sg(obj->drm, vmw_tt->dma_ttm.pages, + vmw_tt->dma_ttm.num_pages); } static const struct vm_operations_struct vmw_vm_ops = { diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/drivers/gpu/drm/xen/xen_drm_front.c index 7e9431c50c5a..2220000f1b61 100644 --- a/drivers/gpu/drm/xen/xen_drm_front.c +++ b/drivers/gpu/drm/xen/xen_drm_front.c @@ -383,10 +383,10 @@ void xen_drm_front_on_frame_done(struct xen_drm_front_info *front_info, void xen_drm_front_gem_object_free(struct drm_gem_object *obj) { - struct xen_drm_front_drm_info *drm_info = obj->dev->dev_private; + struct xen_drm_front_drm_info *drm_info = obj->drm->dev_private; int idx; - if (drm_dev_enter(obj->dev, &idx)) { + if (drm_dev_enter(obj->drm, &idx)) { xen_drm_front_dbuf_destroy(drm_info->front_info, xen_drm_front_dbuf_to_cookie(obj)); drm_dev_exit(idx); diff --git a/drivers/gpu/drm/xen/xen_drm_front_gem.c b/drivers/gpu/drm/xen/xen_drm_front_gem.c index 3ad2b4cfd1f0..2054641d2ec1 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_gem.c +++ b/drivers/gpu/drm/xen/xen_drm_front_gem.c @@ -235,7 +235,7 @@ struct sg_table *xen_drm_front_gem_get_sg_table(struct drm_gem_object *gem_obj) if (!xen_obj->pages) return ERR_PTR(-ENOMEM); - return drm_prime_pages_to_sg(gem_obj->dev, + return drm_prime_pages_to_sg(gem_obj->drm, xen_obj->pages, xen_obj->num_pages); } diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index bbc721870c13..7afda00286f6 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -285,9 +285,9 @@ struct drm_gem_object { unsigned handle_count; /** - * @dev: DRM dev this object belongs to. + * @drm: DRM dev this object belongs to. */ - struct drm_device *dev; + struct drm_device *drm; /** * @filp: From patchwork Thu Jul 13 08:24:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311537 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24C71C001DC for ; Thu, 13 Jul 2023 08:24:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3928E10E626; Thu, 13 Jul 2023 08:24:54 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id AF05A10E627 for ; Thu, 13 Jul 2023 08:24:50 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrcg-0005xv-Ep; Thu, 13 Jul 2023 10:24:26 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrcf-00E4ju-Hb; Thu, 13 Jul 2023 10:24:25 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrce-004VhS-Qy; Thu, 13 Jul 2023 10:24:24 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 12/17] drm/master: Rename struct drm_master::dev to drm Date: Thu, 13 Jul 2023 10:24:03 +0200 Message-Id: <20230713082408.2266984-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6809; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zue23WgFV0mXOzopxMZGE1Y356Xp1QLywHuAYSLQtYM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7SYOPzSuw50H90BB4EbdpheGf/KNCcTI931H 9mp0dj1/paJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0mAAKCRCPgPtYfRL+ Tp8XB/9Pa3gx1RxQhAsjstAjckd0FuMlrhupCy96MHPt4WmHvNob/3QVwfoudnMuE9fSAQwws7u g7xERx94P4cMX3X/mvMeSWQnU6+V/PTOXgNZDUFRUNqHT9bNK+62k+etwRpSIvcqxcryhJvmsvb rbH3z1gZqOejOcoOeIEFbMdHmBoE+JxKXxHoPmhYSb5bPZtdyK2v2H4+TJRrvCKp9wNvZArlCbj L4eSyDNEEgf3ezXDCcreHJEYu7FnOZyaU/G/vvZkZQgBvj419VjkUGTrE8NLyQt7lcBWlsC8OqW T18RF49lpxL+xRNkU49EUV6JgDeexxS1zxF/Y9j6MYyle0bF X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/drm_auth.c | 4 ++-- drivers/gpu/drm/drm_lease.c | 32 ++++++++++++++++---------------- include/drm/drm_auth.h | 4 ++-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c index cf92a9ae8034..c37032bccd0f 100644 --- a/drivers/gpu/drm/drm_auth.c +++ b/drivers/gpu/drm/drm_auth.c @@ -141,7 +141,7 @@ struct drm_master *drm_master_create(struct drm_device *dev) kref_init(&master->refcount); drm_master_legacy_init(master); idr_init_base(&master->magic_map, 1); - master->dev = dev; + master->drm = dev; /* initialize the tree of output resource lessees */ INIT_LIST_HEAD(&master->lessees); @@ -423,7 +423,7 @@ EXPORT_SYMBOL(drm_file_get_master); static void drm_master_destroy(struct kref *kref) { struct drm_master *master = container_of(kref, struct drm_master, refcount); - struct drm_device *dev = master->dev; + struct drm_device *dev = master->drm; if (drm_core_check_feature(dev, DRIVER_MODESET)) drm_lease_destroy(master); diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c index 150fe1555068..02d240897871 100644 --- a/drivers/gpu/drm/drm_lease.c +++ b/drivers/gpu/drm/drm_lease.c @@ -81,13 +81,13 @@ struct drm_master *drm_lease_owner(struct drm_master *master) static struct drm_master* _drm_find_lessee(struct drm_master *master, int lessee_id) { - lockdep_assert_held(&master->dev->mode_config.idr_mutex); + lockdep_assert_held(&master->drm->mode_config.idr_mutex); return idr_find(&drm_lease_owner(master)->lessee_idr, lessee_id); } static int _drm_lease_held_master(struct drm_master *master, int id) { - lockdep_assert_held(&master->dev->mode_config.idr_mutex); + lockdep_assert_held(&master->drm->mode_config.idr_mutex); if (master->lessor) return idr_find(&master->leases, id) != NULL; return true; @@ -98,7 +98,7 @@ static bool _drm_has_leased(struct drm_master *master, int id) { struct drm_master *lessee; - lockdep_assert_held(&master->dev->mode_config.idr_mutex); + lockdep_assert_held(&master->drm->mode_config.idr_mutex); drm_for_each_lessee(lessee, master) if (_drm_lease_held_master(lessee, id)) return true; @@ -138,9 +138,9 @@ bool drm_lease_held(struct drm_file *file_priv, int id) ret = true; goto out; } - mutex_lock(&master->dev->mode_config.idr_mutex); + mutex_lock(&master->drm->mode_config.idr_mutex); ret = _drm_lease_held_master(master, id); - mutex_unlock(&master->dev->mode_config.idr_mutex); + mutex_unlock(&master->drm->mode_config.idr_mutex); out: drm_master_put(&master); @@ -169,10 +169,10 @@ uint32_t drm_lease_filter_crtcs(struct drm_file *file_priv, uint32_t crtcs_in) crtcs_out = crtcs_in; goto out; } - dev = master->dev; + dev = master->drm; count_in = count_out = 0; - mutex_lock(&master->dev->mode_config.idr_mutex); + mutex_lock(&master->drm->mode_config.idr_mutex); list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { if (_drm_lease_held_master(master, crtc->base.id)) { uint32_t mask_in = 1ul << count_in; @@ -186,7 +186,7 @@ uint32_t drm_lease_filter_crtcs(struct drm_file *file_priv, uint32_t crtcs_in) } count_in++; } - mutex_unlock(&master->dev->mode_config.idr_mutex); + mutex_unlock(&master->drm->mode_config.idr_mutex); out: drm_master_put(&master); @@ -206,7 +206,7 @@ uint32_t drm_lease_filter_crtcs(struct drm_file *file_priv, uint32_t crtcs_in) */ static struct drm_master *drm_lease_create(struct drm_master *lessor, struct idr *leases) { - struct drm_device *dev = lessor->dev; + struct drm_device *dev = lessor->drm; int error; struct drm_master *lessee; int object; @@ -215,7 +215,7 @@ static struct drm_master *drm_lease_create(struct drm_master *lessor, struct idr drm_dbg_lease(dev, "lessor %d\n", lessor->lessee_id); - lessee = drm_master_create(lessor->dev); + lessee = drm_master_create(lessor->drm); if (!lessee) { drm_dbg_lease(dev, "drm_master_create failed\n"); return ERR_PTR(-ENOMEM); @@ -265,7 +265,7 @@ static struct drm_master *drm_lease_create(struct drm_master *lessor, struct idr void drm_lease_destroy(struct drm_master *master) { - struct drm_device *dev = master->dev; + struct drm_device *dev = master->drm; mutex_lock(&dev->mode_config.idr_mutex); @@ -303,14 +303,14 @@ static void _drm_lease_revoke(struct drm_master *top) void *entry; struct drm_master *master = top; - lockdep_assert_held(&top->dev->mode_config.idr_mutex); + lockdep_assert_held(&top->drm->mode_config.idr_mutex); /* * Walk the tree starting at 'top' emptying all leases. Because * the tree is fully connected, we can do this without recursing */ for (;;) { - drm_dbg_lease(master->dev, "revoke leases for %p %d\n", + drm_dbg_lease(master->drm, "revoke leases for %p %d\n", master, master->lessee_id); /* Evacuate the lease */ @@ -338,9 +338,9 @@ static void _drm_lease_revoke(struct drm_master *top) void drm_lease_revoke(struct drm_master *top) { - mutex_lock(&top->dev->mode_config.idr_mutex); + mutex_lock(&top->drm->mode_config.idr_mutex); _drm_lease_revoke(top); - mutex_unlock(&top->dev->mode_config.idr_mutex); + mutex_unlock(&top->drm->mode_config.idr_mutex); } static int validate_lease(struct drm_device *dev, @@ -661,7 +661,7 @@ int drm_mode_get_lease_ioctl(struct drm_device *dev, if (lessee->lessor == NULL) /* owner can use all objects */ - object_idr = &lessee->dev->mode_config.object_idr; + object_idr = &lessee->drm->mode_config.object_idr; else /* lessee can only use allowed object */ object_idr = &lessee->leases; diff --git a/include/drm/drm_auth.h b/include/drm/drm_auth.h index ba248ca8866f..cae829079594 100644 --- a/include/drm/drm_auth.h +++ b/include/drm/drm_auth.h @@ -56,7 +56,7 @@ struct drm_lock_data { * struct drm_master - drm master structure * * @refcount: Refcount for this master object. - * @dev: Link back to the DRM device + * @drm: Link back to the DRM device * @driver_priv: Pointer to driver-private information. * * Note that master structures are only relevant for the legacy/primary device @@ -64,7 +64,7 @@ struct drm_lock_data { */ struct drm_master { struct kref refcount; - struct drm_device *dev; + struct drm_device *drm; /** * @unique: Unique identifier: e.g. busid. Protected by * &drm_device.master_mutex. From patchwork Thu Jul 13 08:24:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24CB8C001B0 for ; Thu, 13 Jul 2023 08:25:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DEE2610E63A; Thu, 13 Jul 2023 08:25:36 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 535BB10E630 for ; Thu, 13 Jul 2023 08:25:30 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrch-0005z5-05; Thu, 13 Jul 2023 10:24:27 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrcg-00E4k1-1N; Thu, 13 Jul 2023 10:24:26 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrcf-004VhW-4Q; Thu, 13 Jul 2023 10:24:25 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 13/17] drm/minor: Rename struct drm_minor::dev to drm Date: Thu, 13 Jul 2023 10:24:04 +0200 Message-Id: <20230713082408.2266984-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=59479; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=N6f0/7tXGDbwZz3LatdgKgVIdnoag4xLCb22whl4MLQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7Sav41Xh8uL4P0xQYyc36DtcPRlCYU/TE277 YH+A5hU1kCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0mgAKCRCPgPtYfRL+ ToW8B/9aECPxeZmxOqP4b24EAES/8gzGW4pu/V65v54QS0VG8plBF1fv6MHcZ4/OnuG8zja6QDP z7sGBJBKTETVs5rSFc7sKweeLLvnJ+l9JVJMLqE5ixCSSH9qCk4HjRbz3cVV5lOIjx0qsqErTeN 4Izng5jBUXoCqYN3iW3CunN3jzsI9yaQAwv0md2CPCMrPFCXor2xT3PfvW+5JU+qCnsXYBAdLCO uhPLEy73GoRp1jsfnOZW6KUzCAMEnyFptzBjw12e2PWhl1koAEZQwozIbTGcSAtDiAXwlWi6FNK Pfe9JNCWrvfN2559b0rxHlEqIyaUpOvsMQfyoS/ZEHBuHmYr X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- drivers/accel/drm_accel.c | 16 +++++++------- drivers/accel/ivpu/ivpu_debugfs.c | 16 +++++++------- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | 12 +++++----- drivers/gpu/drm/arm/malidp_drv.c | 4 ++-- drivers/gpu/drm/armada/armada_debugfs.c | 2 +- drivers/gpu/drm/drm_agpsupport.c | 2 +- drivers/gpu/drm/drm_atomic.c | 2 +- drivers/gpu/drm/drm_auth.c | 8 +++---- drivers/gpu/drm/drm_client.c | 2 +- drivers/gpu/drm/drm_debugfs.c | 7 +++--- drivers/gpu/drm/drm_drv.c | 14 ++++++------ drivers/gpu/drm/drm_file.c | 22 +++++++++---------- drivers/gpu/drm/drm_framebuffer.c | 2 +- drivers/gpu/drm/drm_gem.c | 2 +- drivers/gpu/drm/drm_gem_vram_helper.c | 2 +- drivers/gpu/drm/drm_ioc32.c | 2 +- drivers/gpu/drm/drm_ioctl.c | 4 ++-- drivers/gpu/drm/drm_mipi_dbi.c | 2 +- drivers/gpu/drm/drm_sysfs.c | 2 +- drivers/gpu/drm/drm_vm.c | 18 +++++++-------- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++-- .../drm/i915/display/intel_display_debugfs.c | 4 ++-- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 2 +- drivers/gpu/drm/i915/i915_debugfs.c | 6 ++--- drivers/gpu/drm/i915/i915_sysfs.c | 2 +- drivers/gpu/drm/loongson/lsdc_debugfs.c | 4 ++-- drivers/gpu/drm/loongson/lsdc_gem.c | 2 +- drivers/gpu/drm/loongson/lsdc_output_7a2000.c | 2 +- drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 4 ++-- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 2 +- drivers/gpu/drm/msm/dp/dp_debug.c | 2 +- drivers/gpu/drm/msm/msm_debugfs.c | 14 +++++++----- drivers/gpu/drm/msm/msm_drv.c | 2 +- drivers/gpu/drm/msm/msm_perf.c | 4 ++-- drivers/gpu/drm/msm/msm_rd.c | 4 ++-- drivers/gpu/drm/nouveau/nouveau_debugfs.c | 8 +++---- drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- drivers/gpu/drm/omapdrm/omap_debugfs.c | 6 ++--- drivers/gpu/drm/pl111/pl111_debugfs.c | 2 +- drivers/gpu/drm/qxl/qxl_debugfs.c | 6 ++--- drivers/gpu/drm/radeon/radeon_drv.c | 2 +- drivers/gpu/drm/sti/sti_drv.c | 4 ++-- drivers/gpu/drm/tegra/drm.c | 4 ++-- drivers/gpu/drm/tegra/dsi.c | 2 +- drivers/gpu/drm/tegra/hdmi.c | 2 +- drivers/gpu/drm/tegra/sor.c | 4 ++-- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 4 ++-- drivers/gpu/drm/tiny/arcpgu.c | 2 +- drivers/gpu/drm/v3d/v3d_debugfs.c | 3 ++- drivers/gpu/drm/vc4/vc4_bo.c | 2 +- drivers/gpu/drm/vc4/vc4_debugfs.c | 2 +- drivers/gpu/drm/vc4/vc4_hvs.c | 2 +- drivers/gpu/drm/vc4/vc4_v3d.c | 2 +- drivers/gpu/drm/virtio/virtgpu_debugfs.c | 6 ++--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +- include/drm/drm_file.h | 2 +- 58 files changed, 139 insertions(+), 135 deletions(-) diff --git a/drivers/accel/drm_accel.c b/drivers/accel/drm_accel.c index 4a9baf02439e..871606023f95 100644 --- a/drivers/accel/drm_accel.c +++ b/drivers/accel/drm_accel.c @@ -55,7 +55,7 @@ static int accel_name_info(struct seq_file *m, void *data) { struct drm_info_node *node = (struct drm_info_node *) m->private; struct drm_minor *minor = node->minor; - struct drm_device *dev = minor->dev; + struct drm_device *dev = minor->drm; struct drm_master *master; mutex_lock(&dev->master_mutex); @@ -89,7 +89,7 @@ static const struct drm_info_list accel_debugfs_list[] = { */ void accel_debugfs_init(struct drm_minor *minor, int minor_id) { - struct drm_device *dev = minor->dev; + struct drm_device *dev = minor->drm; char name[64]; INIT_LIST_HEAD(&minor->debugfs_list); @@ -195,13 +195,13 @@ static struct drm_minor *accel_minor_acquire(unsigned int minor_id) spin_lock_irqsave(&accel_minor_lock, flags); minor = idr_find(&accel_minors_idr, minor_id); if (minor) - drm_dev_get(minor->dev); + drm_dev_get(minor->drm); spin_unlock_irqrestore(&accel_minor_lock, flags); if (!minor) { return ERR_PTR(-ENODEV); - } else if (drm_dev_is_unplugged(minor->dev)) { - drm_dev_put(minor->dev); + } else if (drm_dev_is_unplugged(minor->drm)) { + drm_dev_put(minor->drm); return ERR_PTR(-ENODEV); } @@ -210,7 +210,7 @@ static struct drm_minor *accel_minor_acquire(unsigned int minor_id) static void accel_minor_release(struct drm_minor *minor) { - drm_dev_put(minor->dev); + drm_dev_put(minor->drm); } /** @@ -234,7 +234,7 @@ int accel_open(struct inode *inode, struct file *filp) if (IS_ERR(minor)) return PTR_ERR(minor); - dev = minor->dev; + dev = minor->drm; atomic_fetch_inc(&dev->open_count); @@ -264,7 +264,7 @@ static int accel_stub_open(struct inode *inode, struct file *filp) if (IS_ERR(minor)) return PTR_ERR(minor); - new_fops = fops_get(minor->dev->driver->fops); + new_fops = fops_get(minor->drm->driver->fops); if (!new_fops) { err = -ENODEV; goto out; diff --git a/drivers/accel/ivpu/ivpu_debugfs.c b/drivers/accel/ivpu/ivpu_debugfs.c index 5e5996fd4f9f..9e45beba88b5 100644 --- a/drivers/accel/ivpu/ivpu_debugfs.c +++ b/drivers/accel/ivpu/ivpu_debugfs.c @@ -22,7 +22,7 @@ static int bo_list_show(struct seq_file *s, void *v) struct drm_info_node *node = (struct drm_info_node *)s->private; struct drm_printer p = drm_seq_file_printer(s); - ivpu_bo_list(node->minor->dev, &p); + ivpu_bo_list(node->minor->drm, &p); return 0; } @@ -30,7 +30,7 @@ static int bo_list_show(struct seq_file *s, void *v) static int fw_name_show(struct seq_file *s, void *v) { struct drm_info_node *node = (struct drm_info_node *)s->private; - struct ivpu_device *vdev = to_ivpu_device(node->minor->dev); + struct ivpu_device *vdev = to_ivpu_device(node->minor->drm); seq_printf(s, "%s\n", vdev->fw->name); return 0; @@ -39,7 +39,7 @@ static int fw_name_show(struct seq_file *s, void *v) static int fw_trace_capability_show(struct seq_file *s, void *v) { struct drm_info_node *node = (struct drm_info_node *)s->private; - struct ivpu_device *vdev = to_ivpu_device(node->minor->dev); + struct ivpu_device *vdev = to_ivpu_device(node->minor->drm); u64 trace_hw_component_mask; u32 trace_destination_mask; int ret; @@ -58,7 +58,7 @@ static int fw_trace_capability_show(struct seq_file *s, void *v) static int fw_trace_config_show(struct seq_file *s, void *v) { struct drm_info_node *node = (struct drm_info_node *)s->private; - struct ivpu_device *vdev = to_ivpu_device(node->minor->dev); + struct ivpu_device *vdev = to_ivpu_device(node->minor->drm); /** * WA: VPU_JSM_MSG_TRACE_GET_CONFIG command is not working yet, * so we use values from vdev->fw instead of calling ivpu_jsm_trace_get_config() @@ -79,7 +79,7 @@ static int fw_trace_config_show(struct seq_file *s, void *v) static int last_bootmode_show(struct seq_file *s, void *v) { struct drm_info_node *node = (struct drm_info_node *)s->private; - struct ivpu_device *vdev = to_ivpu_device(node->minor->dev); + struct ivpu_device *vdev = to_ivpu_device(node->minor->drm); seq_printf(s, "%s\n", (vdev->pm->is_warmboot) ? "warmboot" : "coldboot"); @@ -89,7 +89,7 @@ static int last_bootmode_show(struct seq_file *s, void *v) static int reset_counter_show(struct seq_file *s, void *v) { struct drm_info_node *node = (struct drm_info_node *)s->private; - struct ivpu_device *vdev = to_ivpu_device(node->minor->dev); + struct ivpu_device *vdev = to_ivpu_device(node->minor->drm); seq_printf(s, "%d\n", atomic_read(&vdev->pm->reset_counter)); return 0; @@ -98,7 +98,7 @@ static int reset_counter_show(struct seq_file *s, void *v) static int reset_pending_show(struct seq_file *s, void *v) { struct drm_info_node *node = (struct drm_info_node *)s->private; - struct ivpu_device *vdev = to_ivpu_device(node->minor->dev); + struct ivpu_device *vdev = to_ivpu_device(node->minor->drm); seq_printf(s, "%d\n", atomic_read(&vdev->pm->in_reset)); return 0; @@ -272,7 +272,7 @@ static const struct file_operations ivpu_reset_engine_fops = { void ivpu_debugfs_init(struct drm_minor *minor) { - struct ivpu_device *vdev = to_ivpu_device(minor->dev); + struct ivpu_device *vdev = to_ivpu_device(minor->drm); drm_debugfs_create_files(vdev_debugfs_list, ARRAY_SIZE(vdev_debugfs_list), minor->debugfs_root, minor); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 56dc69bc8b89..cdd9b84f420a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2738,7 +2738,7 @@ long amdgpu_drm_ioctl(struct file *filp, struct drm_file *file_priv = filp->private_data; struct drm_device *dev; long ret; - dev = file_priv->minor->dev; + dev = file_priv->minor->drm; ret = pm_runtime_get_sync(dev->dev); if (ret < 0) goto out; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c index 13d7413d4ca3..f881434f045f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c @@ -55,7 +55,7 @@ static const char *amdgpu_ip_name[AMDGPU_HW_IP_NUM] = { void amdgpu_show_fdinfo(struct drm_printer *p, struct drm_file *file) { - struct amdgpu_device *adev = drm_to_adev(file->minor->dev); + struct amdgpu_device *adev = drm_to_adev(file->minor->drm); struct amdgpu_fpriv *fpriv = file->driver_priv; struct amdgpu_vm *vm = &fpriv->vm; @@ -87,7 +87,7 @@ void amdgpu_show_fdinfo(struct drm_printer *p, struct drm_file *file) */ drm_printf(p, "pasid:\t%u\n", fpriv->vm.pasid); - drm_printf(p, "drm-driver:\t%s\n", file->minor->dev->driver->name); + drm_printf(p, "drm-driver:\t%s\n", file->minor->drm->driver->name); drm_printf(p, "drm-pdev:\t%04x:%02x:%02x.%d\n", domain, bus, dev, fn); drm_printf(p, "drm-client-id:\t%Lu\n", vm->immediate.fence_context); drm_printf(p, "drm-memory-vram:\t%llu KiB\n", stats.vram/1024UL); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c index d733fa6e7477..bcdff2307e73 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c @@ -238,12 +238,12 @@ static int amdgpu_xcp_dev_alloc(struct amdgpu_device *adev) return ret; /* Redirect all IOCTLs to the primary device */ - adev->xcp_mgr->xcp[i].rdev = p_ddev->render->dev; - adev->xcp_mgr->xcp[i].pdev = p_ddev->primary->dev; + adev->xcp_mgr->xcp[i].rdev = p_ddev->render->drm; + adev->xcp_mgr->xcp[i].pdev = p_ddev->primary->drm; adev->xcp_mgr->xcp[i].driver = (struct drm_driver *)p_ddev->driver; adev->xcp_mgr->xcp[i].vma_offset_manager = p_ddev->vma_offset_manager; - p_ddev->render->dev = ddev; - p_ddev->primary->dev = ddev; + p_ddev->render->drm = ddev; + p_ddev->primary->drm = ddev; p_ddev->vma_offset_manager = ddev->vma_offset_manager; p_ddev->driver = &amdgpu_partition_driver; adev->xcp_mgr->xcp[i].ddev = p_ddev; @@ -342,8 +342,8 @@ void amdgpu_xcp_dev_unplug(struct amdgpu_device *adev) for (i = 0; i < MAX_XCP; i++) { p_ddev = adev->xcp_mgr->xcp[i].ddev; drm_dev_unplug(p_ddev); - p_ddev->render->dev = adev->xcp_mgr->xcp[i].rdev; - p_ddev->primary->dev = adev->xcp_mgr->xcp[i].pdev; + p_ddev->render->drm = adev->xcp_mgr->xcp[i].rdev; + p_ddev->primary->drm = adev->xcp_mgr->xcp[i].pdev; p_ddev->driver = adev->xcp_mgr->xcp[i].driver; p_ddev->vma_offset_manager = adev->xcp_mgr->xcp[i].vma_offset_manager; } diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index b23ca9b90b7c..adad8ba01d6b 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -547,13 +547,13 @@ static const struct file_operations malidp_debugfs_fops = { static void malidp_debugfs_init(struct drm_minor *minor) { - struct malidp_drm *malidp = drm_to_malidp(minor->dev); + struct malidp_drm *malidp = drm_to_malidp(minor->drm); malidp_error_stats_init(&malidp->de_errors); malidp_error_stats_init(&malidp->se_errors); spin_lock_init(&malidp->errors_lock); debugfs_create_file("debug", S_IRUGO | S_IWUSR, minor->debugfs_root, - minor->dev, &malidp_debugfs_fops); + minor->drm, &malidp_debugfs_fops); } #endif //CONFIG_DEBUG_FS diff --git a/drivers/gpu/drm/armada/armada_debugfs.c b/drivers/gpu/drm/armada/armada_debugfs.c index 29f4b52e3c8d..3a2c09681013 100644 --- a/drivers/gpu/drm/armada/armada_debugfs.c +++ b/drivers/gpu/drm/armada/armada_debugfs.c @@ -18,7 +18,7 @@ static int armada_debugfs_gem_linear_show(struct seq_file *m, void *data) { struct drm_info_node *node = m->private; - struct drm_device *dev = node->minor->dev; + struct drm_device *dev = node->minor->drm; struct armada_private *priv = drm_to_armada_dev(dev); struct drm_printer p = drm_seq_file_printer(m); diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c index a4ad6fd13abc..9d023f53b599 100644 --- a/drivers/gpu/drm/drm_agpsupport.c +++ b/drivers/gpu/drm/drm_agpsupport.c @@ -127,7 +127,7 @@ EXPORT_SYMBOL(drm_legacy_agp_acquire); int drm_legacy_agp_acquire_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - return drm_legacy_agp_acquire((struct drm_device *)file_priv->minor->dev); + return drm_legacy_agp_acquire((struct drm_device *)file_priv->minor->drm); } /* diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index dfcd7aa474b7..ab851e7b1a41 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -1835,7 +1835,7 @@ static const struct drm_debugfs_info drm_atomic_debugfs_list[] = { void drm_atomic_debugfs_init(struct drm_minor *minor) { - drm_debugfs_add_files(minor->dev, drm_atomic_debugfs_list, + drm_debugfs_add_files(minor->drm, drm_atomic_debugfs_list, ARRAY_SIZE(drm_atomic_debugfs_list)); } #endif diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c index c37032bccd0f..012ed4b9ce6d 100644 --- a/drivers/gpu/drm/drm_auth.c +++ b/drivers/gpu/drm/drm_auth.c @@ -64,9 +64,9 @@ static bool drm_is_current_master_locked(struct drm_file *fpriv) { lockdep_assert_once(lockdep_is_held(&fpriv->master_lookup_lock) || - lockdep_is_held(&fpriv->minor->dev->master_mutex)); + lockdep_is_held(&fpriv->minor->drm->master_mutex)); - return fpriv->is_master && drm_lease_owner(fpriv->master) == fpriv->minor->dev->master; + return fpriv->is_master && drm_lease_owner(fpriv->master) == fpriv->minor->drm->master; } /** @@ -332,7 +332,7 @@ int drm_dropmaster_ioctl(struct drm_device *dev, void *data, int drm_master_open(struct drm_file *file_priv) { - struct drm_device *dev = file_priv->minor->dev; + struct drm_device *dev = file_priv->minor->drm; int ret = 0; /* if there is no current master make this fd it, but do not create @@ -353,7 +353,7 @@ int drm_master_open(struct drm_file *file_priv) void drm_master_release(struct drm_file *file_priv) { - struct drm_device *dev = file_priv->minor->dev; + struct drm_device *dev = file_priv->minor->drm; struct drm_master *master; mutex_lock(&dev->master_mutex); diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c index 3b82635dc9ff..4b0d753ec32f 100644 --- a/drivers/gpu/drm/drm_client.c +++ b/drivers/gpu/drm/drm_client.c @@ -518,7 +518,7 @@ static const struct drm_debugfs_info drm_client_debugfs_list[] = { void drm_client_debugfs_init(struct drm_minor *minor) { - drm_debugfs_add_files(minor->dev, drm_client_debugfs_list, + drm_debugfs_add_files(minor->drm, drm_client_debugfs_list, ARRAY_SIZE(drm_client_debugfs_list)); } #endif diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index 4542eed896dd..9cb888faa479 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -191,7 +191,7 @@ static const struct file_operations drm_debugfs_fops = { void drm_debugfs_create_files(const struct drm_info_list *files, int count, struct dentry *root, struct drm_minor *minor) { - struct drm_device *dev = minor->dev; + struct drm_device *dev = minor->drm; struct drm_info_node *tmp; int i; @@ -221,7 +221,7 @@ EXPORT_SYMBOL(drm_debugfs_create_files); int drm_debugfs_init(struct drm_minor *minor, int minor_id, struct dentry *root) { - struct drm_device *dev = minor->dev; + struct drm_device *dev = minor->drm; struct drm_debugfs_entry *entry, *tmp; char name[64]; @@ -230,7 +230,8 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, sprintf(name, "%d", minor_id); minor->debugfs_root = debugfs_create_dir(name, root); - drm_debugfs_add_files(minor->dev, drm_debugfs_list, DRM_DEBUGFS_ENTRIES); + drm_debugfs_add_files(minor->drm, drm_debugfs_list, + DRM_DEBUGFS_ENTRIES); if (drm_drv_uses_atomic_modeset(dev)) { drm_atomic_debugfs_init(minor); diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 12687dd9e1ac..fc1d47e08427 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -103,7 +103,7 @@ static void drm_minor_alloc_release(struct drm_device *dev, void *data) struct drm_minor *minor = data; unsigned long flags; - WARN_ON(dev != minor->dev); + WARN_ON(dev != minor->drm); put_device(minor->kdev); @@ -127,7 +127,7 @@ static int drm_minor_alloc(struct drm_device *dev, unsigned int type) return -ENOMEM; minor->type = type; - minor->dev = dev; + minor->drm = dev; idr_preload(GFP_KERNEL); if (type == DRM_MINOR_ACCEL) { @@ -243,13 +243,13 @@ struct drm_minor *drm_minor_acquire(unsigned int minor_id) spin_lock_irqsave(&drm_minor_lock, flags); minor = idr_find(&drm_minors_idr, minor_id); if (minor) - drm_dev_get(minor->dev); + drm_dev_get(minor->drm); spin_unlock_irqrestore(&drm_minor_lock, flags); if (!minor) { return ERR_PTR(-ENODEV); - } else if (drm_dev_is_unplugged(minor->dev)) { - drm_dev_put(minor->dev); + } else if (drm_dev_is_unplugged(minor->drm)) { + drm_dev_put(minor->drm); return ERR_PTR(-ENODEV); } @@ -258,7 +258,7 @@ struct drm_minor *drm_minor_acquire(unsigned int minor_id) void drm_minor_release(struct drm_minor *minor) { - drm_dev_put(minor->dev); + drm_dev_put(minor->drm); } /** @@ -1036,7 +1036,7 @@ static int drm_stub_open(struct inode *inode, struct file *filp) if (IS_ERR(minor)) return PTR_ERR(minor); - new_fops = fops_get(minor->dev->driver->fops); + new_fops = fops_get(minor->drm->driver->fops); if (!new_fops) { err = -ENODEV; goto out; diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index 883d83bc0e3d..1f8b2e5b122b 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c @@ -150,7 +150,7 @@ bool drm_dev_needs_global_mutex(struct drm_device *dev) struct drm_file *drm_file_alloc(struct drm_minor *minor) { static atomic64_t ident = ATOMIC_INIT(0); - struct drm_device *dev = minor->dev; + struct drm_device *dev = minor->drm; struct drm_file *file; int ret; @@ -208,7 +208,7 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor) static void drm_events_release(struct drm_file *file_priv) { - struct drm_device *dev = file_priv->minor->dev; + struct drm_device *dev = file_priv->minor->drm; struct drm_pending_event *e, *et; unsigned long flags; @@ -247,7 +247,7 @@ void drm_file_free(struct drm_file *file) if (!file) return; - dev = file->minor->dev; + dev = file->minor->drm; drm_dbg_core(dev, "comm=\"%s\", pid=%d, dev=0x%lx, open_count=%d\n", current->comm, task_pid_nr(current), @@ -298,7 +298,7 @@ void drm_file_free(struct drm_file *file) static void drm_close_helper(struct file *filp) { struct drm_file *file_priv = filp->private_data; - struct drm_device *dev = file_priv->minor->dev; + struct drm_device *dev = file_priv->minor->drm; mutex_lock(&dev->filelist_mutex); list_del(&file_priv->lhead); @@ -332,7 +332,7 @@ static int drm_cpu_valid(void) */ int drm_open_helper(struct file *filp, struct drm_minor *minor) { - struct drm_device *dev = minor->dev; + struct drm_device *dev = minor->drm; struct drm_file *priv; int ret; @@ -417,7 +417,7 @@ int drm_open(struct inode *inode, struct file *filp) if (IS_ERR(minor)) return PTR_ERR(minor); - dev = minor->dev; + dev = minor->drm; if (drm_dev_needs_global_mutex(dev)) mutex_lock(&drm_global_mutex); @@ -484,7 +484,7 @@ int drm_release(struct inode *inode, struct file *filp) { struct drm_file *file_priv = filp->private_data; struct drm_minor *minor = file_priv->minor; - struct drm_device *dev = minor->dev; + struct drm_device *dev = minor->drm; if (drm_dev_needs_global_mutex(dev)) mutex_lock(&drm_global_mutex); @@ -524,7 +524,7 @@ int drm_release_noglobal(struct inode *inode, struct file *filp) { struct drm_file *file_priv = filp->private_data; struct drm_minor *minor = file_priv->minor; - struct drm_device *dev = minor->dev; + struct drm_device *dev = minor->drm; drm_close_helper(filp); @@ -568,7 +568,7 @@ ssize_t drm_read(struct file *filp, char __user *buffer, size_t count, loff_t *offset) { struct drm_file *file_priv = filp->private_data; - struct drm_device *dev = file_priv->minor->dev; + struct drm_device *dev = file_priv->minor->drm; ssize_t ret; ret = mutex_lock_interruptible(&file_priv->event_read_lock); @@ -981,7 +981,7 @@ EXPORT_SYMBOL(drm_show_memory_stats); void drm_show_fdinfo(struct seq_file *m, struct file *f) { struct drm_file *file = f->private_data; - struct drm_device *dev = file->minor->dev; + struct drm_device *dev = file->minor->drm; struct drm_printer p = drm_seq_file_printer(m); drm_printf(&p, "drm-driver:\t%s\n", dev->driver->name); @@ -1016,7 +1016,7 @@ EXPORT_SYMBOL(drm_show_fdinfo); */ struct file *mock_drm_getfile(struct drm_minor *minor, unsigned int flags) { - struct drm_device *dev = minor->dev; + struct drm_device *dev = minor->drm; struct drm_file *priv; struct file *file; diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 882a8b1eaa16..f987c018b65d 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -1224,7 +1224,7 @@ static const struct drm_debugfs_info drm_framebuffer_debugfs_list[] = { void drm_framebuffer_debugfs_init(struct drm_minor *minor) { - drm_debugfs_add_files(minor->dev, drm_framebuffer_debugfs_list, + drm_debugfs_add_files(minor->drm, drm_framebuffer_debugfs_list, ARRAY_SIZE(drm_framebuffer_debugfs_list)); } #endif diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index ce9a8a3d281c..5e4c465ac73f 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -1084,7 +1084,7 @@ EXPORT_SYMBOL(drm_gem_mmap_obj); int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) { struct drm_file *priv = filp->private_data; - struct drm_device *dev = priv->minor->dev; + struct drm_device *dev = priv->minor->drm; struct drm_gem_object *obj = NULL; struct drm_vma_offset_node *node; int ret; diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index 54e53ca19482..da351a6816cf 100644 --- a/drivers/gpu/drm/drm_gem_vram_helper.c +++ b/drivers/gpu/drm/drm_gem_vram_helper.c @@ -989,7 +989,7 @@ static const struct drm_debugfs_info drm_vram_mm_debugfs_list[] = { */ void drm_vram_mm_debugfs_init(struct drm_minor *minor) { - drm_debugfs_add_files(minor->dev, drm_vram_mm_debugfs_list, + drm_debugfs_add_files(minor->drm, drm_vram_mm_debugfs_list, ARRAY_SIZE(drm_vram_mm_debugfs_list)); } EXPORT_SYMBOL(drm_vram_mm_debugfs_init); diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c index 49a743f62b4a..2b0d3eb060d2 100644 --- a/drivers/gpu/drm/drm_ioc32.c +++ b/drivers/gpu/drm/drm_ioc32.c @@ -972,7 +972,7 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { unsigned int nr = DRM_IOCTL_NR(cmd); struct drm_file *file_priv = filp->private_data; - struct drm_device *dev = file_priv->minor->dev; + struct drm_device *dev = file_priv->minor->drm; drm_ioctl_compat_t *fn; int ret; diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index 8e9afe7af19c..188fa010a356 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -771,7 +771,7 @@ long drm_ioctl_kernel(struct file *file, drm_ioctl_t *func, void *kdata, u32 flags) { struct drm_file *file_priv = file->private_data; - struct drm_device *dev = file_priv->minor->dev; + struct drm_device *dev = file_priv->minor->drm; int retcode; if (drm_dev_is_unplugged(dev)) @@ -821,7 +821,7 @@ long drm_ioctl(struct file *filp, unsigned int in_size, out_size, drv_size, ksize; bool is_driver_ioctl; - dev = file_priv->minor->dev; + dev = file_priv->minor->drm; if (drm_dev_is_unplugged(dev)) return -ENODEV; diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index 7b85ebaac7c8..75019ccfc024 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -1449,7 +1449,7 @@ static const struct file_operations mipi_dbi_debugfs_command_fops = { */ void mipi_dbi_debugfs_init(struct drm_minor *minor) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(minor->dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(minor->drm); umode_t mode = S_IFREG | S_IWUSR; if (dbidev->dbi.read_commands) diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 6ad7b54c8f13..d52c2c0f24ee 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -546,7 +546,7 @@ struct device *drm_sysfs_minor_alloc(struct drm_minor *minor) kdev->type = &drm_sysfs_device_minor; } - kdev->parent = minor->dev->dev; + kdev->parent = minor->drm->dev; kdev->release = drm_sysfs_release; dev_set_drvdata(kdev, minor); diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c index 87c9fe55dec7..022837fee2a1 100644 --- a/drivers/gpu/drm/drm_vm.c +++ b/drivers/gpu/drm/drm_vm.c @@ -111,7 +111,7 @@ static vm_fault_t drm_vm_fault(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma; struct drm_file *priv = vma->vm_file->private_data; - struct drm_device *dev = priv->minor->dev; + struct drm_device *dev = priv->minor->drm; struct drm_local_map *map = NULL; struct drm_map_list *r_list; struct drm_hash_item *hash; @@ -230,7 +230,7 @@ static vm_fault_t drm_vm_shm_fault(struct vm_fault *vmf) static void drm_vm_shm_close(struct vm_area_struct *vma) { struct drm_file *priv = vma->vm_file->private_data; - struct drm_device *dev = priv->minor->dev; + struct drm_device *dev = priv->minor->drm; struct drm_vma_entry *pt, *temp; struct drm_local_map *map; struct drm_map_list *r_list; @@ -300,7 +300,7 @@ static vm_fault_t drm_vm_dma_fault(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma; struct drm_file *priv = vma->vm_file->private_data; - struct drm_device *dev = priv->minor->dev; + struct drm_device *dev = priv->minor->drm; struct drm_device_dma *dma = dev->dma; unsigned long offset; unsigned long page_nr; @@ -336,7 +336,7 @@ static vm_fault_t drm_vm_sg_fault(struct vm_fault *vmf) struct vm_area_struct *vma = vmf->vma; struct drm_local_map *map = vma->vm_private_data; struct drm_file *priv = vma->vm_file->private_data; - struct drm_device *dev = priv->minor->dev; + struct drm_device *dev = priv->minor->drm; struct drm_sg_mem *entry = dev->sg; unsigned long offset; unsigned long map_offset; @@ -405,7 +405,7 @@ static void drm_vm_open_locked(struct drm_device *dev, static void drm_vm_open(struct vm_area_struct *vma) { struct drm_file *priv = vma->vm_file->private_data; - struct drm_device *dev = priv->minor->dev; + struct drm_device *dev = priv->minor->drm; mutex_lock(&dev->struct_mutex); drm_vm_open_locked(dev, vma); @@ -440,7 +440,7 @@ static void drm_vm_close_locked(struct drm_device *dev, static void drm_vm_close(struct vm_area_struct *vma) { struct drm_file *priv = vma->vm_file->private_data; - struct drm_device *dev = priv->minor->dev; + struct drm_device *dev = priv->minor->drm; mutex_lock(&dev->struct_mutex); drm_vm_close_locked(dev, vma); @@ -464,7 +464,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma) struct drm_device_dma *dma; unsigned long length = vma->vm_end - vma->vm_start; - dev = priv->minor->dev; + dev = priv->minor->drm; dma = dev->dma; DRM_DEBUG("start = 0x%lx, end = 0x%lx, page offset = 0x%lx\n", vma->vm_start, vma->vm_end, vma->vm_pgoff); @@ -523,7 +523,7 @@ static resource_size_t drm_core_get_reg_ofs(struct drm_device *dev) static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma) { struct drm_file *priv = filp->private_data; - struct drm_device *dev = priv->minor->dev; + struct drm_device *dev = priv->minor->drm; struct drm_local_map *map = NULL; resource_size_t offset = 0; struct drm_hash_item *hash; @@ -637,7 +637,7 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma) int drm_legacy_mmap(struct file *filp, struct vm_area_struct *vma) { struct drm_file *priv = filp->private_data; - struct drm_device *dev = priv->minor->dev; + struct drm_device *dev = priv->minor->drm; int ret; if (drm_dev_is_unplugged(dev)) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index ea55f6b7b744..f08fbdae5c8e 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -199,7 +199,7 @@ static int etnaviv_ring_show(struct etnaviv_gpu *gpu, struct seq_file *m) static int show_unlocked(struct seq_file *m, void *arg) { struct drm_info_node *node = (struct drm_info_node *) m->private; - struct drm_device *dev = node->minor->dev; + struct drm_device *dev = node->minor->drm; int (*show)(struct drm_device *dev, struct seq_file *m) = node->info_ent->data; @@ -209,7 +209,7 @@ static int show_unlocked(struct seq_file *m, void *arg) static int show_each_gpu(struct seq_file *m, void *arg) { struct drm_info_node *node = (struct drm_info_node *) m->private; - struct drm_device *dev = node->minor->dev; + struct drm_device *dev = node->minor->drm; struct etnaviv_drm_private *priv = dev->dev_private; struct etnaviv_gpu *gpu; int (*show)(struct etnaviv_gpu *gpu, struct seq_file *m) = diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c index a4b818da32ed..5448d08cabef 100644 --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c @@ -36,7 +36,7 @@ static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node) { - return to_i915(node->minor->dev); + return to_i915(node->minor->drm); } static int i915_frontbuffer_tracking(struct seq_file *m, void *unused) @@ -1084,7 +1084,7 @@ void intel_display_debugfs_register(struct drm_i915_private *i915) debugfs_create_file(intel_display_debugfs_files[i].name, S_IRUGO | S_IWUSR, minor->debugfs_root, - to_i915(minor->dev), + to_i915(minor->drm), intel_display_debugfs_files[i].fops); } diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c index 89ef6b44aa03..ec403396fd3e 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c @@ -1024,7 +1024,7 @@ int i915_gem_mmap(struct file *filp, struct vm_area_struct *vma) { struct drm_vma_offset_node *node; struct drm_file *priv = filp->private_data; - struct drm_device *dev = priv->minor->dev; + struct drm_device *dev = priv->minor->drm; struct drm_i915_gem_object *obj = NULL; struct i915_mmap_offset *mmo = NULL; diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 76ccd4e03e31..e05521958262 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -56,7 +56,7 @@ static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node) { - return to_i915(node->minor->dev); + return to_i915(node->minor->drm); } static int i915_capabilities(struct seq_file *m, void *data) @@ -846,12 +846,12 @@ void i915_debugfs_register(struct drm_i915_private *dev_priv) i915_debugfs_params(dev_priv); debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->debugfs_root, - to_i915(minor->dev), &i915_forcewake_fops); + to_i915(minor->drm), &i915_forcewake_fops); for (i = 0; i < ARRAY_SIZE(i915_debugfs_files); i++) { debugfs_create_file(i915_debugfs_files[i].name, S_IRUGO | S_IWUSR, minor->debugfs_root, - to_i915(minor->dev), + to_i915(minor->drm), i915_debugfs_files[i].fops); } diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c index e88bb4f04305..ccc0a6ddf7ff 100644 --- a/drivers/gpu/drm/i915/i915_sysfs.c +++ b/drivers/gpu/drm/i915/i915_sysfs.c @@ -41,7 +41,7 @@ struct drm_i915_private *kdev_minor_to_i915(struct device *kdev) { struct drm_minor *minor = dev_get_drvdata(kdev); - return to_i915(minor->dev); + return to_i915(minor->drm); } static int l3_access_valid(struct drm_i915_private *i915, loff_t offset) diff --git a/drivers/gpu/drm/loongson/lsdc_debugfs.c b/drivers/gpu/drm/loongson/lsdc_debugfs.c index b9c2e6b1701f..7b1d16535105 100644 --- a/drivers/gpu/drm/loongson/lsdc_debugfs.c +++ b/drivers/gpu/drm/loongson/lsdc_debugfs.c @@ -33,7 +33,7 @@ static int lsdc_identify(struct seq_file *m, void *arg) static int lsdc_show_mm(struct seq_file *m, void *arg) { struct drm_info_node *node = (struct drm_info_node *)m->private; - struct drm_device *ddev = node->minor->dev; + struct drm_device *ddev = node->minor->drm; struct drm_printer p = drm_seq_file_printer(m); drm_mm_print(&ddev->vma_offset_manager->vm_addr_space_mm, &p); @@ -96,7 +96,7 @@ static struct drm_info_list lsdc_debugfs_list[] = { void lsdc_debugfs_init(struct drm_minor *minor) { - struct drm_device *ddev = minor->dev; + struct drm_device *ddev = minor->drm; struct lsdc_device *ldev = to_lsdc(ddev); unsigned int n = ARRAY_SIZE(lsdc_debugfs_list); unsigned int i; diff --git a/drivers/gpu/drm/loongson/lsdc_gem.c b/drivers/gpu/drm/loongson/lsdc_gem.c index a4029fd72df9..dc54514fec74 100644 --- a/drivers/gpu/drm/loongson/lsdc_gem.c +++ b/drivers/gpu/drm/loongson/lsdc_gem.c @@ -282,7 +282,7 @@ void lsdc_gem_init(struct drm_device *ddev) int lsdc_show_buffer_object(struct seq_file *m, void *arg) { struct drm_info_node *node = (struct drm_info_node *)m->private; - struct drm_device *ddev = node->minor->dev; + struct drm_device *ddev = node->minor->drm; struct lsdc_device *ldev = to_lsdc(ddev); struct lsdc_bo *lbo; unsigned int i; diff --git a/drivers/gpu/drm/loongson/lsdc_output_7a2000.c b/drivers/gpu/drm/loongson/lsdc_output_7a2000.c index 9b230c56d6bd..7cc01623e389 100644 --- a/drivers/gpu/drm/loongson/lsdc_output_7a2000.c +++ b/drivers/gpu/drm/loongson/lsdc_output_7a2000.c @@ -113,7 +113,7 @@ static const struct lsdc_reg32 ls7a2000_hdmi1_encoder_regs[] = { static int ls7a2000_hdmi_encoder_regs_show(struct seq_file *m, void *data) { struct drm_info_node *node = (struct drm_info_node *)m->private; - struct drm_device *ddev = node->minor->dev; + struct drm_device *ddev = node->minor->drm; struct lsdc_device *ldev = to_lsdc(ddev); const struct lsdc_reg32 *preg; diff --git a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c index 169b8fe688f8..712c6f71d4ab 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c @@ -70,7 +70,7 @@ static void roq_print(struct msm_gpu *gpu, struct drm_printer *p) static int show(struct seq_file *m, void *arg) { struct drm_info_node *node = m->private; - struct drm_device *dev = node->minor->dev; + struct drm_device *dev = node->minor->drm; struct msm_drm_private *priv = dev->dev_private; struct drm_printer p = drm_seq_file_printer(m); void (*show)(struct msm_gpu *gpu, struct drm_printer *p) = @@ -148,7 +148,7 @@ void a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor) if (!minor) return; - dev = minor->dev; + dev = minor->drm; drm_debugfs_create_files(a5xx_debugfs_list, ARRAY_SIZE(a5xx_debugfs_list), diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c index b7039b5102d6..ca75251682f0 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c @@ -230,7 +230,7 @@ static void mdp5_kms_destroy(struct msm_kms *kms) static int smp_show(struct seq_file *m, void *arg) { struct drm_info_node *node = m->private; - struct drm_device *dev = node->minor->dev; + struct drm_device *dev = node->minor->drm; struct msm_drm_private *priv = dev->dev_private; struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(priv->kms)); struct drm_printer p = drm_seq_file_printer(m); diff --git a/drivers/gpu/drm/msm/dp/dp_debug.c b/drivers/gpu/drm/msm/dp/dp_debug.c index 3bba901afe33..dce9a70b74bb 100644 --- a/drivers/gpu/drm/msm/dp/dp_debug.c +++ b/drivers/gpu/drm/msm/dp/dp_debug.c @@ -254,7 +254,7 @@ struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel, debug->link = link; debug->panel = panel; debug->dev = dev; - debug->drm_dev = minor->dev; + debug->drm_dev = minor->drm; debug->connector = connector; dp_debug = &debug->dp_debug; diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c index a0a936f80ae3..f198996998c3 100644 --- a/drivers/gpu/drm/msm/msm_debugfs.c +++ b/drivers/gpu/drm/msm/msm_debugfs.c @@ -212,7 +212,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(shrink_fops, static int msm_gem_show(struct seq_file *m, void *arg) { struct drm_info_node *node = m->private; - struct drm_device *dev = node->minor->dev; + struct drm_device *dev = node->minor->drm; struct msm_drm_private *priv = dev->dev_private; int ret; @@ -230,7 +230,7 @@ static int msm_gem_show(struct seq_file *m, void *arg) static int msm_mm_show(struct seq_file *m, void *arg) { struct drm_info_node *node = m->private; - struct drm_device *dev = node->minor->dev; + struct drm_device *dev = node->minor->drm; struct drm_printer p = drm_seq_file_printer(m); drm_mm_print(&dev->vma_offset_manager->vm_addr_space_mm, &p); @@ -241,7 +241,7 @@ static int msm_mm_show(struct seq_file *m, void *arg) static int msm_fb_show(struct seq_file *m, void *arg) { struct drm_info_node *node = m->private; - struct drm_device *dev = node->minor->dev; + struct drm_device *dev = node->minor->drm; struct drm_framebuffer *fb, *fbdev_fb = NULL; if (dev->fb_helper && dev->fb_helper->fb) { @@ -278,13 +278,15 @@ static int late_init_minor(struct drm_minor *minor) ret = msm_rd_debugfs_init(minor); if (ret) { - DRM_DEV_ERROR(minor->dev->dev, "could not install rd debugfs\n"); + DRM_DEV_ERROR(minor->drm->dev, + "could not install rd debugfs\n"); return ret; } ret = msm_perf_debugfs_init(minor); if (ret) { - DRM_DEV_ERROR(minor->dev->dev, "could not install perf debugfs\n"); + DRM_DEV_ERROR(minor->drm->dev, + "could not install perf debugfs\n"); return ret; } @@ -303,7 +305,7 @@ int msm_debugfs_late_init(struct drm_device *dev) void msm_debugfs_init(struct drm_minor *minor) { - struct drm_device *dev = minor->dev; + struct drm_device *dev = minor->drm; struct msm_drm_private *priv = dev->dev_private; struct dentry *gpu_devfreq; diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 11ff297db886..f9b890422980 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -1059,7 +1059,7 @@ static const struct drm_ioctl_desc msm_ioctls[] = { static void msm_show_fdinfo(struct drm_printer *p, struct drm_file *file) { - struct drm_device *dev = file->minor->dev; + struct drm_device *dev = file->minor->drm; struct msm_drm_private *priv = dev->dev_private; if (!priv->gpu) diff --git a/drivers/gpu/drm/msm/msm_perf.c b/drivers/gpu/drm/msm/msm_perf.c index 3d3da79fec2a..cb0243671944 100644 --- a/drivers/gpu/drm/msm/msm_perf.c +++ b/drivers/gpu/drm/msm/msm_perf.c @@ -198,7 +198,7 @@ static const struct file_operations perf_debugfs_fops = { int msm_perf_debugfs_init(struct drm_minor *minor) { - struct msm_drm_private *priv = minor->dev->dev_private; + struct msm_drm_private *priv = minor->drm->dev_private; struct msm_perf_state *perf; /* only create on first minor: */ @@ -209,7 +209,7 @@ int msm_perf_debugfs_init(struct drm_minor *minor) if (!perf) return -ENOMEM; - perf->dev = minor->dev; + perf->dev = minor->drm; mutex_init(&perf->read_lock); priv->perf = perf; diff --git a/drivers/gpu/drm/msm/msm_rd.c b/drivers/gpu/drm/msm/msm_rd.c index 8d5687d5ed78..430783cf4974 100644 --- a/drivers/gpu/drm/msm/msm_rd.c +++ b/drivers/gpu/drm/msm/msm_rd.c @@ -250,7 +250,7 @@ static struct msm_rd_state *rd_init(struct drm_minor *minor, const char *name) if (!rd) return ERR_PTR(-ENOMEM); - rd->dev = minor->dev; + rd->dev = minor->drm; rd->fifo.buf = rd->buf; mutex_init(&rd->read_lock); @@ -266,7 +266,7 @@ static struct msm_rd_state *rd_init(struct drm_minor *minor, const char *name) int msm_rd_debugfs_init(struct drm_minor *minor) { - struct msm_drm_private *priv = minor->dev->dev_private; + struct msm_drm_private *priv = minor->drm->dev_private; struct msm_rd_state *rd; int ret; diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c index 99d022a91afc..0c57e3b426b4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c @@ -38,7 +38,7 @@ static int nouveau_debugfs_vbios_image(struct seq_file *m, void *data) { struct drm_info_node *node = (struct drm_info_node *) m->private; - struct nouveau_drm *drm = nouveau_drm(node->minor->dev); + struct nouveau_drm *drm = nouveau_drm(node->minor->drm); int i; for (i = 0; i < drm->vbios.length; i++) @@ -50,7 +50,7 @@ static int nouveau_debugfs_strap_peek(struct seq_file *m, void *data) { struct drm_info_node *node = m->private; - struct nouveau_drm *drm = nouveau_drm(node->minor->dev); + struct nouveau_drm *drm = nouveau_drm(node->minor->drm); int ret; ret = pm_runtime_get_sync(drm->dev->dev); @@ -227,14 +227,14 @@ static const struct nouveau_debugfs_files { void nouveau_drm_debugfs_init(struct drm_minor *minor) { - struct nouveau_drm *drm = nouveau_drm(minor->dev); + struct nouveau_drm *drm = nouveau_drm(minor->drm); struct dentry *dentry; int i; for (i = 0; i < ARRAY_SIZE(nouveau_debugfs_files); i++) { debugfs_create_file(nouveau_debugfs_files[i].name, S_IRUGO | S_IWUSR, - minor->debugfs_root, minor->dev, + minor->debugfs_root, minor->drm, nouveau_debugfs_files[i].fops); } diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index ca3bb8075357..5af878525516 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -1185,7 +1185,7 @@ long nouveau_drm_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct drm_file *filp = file->private_data; - struct drm_device *dev = filp->minor->dev; + struct drm_device *dev = filp->minor->drm; long ret; ret = pm_runtime_get_sync(dev->dev); diff --git a/drivers/gpu/drm/omapdrm/omap_debugfs.c b/drivers/gpu/drm/omapdrm/omap_debugfs.c index a3d470468e5b..025b1cc7dcf5 100644 --- a/drivers/gpu/drm/omapdrm/omap_debugfs.c +++ b/drivers/gpu/drm/omapdrm/omap_debugfs.c @@ -20,7 +20,7 @@ static int gem_show(struct seq_file *m, void *arg) { struct drm_info_node *node = (struct drm_info_node *) m->private; - struct drm_device *dev = node->minor->dev; + struct drm_device *dev = node->minor->drm; struct omap_drm_private *priv = dev->dev_private; seq_printf(m, "All Objects:\n"); @@ -34,7 +34,7 @@ static int gem_show(struct seq_file *m, void *arg) static int mm_show(struct seq_file *m, void *arg) { struct drm_info_node *node = (struct drm_info_node *) m->private; - struct drm_device *dev = node->minor->dev; + struct drm_device *dev = node->minor->drm; struct drm_printer p = drm_seq_file_printer(m); drm_mm_print(&dev->vma_offset_manager->vm_addr_space_mm, &p); @@ -46,7 +46,7 @@ static int mm_show(struct seq_file *m, void *arg) static int fb_show(struct seq_file *m, void *arg) { struct drm_info_node *node = (struct drm_info_node *) m->private; - struct drm_device *dev = node->minor->dev; + struct drm_device *dev = node->minor->drm; struct drm_fb_helper *helper = dev->fb_helper; struct drm_framebuffer *fb; diff --git a/drivers/gpu/drm/pl111/pl111_debugfs.c b/drivers/gpu/drm/pl111/pl111_debugfs.c index 6744fa16f464..51a90b04bd25 100644 --- a/drivers/gpu/drm/pl111/pl111_debugfs.c +++ b/drivers/gpu/drm/pl111/pl111_debugfs.c @@ -33,7 +33,7 @@ static const struct { static int pl111_debugfs_regs(struct seq_file *m, void *unused) { struct drm_info_node *node = (struct drm_info_node *)m->private; - struct drm_device *dev = node->minor->dev; + struct drm_device *dev = node->minor->drm; struct pl111_drm_dev_private *priv = dev->dev_private; int i; diff --git a/drivers/gpu/drm/qxl/qxl_debugfs.c b/drivers/gpu/drm/qxl/qxl_debugfs.c index 2d9ed3b94574..3fd8e02066c1 100644 --- a/drivers/gpu/drm/qxl/qxl_debugfs.c +++ b/drivers/gpu/drm/qxl/qxl_debugfs.c @@ -39,7 +39,7 @@ static int qxl_debugfs_irq_received(struct seq_file *m, void *data) { struct drm_info_node *node = (struct drm_info_node *) m->private; - struct qxl_device *qdev = to_qxl(node->minor->dev); + struct qxl_device *qdev = to_qxl(node->minor->drm); seq_printf(m, "%d\n", atomic_read(&qdev->irq_received)); seq_printf(m, "%d\n", atomic_read(&qdev->irq_received_display)); @@ -53,7 +53,7 @@ static int qxl_debugfs_buffers_info(struct seq_file *m, void *data) { struct drm_info_node *node = (struct drm_info_node *) m->private; - struct qxl_device *qdev = to_qxl(node->minor->dev); + struct qxl_device *qdev = to_qxl(node->minor->drm); struct qxl_bo *bo; list_for_each_entry(bo, &qdev->gem.objects, list) { @@ -87,7 +87,7 @@ void qxl_debugfs_init(struct drm_minor *minor) { #if defined(CONFIG_DEBUG_FS) - struct qxl_device *dev = to_qxl(minor->dev); + struct qxl_device *dev = to_qxl(minor->drm); drm_debugfs_create_files(qxl_debugfs_list, QXL_DEBUGFS_ENTRIES, minor->debugfs_root, minor); diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 39cdede460b5..41abd4e232c4 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -494,7 +494,7 @@ long radeon_drm_ioctl(struct file *filp, struct drm_file *file_priv = filp->private_data; struct drm_device *dev; long ret; - dev = file_priv->minor->dev; + dev = file_priv->minor->drm; ret = pm_runtime_get_sync(dev->dev); if (ret < 0) { pm_runtime_put_autosuspend(dev->dev); diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index 346c151e87be..d6d9d09addaa 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -73,7 +73,7 @@ DEFINE_SIMPLE_ATTRIBUTE(sti_drm_fps_fops, static int sti_drm_fps_dbg_show(struct seq_file *s, void *data) { struct drm_info_node *node = s->private; - struct drm_device *dev = node->minor->dev; + struct drm_device *dev = node->minor->drm; struct drm_plane *p; list_for_each_entry(p, &dev->mode_config.plane_list, head) { @@ -98,7 +98,7 @@ static void sti_drm_dbg_init(struct drm_minor *minor) minor->debugfs_root, minor); debugfs_create_file("fps_show", S_IRUGO | S_IWUSR, minor->debugfs_root, - minor->dev, &sti_drm_fps_fops); + minor->drm, &sti_drm_fps_fops); DRM_INFO("%s: debugfs installed\n", DRIVER_NAME); } diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 6cfea8bef59b..35df1987d023 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -830,7 +830,7 @@ static void tegra_drm_postclose(struct drm_device *drm, struct drm_file *file) static int tegra_debugfs_framebuffers(struct seq_file *s, void *data) { struct drm_info_node *node = (struct drm_info_node *)s->private; - struct drm_device *drm = node->minor->dev; + struct drm_device *drm = node->minor->drm; struct drm_framebuffer *fb; mutex_lock(&drm->mode_config.fb_lock); @@ -851,7 +851,7 @@ static int tegra_debugfs_framebuffers(struct seq_file *s, void *data) static int tegra_debugfs_iova(struct seq_file *s, void *data) { struct drm_info_node *node = (struct drm_info_node *)s->private; - struct drm_device *drm = node->minor->dev; + struct drm_device *drm = node->minor->drm; struct tegra_drm *tegra = drm->dev_private; struct drm_printer p = drm_seq_file_printer(s); diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index 467f797fa65a..c222b18b1215 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -201,7 +201,7 @@ static int tegra_dsi_show_regs(struct seq_file *s, void *data) struct drm_info_node *node = s->private; struct tegra_dsi *dsi = node->info_ent->data; struct drm_crtc *crtc = dsi->output.encoder.crtc; - struct drm_device *drm = node->minor->dev; + struct drm_device *drm = node->minor->drm; unsigned int i; int err = 0; diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index 7f994d79fd72..f9f454f0c755 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -1059,7 +1059,7 @@ static int tegra_hdmi_show_regs(struct seq_file *s, void *data) struct drm_info_node *node = s->private; struct tegra_hdmi *hdmi = node->info_ent->data; struct drm_crtc *crtc = hdmi->output.encoder.crtc; - struct drm_device *drm = node->minor->dev; + struct drm_device *drm = node->minor->drm; unsigned int i; int err = 0; diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index 2bc0f6668b30..9d13ad637cb9 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -1489,7 +1489,7 @@ static int tegra_sor_show_crc(struct seq_file *s, void *data) struct drm_info_node *node = s->private; struct tegra_sor *sor = node->info_ent->data; struct drm_crtc *crtc = sor->output.encoder.crtc; - struct drm_device *drm = node->minor->dev; + struct drm_device *drm = node->minor->drm; int err = 0; u32 value; @@ -1651,7 +1651,7 @@ static int tegra_sor_show_regs(struct seq_file *s, void *data) struct drm_info_node *node = s->private; struct tegra_sor *sor = node->info_ent->data; struct drm_crtc *crtc = sor->output.encoder.crtc; - struct drm_device *drm = node->minor->dev; + struct drm_device *drm = node->minor->drm; unsigned int i; int err = 0; diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index fe56beea3e93..25029ee2d50e 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -430,7 +430,7 @@ static const struct { static int tilcdc_regs_show(struct seq_file *m, void *arg) { struct drm_info_node *node = (struct drm_info_node *) m->private; - struct drm_device *dev = node->minor->dev; + struct drm_device *dev = node->minor->drm; struct tilcdc_drm_private *priv = dev->dev_private; unsigned i; @@ -451,7 +451,7 @@ static int tilcdc_regs_show(struct seq_file *m, void *arg) static int tilcdc_mm_show(struct seq_file *m, void *arg) { struct drm_info_node *node = (struct drm_info_node *) m->private; - struct drm_device *dev = node->minor->dev; + struct drm_device *dev = node->minor->drm; struct drm_printer p = drm_seq_file_printer(m); drm_mm_print(&dev->vma_offset_manager->vm_addr_space_mm, &p); return 0; diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c index e5b10e41554a..14c558fbb397 100644 --- a/drivers/gpu/drm/tiny/arcpgu.c +++ b/drivers/gpu/drm/tiny/arcpgu.c @@ -339,7 +339,7 @@ static int arcpgu_unload(struct drm_device *drm) static int arcpgu_show_pxlclock(struct seq_file *m, void *arg) { struct drm_info_node *node = (struct drm_info_node *)m->private; - struct drm_device *drm = node->minor->dev; + struct drm_device *drm = node->minor->drm; struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(drm); unsigned long clkrate = clk_get_rate(arcpgu->clk); unsigned long mode_clock = arcpgu->pipe.crtc.mode.crtc_clock * 1000; diff --git a/drivers/gpu/drm/v3d/v3d_debugfs.c b/drivers/gpu/drm/v3d/v3d_debugfs.c index 54a9cfbb5a7d..f726ebbfdf14 100644 --- a/drivers/gpu/drm/v3d/v3d_debugfs.c +++ b/drivers/gpu/drm/v3d/v3d_debugfs.c @@ -246,5 +246,6 @@ static const struct drm_debugfs_info v3d_debugfs_list[] = { void v3d_debugfs_init(struct drm_minor *minor) { - drm_debugfs_add_files(minor->dev, v3d_debugfs_list, ARRAY_SIZE(v3d_debugfs_list)); + drm_debugfs_add_files(minor->drm, v3d_debugfs_list, + ARRAY_SIZE(v3d_debugfs_list)); } diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c index 54ff7922ae4d..c25fed030bd5 100644 --- a/drivers/gpu/drm/vc4/vc4_bo.c +++ b/drivers/gpu/drm/vc4/vc4_bo.c @@ -989,7 +989,7 @@ int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, int vc4_bo_debugfs_init(struct drm_minor *minor) { - struct drm_device *drm = minor->dev; + struct drm_device *drm = minor->drm; struct vc4_dev *vc4 = to_vc4_dev(drm); if (!vc4->v3d) diff --git a/drivers/gpu/drm/vc4/vc4_debugfs.c b/drivers/gpu/drm/vc4/vc4_debugfs.c index 1af0432ee6a1..99de3a8c645d 100644 --- a/drivers/gpu/drm/vc4/vc4_debugfs.c +++ b/drivers/gpu/drm/vc4/vc4_debugfs.c @@ -21,7 +21,7 @@ void vc4_debugfs_init(struct drm_minor *minor) { - struct vc4_dev *vc4 = to_vc4_dev(minor->dev); + struct vc4_dev *vc4 = to_vc4_dev(minor->drm); struct drm_device *drm = &vc4->base; drm_WARN_ON(drm, vc4_hvs_debugfs_init(minor)); diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index 552142320e2d..0096d13f8a45 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -760,7 +760,7 @@ static irqreturn_t vc4_hvs_irq_handler(int irq, void *data) int vc4_hvs_debugfs_init(struct drm_minor *minor) { - struct drm_device *drm = minor->dev; + struct drm_device *drm = minor->drm; struct vc4_dev *vc4 = to_vc4_dev(drm); struct vc4_hvs *hvs = vc4->hvs; diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c index 72edeb2d3d78..91b0166821bc 100644 --- a/drivers/gpu/drm/vc4/vc4_v3d.c +++ b/drivers/gpu/drm/vc4/vc4_v3d.c @@ -401,7 +401,7 @@ static int vc4_v3d_runtime_resume(struct device *dev) int vc4_v3d_debugfs_init(struct drm_minor *minor) { - struct drm_device *drm = minor->dev; + struct drm_device *drm = minor->drm; struct vc4_dev *vc4 = to_vc4_dev(drm); struct vc4_v3d *v3d = vc4->v3d; diff --git a/drivers/gpu/drm/virtio/virtgpu_debugfs.c b/drivers/gpu/drm/virtio/virtgpu_debugfs.c index 853dd9aa397e..4ff9e206fefc 100644 --- a/drivers/gpu/drm/virtio/virtgpu_debugfs.c +++ b/drivers/gpu/drm/virtio/virtgpu_debugfs.c @@ -44,7 +44,7 @@ static void virtio_gpu_add_int(struct seq_file *m, const char *name, int value) static int virtio_gpu_features(struct seq_file *m, void *data) { struct drm_info_node *node = (struct drm_info_node *)m->private; - struct virtio_gpu_device *vgdev = node->minor->dev->dev_private; + struct virtio_gpu_device *vgdev = node->minor->drm->dev_private; virtio_gpu_add_bool(m, "virgl", vgdev->has_virgl_3d); virtio_gpu_add_bool(m, "edid", vgdev->has_edid); @@ -69,7 +69,7 @@ static int virtio_gpu_debugfs_irq_info(struct seq_file *m, void *data) { struct drm_info_node *node = (struct drm_info_node *) m->private; - struct virtio_gpu_device *vgdev = node->minor->dev->dev_private; + struct virtio_gpu_device *vgdev = node->minor->drm->dev_private; seq_printf(m, "fence %llu %lld\n", (u64)atomic64_read(&vgdev->fence_drv.last_fence_id), @@ -81,7 +81,7 @@ static int virtio_gpu_debugfs_host_visible_mm(struct seq_file *m, void *data) { struct drm_info_node *node = (struct drm_info_node *)m->private; - struct virtio_gpu_device *vgdev = node->minor->dev->dev_private; + struct virtio_gpu_device *vgdev = node->minor->drm->dev_private; struct drm_printer p; if (!vgdev->has_host_visible) { diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 8b24ecf60e3e..25bb12aa059c 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -1262,7 +1262,7 @@ static long vmw_generic_ioctl(struct file *filp, unsigned int cmd, unsigned long)) { struct drm_file *file_priv = filp->private_data; - struct drm_device *dev = file_priv->minor->dev; + struct drm_device *dev = file_priv->minor->drm; unsigned int nr = DRM_IOCTL_NR(cmd); unsigned int flags; diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index 966912053cb0..de9422281487 100644 --- a/include/drm/drm_file.h +++ b/include/drm/drm_file.h @@ -77,7 +77,7 @@ struct drm_minor { int index; /* Minor device number */ int type; /* Control or render or accel */ struct device *kdev; /* Linux device */ - struct drm_device *dev; + struct drm_device *drm; struct dentry *debugfs_root; From patchwork Thu Jul 13 08:24:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311550 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 54369EB64DD for ; Thu, 13 Jul 2023 08:25:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6CDDB89F41; Thu, 13 Jul 2023 08:25:53 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id AF3D210E62F for ; Thu, 13 Jul 2023 08:25:29 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrch-0005zU-Bn; Thu, 13 Jul 2023 10:24:27 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrcg-00E4k6-Dm; Thu, 13 Jul 2023 10:24:26 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrcf-004VhZ-G8; Thu, 13 Jul 2023 10:24:25 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 14/17] drm/plane: Rename struct drm_plane::dev to drm Date: Thu, 13 Jul 2023 10:24:05 +0200 Message-Id: <20230713082408.2266984-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=154513; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6wXov2xjAZXKTLEElaAVDr3vvLMi8BdZCf5NwH5G0B8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7ScP9o+662yplvvJYGXJqYCDrCP2KKvm0X8C kSfrNXnsYSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0nAAKCRCPgPtYfRL+ TtZUCACJFXSfx+uKBkcIvQ0XyF7u+g1+/2Z7tEFZMYaaXi1SxFAHOhYamGQURPbnrW4m2n/ha7K rrtyXbGSd2YyclN2GcYE7oD3ETyGlFfvE4NEj0vfN7owD51BXfLGK6TEcZxXvvfNGP/xdyqO5bX 0/yfoeH18ejiOyWv18tWWXt1+cZbUuJqGa9cWrd2Msvi3ZlrG3KSxGJL+nTfEI3kqaL7H7BNR1h qS3DShaAXCAZyeDBwP7OJPtO0ua4IhvLiQPp/r7cCWaNJ/NcwnbneN7HDbx7Runpdd22xkQxpKy pMpyq7meay9bgkZcL8PJworJFMqF62yzGpo6YOL8kIcrsaO/ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +-- .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 10 ++-- .../gpu/drm/arm/display/komeda/komeda_plane.c | 2 +- drivers/gpu/drm/arm/hdlcd_crtc.c | 4 +- drivers/gpu/drm/arm/malidp_planes.c | 4 +- drivers/gpu/drm/armada/armada_overlay.c | 6 +-- drivers/gpu/drm/ast/ast_mode.c | 12 ++--- .../gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 8 ++-- drivers/gpu/drm/drm_atomic.c | 20 ++++---- drivers/gpu/drm/drm_atomic_helper.c | 20 ++++---- drivers/gpu/drm/drm_atomic_uapi.c | 16 +++---- drivers/gpu/drm/drm_blend.c | 10 ++-- drivers/gpu/drm/drm_color_mgmt.c | 2 +- drivers/gpu/drm/drm_plane.c | 24 +++++----- drivers/gpu/drm/drm_plane_helper.c | 4 +- drivers/gpu/drm/drm_simple_kms_helper.c | 2 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 6 +-- .../gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 13 +++-- drivers/gpu/drm/i915/display/i9xx_plane.c | 36 +++++++------- drivers/gpu/drm/i915/display/i9xx_wm.c | 4 +- .../gpu/drm/i915/display/intel_atomic_plane.c | 18 +++---- drivers/gpu/drm/i915/display/intel_color.c | 2 +- .../drm/i915/display/intel_crtc_state_dump.c | 2 +- drivers/gpu/drm/i915/display/intel_cursor.c | 26 +++++----- drivers/gpu/drm/i915/display/intel_display.c | 4 +- .../drm/i915/display/intel_display_trace.h | 12 ++--- drivers/gpu/drm/i915/display/intel_fb.c | 6 +-- drivers/gpu/drm/i915/display/intel_fb_pin.c | 2 +- drivers/gpu/drm/i915/display/intel_fbc.c | 20 ++++---- drivers/gpu/drm/i915/display/intel_psr.c | 6 +-- drivers/gpu/drm/i915/display/intel_sprite.c | 48 +++++++++---------- .../gpu/drm/i915/display/intel_sprite_uapi.c | 4 +- drivers/gpu/drm/i915/display/skl_scaler.c | 4 +- .../drm/i915/display/skl_universal_plane.c | 48 +++++++++---------- drivers/gpu/drm/i915/display/skl_watermark.c | 10 ++-- drivers/gpu/drm/imx/dcss/dcss-plane.c | 8 ++-- drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c | 12 +++-- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 6 +-- drivers/gpu/drm/kmb/kmb_plane.c | 8 ++-- drivers/gpu/drm/logicvc/logicvc_layer.c | 6 +-- drivers/gpu/drm/loongson/lsdc_plane.c | 30 ++++++------ drivers/gpu/drm/mgag200/mgag200_mode.c | 6 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 2 +- drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c | 6 +-- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 4 +- drivers/gpu/drm/mxsfb/lcdif_kms.c | 4 +- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 8 ++-- drivers/gpu/drm/nouveau/dispnv04/overlay.c | 10 ++-- drivers/gpu/drm/nouveau/dispnv50/curs507a.c | 6 +-- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 16 +++---- drivers/gpu/drm/omapdrm/omap_plane.c | 19 ++++---- drivers/gpu/drm/qxl/qxl_display.c | 12 ++--- .../gpu/drm/renesas/rcar-du/rcar_du_plane.c | 2 +- .../drm/renesas/shmobile/shmob_drm_plane.c | 6 +-- drivers/gpu/drm/solomon/ssd130x.c | 4 +- drivers/gpu/drm/sti/sti_cursor.c | 2 +- drivers/gpu/drm/sti/sti_gdp.c | 2 +- drivers/gpu/drm/sti/sti_hqvdp.c | 2 +- drivers/gpu/drm/stm/ltdc.c | 2 +- drivers/gpu/drm/tegra/dc.c | 2 +- drivers/gpu/drm/tegra/plane.c | 6 +-- .../gpu/drm/tests/drm_damage_helper_test.c | 2 +- drivers/gpu/drm/tidss/tidss_plane.c | 8 ++-- drivers/gpu/drm/tilcdc/tilcdc_plane.c | 8 ++-- drivers/gpu/drm/tiny/cirrus.c | 2 +- drivers/gpu/drm/tiny/ofdrm.c | 4 +- drivers/gpu/drm/tiny/simpledrm.c | 4 +- drivers/gpu/drm/udl/udl_modeset.c | 2 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 4 +- drivers/gpu/drm/vc4/vc4_plane.c | 14 +++--- drivers/gpu/drm/virtio/virtgpu_plane.c | 10 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 6 +-- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 7 +-- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 2 +- drivers/gpu/drm/xlnx/zynqmp_kms.c | 4 +- include/drm/drm_plane.h | 4 +- 76 files changed, 348 insertions(+), 345 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index ebc22b9780c4..a7d639231380 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5075,11 +5075,11 @@ static inline void fill_dc_dirty_rect(struct drm_plane *plane, dirty_rect->height = height; if (ffu) - drm_dbg(plane->dev, + drm_dbg(plane->drm, "[PLANE:%d] PSR FFU dirty rect size (%d, %d)\n", plane->base.id, width, height); else - drm_dbg(plane->dev, + drm_dbg(plane->drm, "[PLANE:%d] PSR SU dirty rect at (%d, %d) size (%d, %d)", plane->base.id, x, y, width, height); @@ -5163,7 +5163,7 @@ static void fill_dc_dirty_rects(struct drm_plane *plane, old_plane_state->crtc_w != new_plane_state->crtc_w || old_plane_state->crtc_h != new_plane_state->crtc_h); - drm_dbg(plane->dev, + drm_dbg(plane->drm, "[PLANE:%d] PSR bb_changed:%d fb_changed:%d num_clips:%d\n", new_plane_state->plane->base.id, bb_changed, fb_changed, num_clips); diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c index 7ea95dfde4e3..2991487e4f0e 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c @@ -1090,8 +1090,8 @@ int amdgpu_dm_plane_fill_dc_scaling_info(struct amdgpu_device *adev, scaling_info->clip_rect = scaling_info->dst_rect; /* Validate scaling per-format with DC plane caps */ - if (state->plane && state->plane->dev && state->fb) { - get_min_max_dc_plane_scaling(state->plane->dev, state->fb, + if (state->plane && state->plane->drm && state->fb) { + get_min_max_dc_plane_scaling(state->plane->drm, state->fb, &min_downscale, &max_upscale); } else { min_downscale = 250; @@ -1123,7 +1123,7 @@ static int dm_plane_atomic_check(struct drm_plane *plane, { struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); - struct amdgpu_device *adev = drm_to_adev(plane->dev); + struct amdgpu_device *adev = drm_to_adev(plane->drm); struct dc *dc = adev->dm.dc; struct dm_plane_state *dm_plane_state; struct dc_scaling_info scaling_info; @@ -1214,7 +1214,7 @@ static int get_cursor_position(struct drm_plane *plane, struct drm_crtc *crtc, void amdgpu_dm_plane_handle_cursor_update(struct drm_plane *plane, struct drm_plane_state *old_plane_state) { - struct amdgpu_device *adev = drm_to_adev(plane->dev); + struct amdgpu_device *adev = drm_to_adev(plane->drm); struct amdgpu_framebuffer *afb = to_amdgpu_framebuffer(plane->state->fb); struct drm_crtc *crtc = afb ? plane->state->crtc : old_plane_state->crtc; struct dm_crtc_state *crtc_state = crtc ? to_dm_crtc_state(crtc->state) : NULL; @@ -1345,7 +1345,7 @@ static bool dm_plane_format_mod_supported(struct drm_plane *plane, uint32_t format, uint64_t modifier) { - struct amdgpu_device *adev = drm_to_adev(plane->dev); + struct amdgpu_device *adev = drm_to_adev(plane->drm); const struct drm_format_info *info = drm_format_info(format); int i; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c index c20ff72f0ae5..dc6477f32055 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c @@ -176,7 +176,7 @@ static bool komeda_plane_format_mod_supported(struct drm_plane *plane, u32 format, u64 modifier) { - struct komeda_dev *mdev = plane->dev->dev_private; + struct komeda_dev *mdev = plane->drm->dev_private; struct komeda_plane *kplane = to_kplane(plane); u32 layer_type = kplane->layer->layer_type; diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index f7f2d101d476..d971ebe42770 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -274,7 +274,7 @@ static void hdlcd_plane_atomic_update(struct drm_plane *plane, dest_h = drm_rect_height(&new_plane_state->dst); scanout_start = drm_fb_dma_get_gem_addr(fb, new_plane_state, 0); - hdlcd = drm_to_hdlcd_priv(plane->dev); + hdlcd = drm_to_hdlcd_priv(plane->drm); hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, fb->pitches[0]); hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_PITCH, fb->pitches[0]); hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_COUNT, dest_h - 1); @@ -303,7 +303,7 @@ static struct drm_plane *hdlcd_plane_init(struct drm_device *drm) for (i = 0; i < ARRAY_SIZE(supported_formats); i++) formats[i] = supported_formats[i].fourcc; - plane = drmm_universal_plane_alloc(drm, struct drm_plane, dev, 0xff, + plane = drmm_universal_plane_alloc(drm, struct drm_plane, drm, 0xff, &hdlcd_plane_funcs, formats, ARRAY_SIZE(formats), NULL, DRM_PLANE_TYPE_PRIMARY, NULL); diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 34547edf1ee3..13048b213560 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -246,7 +246,7 @@ bool malidp_format_mod_supported(struct drm_device *drm, static bool malidp_format_mod_supported_per_plane(struct drm_plane *plane, u32 format, u64 modifier) { - return malidp_format_mod_supported(plane->dev, format, modifier); + return malidp_format_mod_supported(plane->drm, format, modifier); } static const struct drm_plane_funcs malidp_de_plane_funcs = { @@ -304,7 +304,7 @@ static u32 malidp_get_pgsize_bitmap(struct malidp_plane *mp) { struct iommu_domain *mmu_dom; - mmu_dom = iommu_get_domain_for_dev(mp->base.dev->dev); + mmu_dom = iommu_get_domain_for_dev(mp->base.drm->dev); if (mmu_dom) return mmu_dom->pgsize_bitmap; diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index f21eb8fb76d8..a999231f6a35 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c @@ -267,7 +267,7 @@ armada_overlay_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, crtc_x, crtc_y, crtc_w, crtc_h, src_x, src_y, src_w, src_h); - state = drm_atomic_state_alloc(plane->dev); + state = drm_atomic_state_alloc(plane->drm); if (!state) return -ENOMEM; @@ -343,7 +343,7 @@ static int armada_overlay_set_property(struct drm_plane *plane, struct drm_plane_state *state, struct drm_property *property, uint64_t val) { - struct armada_private *priv = drm_to_armada_dev(plane->dev); + struct armada_private *priv = drm_to_armada_dev(plane->drm); #define K2R(val) (((val) >> 0) & 0xff) #define K2G(val) (((val) >> 8) & 0xff) @@ -411,7 +411,7 @@ static int armada_overlay_get_property(struct drm_plane *plane, const struct drm_plane_state *state, struct drm_property *property, uint64_t *val) { - struct armada_private *priv = drm_to_armada_dev(plane->dev); + struct armada_private *priv = drm_to_armada_dev(plane->drm); #define C2K(c,s) (((c) >> (s)) & 0xff) #define R2BGR(r,g,b,s) (C2K(r,s) << 0 | C2K(g,s) << 8 | C2K(b,s) << 16) diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index bfbdc03c1ac9..02857761c3e6 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -598,7 +598,7 @@ static const uint32_t ast_primary_plane_formats[] = { static int ast_primary_plane_helper_atomic_check(struct drm_plane *plane, struct drm_atomic_state *state) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); struct drm_crtc_state *new_crtc_state = NULL; struct ast_crtc_state *new_ast_crtc_state; @@ -640,7 +640,7 @@ static void ast_handle_damage(struct ast_plane *ast_plane, struct iosys_map *src static void ast_primary_plane_helper_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct ast_device *ast = to_ast_device(dev); struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane); struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state); @@ -679,7 +679,7 @@ static void ast_primary_plane_helper_atomic_update(struct drm_plane *plane, static void ast_primary_plane_helper_atomic_enable(struct drm_plane *plane, struct drm_atomic_state *state) { - struct ast_device *ast = to_ast_device(plane->dev); + struct ast_device *ast = to_ast_device(plane->drm); struct ast_plane *ast_plane = to_ast_plane(plane); /* @@ -695,7 +695,7 @@ static void ast_primary_plane_helper_atomic_enable(struct drm_plane *plane, static void ast_primary_plane_helper_atomic_disable(struct drm_plane *plane, struct drm_atomic_state *state) { - struct ast_device *ast = to_ast_device(plane->dev); + struct ast_device *ast = to_ast_device(plane->drm); ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x1, 0xdf, 0x20); } @@ -884,7 +884,7 @@ static void ast_cursor_plane_helper_atomic_update(struct drm_plane *plane, struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state); struct drm_framebuffer *fb = plane_state->fb; struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane); - struct ast_device *ast = to_ast_device(plane->dev); + struct ast_device *ast = to_ast_device(plane->drm); struct iosys_map src_map = shadow_plane_state->data[0]; struct drm_rect damage; const u8 *src = src_map.vaddr; /* TODO: Use mapping abstraction properly */ @@ -939,7 +939,7 @@ static void ast_cursor_plane_helper_atomic_update(struct drm_plane *plane, static void ast_cursor_plane_helper_atomic_disable(struct drm_plane *plane, struct drm_atomic_state *state) { - struct ast_device *ast = to_ast_device(plane->dev); + struct ast_device *ast = to_ast_device(plane->drm); ast_set_cursor_enabled(ast, false); } diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index daa508504f47..9d8421a472f3 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c @@ -830,7 +830,7 @@ void atmel_hlcdc_plane_irq(struct atmel_hlcdc_plane *plane) if (isr & (ATMEL_HLCDC_LAYER_OVR_IRQ(0) | ATMEL_HLCDC_LAYER_OVR_IRQ(1) | ATMEL_HLCDC_LAYER_OVR_IRQ(2))) - dev_dbg(plane->base.dev->dev, "overrun on plane %s\n", + dev_dbg(plane->base.drm->dev, "overrun on plane %s\n", desc->name); } @@ -843,7 +843,7 @@ static const struct drm_plane_helper_funcs atmel_hlcdc_layer_plane_helper_funcs static int atmel_hlcdc_plane_alloc_dscrs(struct drm_plane *p, struct atmel_hlcdc_plane_state *state) { - struct atmel_hlcdc_dc *dc = p->dev->dev_private; + struct atmel_hlcdc_dc *dc = p->drm->dev_private; int i; for (i = 0; i < ARRAY_SIZE(state->dscrs); i++) { @@ -891,7 +891,7 @@ static void atmel_hlcdc_plane_reset(struct drm_plane *p) if (state) { if (atmel_hlcdc_plane_alloc_dscrs(p, state)) { kfree(state); - dev_err(p->dev->dev, + dev_err(p->drm->dev, "Failed to allocate initial plane state\n"); return; } @@ -926,7 +926,7 @@ static void atmel_hlcdc_plane_atomic_destroy_state(struct drm_plane *p, { struct atmel_hlcdc_plane_state *state = drm_plane_state_to_atmel_hlcdc_plane_state(s); - struct atmel_hlcdc_dc *dc = p->dev->dev_private; + struct atmel_hlcdc_dc *dc = p->drm->dev_private; int i; for (i = 0; i < ARRAY_SIZE(state->dscrs); i++) { diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index ab851e7b1a41..a415805ce6b0 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -546,7 +546,7 @@ drm_atomic_get_plane_state(struct drm_atomic_state *state, state->planes[index].new_state = plane_state; plane_state->state = state; - drm_dbg_atomic(plane->dev, "Added [PLANE:%d:%s] %p state to %p\n", + drm_dbg_atomic(plane->drm, "Added [PLANE:%d:%s] %p state to %p\n", plane->base.id, plane->name, plane_state, state); if (plane_state->crtc) { @@ -603,11 +603,13 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state, /* either *both* CRTC and FB must be set, or neither */ if (crtc && !fb) { - drm_dbg_atomic(plane->dev, "[PLANE:%d:%s] CRTC set but no FB\n", + drm_dbg_atomic(plane->drm, + "[PLANE:%d:%s] CRTC set but no FB\n", plane->base.id, plane->name); return -EINVAL; } else if (fb && !crtc) { - drm_dbg_atomic(plane->dev, "[PLANE:%d:%s] FB set but no CRTC\n", + drm_dbg_atomic(plane->drm, + "[PLANE:%d:%s] FB set but no CRTC\n", plane->base.id, plane->name); return -EINVAL; } @@ -618,7 +620,7 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state, /* Check whether this plane is usable on this CRTC */ if (!(plane->possible_crtcs & drm_crtc_mask(crtc))) { - drm_dbg_atomic(plane->dev, + drm_dbg_atomic(plane->drm, "Invalid [CRTC:%d:%s] for [PLANE:%d:%s]\n", crtc->base.id, crtc->name, plane->base.id, plane->name); @@ -629,7 +631,7 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state, ret = drm_plane_check_pixel_format(plane, fb->format->format, fb->modifier); if (ret) { - drm_dbg_atomic(plane->dev, + drm_dbg_atomic(plane->drm, "[PLANE:%d:%s] invalid pixel format %p4cc, modifier 0x%llx\n", plane->base.id, plane->name, &fb->format->format, fb->modifier); @@ -641,7 +643,7 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state, new_plane_state->crtc_x > INT_MAX - (int32_t) new_plane_state->crtc_w || new_plane_state->crtc_h > INT_MAX || new_plane_state->crtc_y > INT_MAX - (int32_t) new_plane_state->crtc_h) { - drm_dbg_atomic(plane->dev, + drm_dbg_atomic(plane->drm, "[PLANE:%d:%s] invalid CRTC coordinates %ux%u+%d+%d\n", plane->base.id, plane->name, new_plane_state->crtc_w, new_plane_state->crtc_h, @@ -657,7 +659,7 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state, new_plane_state->src_x > fb_width - new_plane_state->src_w || new_plane_state->src_h > fb_height || new_plane_state->src_y > fb_height - new_plane_state->src_h) { - drm_dbg_atomic(plane->dev, + drm_dbg_atomic(plane->drm, "[PLANE:%d:%s] invalid source coordinates " "%u.%06ux%u.%06u+%u.%06u+%u.%06u (fb %ux%u)\n", plane->base.id, plane->name, @@ -684,7 +686,7 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state, clips->y1 < 0 || clips->x2 > fb_width || clips->y2 > fb_height) { - drm_dbg_atomic(plane->dev, + drm_dbg_atomic(plane->drm, "[PLANE:%d:%s] invalid damage clip %d %d %d %d\n", plane->base.id, plane->name, clips->x1, clips->y1, clips->x2, clips->y2); @@ -695,7 +697,7 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state, } if (plane_switching_crtc(old_plane_state, new_plane_state)) { - drm_dbg_atomic(plane->dev, + drm_dbg_atomic(plane->drm, "[PLANE:%d:%s] switching CRTC directly\n", plane->base.id, plane->name); return -EINVAL; diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 39e8900e6283..910e477cb9cc 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -882,7 +882,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, } if (!crtc_state->enable && !can_update_disabled) { - drm_dbg_kms(plane_state->plane->dev, + drm_dbg_kms(plane_state->plane->drm, "Cannot update plane of a disabled CRTC.\n"); return -EINVAL; } @@ -893,7 +893,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, hscale = drm_rect_calc_hscale(src, dst, min_scale, max_scale); vscale = drm_rect_calc_vscale(src, dst, min_scale, max_scale); if (hscale < 0 || vscale < 0) { - drm_dbg_kms(plane_state->plane->dev, + drm_dbg_kms(plane_state->plane->drm, "Invalid scaling of plane\n"); drm_rect_debug_print("src: ", &plane_state->src, true); drm_rect_debug_print("dst: ", &plane_state->dst, false); @@ -918,7 +918,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, return 0; if (!can_position && !drm_rect_equals(dst, &clip)) { - drm_dbg_kms(plane_state->plane->dev, + drm_dbg_kms(plane_state->plane->drm, "Plane must cover entire CRTC\n"); drm_rect_debug_print("dst: ", dst, false); drm_rect_debug_print("clip: ", &clip, false); @@ -1002,7 +1002,7 @@ drm_atomic_helper_check_planes(struct drm_device *dev, ret = funcs->atomic_check(plane, state); if (ret) { - drm_dbg_atomic(plane->dev, + drm_dbg_atomic(plane->drm, "[PLANE:%d:%s] atomic driver check failed\n", plane->base.id, plane->name); return ret; @@ -2356,7 +2356,7 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state, */ if (nonblock && old_plane_state->commit && !try_wait_for_completion(&old_plane_state->commit->flip_done)) { - drm_dbg_atomic(plane->dev, + drm_dbg_atomic(plane->drm, "[PLANE:%d:%s] busy with a previous commit\n", plane->base.id, plane->name); @@ -2420,7 +2420,7 @@ void drm_atomic_helper_wait_for_dependencies(struct drm_atomic_state *old_state) for_each_old_plane_in_state(old_state, plane, old_plane_state, i) { ret = drm_crtc_commit_wait(old_plane_state->commit); if (ret) - drm_err(plane->dev, + drm_err(plane->drm, "[PLANE:%d:%s] commit wait timed out\n", plane->base.id, plane->name); } @@ -3125,7 +3125,7 @@ int drm_atomic_helper_update_plane(struct drm_plane *plane, struct drm_plane_state *plane_state; int ret = 0; - state = drm_atomic_state_alloc(plane->dev); + state = drm_atomic_state_alloc(plane->drm); if (!state) return -ENOMEM; @@ -3176,7 +3176,7 @@ int drm_atomic_helper_disable_plane(struct drm_plane *plane, struct drm_plane_state *plane_state; int ret = 0; - state = drm_atomic_state_alloc(plane->dev); + state = drm_atomic_state_alloc(plane->drm); if (!state) return -ENOMEM; @@ -3647,7 +3647,7 @@ int drm_atomic_helper_page_flip(struct drm_crtc *crtc, struct drm_atomic_state *state; int ret = 0; - state = drm_atomic_state_alloc(plane->dev); + state = drm_atomic_state_alloc(plane->drm); if (!state) return -ENOMEM; @@ -3692,7 +3692,7 @@ int drm_atomic_helper_page_flip_target(struct drm_crtc *crtc, struct drm_crtc_state *crtc_state; int ret = 0; - state = drm_atomic_state_alloc(plane->dev); + state = drm_atomic_state_alloc(plane->drm); if (!state) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index 38a5f69f0c9c..d9d41d1b4f5d 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -212,12 +212,12 @@ drm_atomic_set_crtc_for_plane(struct drm_plane_state *plane_state, } if (crtc) - drm_dbg_atomic(plane->dev, + drm_dbg_atomic(plane->drm, "Link [PLANE:%d:%s] state %p to [CRTC:%d:%s]\n", plane->base.id, plane->name, plane_state, crtc->base.id, crtc->name); else - drm_dbg_atomic(plane->dev, + drm_dbg_atomic(plane->drm, "Link [PLANE:%d:%s] state %p to [NOCRTC]\n", plane->base.id, plane->name, plane_state); @@ -242,12 +242,12 @@ drm_atomic_set_fb_for_plane(struct drm_plane_state *plane_state, struct drm_plane *plane = plane_state->plane; if (fb) - drm_dbg_atomic(plane->dev, + drm_dbg_atomic(plane->drm, "Set [FB:%d] for [PLANE:%d:%s] state %p\n", fb->base.id, plane->base.id, plane->name, plane_state); else - drm_dbg_atomic(plane->dev, + drm_dbg_atomic(plane->drm, "Set [NOFB] for [PLANE:%d:%s] state %p\n", plane->base.id, plane->name, plane_state); @@ -513,7 +513,7 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, struct drm_plane_state *state, struct drm_file *file_priv, struct drm_property *property, uint64_t val) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct drm_mode_config *config = &dev->mode_config; bool replaced = false; int ret; @@ -568,7 +568,7 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, state->pixel_blend_mode = val; } else if (property == plane->rotation_property) { if (!is_power_of_2(val & DRM_MODE_ROTATE_MASK)) { - drm_dbg_atomic(plane->dev, + drm_dbg_atomic(plane->drm, "[PLANE:%d:%s] bad rotation bitmask: 0x%llx\n", plane->base.id, plane->name, val); return -EINVAL; @@ -594,7 +594,7 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, return plane->funcs->atomic_set_property(plane, state, property, val); } else { - drm_dbg_atomic(plane->dev, + drm_dbg_atomic(plane->drm, "[PLANE:%d:%s] unknown property [PROP:%d:%s]\n", plane->base.id, plane->name, property->base.id, property->name); @@ -609,7 +609,7 @@ drm_atomic_plane_get_property(struct drm_plane *plane, const struct drm_plane_state *state, struct drm_property *property, uint64_t *val) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct drm_mode_config *config = &dev->mode_config; if (property == config->prop_fb_id) { diff --git a/drivers/gpu/drm/drm_blend.c b/drivers/gpu/drm/drm_blend.c index c390b8924e95..5993f1ef208e 100644 --- a/drivers/gpu/drm/drm_blend.c +++ b/drivers/gpu/drm/drm_blend.c @@ -220,7 +220,7 @@ int drm_plane_create_alpha_property(struct drm_plane *plane) { struct drm_property *prop; - prop = drm_property_create_range(plane->dev, 0, "alpha", + prop = drm_property_create_range(plane->drm, 0, "alpha", 0, DRM_BLEND_ALPHA_OPAQUE); if (!prop) return -ENOMEM; @@ -287,7 +287,7 @@ int drm_plane_create_rotation_property(struct drm_plane *plane, WARN_ON(!is_power_of_2(rotation & DRM_MODE_ROTATE_MASK)); WARN_ON(rotation & ~supported_rotations); - prop = drm_property_create_bitmask(plane->dev, 0, "rotation", + prop = drm_property_create_bitmask(plane->drm, 0, "rotation", props, ARRAY_SIZE(props), supported_rotations); if (!prop) @@ -372,7 +372,7 @@ int drm_plane_create_zpos_property(struct drm_plane *plane, { struct drm_property *prop; - prop = drm_property_create_range(plane->dev, 0, "zpos", min, max); + prop = drm_property_create_range(plane->drm, 0, "zpos", min, max); if (!prop) return -ENOMEM; @@ -410,7 +410,7 @@ int drm_plane_create_zpos_immutable_property(struct drm_plane *plane, { struct drm_property *prop; - prop = drm_property_create_range(plane->dev, DRM_MODE_PROP_IMMUTABLE, + prop = drm_property_create_range(plane->drm, DRM_MODE_PROP_IMMUTABLE, "zpos", zpos, zpos); if (!prop) return -ENOMEM; @@ -571,7 +571,7 @@ EXPORT_SYMBOL(drm_atomic_normalize_zpos); int drm_plane_create_blend_mode_property(struct drm_plane *plane, unsigned int supported_modes) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct drm_property *prop; static const struct drm_prop_enum_list props[] = { { DRM_MODE_BLEND_PIXEL_NONE, "None" }, diff --git a/drivers/gpu/drm/drm_color_mgmt.c b/drivers/gpu/drm/drm_color_mgmt.c index 2a437d84e531..9abf578690bb 100644 --- a/drivers/gpu/drm/drm_color_mgmt.c +++ b/drivers/gpu/drm/drm_color_mgmt.c @@ -530,7 +530,7 @@ int drm_plane_create_color_properties(struct drm_plane *plane, enum drm_color_encoding default_encoding, enum drm_color_range default_range) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct drm_property *prop; struct drm_prop_enum_list enum_list[max_t(int, DRM_COLOR_ENCODING_MAX, DRM_COLOR_RANGE_MAX)]; diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index 1cff3c23c2a1..f8d8f330c5c8 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -270,7 +270,7 @@ static int __drm_universal_plane_init(struct drm_device *dev, drm_modeset_lock_init(&plane->mutex); plane->base.properties = &plane->properties; - plane->dev = dev; + plane->drm = dev; plane->funcs = funcs; plane->format_types = kmalloc_array(format_count, sizeof(uint32_t), GFP_KERNEL); @@ -408,7 +408,7 @@ static void drmm_universal_plane_alloc_release(struct drm_device *dev, void *ptr { struct drm_plane *plane = ptr; - if (WARN_ON(!plane->dev)) + if (WARN_ON(!plane->drm)) return; drm_plane_cleanup(plane); @@ -535,7 +535,7 @@ void drm_plane_unregister_all(struct drm_device *dev) */ void drm_plane_cleanup(struct drm_plane *plane) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; drm_modeset_lock_fini(&plane->mutex); @@ -606,7 +606,7 @@ void drm_plane_force_disable(struct drm_plane *plane) if (!plane->fb) return; - WARN_ON(drm_drv_uses_atomic_modeset(plane->dev)); + WARN_ON(drm_drv_uses_atomic_modeset(plane->drm)); plane->old_fb = plane->fb; ret = plane->funcs->disable_plane(plane, NULL); @@ -859,7 +859,7 @@ static int __setplane_internal(struct drm_plane *plane, { int ret = 0; - WARN_ON(drm_drv_uses_atomic_modeset(plane->dev)); + WARN_ON(drm_drv_uses_atomic_modeset(plane->drm)); /* No fb means shut it down */ if (!fb) { @@ -911,7 +911,7 @@ static int __setplane_atomic(struct drm_plane *plane, { int ret; - WARN_ON(!drm_drv_uses_atomic_modeset(plane->dev)); + WARN_ON(!drm_drv_uses_atomic_modeset(plane->drm)); /* No fb means shut it down */ if (!fb) @@ -947,10 +947,10 @@ static int setplane_internal(struct drm_plane *plane, struct drm_modeset_acquire_ctx ctx; int ret; - DRM_MODESET_LOCK_ALL_BEGIN(plane->dev, ctx, + DRM_MODESET_LOCK_ALL_BEGIN(plane->drm, ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE, ret); - if (drm_drv_uses_atomic_modeset(plane->dev)) + if (drm_drv_uses_atomic_modeset(plane->drm)) ret = __setplane_atomic(plane, crtc, fb, crtc_x, crtc_y, crtc_w, crtc_h, src_x, src_y, src_w, src_h, &ctx); @@ -959,7 +959,7 @@ static int setplane_internal(struct drm_plane *plane, crtc_x, crtc_y, crtc_w, crtc_h, src_x, src_y, src_w, src_h, &ctx); - DRM_MODESET_LOCK_ALL_END(plane->dev, ctx, ret); + DRM_MODESET_LOCK_ALL_END(plane->drm, ctx, ret); return ret; } @@ -1452,7 +1452,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, */ void drm_plane_enable_fb_damage_clips(struct drm_plane *plane) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct drm_mode_config *config = &dev->mode_config; drm_object_attach_property(&plane->base, config->prop_fb_damage_clips, @@ -1498,7 +1498,7 @@ __drm_plane_get_damage_clips(const struct drm_plane_state *state) struct drm_mode_rect * drm_plane_get_damage_clips(const struct drm_plane_state *state) { - struct drm_device *dev = state->plane->dev; + struct drm_device *dev = state->plane->drm; struct drm_mode_config *config = &dev->mode_config; /* check that drm_plane_enable_fb_damage_clips() was called */ @@ -1570,7 +1570,7 @@ int drm_plane_create_scaling_filter_property(struct drm_plane *plane, unsigned int supported_filters) { struct drm_property *prop = - drm_create_scaling_filter_prop(plane->dev, supported_filters); + drm_create_scaling_filter_prop(plane->drm, supported_filters); if (IS_ERR(prop)) return PTR_ERR(prop); diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c index d26c99fa7aee..e5ce73764379 100644 --- a/drivers/gpu/drm/drm_plane_helper.c +++ b/drivers/gpu/drm/drm_plane_helper.c @@ -196,7 +196,7 @@ int drm_plane_helper_update_primary(struct drm_plane *plane, struct drm_crtc *cr .x2 = crtc_x + crtc_w, .y2 = crtc_y + crtc_h, }; - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct drm_connector **connector_list; int num_connectors, ret; bool visible; @@ -265,7 +265,7 @@ EXPORT_SYMBOL(drm_plane_helper_update_primary); int drm_plane_helper_disable_primary(struct drm_plane *plane, struct drm_modeset_acquire_ctx *ctx) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; drm_WARN_ON_ONCE(dev, drm_drv_uses_atomic_modeset(dev)); diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c index 270523ae36d4..598872d09713 100644 --- a/drivers/gpu/drm/drm_simple_kms_helper.c +++ b/drivers/gpu/drm/drm_simple_kms_helper.c @@ -262,7 +262,7 @@ static int drm_simple_kms_plane_prepare_fb(struct drm_plane *plane, pipe = container_of(plane, struct drm_simple_display_pipe, plane); if (!pipe->funcs || !pipe->funcs->prepare_fb) { - if (WARN_ON_ONCE(!drm_core_check_feature(plane->dev, DRIVER_GEM))) + if (WARN_ON_ONCE(!drm_core_check_feature(plane->drm, DRIVER_GEM))) return 0; WARN_ON_ONCE(pipe->funcs && pipe->funcs->cleanup_fb); diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c index 794a87d16f88..ea5aae31bdc3 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c @@ -22,7 +22,7 @@ static int fsl_dcu_drm_plane_index(struct drm_plane *plane) { - struct fsl_dcu_drm_device *fsl_dev = plane->dev->dev_private; + struct fsl_dcu_drm_device *fsl_dev = plane->drm->dev_private; unsigned int total_layer = fsl_dev->soc->total_layer; unsigned int index; @@ -63,7 +63,7 @@ static int fsl_dcu_drm_plane_atomic_check(struct drm_plane *plane, static void fsl_dcu_drm_plane_atomic_disable(struct drm_plane *plane, struct drm_atomic_state *state) { - struct fsl_dcu_drm_device *fsl_dev = plane->dev->dev_private; + struct fsl_dcu_drm_device *fsl_dev = plane->drm->dev_private; unsigned int value; int index; @@ -80,7 +80,7 @@ static void fsl_dcu_drm_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { - struct fsl_dcu_drm_device *fsl_dev = plane->dev->dev_private; + struct fsl_dcu_drm_device *fsl_dev = plane->drm->dev_private; struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane); struct drm_framebuffer *fb = plane->state->fb; diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c index 42b54119c57b..a50dd4ec0085 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c @@ -71,12 +71,13 @@ static int hibmc_plane_atomic_check(struct drm_plane *plane, return PTR_ERR(crtc_state); if (src_w != new_plane_state->crtc_w || src_h != new_plane_state->crtc_h) { - drm_dbg_atomic(plane->dev, "scale not support\n"); + drm_dbg_atomic(plane->drm, "scale not support\n"); return -EINVAL; } if (new_plane_state->crtc_x < 0 || new_plane_state->crtc_y < 0) { - drm_dbg_atomic(plane->dev, "crtc_x/y of drm_plane state is invalid\n"); + drm_dbg_atomic(plane->drm, + "crtc_x/y of drm_plane state is invalid\n"); return -EINVAL; } @@ -87,12 +88,14 @@ static int hibmc_plane_atomic_check(struct drm_plane *plane, crtc_state->adjusted_mode.hdisplay || new_plane_state->crtc_y + new_plane_state->crtc_h > crtc_state->adjusted_mode.vdisplay) { - drm_dbg_atomic(plane->dev, "visible portion of plane is invalid\n"); + drm_dbg_atomic(plane->drm, + "visible portion of plane is invalid\n"); return -EINVAL; } if (new_plane_state->fb->pitches[0] % 128 != 0) { - drm_dbg_atomic(plane->dev, "wrong stride with 128-byte aligned\n"); + drm_dbg_atomic(plane->drm, + "wrong stride with 128-byte aligned\n"); return -EINVAL; } return 0; @@ -106,7 +109,7 @@ static void hibmc_plane_atomic_update(struct drm_plane *plane, u32 reg; s64 gpu_addr = 0; u32 line_l; - struct hibmc_drm_private *priv = to_hibmc_drm_private(plane->dev); + struct hibmc_drm_private *priv = to_hibmc_drm_private(plane->drm); struct drm_gem_vram_object *gbo; if (!new_state->fb) diff --git a/drivers/gpu/drm/i915/display/i9xx_plane.c b/drivers/gpu/drm/i915/display/i9xx_plane.c index be31ce8ebb10..45ff769b5561 100644 --- a/drivers/gpu/drm/i915/display/i9xx_plane.c +++ b/drivers/gpu/drm/i915/display/i9xx_plane.c @@ -134,7 +134,7 @@ static struct intel_fbc *i9xx_plane_fbc(struct drm_i915_private *dev_priv, static bool i9xx_plane_has_windowing(struct intel_plane *plane) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum i9xx_plane_id i9xx_plane = plane->i9xx_plane; if (IS_CHERRYVIEW(dev_priv)) @@ -152,7 +152,7 @@ static u32 i9xx_plane_ctl(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { struct drm_i915_private *dev_priv = - to_i915(plane_state->uapi.plane->dev); + to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int rotation = plane_state->hw.rotation; u32 dspcntr; @@ -224,7 +224,7 @@ static u32 i9xx_plane_ctl(const struct intel_crtc_state *crtc_state, int i9xx_check_plane_surface(struct intel_plane_state *plane_state) { struct drm_i915_private *dev_priv = - to_i915(plane_state->uapi.plane->dev); + to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; int src_x, src_y, src_w; u32 offset; @@ -418,7 +418,7 @@ static void i9xx_plane_update_noarm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum i9xx_plane_id i9xx_plane = plane->i9xx_plane; intel_de_write_fw(dev_priv, DSPSTRIDE(i9xx_plane), @@ -446,7 +446,7 @@ static void i9xx_plane_update_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum i9xx_plane_id i9xx_plane = plane->i9xx_plane; int x = plane_state->view.color_plane[0].x; int y = plane_state->view.color_plane[0].y; @@ -516,7 +516,7 @@ static void i830_plane_update_arm(struct intel_plane *plane, static void i9xx_plane_disable_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum i9xx_plane_id i9xx_plane = plane->i9xx_plane; u32 dspcntr; @@ -546,7 +546,7 @@ g4x_primary_async_flip(struct intel_plane *plane, const struct intel_plane_state *plane_state, bool async_flip) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); u32 dspcntr = plane_state->ctl | i9xx_plane_ctl_crtc(crtc_state); u32 dspaddr_offset = plane_state->view.color_plane[0].offset; enum i9xx_plane_id i9xx_plane = plane->i9xx_plane; @@ -566,7 +566,7 @@ vlv_primary_async_flip(struct intel_plane *plane, const struct intel_plane_state *plane_state, bool async_flip) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); u32 dspaddr_offset = plane_state->view.color_plane[0].offset; enum i9xx_plane_id i9xx_plane = plane->i9xx_plane; @@ -577,7 +577,7 @@ vlv_primary_async_flip(struct intel_plane *plane, static void bdw_primary_enable_flip_done(struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; spin_lock_irq(&i915->irq_lock); @@ -588,7 +588,7 @@ bdw_primary_enable_flip_done(struct intel_plane *plane) static void bdw_primary_disable_flip_done(struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; spin_lock_irq(&i915->irq_lock); @@ -599,7 +599,7 @@ bdw_primary_disable_flip_done(struct intel_plane *plane) static void ivb_primary_enable_flip_done(struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); spin_lock_irq(&i915->irq_lock); ilk_enable_display_irq(i915, DE_PLANE_FLIP_DONE_IVB(plane->i9xx_plane)); @@ -609,7 +609,7 @@ ivb_primary_enable_flip_done(struct intel_plane *plane) static void ivb_primary_disable_flip_done(struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); spin_lock_irq(&i915->irq_lock); ilk_disable_display_irq(i915, DE_PLANE_FLIP_DONE_IVB(plane->i9xx_plane)); @@ -619,7 +619,7 @@ ivb_primary_disable_flip_done(struct intel_plane *plane) static void ilk_primary_enable_flip_done(struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); spin_lock_irq(&i915->irq_lock); ilk_enable_display_irq(i915, DE_PLANE_FLIP_DONE(plane->i9xx_plane)); @@ -629,7 +629,7 @@ ilk_primary_enable_flip_done(struct intel_plane *plane) static void ilk_primary_disable_flip_done(struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); spin_lock_irq(&i915->irq_lock); ilk_disable_display_irq(i915, DE_PLANE_FLIP_DONE(plane->i9xx_plane)); @@ -639,7 +639,7 @@ ilk_primary_disable_flip_done(struct intel_plane *plane) static void vlv_primary_enable_flip_done(struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; spin_lock_irq(&i915->irq_lock); @@ -650,7 +650,7 @@ vlv_primary_enable_flip_done(struct intel_plane *plane) static void vlv_primary_disable_flip_done(struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; spin_lock_irq(&i915->irq_lock); @@ -661,7 +661,7 @@ vlv_primary_disable_flip_done(struct intel_plane *plane) static bool i9xx_plane_get_hw_state(struct intel_plane *plane, enum pipe *pipe) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum intel_display_power_domain power_domain; enum i9xx_plane_id i9xx_plane = plane->i9xx_plane; intel_wakeref_t wakeref; @@ -739,7 +739,7 @@ i9xx_plane_max_stride(struct intel_plane *plane, u32 pixel_format, u64 modifier, unsigned int rotation) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); if (DISPLAY_VER(dev_priv) >= 3) { if (modifier == I915_FORMAT_MOD_X_TILED) diff --git a/drivers/gpu/drm/i915/display/i9xx_wm.c b/drivers/gpu/drm/i915/display/i9xx_wm.c index 876ce49a3c75..65a20c42117d 100644 --- a/drivers/gpu/drm/i915/display/i9xx_wm.c +++ b/drivers/gpu/drm/i915/display/i9xx_wm.c @@ -875,7 +875,7 @@ static u16 g4x_compute_wm(const struct intel_crtc_state *crtc_state, int level) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); const struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode; unsigned int latency = dev_priv->display.wm.pri_latency[level] * 10; @@ -1402,7 +1402,7 @@ static u16 vlv_compute_wm_level(const struct intel_crtc_state *crtc_state, int level) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); const struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode; unsigned int pixel_rate, htotal, cpp, width, wm; diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index e66f45e25201..37c190ebaca5 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -132,8 +132,8 @@ intel_plane_destroy_state(struct drm_plane *plane, { struct intel_plane_state *plane_state = to_intel_plane_state(state); - drm_WARN_ON(plane->dev, plane_state->ggtt_vma); - drm_WARN_ON(plane->dev, plane_state->dpt_vma); + drm_WARN_ON(plane->drm, plane_state->ggtt_vma); + drm_WARN_ON(plane->drm, plane_state->dpt_vma); __drm_atomic_helper_plane_destroy_state(&plane_state->uapi); if (plane_state->hw.fb) @@ -197,7 +197,7 @@ static bool use_min_ddb(const struct intel_crtc_state *crtc_state, struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); return DISPLAY_VER(i915) >= 13 && crtc_state->uapi.async_flip && @@ -248,7 +248,7 @@ int intel_plane_calc_min_cdclk(struct intel_atomic_state *state, struct intel_plane *plane, bool *need_cdclk_calc) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); const struct intel_plane_state *plane_state = intel_atomic_get_new_plane_state(state, plane); struct intel_crtc *crtc = to_intel_crtc(plane_state->hw.crtc); @@ -409,7 +409,7 @@ static bool intel_plane_do_async_flip(struct intel_plane *plane, const struct intel_crtc_state *old_crtc_state, const struct intel_crtc_state *new_crtc_state) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); if (!plane->async_flip) return false; @@ -894,7 +894,7 @@ int intel_atomic_plane_check_clipping(struct intel_plane_state *plane_state, int min_scale, int max_scale, bool can_position) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); struct drm_framebuffer *fb = plane_state->hw.fb; struct drm_rect *src = &plane_state->uapi.src; struct drm_rect *dst = &plane_state->uapi.dst; @@ -943,7 +943,7 @@ int intel_atomic_plane_check_clipping(struct intel_plane_state *plane_state, int intel_plane_check_src_coordinates(struct intel_plane_state *plane_state) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; struct drm_rect *src = &plane_state->uapi.src; u32 src_x, src_y, src_w, src_h, hsub, vsub; @@ -1021,7 +1021,7 @@ intel_prepare_plane_fb(struct drm_plane *_plane, to_intel_plane_state(_new_plane_state); struct intel_atomic_state *state = to_intel_atomic_state(new_plane_state->uapi.state); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); const struct intel_plane_state *old_plane_state = intel_atomic_get_old_plane_state(state, plane); struct drm_i915_gem_object *obj = intel_fb_obj(new_plane_state->hw.fb); @@ -1131,7 +1131,7 @@ intel_cleanup_plane_fb(struct drm_plane *plane, to_intel_plane_state(_old_plane_state); struct intel_atomic_state *state = to_intel_atomic_state(old_plane_state->uapi.state); - struct drm_i915_private *dev_priv = to_i915(plane->dev); + struct drm_i915_private *dev_priv = to_i915(plane->drm); struct drm_i915_gem_object *obj = intel_fb_obj(old_plane_state->hw.fb); if (!obj) diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c index 72b840e374e0..297dd85ffa01 100644 --- a/drivers/gpu/drm/i915/display/intel_color.c +++ b/drivers/gpu/drm/i915/display/intel_color.c @@ -1901,7 +1901,7 @@ bool intel_color_lut_equal(const struct intel_crtc_state *crtc_state, static bool need_plane_update(struct intel_plane *plane, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); /* * On pre-SKL the pipe gamma enable and pipe csc enable for diff --git a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c index b3eb7c38acd9..4dea76f6cdad 100644 --- a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c +++ b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c @@ -133,7 +133,7 @@ const char *intel_output_format_name(enum intel_output_format format) static void intel_dump_plane_state(const struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); const struct drm_framebuffer *fb = plane_state->hw.fb; if (!fb) { diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c b/drivers/gpu/drm/i915/display/intel_cursor.c index b095fd85717f..3fc172957090 100644 --- a/drivers/gpu/drm/i915/display/intel_cursor.c +++ b/drivers/gpu/drm/i915/display/intel_cursor.c @@ -31,7 +31,7 @@ static const u32 intel_cursor_formats[] = { static u32 intel_cursor_base(const struct intel_plane_state *plane_state) { struct drm_i915_private *dev_priv = - to_i915(plane_state->uapi.plane->dev); + to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; const struct drm_i915_gem_object *obj = intel_fb_obj(fb); u32 base; @@ -68,7 +68,7 @@ static u32 intel_cursor_position(const struct intel_plane_state *plane_state) static bool intel_cursor_size_ok(const struct intel_plane_state *plane_state) { const struct drm_mode_config *config = - &plane_state->uapi.plane->dev->mode_config; + &plane_state->uapi.plane->drm->mode_config; int width = drm_rect_width(&plane_state->uapi.dst); int height = drm_rect_height(&plane_state->uapi.dst); @@ -79,7 +79,7 @@ static bool intel_cursor_size_ok(const struct intel_plane_state *plane_state) static int intel_cursor_check_surface(struct intel_plane_state *plane_state) { struct drm_i915_private *dev_priv = - to_i915(plane_state->uapi.plane->dev); + to_i915(plane_state->uapi.plane->drm); unsigned int rotation = plane_state->hw.rotation; int src_x, src_y; u32 offset; @@ -132,7 +132,7 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state, struct intel_plane_state *plane_state) { const struct drm_framebuffer *fb = plane_state->hw.fb; - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); const struct drm_rect src = plane_state->uapi.src; const struct drm_rect dst = plane_state->uapi.dst; int ret; @@ -213,7 +213,7 @@ static int i845_check_cursor(struct intel_crtc_state *crtc_state, struct intel_plane_state *plane_state) { const struct drm_framebuffer *fb = plane_state->hw.fb; - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); int ret; ret = intel_check_cursor(crtc_state, plane_state); @@ -258,7 +258,7 @@ static void i845_cursor_update_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); u32 cntl = 0, base = 0, pos = 0, size = 0; if (plane_state && plane_state->uapi.visible) { @@ -303,7 +303,7 @@ static void i845_cursor_disable_arm(struct intel_plane *plane, static bool i845_cursor_get_hw_state(struct intel_plane *plane, enum pipe *pipe) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum intel_display_power_domain power_domain; intel_wakeref_t wakeref; bool ret; @@ -327,7 +327,7 @@ i9xx_cursor_max_stride(struct intel_plane *plane, u32 pixel_format, u64 modifier, unsigned int rotation) { - return plane->base.dev->mode_config.cursor_width * 4; + return plane->base.drm->mode_config.cursor_width * 4; } static u32 i9xx_cursor_ctl_crtc(const struct intel_crtc_state *crtc_state) @@ -355,7 +355,7 @@ static u32 i9xx_cursor_ctl(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { struct drm_i915_private *dev_priv = - to_i915(plane_state->uapi.plane->dev); + to_i915(plane_state->uapi.plane->drm); u32 cntl = 0; if (IS_SANDYBRIDGE(dev_priv) || IS_IVYBRIDGE(dev_priv)) @@ -389,7 +389,7 @@ static u32 i9xx_cursor_ctl(const struct intel_crtc_state *crtc_state, static bool i9xx_cursor_size_ok(const struct intel_plane_state *plane_state) { struct drm_i915_private *dev_priv = - to_i915(plane_state->uapi.plane->dev); + to_i915(plane_state->uapi.plane->drm); int width = drm_rect_width(&plane_state->uapi.dst); int height = drm_rect_height(&plane_state->uapi.dst); @@ -428,7 +428,7 @@ static int i9xx_check_cursor(struct intel_crtc_state *crtc_state, struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); const struct drm_framebuffer *fb = plane_state->hw.fb; enum pipe pipe = plane->pipe; int ret; @@ -489,7 +489,7 @@ static void i9xx_cursor_update_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; u32 cntl = 0, base = 0, pos = 0, fbc_ctl = 0; @@ -564,7 +564,7 @@ static void i9xx_cursor_disable_arm(struct intel_plane *plane, static bool i9xx_cursor_get_hw_state(struct intel_plane *plane, enum pipe *pipe) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum intel_display_power_domain power_domain; intel_wakeref_t wakeref; bool ret; diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 0c8beaa8f638..63095107ff9c 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -331,7 +331,7 @@ void assert_transcoder(struct drm_i915_private *dev_priv, static void assert_plane(struct intel_plane *plane, bool state) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); enum pipe pipe; bool cur_state; @@ -535,7 +535,7 @@ unsigned int intel_remapped_info_size(const struct intel_remapped_info *rem_info bool intel_plane_uses_fence(const struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); return DISPLAY_VER(dev_priv) < 4 || (plane->fbc && diff --git a/drivers/gpu/drm/i915/display/intel_display_trace.h b/drivers/gpu/drm/i915/display/intel_display_trace.h index dd5008dcf2fb..236ed9d1a993 100644 --- a/drivers/gpu/drm/i915/display/intel_display_trace.h +++ b/drivers/gpu/drm/i915/display/intel_display_trace.h @@ -308,9 +308,6 @@ TRACE_EVENT(vlv_fifo_size, __entry->sprite0_start, __entry->sprite1_start, __entry->fifo_size) ); -#undef __dev_name_kms -#define __dev_name_kms(obj) dev_name((obj)->base.dev->dev) - TRACE_EVENT(intel_plane_update_noarm, TP_PROTO(struct intel_plane *plane, struct intel_crtc *crtc), TP_ARGS(plane, crtc), @@ -411,7 +408,7 @@ TRACE_EVENT(intel_fbc_activate, ), TP_fast_assign( - struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(plane->base.dev), + struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(plane->base.drm), plane->pipe); __assign_str(dev, __dev_name_kms(plane)); __assign_str(name, plane->base.name) @@ -438,7 +435,7 @@ TRACE_EVENT(intel_fbc_deactivate, ), TP_fast_assign( - struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(plane->base.dev), + struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(plane->base.drm), plane->pipe); __assign_str(dev, __dev_name_kms(plane)); __assign_str(name, plane->base.name) @@ -465,7 +462,7 @@ TRACE_EVENT(intel_fbc_nuke, ), TP_fast_assign( - struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(plane->base.dev), + struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(plane->base.drm), plane->pipe); __assign_str(dev, __dev_name_kms(plane)); __assign_str(name, plane->base.name) @@ -479,9 +476,6 @@ TRACE_EVENT(intel_fbc_nuke, __entry->frame, __entry->scanline) ); -#undef __dev_name_kms -#define __dev_name_kms(obj) dev_name((obj)->base.drm->dev) - TRACE_EVENT(intel_crtc_vblank_work_start, TP_PROTO(struct intel_crtc *crtc), TP_ARGS(crtc), diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c index e870a46ce12a..353b9231e2ac 100644 --- a/drivers/gpu/drm/i915/display/intel_fb.c +++ b/drivers/gpu/drm/i915/display/intel_fb.c @@ -1073,7 +1073,7 @@ u32 intel_plane_compute_aligned_offset(int *x, int *y, int color_plane) { struct intel_plane *intel_plane = to_intel_plane(state->uapi.plane); - struct drm_i915_private *i915 = to_i915(intel_plane->base.dev); + struct drm_i915_private *i915 = to_i915(intel_plane->base.drm); const struct drm_framebuffer *fb = state->hw.fb; unsigned int rotation = state->hw.rotation; int pitch = state->view.color_plane[color_plane].mapping_stride; @@ -1189,7 +1189,7 @@ static int intel_fb_check_ccs_xy(const struct drm_framebuffer *fb, int ccs_plane static bool intel_plane_can_remap(const struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); const struct drm_framebuffer *fb = plane_state->hw.fb; int i; @@ -1666,7 +1666,7 @@ int intel_fill_fb_info(struct drm_i915_private *i915, struct intel_framebuffer * static void intel_plane_remap_gtt(struct intel_plane_state *plane_state) { struct drm_i915_private *i915 = - to_i915(plane_state->uapi.plane->dev); + to_i915(plane_state->uapi.plane->drm); struct drm_framebuffer *fb = plane_state->hw.fb; struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); unsigned int rotation = plane_state->hw.rotation; diff --git a/drivers/gpu/drm/i915/display/intel_fb_pin.c b/drivers/gpu/drm/i915/display/intel_fb_pin.c index bee4ee229182..50a351e064e9 100644 --- a/drivers/gpu/drm/i915/display/intel_fb_pin.c +++ b/drivers/gpu/drm/i915/display/intel_fb_pin.c @@ -238,7 +238,7 @@ void intel_unpin_fb_vma(struct i915_vma *vma, unsigned long flags) int intel_plane_pin_fb(struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); struct drm_framebuffer *fb = plane_state->hw.fb; struct i915_vma *vma; bool phys_cursor = diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c index 851654891e19..6c1428da5519 100644 --- a/drivers/gpu/drm/i915/display/intel_fbc.c +++ b/drivers/gpu/drm/i915/display/intel_fbc.c @@ -145,7 +145,7 @@ static unsigned int _intel_fbc_cfb_stride(const struct intel_plane_state *plane_ /* minimum acceptable cfb stride in bytes, assuming 1:1 compression limit */ static unsigned int skl_fbc_min_cfb_stride(const struct intel_plane_state *plane_state) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); unsigned int limit = 4; /* 1:4 compression limit is the worst case */ unsigned int cpp = 4; /* FBC always 4 bytes per pixel */ unsigned int width = drm_rect_width(&plane_state->uapi.src) >> 16; @@ -175,7 +175,7 @@ static unsigned int skl_fbc_min_cfb_stride(const struct intel_plane_state *plane /* properly aligned cfb stride in bytes, assuming 1:1 compression limit */ static unsigned int intel_fbc_cfb_stride(const struct intel_plane_state *plane_state) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); unsigned int stride = _intel_fbc_cfb_stride(plane_state); /* @@ -191,7 +191,7 @@ static unsigned int intel_fbc_cfb_stride(const struct intel_plane_state *plane_s static unsigned int intel_fbc_cfb_size(const struct intel_plane_state *plane_state) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); int lines = drm_rect_height(&plane_state->uapi.src) >> 16; if (DISPLAY_VER(i915) == 7) @@ -204,7 +204,7 @@ static unsigned int intel_fbc_cfb_size(const struct intel_plane_state *plane_sta static u16 intel_fbc_override_cfb_stride(const struct intel_plane_state *plane_state) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); unsigned int stride_aligned = intel_fbc_cfb_stride(plane_state); unsigned int stride = _intel_fbc_cfb_stride(plane_state); const struct drm_framebuffer *fb = plane_state->hw.fb; @@ -847,7 +847,7 @@ void intel_fbc_cleanup(struct drm_i915_private *i915) static bool stride_is_valid(const struct intel_plane_state *plane_state) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int stride = intel_fbc_plane_stride(plane_state) * fb->format->cpp[0]; @@ -879,7 +879,7 @@ static bool stride_is_valid(const struct intel_plane_state *plane_state) static bool pixel_format_is_valid(const struct intel_plane_state *plane_state) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; switch (fb->format->format) { @@ -902,7 +902,7 @@ static bool pixel_format_is_valid(const struct intel_plane_state *plane_state) static bool rotation_is_valid(const struct intel_plane_state *plane_state) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int rotation = plane_state->hw.rotation; @@ -924,7 +924,7 @@ static bool rotation_is_valid(const struct intel_plane_state *plane_state) */ static bool intel_fbc_hw_tracking_covers_screen(const struct intel_plane_state *plane_state) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); unsigned int effective_w, effective_h, max_w, max_h; if (DISPLAY_VER(i915) >= 10) { @@ -951,7 +951,7 @@ static bool intel_fbc_hw_tracking_covers_screen(const struct intel_plane_state * static bool tiling_is_valid(const struct intel_plane_state *plane_state) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; switch (fb->modifier) { @@ -1005,7 +1005,7 @@ static void intel_fbc_update_state(struct intel_atomic_state *state, static bool intel_fbc_is_fence_ok(const struct intel_plane_state *plane_state) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); /* * The use of a CPU fence is one of two ways to detect writes by the diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 2f60e3cc26e6..5a4fa3abc552 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -1657,7 +1657,7 @@ static void psr_force_hw_tracking_exit(struct intel_dp *intel_dp) void intel_psr2_disable_plane_sel_fetch_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; if (!crtc_state->enable_psr2_sel_fetch) @@ -1670,7 +1670,7 @@ void intel_psr2_program_plane_sel_fetch_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; if (!crtc_state->enable_psr2_sel_fetch) @@ -1689,7 +1689,7 @@ void intel_psr2_program_plane_sel_fetch_noarm(struct intel_plane *plane, const struct intel_plane_state *plane_state, int color_plane) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; const struct drm_rect *clip; u32 val; diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c index 25034bbf1445..109b17620079 100644 --- a/drivers/gpu/drm/i915/display/intel_sprite.c +++ b/drivers/gpu/drm/i915/display/intel_sprite.c @@ -61,7 +61,7 @@ static void chv_sprite_update_csc(const struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); const struct drm_framebuffer *fb = plane_state->hw.fb; enum plane_id plane_id = plane->id; /* @@ -133,7 +133,7 @@ static void vlv_sprite_update_clrc(const struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); const struct drm_framebuffer *fb = plane_state->hw.fb; enum pipe pipe = plane->pipe; enum plane_id plane_id = plane->id; @@ -336,7 +336,7 @@ static u32 vlv_sprite_ctl(const struct intel_crtc_state *crtc_state, static void vlv_sprite_update_gamma(const struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); const struct drm_framebuffer *fb = plane_state->hw.fb; enum pipe pipe = plane->pipe; enum plane_id plane_id = plane->id; @@ -361,7 +361,7 @@ vlv_sprite_update_noarm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; enum plane_id plane_id = plane->id; int crtc_x = plane_state->uapi.dst.x1; @@ -382,7 +382,7 @@ vlv_sprite_update_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; enum plane_id plane_id = plane->id; const struct drm_intel_sprite_colorkey *key = &plane_state->ckey; @@ -430,7 +430,7 @@ static void vlv_sprite_disable_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; enum plane_id plane_id = plane->id; @@ -442,7 +442,7 @@ static bool vlv_sprite_get_hw_state(struct intel_plane *plane, enum pipe *pipe) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum intel_display_power_domain power_domain; enum plane_id plane_id = plane->id; intel_wakeref_t wakeref; @@ -636,7 +636,7 @@ static u32 ivb_sprite_ctl_crtc(const struct intel_crtc_state *crtc_state) static bool ivb_need_sprite_gamma(const struct intel_plane_state *plane_state) { struct drm_i915_private *dev_priv = - to_i915(plane_state->uapi.plane->dev); + to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; return fb->format->cpp[0] == 8 && @@ -647,7 +647,7 @@ static u32 ivb_sprite_ctl(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { struct drm_i915_private *dev_priv = - to_i915(plane_state->uapi.plane->dev); + to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int rotation = plane_state->hw.rotation; const struct drm_intel_sprite_colorkey *key = &plane_state->ckey; @@ -745,7 +745,7 @@ static void ivb_sprite_linear_gamma(const struct intel_plane_state *plane_state, static void ivb_sprite_update_gamma(const struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; u16 gamma[18]; int i; @@ -776,7 +776,7 @@ ivb_sprite_update_noarm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; int crtc_x = plane_state->uapi.dst.x1; int crtc_y = plane_state->uapi.dst.y1; @@ -806,7 +806,7 @@ ivb_sprite_update_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; const struct drm_intel_sprite_colorkey *key = &plane_state->ckey; u32 sprsurf_offset = plane_state->view.color_plane[0].offset; @@ -852,7 +852,7 @@ static void ivb_sprite_disable_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; intel_de_write_fw(dev_priv, SPRCTL(pipe), 0); @@ -866,7 +866,7 @@ static bool ivb_sprite_get_hw_state(struct intel_plane *plane, enum pipe *pipe) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum intel_display_power_domain power_domain; intel_wakeref_t wakeref; bool ret; @@ -975,7 +975,7 @@ static u32 g4x_sprite_ctl(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { struct drm_i915_private *dev_priv = - to_i915(plane_state->uapi.plane->dev); + to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int rotation = plane_state->hw.rotation; const struct drm_intel_sprite_colorkey *key = &plane_state->ckey; @@ -1045,7 +1045,7 @@ static u32 g4x_sprite_ctl(const struct intel_crtc_state *crtc_state, static void g4x_sprite_update_gamma(const struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); const struct drm_framebuffer *fb = plane_state->hw.fb; enum pipe pipe = plane->pipe; u16 gamma[8]; @@ -1075,7 +1075,7 @@ static void ilk_sprite_linear_gamma(u16 gamma[17]) static void ilk_sprite_update_gamma(const struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); const struct drm_framebuffer *fb = plane_state->hw.fb; enum pipe pipe = plane->pipe; u16 gamma[17]; @@ -1103,7 +1103,7 @@ g4x_sprite_update_noarm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; int crtc_x = plane_state->uapi.dst.x1; int crtc_y = plane_state->uapi.dst.y1; @@ -1132,7 +1132,7 @@ g4x_sprite_update_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; const struct drm_intel_sprite_colorkey *key = &plane_state->ckey; u32 dvssurf_offset = plane_state->view.color_plane[0].offset; @@ -1174,7 +1174,7 @@ static void g4x_sprite_disable_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; intel_de_write_fw(dev_priv, DVSCNTR(pipe), 0); @@ -1187,7 +1187,7 @@ static bool g4x_sprite_get_hw_state(struct intel_plane *plane, enum pipe *pipe) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum intel_display_power_domain power_domain; intel_wakeref_t wakeref; bool ret; @@ -1227,7 +1227,7 @@ static int g4x_sprite_check_scaling(struct intel_crtc_state *crtc_state, struct intel_plane_state *plane_state) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; const struct drm_rect *src = &plane_state->uapi.src; const struct drm_rect *dst = &plane_state->uapi.dst; @@ -1290,7 +1290,7 @@ g4x_sprite_check(struct intel_crtc_state *crtc_state, struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); int min_scale = DRM_PLANE_NO_SCALING; int max_scale = DRM_PLANE_NO_SCALING; int ret; @@ -1336,7 +1336,7 @@ g4x_sprite_check(struct intel_crtc_state *crtc_state, int chv_plane_check_rotation(const struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); unsigned int rotation = plane_state->hw.rotation; /* CHV ignores the mirror bit when the rotate bit is set :( */ diff --git a/drivers/gpu/drm/i915/display/intel_sprite_uapi.c b/drivers/gpu/drm/i915/display/intel_sprite_uapi.c index a76b48ebc2d3..bcffad2e17ec 100644 --- a/drivers/gpu/drm/i915/display/intel_sprite_uapi.c +++ b/drivers/gpu/drm/i915/display/intel_sprite_uapi.c @@ -17,7 +17,7 @@ static void intel_plane_set_ckey(struct intel_plane_state *plane_state, const struct drm_intel_sprite_colorkey *set) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); struct drm_intel_sprite_colorkey *key = &plane_state->ckey; *key = *set; @@ -80,7 +80,7 @@ int intel_sprite_set_colorkey_ioctl(struct drm_device *dev, void *data, drm_modeset_acquire_init(&ctx, 0); - state = drm_atomic_state_alloc(plane->dev); + state = drm_atomic_state_alloc(plane->drm); if (!state) { ret = -ENOMEM; goto out; diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c index 0d6c26d4453d..e8f808846ea4 100644 --- a/drivers/gpu/drm/i915/display/skl_scaler.c +++ b/drivers/gpu/drm/i915/display/skl_scaler.c @@ -269,7 +269,7 @@ int skl_update_scaler_plane(struct intel_crtc_state *crtc_state, { struct intel_plane *intel_plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(intel_plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_plane->base.drm); struct drm_framebuffer *fb = plane_state->hw.fb; int ret; bool force_detach = !fb || !plane_state->uapi.visible; @@ -764,7 +764,7 @@ skl_program_plane_scaler(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); const struct drm_framebuffer *fb = plane_state->hw.fb; enum pipe pipe = plane->pipe; int scaler_id = plane_state->scaler_id; diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c index 5c02b9b805e2..1ff7f870df21 100644 --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c @@ -463,7 +463,7 @@ skl_plane_max_stride(struct intel_plane *plane, u32 pixel_format, u64 modifier, unsigned int rotation) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); const struct drm_format_info *info = drm_format_info(pixel_format); int cpp = info->cpp[0]; int max_horizontal_pixels = 8192; @@ -515,7 +515,7 @@ icl_program_input_csc(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; enum plane_id plane_id = plane->id; @@ -618,7 +618,7 @@ static void skl_plane_disable_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum plane_id plane_id = plane->id; enum pipe pipe = plane->pipe; @@ -632,7 +632,7 @@ static void icl_plane_disable_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum plane_id plane_id = plane->id; enum pipe pipe = plane->pipe; @@ -650,7 +650,7 @@ static bool skl_plane_get_hw_state(struct intel_plane *plane, enum pipe *pipe) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum intel_display_power_domain power_domain; enum plane_id plane_id = plane->id; intel_wakeref_t wakeref; @@ -898,7 +898,7 @@ static u32 skl_plane_ctl(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { struct drm_i915_private *dev_priv = - to_i915(plane_state->uapi.plane->dev); + to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int rotation = plane_state->hw.rotation; const struct drm_intel_sprite_colorkey *key = &plane_state->ckey; @@ -958,7 +958,7 @@ static u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { struct drm_i915_private *dev_priv = - to_i915(plane_state->uapi.plane->dev); + to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); u32 plane_color_ctl = 0; @@ -996,7 +996,7 @@ static u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state, static u32 skl_surf_address(const struct intel_plane_state *plane_state, int color_plane) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; u32 offset = plane_state->view.color_plane[color_plane].offset; @@ -1031,7 +1031,7 @@ static u32 skl_plane_surf(const struct intel_plane_state *plane_state, static u32 skl_plane_aux_dist(const struct intel_plane_state *plane_state, int color_plane) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; int aux_plane = skl_main_to_aux_plane(fb, color_plane); u32 aux_dist; @@ -1078,7 +1078,7 @@ static u32 skl_plane_keymsk(const struct intel_plane_state *plane_state) static void icl_plane_csc_load_black(struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); enum plane_id plane_id = plane->id; enum pipe pipe = plane->pipe; @@ -1114,7 +1114,7 @@ skl_plane_update_noarm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum plane_id plane_id = plane->id; enum pipe pipe = plane->pipe; u32 stride = skl_plane_stride(plane_state, 0); @@ -1144,7 +1144,7 @@ skl_plane_update_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum plane_id plane_id = plane->id; enum pipe pipe = plane->pipe; u32 x = plane_state->view.color_plane[0].x; @@ -1200,7 +1200,7 @@ icl_plane_update_noarm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum plane_id plane_id = plane->id; enum pipe pipe = plane->pipe; int color_plane = icl_plane_color_plane(plane_state); @@ -1275,7 +1275,7 @@ icl_plane_update_arm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum plane_id plane_id = plane->id; enum pipe pipe = plane->pipe; int color_plane = icl_plane_color_plane(plane_state); @@ -1312,7 +1312,7 @@ skl_plane_async_flip(struct intel_plane *plane, const struct intel_plane_state *plane_state, bool async_flip) { - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); enum plane_id plane_id = plane->id; enum pipe pipe = plane->pipe; u32 plane_ctl = plane_state->ctl; @@ -1343,7 +1343,7 @@ static int skl_plane_check_fb(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int rotation = plane_state->hw.rotation; @@ -1426,7 +1426,7 @@ static int skl_plane_check_dst_coordinates(const struct intel_crtc_state *crtc_s const struct intel_plane_state *plane_state) { struct drm_i915_private *dev_priv = - to_i915(plane_state->uapi.plane->dev); + to_i915(plane_state->uapi.plane->drm); int crtc_x = plane_state->uapi.dst.x1; int crtc_w = drm_rect_width(&plane_state->uapi.dst); int pipe_src_w = drm_rect_width(&crtc_state->pipe_src); @@ -1455,7 +1455,7 @@ static int skl_plane_check_dst_coordinates(const struct intel_crtc_state *crtc_s static int skl_plane_check_nv12_rotation(const struct intel_plane_state *plane_state) { - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); + struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->drm); const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int rotation = plane_state->hw.rotation; int src_w = drm_rect_width(&plane_state->uapi.src) >> 16; @@ -1571,7 +1571,7 @@ int skl_calc_main_surface_offset(const struct intel_plane_state *plane_state, int *x, int *y, u32 *offset) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); const struct drm_framebuffer *fb = plane_state->hw.fb; const int aux_plane = skl_main_to_aux_plane(fb, 0); const u32 aux_offset = plane_state->view.color_plane[aux_plane].offset; @@ -1621,7 +1621,7 @@ int skl_calc_main_surface_offset(const struct intel_plane_state *plane_state, static int skl_check_main_surface(struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); const struct drm_framebuffer *fb = plane_state->hw.fb; const unsigned int rotation = plane_state->hw.rotation; int x = plane_state->uapi.src.x1 >> 16; @@ -1692,7 +1692,7 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state) static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int rotation = plane_state->hw.rotation; int uv_plane = 1; @@ -1869,7 +1869,7 @@ static int skl_plane_check(struct intel_crtc_state *crtc_state, struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); + struct drm_i915_private *dev_priv = to_i915(plane->base.drm); const struct drm_framebuffer *fb = plane_state->hw.fb; int min_scale = DRM_PLANE_NO_SCALING; int max_scale = DRM_PLANE_NO_SCALING; @@ -2146,7 +2146,7 @@ static const struct drm_plane_funcs gen12_plane_funcs = { static void skl_plane_enable_flip_done(struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; spin_lock_irq(&i915->irq_lock); @@ -2157,7 +2157,7 @@ skl_plane_enable_flip_done(struct intel_plane *plane) static void skl_plane_disable_flip_done(struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); enum pipe pipe = plane->pipe; spin_lock_irq(&i915->irq_lock); diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c index ecbf118ed0b0..76edd8fd0dc8 100644 --- a/drivers/gpu/drm/i915/display/skl_watermark.c +++ b/drivers/gpu/drm/i915/display/skl_watermark.c @@ -1351,7 +1351,7 @@ static bool use_minimal_wm0_only(const struct intel_crtc_state *crtc_state, struct intel_plane *plane) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); return DISPLAY_VER(i915) >= 13 && crtc_state->uapi.async_flip && @@ -2167,7 +2167,7 @@ static int icl_build_plane_wm(struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); enum plane_id plane_id = plane->id; struct skl_plane_wm *wm = &crtc_state->wm.skl.raw.planes[plane_id]; int ret; @@ -2379,7 +2379,7 @@ static void skl_write_wm_level(struct drm_i915_private *i915, void skl_write_plane_wm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); enum plane_id plane_id = plane->id; enum pipe pipe = plane->pipe; const struct skl_pipe_wm *pipe_wm = &crtc_state->wm.skl.optimal; @@ -2416,7 +2416,7 @@ void skl_write_plane_wm(struct intel_plane *plane, void skl_write_cursor_wm(struct intel_plane *plane, const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); enum plane_id plane_id = plane->id; enum pipe pipe = plane->pipe; const struct skl_pipe_wm *pipe_wm = &crtc_state->wm.skl.optimal; @@ -2807,7 +2807,7 @@ static bool skl_plane_selected_wm_equals(struct intel_plane *plane, const struct skl_pipe_wm *old_pipe_wm, const struct skl_pipe_wm *new_pipe_wm) { - struct drm_i915_private *i915 = to_i915(plane->base.dev); + struct drm_i915_private *i915 = to_i915(plane->base.drm); int level; for (level = 0; level < i915->display.wm.num_levels; level++) { diff --git a/drivers/gpu/drm/imx/dcss/dcss-plane.c b/drivers/gpu/drm/imx/dcss/dcss-plane.c index ab6d32bad756..a3c6eabb8a2f 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-plane.c +++ b/drivers/gpu/drm/imx/dcss/dcss-plane.c @@ -144,7 +144,7 @@ static int dcss_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); struct dcss_plane *dcss_plane = to_dcss_plane(plane); - struct dcss_dev *dcss = plane->dev->dev_private; + struct dcss_dev *dcss = plane->drm->dev_private; struct drm_framebuffer *fb = new_plane_state->fb; bool is_primary_plane = plane->type == DRM_PLANE_TYPE_PRIMARY; struct drm_gem_dma_object *dma_obj; @@ -215,7 +215,7 @@ static void dcss_plane_atomic_set_base(struct dcss_plane *dcss_plane) { struct drm_plane *plane = &dcss_plane->base; struct drm_plane_state *state = plane->state; - struct dcss_dev *dcss = plane->dev->dev_private; + struct dcss_dev *dcss = plane->drm->dev_private; struct drm_framebuffer *fb = state->fb; const struct drm_format_info *format = fb->format; struct drm_gem_dma_object *dma_obj = drm_fb_dma_get_gem_obj(fb, 0); @@ -273,7 +273,7 @@ static void dcss_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane); struct dcss_plane *dcss_plane = to_dcss_plane(plane); - struct dcss_dev *dcss = plane->dev->dev_private; + struct dcss_dev *dcss = plane->drm->dev_private; struct drm_framebuffer *fb = new_state->fb; struct drm_crtc_state *crtc_state; bool modifiers_present; @@ -354,7 +354,7 @@ static void dcss_plane_atomic_disable(struct drm_plane *plane, struct drm_atomic_state *state) { struct dcss_plane *dcss_plane = to_dcss_plane(plane); - struct dcss_dev *dcss = plane->dev->dev_private; + struct dcss_dev *dcss = plane->drm->dev_private; dcss_dpr_enable(dcss->dpr, dcss_plane->ch_num, false); dcss_scaler_ch_enable(dcss->scaler, dcss_plane->ch_num, false); diff --git a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c index 80142d9a4a55..e5b501e30585 100644 --- a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c @@ -371,7 +371,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); struct drm_crtc_state *crtc_state; - struct device *dev = plane->dev->dev; + struct device *dev = plane->drm->dev; struct drm_framebuffer *fb = new_state->fb; struct drm_framebuffer *old_fb = old_state->fb; unsigned long eba, ubo, vbo, old_ubo, old_vbo, alpha_eba; @@ -716,7 +716,7 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, ipu_cpmem_set_yuv_planar_full(ipu_plane->ipu_ch, fb->pitches[1], ubo, vbo); - dev_dbg(ipu_plane->base.dev->dev, + dev_dbg(ipu_plane->base.drm->dev, "phy = %lu %lu %lu, x = %d, y = %d", eba, ubo, vbo, new_state->src.x1 >> 16, new_state->src.y1 >> 16); break; @@ -727,7 +727,7 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, ipu_cpmem_set_yuv_planar_full(ipu_plane->ipu_ch, fb->pitches[1], ubo, ubo); - dev_dbg(ipu_plane->base.dev->dev, + dev_dbg(ipu_plane->base.drm->dev, "phy = %lu %lu, x = %d, y = %d", eba, ubo, new_state->src.x1 >> 16, new_state->src.y1 >> 16); break; @@ -740,7 +740,8 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, alpha_eba = drm_plane_state_to_eba(new_state, 1); num_bursts = 0; - dev_dbg(ipu_plane->base.dev->dev, "phys = %lu %lu, x = %d, y = %d", + dev_dbg(ipu_plane->base.drm->dev, + "phys = %lu %lu, x = %d, y = %d", eba, alpha_eba, new_state->src.x1 >> 16, new_state->src.y1 >> 16); @@ -758,7 +759,8 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, ipu_cpmem_set_buffer(ipu_plane->alpha_ch, 1, alpha_eba); break; default: - dev_dbg(ipu_plane->base.dev->dev, "phys = %lu, x = %d, y = %d", + dev_dbg(ipu_plane->base.drm->dev, + "phys = %lu, x = %d, y = %d", eba, new_state->src.x1 >> 16, new_state->src.y1 >> 16); break; } diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index c8b4b988e20b..25461cda2cc7 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -458,7 +458,7 @@ static int ingenic_drm_plane_atomic_check(struct drm_plane *plane, plane); struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); - struct ingenic_drm *priv = drm_device_get_priv(plane->dev); + struct ingenic_drm *priv = drm_device_get_priv(plane->drm); struct ingenic_drm_private_state *priv_state; struct drm_crtc_state *crtc_state; struct drm_crtc *crtc = new_plane_state->crtc ?: old_plane_state->crtc; @@ -552,7 +552,7 @@ void ingenic_drm_plane_disable(struct device *dev, struct drm_plane *plane) static void ingenic_drm_plane_atomic_disable(struct drm_plane *plane, struct drm_atomic_state *state) { - struct ingenic_drm *priv = drm_device_get_priv(plane->dev); + struct ingenic_drm *priv = drm_device_get_priv(plane->drm); ingenic_drm_plane_disable(priv->dev, plane); } @@ -656,7 +656,7 @@ static void ingenic_drm_update_palette(struct ingenic_drm *priv, static void ingenic_drm_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { - struct ingenic_drm *priv = drm_device_get_priv(plane->dev); + struct ingenic_drm *priv = drm_device_get_priv(plane->drm); struct drm_plane_state *newstate = drm_atomic_get_new_plane_state(state, plane); struct drm_plane_state *oldstate = drm_atomic_get_old_plane_state(state, plane); unsigned int width, height, cpp, next_id, plane_id; diff --git a/drivers/gpu/drm/kmb/kmb_plane.c b/drivers/gpu/drm/kmb/kmb_plane.c index 9e0562aa2bcb..e4590d4b6745 100644 --- a/drivers/gpu/drm/kmb/kmb_plane.c +++ b/drivers/gpu/drm/kmb/kmb_plane.c @@ -72,7 +72,7 @@ static unsigned int check_pixel_format(struct drm_plane *plane, u32 format) int plane_id = kmb_plane->id; struct disp_cfg init_disp_cfg; - kmb = to_kmb(plane->dev); + kmb = to_kmb(plane->drm); init_disp_cfg = kmb->init_disp_cfg[plane_id]; /* Due to HW limitations, changing pixel format after initial * plane configuration is not supported. @@ -102,7 +102,7 @@ static int kmb_plane_atomic_check(struct drm_plane *plane, struct drm_crtc_state *crtc_state; bool can_position; - kmb = to_kmb(plane->dev); + kmb = to_kmb(plane->drm); init_disp_cfg = kmb->init_disp_cfg[plane_id]; fb = new_plane_state->fb; if (!fb || !new_plane_state->crtc) @@ -145,7 +145,7 @@ static void kmb_plane_atomic_disable(struct drm_plane *plane, int plane_id = kmb_plane->id; struct kmb_drm_private *kmb; - kmb = to_kmb(plane->dev); + kmb = to_kmb(plane->drm); if (WARN_ON(plane_id >= KMB_MAX_PLANES)) return; @@ -369,7 +369,7 @@ static void kmb_plane_atomic_update(struct drm_plane *plane, num_planes = fb->format->num_planes; kmb_plane = to_kmb_plane(plane); - kmb = to_kmb(plane->dev); + kmb = to_kmb(plane->drm); plane_id = kmb_plane->id; spin_lock_irq(&kmb->irq_lock); diff --git a/drivers/gpu/drm/logicvc/logicvc_layer.c b/drivers/gpu/drm/logicvc/logicvc_layer.c index 464000aea765..966dc5e74f9a 100644 --- a/drivers/gpu/drm/logicvc/logicvc_layer.c +++ b/drivers/gpu/drm/logicvc/logicvc_layer.c @@ -83,7 +83,7 @@ static bool logicvc_layer_format_inverted(uint32_t format) static int logicvc_plane_atomic_check(struct drm_plane *drm_plane, struct drm_atomic_state *state) { - struct drm_device *drm_dev = drm_plane->dev; + struct drm_device *drm_dev = drm_plane->drm; struct logicvc_layer *layer = logicvc_layer(drm_plane); struct logicvc_drm *logicvc = logicvc_drm(drm_dev); struct drm_plane_state *new_state = @@ -138,7 +138,7 @@ static void logicvc_plane_atomic_update(struct drm_plane *drm_plane, struct drm_atomic_state *state) { struct logicvc_layer *layer = logicvc_layer(drm_plane); - struct logicvc_drm *logicvc = logicvc_drm(drm_plane->dev); + struct logicvc_drm *logicvc = logicvc_drm(drm_plane->drm); struct drm_device *drm_dev = &logicvc->drm_dev; struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, drm_plane); @@ -235,7 +235,7 @@ static void logicvc_plane_atomic_disable(struct drm_plane *drm_plane, struct drm_atomic_state *state) { struct logicvc_layer *layer = logicvc_layer(drm_plane); - struct logicvc_drm *logicvc = logicvc_drm(drm_plane->dev); + struct logicvc_drm *logicvc = logicvc_drm(drm_plane->drm); u32 index = layer->index; regmap_write(logicvc->regmap, LOGICVC_LAYER_CTRL_REG(index), 0); diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c b/drivers/gpu/drm/loongson/lsdc_plane.c index bd8a27106d16..b333e376e0a8 100644 --- a/drivers/gpu/drm/loongson/lsdc_plane.c +++ b/drivers/gpu/drm/loongson/lsdc_plane.c @@ -94,7 +94,7 @@ static void lsdc_primary_atomic_disable(struct drm_plane *plane, * Writing the format as LSDC_PF_NONE can disable the primary, * But it seems not necessary... */ - drm_dbg(plane->dev, "%s disabled\n", plane->name); + drm_dbg(plane->drm, "%s disabled\n", plane->name); } static int lsdc_plane_prepare_fb(struct drm_plane *plane, @@ -112,7 +112,7 @@ static int lsdc_plane_prepare_fb(struct drm_plane *plane, ret = lsdc_bo_reserve(lbo); if (unlikely(ret)) { - drm_err(plane->dev, "bo %p reserve failed\n", lbo); + drm_err(plane->drm, "bo %p reserve failed\n", lbo); return ret; } @@ -121,14 +121,14 @@ static int lsdc_plane_prepare_fb(struct drm_plane *plane, lsdc_bo_unreserve(lbo); if (unlikely(ret)) { - drm_err(plane->dev, "bo %p pin failed\n", lbo); + drm_err(plane->drm, "bo %p pin failed\n", lbo); return ret; } lsdc_bo_ref(lbo); if (plane->type != DRM_PLANE_TYPE_CURSOR) - drm_dbg(plane->dev, + drm_dbg(plane->drm, "%s[%p] pin at 0x%llx, bo size: %zu\n", plane->name, lbo, gpu_vaddr, lsdc_bo_size(lbo)); @@ -149,7 +149,7 @@ static void lsdc_plane_cleanup_fb(struct drm_plane *plane, ret = lsdc_bo_reserve(lbo); if (unlikely(ret)) { - drm_err(plane->dev, "%p reserve failed\n", lbo); + drm_err(plane->drm, "%p reserve failed\n", lbo); return; } @@ -160,7 +160,7 @@ static void lsdc_plane_cleanup_fb(struct drm_plane *plane, lsdc_bo_unref(lbo); if (plane->type != DRM_PLANE_TYPE_CURSOR) - drm_dbg(plane->dev, "%s unpin\n", plane->name); + drm_dbg(plane->drm, "%s unpin\n", plane->name); } static const struct drm_plane_helper_funcs lsdc_primary_helper_funcs = { @@ -180,18 +180,18 @@ static int lsdc_cursor_plane_atomic_async_check(struct drm_plane *plane, new_state = drm_atomic_get_new_plane_state(state, plane); if (!plane->state || !plane->state->fb) { - drm_dbg(plane->dev, "%s: state is NULL\n", plane->name); + drm_dbg(plane->drm, "%s: state is NULL\n", plane->name); return -EINVAL; } if (new_state->crtc_w != new_state->crtc_h) { - drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n", + drm_dbg(plane->drm, "unsupported cursor size: %ux%u\n", new_state->crtc_w, new_state->crtc_h); return -EINVAL; } if (new_state->crtc_w != 64 && new_state->crtc_w != 32) { - drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n", + drm_dbg(plane->drm, "unsupported cursor size: %ux%u\n", new_state->crtc_w, new_state->crtc_h); return -EINVAL; } @@ -200,7 +200,7 @@ static int lsdc_cursor_plane_atomic_async_check(struct drm_plane *plane, crtc_state = drm_atomic_get_existing_crtc_state(state, new_state->crtc); } else { crtc_state = plane->crtc->state; - drm_dbg(plane->dev, "%s: atomic state is NULL\n", plane->name); + drm_dbg(plane->drm, "%s: atomic state is NULL\n", plane->name); } if (!crtc_state->active) @@ -283,12 +283,12 @@ static int ls7a1000_cursor_plane_atomic_check(struct drm_plane *plane, crtc = new_plane_state->crtc; if (!crtc) { - drm_dbg(plane->dev, "%s is not bind to a crtc\n", plane->name); + drm_dbg(plane->drm, "%s is not bind to a crtc\n", plane->name); return 0; } if (new_plane_state->crtc_w != 32 || new_plane_state->crtc_h != 32) { - drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n", + drm_dbg(plane->drm, "unsupported cursor size: %ux%u\n", new_plane_state->crtc_w, new_plane_state->crtc_h); return -EINVAL; } @@ -356,18 +356,18 @@ static int ls7a2000_cursor_plane_atomic_check(struct drm_plane *plane, crtc = new_plane_state->crtc; if (!crtc) { - drm_dbg(plane->dev, "%s is not bind to a crtc\n", plane->name); + drm_dbg(plane->drm, "%s is not bind to a crtc\n", plane->name); return 0; } if (new_plane_state->crtc_w != new_plane_state->crtc_h) { - drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n", + drm_dbg(plane->drm, "unsupported cursor size: %ux%u\n", new_plane_state->crtc_w, new_plane_state->crtc_h); return -EINVAL; } if (new_plane_state->crtc_w != 64 && new_plane_state->crtc_w != 32) { - drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n", + drm_dbg(plane->drm, "unsupported cursor size: %ux%u\n", new_plane_state->crtc_w, new_plane_state->crtc_h); return -EINVAL; } diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index f3c089b183eb..64a842e075db 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -493,7 +493,7 @@ int mgag200_primary_plane_helper_atomic_check(struct drm_plane *plane, void mgag200_primary_plane_helper_atomic_update(struct drm_plane *plane, struct drm_atomic_state *old_state) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct mga_device *mdev = to_mga_device(dev); struct drm_plane_state *plane_state = plane->state; struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(old_state, plane); @@ -515,7 +515,7 @@ void mgag200_primary_plane_helper_atomic_update(struct drm_plane *plane, void mgag200_primary_plane_helper_atomic_enable(struct drm_plane *plane, struct drm_atomic_state *state) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct mga_device *mdev = to_mga_device(dev); u8 seq1; @@ -528,7 +528,7 @@ void mgag200_primary_plane_helper_atomic_enable(struct drm_plane *plane, void mgag200_primary_plane_helper_atomic_disable(struct drm_plane *plane, struct drm_atomic_state *old_state) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct mga_device *mdev = to_mga_device(dev); u8 seq1; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index c2aaaded07ed..0f6588366eab 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -98,7 +98,7 @@ static const uint64_t supported_format_modifiers[] = { static struct dpu_kms *_dpu_plane_get_kms(struct drm_plane *plane) { - struct msm_drm_private *priv = plane->dev->dev_private; + struct msm_drm_private *priv = plane->drm->dev_private; return to_dpu_kms(priv->kms); } diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c index b689b618da78..b9062652d972 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c @@ -55,7 +55,7 @@ static int mdp4_plane_mode_set(struct drm_plane *plane, static struct mdp4_kms *get_kms(struct drm_plane *plane) { - struct msm_drm_private *priv = plane->dev->dev_private; + struct msm_drm_private *priv = plane->drm->dev_private; return to_mdp4_kms(to_mdp_kms(priv->kms)); } @@ -95,7 +95,7 @@ static const struct drm_plane_funcs mdp4_plane_funcs = { static int mdp4_plane_prepare_fb(struct drm_plane *plane, struct drm_plane_state *new_state) { - struct msm_drm_private *priv = plane->dev->dev_private; + struct msm_drm_private *priv = plane->drm->dev_private; struct msm_kms *kms = priv->kms; if (!new_state->fb) @@ -214,7 +214,7 @@ static int mdp4_plane_mode_set(struct drm_plane *plane, uint32_t src_x, uint32_t src_y, uint32_t src_w, uint32_t src_h) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct mdp4_plane *mdp4_plane = to_mdp4_plane(plane); struct mdp4_kms *mdp4_kms = get_kms(plane); enum mdp4_pipe pipe = mdp4_plane->pipe; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index bd2c4ac45601..6f47d3511764 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -29,7 +29,7 @@ static int mdp5_plane_mode_set(struct drm_plane *plane, static struct mdp5_kms *get_kms(struct drm_plane *plane) { - struct msm_drm_private *priv = plane->dev->dev_private; + struct msm_drm_private *priv = plane->drm->dev_private; return to_mdp5_kms(to_mdp_kms(priv->kms)); } @@ -149,7 +149,7 @@ static const struct drm_plane_funcs mdp5_plane_funcs = { static int mdp5_plane_prepare_fb(struct drm_plane *plane, struct drm_plane_state *new_state) { - struct msm_drm_private *priv = plane->dev->dev_private; + struct msm_drm_private *priv = plane->drm->dev_private; struct msm_kms *kms = priv->kms; bool needs_dirtyfb = to_mdp5_plane_state(new_state)->needs_dirtyfb; diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index fb5e211c838f..8a6393d8f8a0 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -668,7 +668,7 @@ static int lcdif_plane_atomic_check(struct drm_plane *plane, { struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane); - struct lcdif_drm_private *lcdif = to_lcdif_drm_private(plane->dev); + struct lcdif_drm_private *lcdif = to_lcdif_drm_private(plane->drm); struct drm_crtc_state *crtc_state; crtc_state = drm_atomic_get_new_crtc_state(state, @@ -683,7 +683,7 @@ static int lcdif_plane_atomic_check(struct drm_plane *plane, static void lcdif_plane_primary_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { - struct lcdif_drm_private *lcdif = to_lcdif_drm_private(plane->dev); + struct lcdif_drm_private *lcdif = to_lcdif_drm_private(plane->drm); struct drm_plane_state *new_pstate = drm_atomic_get_new_plane_state(state, plane); dma_addr_t paddr; diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsfb_kms.c index d84e03a0c9eb..85b3d5ff3ad4 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c @@ -523,7 +523,7 @@ static int mxsfb_plane_atomic_check(struct drm_plane *plane, { struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane); - struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->dev); + struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->drm); struct drm_crtc_state *crtc_state; crtc_state = drm_atomic_get_new_crtc_state(state, @@ -538,7 +538,7 @@ static int mxsfb_plane_atomic_check(struct drm_plane *plane, static void mxsfb_plane_primary_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { - struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->dev); + struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->drm); struct drm_plane_state *new_pstate = drm_atomic_get_new_plane_state(state, plane); dma_addr_t dma_addr; @@ -553,7 +553,7 @@ static void mxsfb_plane_overlay_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_pstate = drm_atomic_get_old_plane_state(state, plane); - struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->dev); + struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->drm); struct drm_plane_state *new_pstate = drm_atomic_get_new_plane_state(state, plane); dma_addr_t dma_addr; @@ -614,7 +614,7 @@ static void mxsfb_plane_overlay_atomic_update(struct drm_plane *plane, static void mxsfb_plane_overlay_atomic_disable(struct drm_plane *plane, struct drm_atomic_state *state) { - struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->dev); + struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->drm); writel(0, mxsfb->base + LCDC_AS_CTRL); } diff --git a/drivers/gpu/drm/nouveau/dispnv04/overlay.c b/drivers/gpu/drm/nouveau/dispnv04/overlay.c index 33f29736024a..17b836c4b671 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/overlay.c +++ b/drivers/gpu/drm/nouveau/dispnv04/overlay.c @@ -117,7 +117,7 @@ nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, uint32_t src_w, uint32_t src_h, struct drm_modeset_acquire_ctx *ctx) { - struct nouveau_drm *drm = nouveau_drm(plane->dev); + struct nouveau_drm *drm = nouveau_drm(plane->drm); struct nvif_object *dev = &drm->client.device.object; struct nouveau_plane *nv_plane = container_of(plane, struct nouveau_plane, base); @@ -192,7 +192,7 @@ static int nv10_disable_plane(struct drm_plane *plane, struct drm_modeset_acquire_ctx *ctx) { - struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object; + struct nvif_object *dev = &nouveau_drm(plane->drm)->client.device.object; struct nouveau_plane *nv_plane = container_of(plane, struct nouveau_plane, base); @@ -216,7 +216,7 @@ nv_destroy_plane(struct drm_plane *plane) static void nv10_set_params(struct nouveau_plane *plane) { - struct nvif_object *dev = &nouveau_drm(plane->base.dev)->client.device.object; + struct nvif_object *dev = &nouveau_drm(plane->base.drm)->client.device.object; u32 luma = (plane->brightness - 512) << 16 | plane->contrast; u32 chroma = ((sin_mul(plane->hue, plane->saturation) & 0xffff) << 16) | (cos_mul(plane->hue, plane->saturation) & 0xffff); @@ -368,7 +368,7 @@ nv04_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, uint32_t src_w, uint32_t src_h, struct drm_modeset_acquire_ctx *ctx) { - struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object; + struct nvif_object *dev = &nouveau_drm(plane->drm)->client.device.object; struct nouveau_plane *nv_plane = container_of(plane, struct nouveau_plane, base); struct nouveau_bo *cur = nv_plane->cur; @@ -443,7 +443,7 @@ static int nv04_disable_plane(struct drm_plane *plane, struct drm_modeset_acquire_ctx *ctx) { - struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object; + struct nvif_object *dev = &nouveau_drm(plane->drm)->client.device.object; struct nouveau_plane *nv_plane = container_of(plane, struct nouveau_plane, base); diff --git a/drivers/gpu/drm/nouveau/dispnv50/curs507a.c b/drivers/gpu/drm/nouveau/dispnv50/curs507a.c index a95ee5dcc2e3..1bd63408bbce 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/curs507a.c +++ b/drivers/gpu/drm/nouveau/dispnv50/curs507a.c @@ -34,7 +34,7 @@ bool curs507a_space(struct nv50_wndw *wndw) { - nvif_msec(&nouveau_drm(wndw->plane.dev)->client.device, 100, + nvif_msec(&nouveau_drm(wndw->plane.drm)->client.device, 100, if (NVIF_TV32(&wndw->wimm.base.user, NV507A, FREE, COUNT, >=, 4)) return true; ); @@ -78,7 +78,7 @@ static void curs507a_prepare(struct nv50_wndw *wndw, struct nv50_head_atom *asyh, struct nv50_wndw_atom *asyw) { - u32 handle = nv50_disp(wndw->plane.dev)->core->chan.vram.handle; + u32 handle = nv50_disp(wndw->plane.drm)->core->chan.vram.handle; u32 offset = asyw->image.offset[0]; if (asyh->curs.handle != handle || asyh->curs.offset != offset) { asyh->curs.handle = handle; @@ -98,7 +98,7 @@ static int curs507a_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) { - struct nouveau_drm *drm = nouveau_drm(wndw->plane.dev); + struct nouveau_drm *drm = nouveau_drm(wndw->plane.drm); struct nv50_head *head = nv50_head(asyw->state.crtc); struct drm_framebuffer *fb = asyw->state.fb; int ret; diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.c b/drivers/gpu/drm/nouveau/dispnv50/wndw.c index 0f48af3f2008..7b7b850fbbd0 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c @@ -114,7 +114,7 @@ nv50_wndw_ctxdma_new(struct nv50_wndw *wndw, struct drm_framebuffer *fb) int nv50_wndw_wait_armed(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) { - struct nv50_disp *disp = nv50_disp(wndw->plane.dev); + struct nv50_disp *disp = nv50_disp(wndw->plane.drm); if (asyw->set.ntfy) { return wndw->func->ntfy_wait_begun(disp->sync, asyw->ntfy.offset, @@ -179,7 +179,7 @@ nv50_wndw_flush_set(struct nv50_wndw *wndw, u32 *interlock, void nv50_wndw_ntfy_enable(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) { - struct nv50_disp *disp = nv50_disp(wndw->plane.dev); + struct nv50_disp *disp = nv50_disp(wndw->plane.drm); asyw->ntfy.handle = wndw->wndw.sync.handle; asyw->ntfy.offset = wndw->ntfy; @@ -195,7 +195,7 @@ nv50_wndw_atomic_check_release(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) { - struct nouveau_drm *drm = nouveau_drm(wndw->plane.dev); + struct nouveau_drm *drm = nouveau_drm(wndw->plane.drm); NV_ATOMIC(drm, "%s release\n", wndw->plane.name); wndw->func->release(wndw, asyw, asyh); asyw->ntfy.handle = 0; @@ -272,7 +272,7 @@ nv50_wndw_atomic_check_acquire(struct nv50_wndw *wndw, bool modeset, struct nv50_head_atom *asyh) { struct drm_framebuffer *fb = asyw->state.fb; - struct nouveau_drm *drm = nouveau_drm(wndw->plane.dev); + struct nouveau_drm *drm = nouveau_drm(wndw->plane.drm); uint8_t kind; uint32_t tile_mode; int ret; @@ -439,7 +439,7 @@ nv50_wndw_atomic_check(struct drm_plane *plane, { struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); - struct nouveau_drm *drm = nouveau_drm(plane->dev); + struct nouveau_drm *drm = nouveau_drm(plane->drm); struct nv50_wndw *wndw = nv50_wndw(plane); struct nv50_wndw_atom *armw = nv50_wndw_atom(wndw->plane.state); struct nv50_wndw_atom *asyw = nv50_wndw_atom(new_plane_state); @@ -517,7 +517,7 @@ nv50_wndw_atomic_check(struct drm_plane *plane, static void nv50_wndw_cleanup_fb(struct drm_plane *plane, struct drm_plane_state *old_state) { - struct nouveau_drm *drm = nouveau_drm(plane->dev); + struct nouveau_drm *drm = nouveau_drm(plane->drm); struct nouveau_bo *nvbo; NV_ATOMIC(drm, "%s cleanup: %p\n", plane->name, old_state->fb); @@ -532,7 +532,7 @@ static int nv50_wndw_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state) { struct drm_framebuffer *fb = state->fb; - struct nouveau_drm *drm = nouveau_drm(plane->dev); + struct nouveau_drm *drm = nouveau_drm(plane->drm); struct nv50_wndw *wndw = nv50_wndw(plane); struct nv50_wndw_atom *asyw = nv50_wndw_atom(state); struct nouveau_bo *nvbo; @@ -660,7 +660,7 @@ nv50_wndw_destroy(struct drm_plane *plane) static bool nv50_plane_format_mod_supported(struct drm_plane *plane, u32 format, u64 modifier) { - struct nouveau_drm *drm = nouveau_drm(plane->dev); + struct nouveau_drm *drm = nouveau_drm(plane->drm); uint8_t i; if (drm->client.device.info.chipset < 0xc0) { diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index 24a2ded08b45..17c16e6f2ee6 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c @@ -63,7 +63,7 @@ static void omap_plane_cleanup_fb(struct drm_plane *plane, static void omap_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { - struct omap_drm_private *priv = plane->dev->dev_private; + struct omap_drm_private *priv = plane->drm->dev_private; struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane); struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, @@ -141,7 +141,7 @@ static void omap_plane_atomic_update(struct drm_plane *plane, omap_crtc_timings(new_state->crtc), false, omap_crtc_channel(new_state->crtc)); if (ret) { - dev_err(plane->dev->dev, "Failed to setup plane %s\n", + dev_err(plane->drm->dev, "Failed to setup plane %s\n", plane->name); dispc_ovl_enable(priv->dispc, ovl_id, false); return; @@ -154,7 +154,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane, omap_crtc_timings(new_state->crtc), false, omap_crtc_channel(new_state->crtc)); if (ret) { - dev_err(plane->dev->dev, "Failed to setup plane right-overlay %s\n", + dev_err(plane->drm->dev, + "Failed to setup plane right-overlay %s\n", plane->name); dispc_ovl_enable(priv->dispc, r_ovl_id, false); dispc_ovl_enable(priv->dispc, ovl_id, false); @@ -168,7 +169,7 @@ static void omap_plane_atomic_update(struct drm_plane *plane, static void omap_plane_atomic_disable(struct drm_plane *plane, struct drm_atomic_state *state) { - struct omap_drm_private *priv = plane->dev->dev_private; + struct omap_drm_private *priv = plane->drm->dev_private; struct omap_plane *omap_plane = to_omap_plane(plane); struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane); @@ -204,7 +205,7 @@ static int omap_plane_atomic_check(struct drm_plane *plane, plane); struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane); - struct omap_drm_private *priv = plane->dev->dev_private; + struct omap_drm_private *priv = plane->drm->dev_private; struct omap_plane_state *omap_state = to_omap_plane_state(new_plane_state); struct omap_global_state *omap_overlay_global_state; struct drm_crtc_state *crtc_state; @@ -382,7 +383,7 @@ static void omap_plane_destroy(struct drm_plane *plane) void omap_plane_install_properties(struct drm_plane *plane, struct drm_mode_object *obj) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct omap_drm_private *priv = dev->dev_private; if (priv->has_dmm) { @@ -462,7 +463,7 @@ static int omap_plane_atomic_set_property(struct drm_plane *plane, struct drm_property *property, u64 val) { - struct omap_drm_private *priv = plane->dev->dev_private; + struct omap_drm_private *priv = plane->drm->dev_private; if (property == priv->zorder_prop) state->zpos = val; @@ -477,7 +478,7 @@ static int omap_plane_atomic_get_property(struct drm_plane *plane, struct drm_property *property, u64 *val) { - struct omap_drm_private *priv = plane->dev->dev_private; + struct omap_drm_private *priv = plane->drm->dev_private; if (property == priv->zorder_prop) *val = state->zpos; @@ -501,7 +502,7 @@ static const struct drm_plane_funcs omap_plane_funcs = { static bool omap_plane_supports_yuv(struct drm_plane *plane) { - struct omap_drm_private *priv = plane->dev->dev_private; + struct omap_drm_private *priv = plane->drm->dev_private; struct omap_plane *omap_plane = to_omap_plane(plane); const u32 *formats = dispc_ovl_get_color_modes(priv->dispc, omap_plane->id); u32 i; diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index d123a59c0c9f..f614aa85e0b3 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -472,7 +472,7 @@ static int qxl_primary_atomic_check(struct drm_plane *plane, { struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); - struct qxl_device *qdev = to_qxl(plane->dev); + struct qxl_device *qdev = to_qxl(plane->drm); struct qxl_bo *bo; if (!new_plane_state->crtc || !new_plane_state->fb) @@ -641,7 +641,7 @@ static void qxl_primary_atomic_update(struct drm_plane *plane, { struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane); - struct qxl_device *qdev = to_qxl(plane->dev); + struct qxl_device *qdev = to_qxl(plane->drm); struct qxl_bo *bo = gem_to_qxl_bo(new_state->fb->obj[0]); struct qxl_bo *primary; struct drm_clip_rect norect = { @@ -674,7 +674,7 @@ static void qxl_primary_atomic_disable(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct qxl_device *qdev = to_qxl(plane->dev); + struct qxl_device *qdev = to_qxl(plane->drm); if (old_state->fb) { struct qxl_bo *bo = gem_to_qxl_bo(old_state->fb->obj[0]); @@ -693,7 +693,7 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane, plane); struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane); - struct qxl_device *qdev = to_qxl(plane->dev); + struct qxl_device *qdev = to_qxl(plane->drm); struct drm_framebuffer *fb = new_state->fb; if (fb != old_state->fb) { @@ -708,7 +708,7 @@ static void qxl_cursor_atomic_disable(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct qxl_device *qdev = to_qxl(plane->dev); + struct qxl_device *qdev = to_qxl(plane->drm); struct qxl_crtc *qcrtc; struct qxl_release *release; struct qxl_cursor_cmd *cmd; @@ -830,7 +830,7 @@ static void qxl_prepare_shadow(struct qxl_device *qdev, struct qxl_bo *user_bo, static int qxl_plane_prepare_fb(struct drm_plane *plane, struct drm_plane_state *new_state) { - struct qxl_device *qdev = to_qxl(plane->dev); + struct qxl_device *qdev = to_qxl(plane->drm); struct drm_gem_object *obj; struct qxl_bo *user_bo; int ret; diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c index d759e0192181..75b7fd27a6bc 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c @@ -593,7 +593,7 @@ int __rcar_du_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *state, const struct rcar_du_format_info **format) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct drm_crtc_state *crtc_state; int ret; diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c index 850986cee848..ddd3b6aae69c 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c @@ -60,7 +60,7 @@ static void shmob_drm_plane_compute_base(struct shmob_drm_plane *splane, static void __shmob_drm_plane_setup(struct shmob_drm_plane *splane, struct drm_framebuffer *fb) { - struct shmob_drm_device *sdev = splane->plane.dev->dev_private; + struct shmob_drm_device *sdev = splane->plane.drm->dev_private; u32 format; /* TODO: Support ROP3 mode */ @@ -179,7 +179,7 @@ shmob_drm_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_modeset_acquire_ctx *ctx) { struct shmob_drm_plane *splane = to_shmob_plane(plane); - struct shmob_drm_device *sdev = plane->dev->dev_private; + struct shmob_drm_device *sdev = plane->drm->dev_private; const struct shmob_drm_format_info *format; format = shmob_drm_format_info(fb->format->format); @@ -211,7 +211,7 @@ static int shmob_drm_plane_disable(struct drm_plane *plane, struct drm_modeset_acquire_ctx *ctx) { struct shmob_drm_plane *splane = to_shmob_plane(plane); - struct shmob_drm_device *sdev = plane->dev->dev_private; + struct shmob_drm_device *sdev = plane->drm->dev_private; splane->format = NULL; diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c index 5d94b494a545..0f13b2206ac4 100644 --- a/drivers/gpu/drm/solomon/ssd130x.c +++ b/drivers/gpu/drm/solomon/ssd130x.c @@ -619,7 +619,7 @@ static void ssd130x_primary_plane_helper_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane); struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state); struct drm_atomic_helper_damage_iter iter; - struct drm_device *drm = plane->dev; + struct drm_device *drm = plane->drm; struct drm_rect dst_clip; struct drm_rect damage; int idx; @@ -643,7 +643,7 @@ static void ssd130x_primary_plane_helper_atomic_update(struct drm_plane *plane, static void ssd130x_primary_plane_helper_atomic_disable(struct drm_plane *plane, struct drm_atomic_state *state) { - struct drm_device *drm = plane->dev; + struct drm_device *drm = plane->drm; struct ssd130x_device *ssd130x = drm_to_ssd130x(drm); int idx; diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c index db0a1eb53532..e9549090222b 100644 --- a/drivers/gpu/drm/sti/sti_cursor.c +++ b/drivers/gpu/drm/sti/sti_cursor.c @@ -343,7 +343,7 @@ static int sti_cursor_late_register(struct drm_plane *drm_plane) struct sti_plane *plane = to_sti_plane(drm_plane); struct sti_cursor *cursor = to_sti_cursor(plane); - cursor_debugfs_init(cursor, drm_plane->dev->primary); + cursor_debugfs_init(cursor, drm_plane->drm->primary); return 0; } diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c index 43c72c2604a0..6def1c5b89bc 100644 --- a/drivers/gpu/drm/sti/sti_gdp.c +++ b/drivers/gpu/drm/sti/sti_gdp.c @@ -900,7 +900,7 @@ static int sti_gdp_late_register(struct drm_plane *drm_plane) struct sti_plane *plane = to_sti_plane(drm_plane); struct sti_gdp *gdp = to_sti_gdp(plane); - return gdp_debugfs_init(gdp, drm_plane->dev->primary); + return gdp_debugfs_init(gdp, drm_plane->drm->primary); } static const struct drm_plane_funcs sti_gdp_plane_helpers_funcs = { diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index 0fb48ac044d8..2a43d18e090a 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -1276,7 +1276,7 @@ static int sti_hqvdp_late_register(struct drm_plane *drm_plane) struct sti_plane *plane = to_sti_plane(drm_plane); struct sti_hqvdp *hqvdp = to_sti_hqvdp(plane); - hqvdp_debugfs_init(hqvdp, drm_plane->dev->primary); + hqvdp_debugfs_init(hqvdp, drm_plane->drm->primary); return 0; } diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index 7296cdebd712..ebf214f2f92c 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -489,7 +489,7 @@ static inline struct ltdc_device *crtc_to_ltdc(struct drm_crtc *crtc) static inline struct ltdc_device *plane_to_ltdc(struct drm_plane *plane) { - return (struct ltdc_device *)plane->dev->dev_private; + return (struct ltdc_device *) plane->drm->dev_private; } static inline struct ltdc_device *encoder_to_ltdc(struct drm_encoder *enc) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 133175353fba..d99e0e8a2671 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -904,7 +904,7 @@ static void __tegra_cursor_atomic_update(struct drm_plane *plane, { struct tegra_plane_state *tegra_plane_state = to_tegra_plane_state(new_state); struct tegra_dc *dc = to_tegra_dc(new_state->crtc); - struct tegra_drm *tegra = plane->dev->dev_private; + struct tegra_drm *tegra = plane->drm->dev_private; #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT u64 dma_mask = *dc->dev->dma_mask; #endif diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c index ffe5f06b770d..1fd1ab0f4f97 100644 --- a/drivers/gpu/drm/tegra/plane.c +++ b/drivers/gpu/drm/tegra/plane.c @@ -92,7 +92,7 @@ static bool tegra_plane_supports_sector_layout(struct drm_plane *plane) { struct drm_crtc *crtc; - drm_for_each_crtc(crtc, plane->dev) { + drm_for_each_crtc(crtc, plane->drm) { if (plane->possible_crtcs & drm_crtc_mask(crtc)) { struct tegra_dc *dc = to_tegra_dc(crtc); @@ -628,7 +628,7 @@ static int tegra_plane_check_transparency(struct tegra_plane *tegra, return 0; /* include all sibling planes into this commit */ - drm_for_each_plane(plane, tegra->base.dev) { + drm_for_each_plane(plane, tegra->base.drm) { struct tegra_plane *p = to_tegra_plane(plane); /* skip this plane and planes on different CRTCs */ @@ -723,7 +723,7 @@ static int tegra_plane_setup_transparency(struct tegra_plane *tegra, * All planes are now in the atomic state, walk them up and update * transparency state for each plane. */ - drm_for_each_plane(plane, tegra->base.dev) { + drm_for_each_plane(plane, tegra->base.drm) { struct tegra_plane *p = to_tegra_plane(plane); /* skip planes on different CRTCs */ diff --git a/drivers/gpu/drm/tests/drm_damage_helper_test.c b/drivers/gpu/drm/tests/drm_damage_helper_test.c index 115034fc3421..0403e0e4450a 100644 --- a/drivers/gpu/drm/tests/drm_damage_helper_test.c +++ b/drivers/gpu/drm/tests/drm_damage_helper_test.c @@ -43,7 +43,7 @@ static int drm_damage_helper_init(struct kunit *test) /* just enough so that drm_plane_enable_fb_damage_clips() works */ mock->device.driver = &mock->driver; mock->device.mode_config.prop_fb_damage_clips = &mock->prop; - mock->plane.dev = &mock->device; + mock->plane.drm = &mock->device; mock->obj_props.count = 0; mock->plane.base.properties = &mock->obj_props; mock->prop.base.id = 1; /* 0 is an invalid id */ diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c index 6bdd6e4a955a..033e8222e12f 100644 --- a/drivers/gpu/drm/tidss/tidss_plane.c +++ b/drivers/gpu/drm/tidss/tidss_plane.c @@ -24,7 +24,7 @@ static int tidss_plane_atomic_check(struct drm_plane *plane, { struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); - struct drm_device *ddev = plane->dev; + struct drm_device *ddev = plane->drm; struct tidss_device *tidss = to_tidss(ddev); struct tidss_plane *tplane = to_tidss_plane(plane); const struct drm_format_info *finfo; @@ -107,7 +107,7 @@ static int tidss_plane_atomic_check(struct drm_plane *plane, static void tidss_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { - struct drm_device *ddev = plane->dev; + struct drm_device *ddev = plane->drm; struct tidss_device *tidss = to_tidss(ddev); struct tidss_plane *tplane = to_tidss_plane(plane); struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, @@ -129,7 +129,7 @@ static void tidss_plane_atomic_update(struct drm_plane *plane, static void tidss_plane_atomic_enable(struct drm_plane *plane, struct drm_atomic_state *state) { - struct drm_device *ddev = plane->dev; + struct drm_device *ddev = plane->drm; struct tidss_device *tidss = to_tidss(ddev); struct tidss_plane *tplane = to_tidss_plane(plane); @@ -141,7 +141,7 @@ static void tidss_plane_atomic_enable(struct drm_plane *plane, static void tidss_plane_atomic_disable(struct drm_plane *plane, struct drm_atomic_state *state) { - struct drm_device *ddev = plane->dev; + struct drm_device *ddev = plane->drm; struct tidss_device *tidss = to_tidss(ddev); struct tidss_plane *tplane = to_tidss_plane(plane); diff --git a/drivers/gpu/drm/tilcdc/tilcdc_plane.c b/drivers/gpu/drm/tilcdc/tilcdc_plane.c index cf77a8ce7398..a1afb8c69ed9 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_plane.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_plane.c @@ -37,7 +37,7 @@ static int tilcdc_plane_atomic_check(struct drm_plane *plane, return -EINVAL; if (new_state->crtc_x || new_state->crtc_y) { - dev_err(plane->dev->dev, "%s: crtc position must be zero.", + dev_err(plane->drm->dev, "%s: crtc position must be zero.", __func__); return -EINVAL; } @@ -50,7 +50,7 @@ static int tilcdc_plane_atomic_check(struct drm_plane *plane, if (crtc_state->mode.hdisplay != new_state->crtc_w || crtc_state->mode.vdisplay != new_state->crtc_h) { - dev_err(plane->dev->dev, + dev_err(plane->drm->dev, "%s: Size must match mode (%dx%d == %dx%d)", __func__, crtc_state->mode.hdisplay, crtc_state->mode.vdisplay, new_state->crtc_w, new_state->crtc_h); @@ -60,13 +60,13 @@ static int tilcdc_plane_atomic_check(struct drm_plane *plane, pitch = crtc_state->mode.hdisplay * new_state->fb->format->cpp[0]; if (new_state->fb->pitches[0] != pitch) { - dev_err(plane->dev->dev, + dev_err(plane->drm->dev, "Invalid pitch: fb and crtc widths must be the same"); return -EINVAL; } if (old_state->fb && new_state->fb->format != old_state->fb->format) { - dev_dbg(plane->dev->dev, + dev_dbg(plane->drm->dev, "%s(): pixel format change requires mode_change\n", __func__); crtc_state->mode_changed = true; diff --git a/drivers/gpu/drm/tiny/cirrus.c b/drivers/gpu/drm/tiny/cirrus.c index 2f6763999360..c9788e4757ed 100644 --- a/drivers/gpu/drm/tiny/cirrus.c +++ b/drivers/gpu/drm/tiny/cirrus.c @@ -379,7 +379,7 @@ static int cirrus_primary_plane_helper_atomic_check(struct drm_plane *plane, static void cirrus_primary_plane_helper_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { - struct cirrus_device *cirrus = to_cirrus(plane->dev); + struct cirrus_device *cirrus = to_cirrus(plane->drm); struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane); struct cirrus_primary_plane_state *primary_plane_state = to_cirrus_primary_plane_state(plane_state); diff --git a/drivers/gpu/drm/tiny/ofdrm.c b/drivers/gpu/drm/tiny/ofdrm.c index ddc0ddb29434..43c376625ace 100644 --- a/drivers/gpu/drm/tiny/ofdrm.c +++ b/drivers/gpu/drm/tiny/ofdrm.c @@ -788,7 +788,7 @@ static int ofdrm_primary_plane_helper_atomic_check(struct drm_plane *plane, static void ofdrm_primary_plane_helper_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct ofdrm_device *odev = ofdrm_device_of_dev(dev); struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane); struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane); @@ -828,7 +828,7 @@ static void ofdrm_primary_plane_helper_atomic_update(struct drm_plane *plane, static void ofdrm_primary_plane_helper_atomic_disable(struct drm_plane *plane, struct drm_atomic_state *state) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct ofdrm_device *odev = ofdrm_device_of_dev(dev); struct iosys_map dst = odev->screen_base; struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane); diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index be02d12f80eb..59310065f338 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -484,7 +484,7 @@ static void simpledrm_primary_plane_helper_atomic_update(struct drm_plane *plane struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane); struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state); struct drm_framebuffer *fb = plane_state->fb; - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct simpledrm_device *sdev = simpledrm_device_of_dev(dev); struct drm_atomic_helper_damage_iter iter; struct drm_rect damage; @@ -518,7 +518,7 @@ static void simpledrm_primary_plane_helper_atomic_update(struct drm_plane *plane static void simpledrm_primary_plane_helper_atomic_disable(struct drm_plane *plane, struct drm_atomic_state *state) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct simpledrm_device *sdev = simpledrm_device_of_dev(dev); int idx; diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c index bc0accd155c6..6b521d6f5334 100644 --- a/drivers/gpu/drm/udl/udl_modeset.c +++ b/drivers/gpu/drm/udl/udl_modeset.c @@ -263,7 +263,7 @@ static const uint64_t udl_primary_plane_fmtmods[] = { static void udl_primary_plane_helper_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane); struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state); struct drm_framebuffer *fb = plane_state->fb; diff --git a/drivers/gpu/drm/vboxvideo/vbox_mode.c b/drivers/gpu/drm/vboxvideo/vbox_mode.c index f8f2dc3d3b1b..221077f38bf1 100644 --- a/drivers/gpu/drm/vboxvideo/vbox_mode.c +++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c @@ -393,7 +393,7 @@ static void vbox_cursor_atomic_update(struct drm_plane *plane, struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane); struct vbox_private *vbox = - container_of(plane->dev, struct vbox_private, ddev); + container_of(plane->drm, struct vbox_private, ddev); struct vbox_crtc *vbox_crtc = to_vbox_crtc(new_state->crtc); struct drm_framebuffer *fb = new_state->fb; u32 width = new_state->crtc_w; @@ -442,7 +442,7 @@ static void vbox_cursor_atomic_disable(struct drm_plane *plane, struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); struct vbox_private *vbox = - container_of(plane->dev, struct vbox_private, ddev); + container_of(plane->drm, struct vbox_private, ddev); struct vbox_crtc *vbox_crtc = to_vbox_crtc(old_state->crtc); bool cursor_enabled = false; struct drm_crtc *crtci; diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 00e713faecd5..25ee096323e1 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -297,7 +297,7 @@ static struct drm_plane_state *vc4_plane_duplicate_state(struct drm_plane *plane static void vc4_plane_destroy_state(struct drm_plane *plane, struct drm_plane_state *state) { - struct vc4_dev *vc4 = to_vc4_dev(plane->dev); + struct vc4_dev *vc4 = to_vc4_dev(plane->drm); struct vc4_plane_state *vc4_state = to_vc4_plane_state(state); if (drm_mm_node_allocated(&vc4_state->lbm)) { @@ -550,7 +550,7 @@ static void vc4_write_ppf(struct vc4_plane_state *vc4_state, u32 src, u32 dst) static u32 vc4_lbm_size(struct drm_plane_state *state) { struct vc4_plane_state *vc4_state = to_vc4_plane_state(state); - struct vc4_dev *vc4 = to_vc4_dev(state->plane->dev); + struct vc4_dev *vc4 = to_vc4_dev(state->plane->drm); u32 pix_per_line; u32 lbm; @@ -684,7 +684,7 @@ static void vc4_plane_calc_load(struct drm_plane_state *state) static int vc4_plane_allocate_lbm(struct drm_plane_state *state) { - struct vc4_dev *vc4 = to_vc4_dev(state->plane->dev); + struct vc4_dev *vc4 = to_vc4_dev(state->plane->drm); struct vc4_plane_state *vc4_state = to_vc4_plane_state(state); unsigned long irqflags; u32 lbm_size; @@ -814,7 +814,7 @@ static u32 vc4_hvs5_get_alpha_blend_mode(struct drm_plane_state *state) static int vc4_plane_mode_set(struct drm_plane *plane, struct drm_plane_state *state) { - struct vc4_dev *vc4 = to_vc4_dev(plane->dev); + struct vc4_dev *vc4 = to_vc4_dev(plane->drm); struct vc4_plane_state *vc4_state = to_vc4_plane_state(state); struct drm_framebuffer *fb = state->fb; u32 ctl0_offset = vc4_state->dlist_count; @@ -1317,7 +1317,7 @@ u32 vc4_plane_write_dlist(struct drm_plane *plane, u32 __iomem *dlist) int i; int idx; - if (!drm_dev_enter(plane->dev, &idx)) + if (!drm_dev_enter(plane->drm, &idx)) goto out; vc4_state->hw_dlist = dlist; @@ -1349,7 +1349,7 @@ void vc4_plane_async_set_fb(struct drm_plane *plane, struct drm_framebuffer *fb) uint32_t addr; int idx; - if (!drm_dev_enter(plane->dev, &idx)) + if (!drm_dev_enter(plane->drm, &idx)) return; /* We're skipping the address adjustment for negative origin, @@ -1381,7 +1381,7 @@ static void vc4_plane_atomic_async_update(struct drm_plane *plane, struct vc4_plane_state *vc4_state, *new_vc4_state; int idx; - if (!drm_dev_enter(plane->dev, &idx)) + if (!drm_dev_enter(plane->drm, &idx)) return; swap(plane->state->fb, new_plane_state->fb); diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index a2e045f3a000..e31397e0faa7 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -125,7 +125,7 @@ static void virtio_gpu_resource_flush(struct drm_plane *plane, uint32_t x, uint32_t y, uint32_t width, uint32_t height) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct virtio_gpu_device *vgdev = dev->dev_private; struct virtio_gpu_framebuffer *vgfb; struct virtio_gpu_object *bo; @@ -160,7 +160,7 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct virtio_gpu_device *vgdev = dev->dev_private; struct virtio_gpu_output *output = NULL; struct virtio_gpu_object *bo; @@ -234,7 +234,7 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane, static int virtio_gpu_plane_prepare_fb(struct drm_plane *plane, struct drm_plane_state *new_state) { - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct virtio_gpu_device *vgdev = dev->dev_private; struct virtio_gpu_framebuffer *vgfb; struct virtio_gpu_object *bo; @@ -277,7 +277,7 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct drm_device *dev = plane->dev; + struct drm_device *dev = plane->drm; struct virtio_gpu_device *vgdev = dev->dev_private; struct virtio_gpu_output *output = NULL; struct virtio_gpu_framebuffer *vgfb; @@ -383,7 +383,7 @@ struct drm_plane *virtio_gpu_plane_init(struct virtio_gpu_device *vgdev, funcs = &virtio_gpu_primary_helper_funcs; } - plane = drmm_universal_plane_alloc(dev, struct drm_plane, dev, + plane = drmm_universal_plane_alloc(dev, struct drm_plane, drm, 1 << index, &virtio_gpu_plane_funcs, formats, nformats, NULL, type, NULL); if (IS_ERR(plane)) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index c332ad7e4e8f..6f01d06da2ef 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -38,7 +38,7 @@ void vmw_du_cleanup(struct vmw_display_unit *du) { - struct vmw_private *dev_priv = vmw_priv(du->primary.dev); + struct vmw_private *dev_priv = vmw_priv(du->primary.drm); drm_plane_cleanup(&du->primary); if (vmw_cmd_supported(dev_priv)) drm_plane_cleanup(&du->cursor.base); @@ -268,7 +268,7 @@ static void vmw_du_put_cursor_mob(struct vmw_cursor_plane *vcp, static int vmw_du_get_cursor_mob(struct vmw_cursor_plane *vcp, struct vmw_plane_state *vps) { - struct vmw_private *dev_priv = vcp->base.dev->dev_private; + struct vmw_private *dev_priv = vcp->base.drm->dev_private; u32 size = vmw_du_cursor_mob_size(vps->base.crtc_w, vps->base.crtc_h); u32 i; u32 cursor_max_dim, mob_max_size; @@ -498,7 +498,7 @@ void vmw_du_cursor_plane_destroy(struct drm_plane *plane) struct vmw_cursor_plane *vcp = vmw_plane_to_vcp(plane); u32 i; - vmw_cursor_update_position(plane->dev->dev_private, false, 0, 0); + vmw_cursor_update_position(plane->drm->dev_private, false, 0, 0); for (i = 0; i < ARRAY_SIZE(vcp->cursor_mobs); i++) vmw_du_destroy_cursor_mob(&vcp->cursor_mobs[i]); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c index 289165b1b976..4a05b7e43135 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c @@ -340,7 +340,7 @@ vmw_ldu_primary_plane_atomic_update(struct drm_plane *plane, struct drm_crtc *crtc = new_state->crtc ?: old_state->crtc; ldu = vmw_crtc_to_ldu(crtc); - dev_priv = vmw_priv(plane->dev); + dev_priv = vmw_priv(plane->drm); fb = new_state->fb; vfb = (fb) ? vmw_framebuffer_to_vfb(fb) : NULL; @@ -370,8 +370,9 @@ vmw_ldu_primary_plane_atomic_update(struct drm_plane *plane, ret = vmw_kms_ldu_do_bo_dirty(dev_priv, vfb, 0, 0, damage_rects, rect_count); - drm_WARN_ONCE(plane->dev, ret, - "vmw_kms_ldu_do_bo_dirty failed with: ret=%d\n", ret); + drm_WARN_ONCE(plane->drm, ret, + "vmw_kms_ldu_do_bo_dirty failed with: ret=%d\n", + ret); vmw_cmd_flush(dev_priv, false); } diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index b3c3cdba00a8..1aecaa016b54 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c @@ -893,7 +893,7 @@ static int vmw_stdu_primary_plane_prepare_fb(struct drm_plane *plane, struct drm_plane_state *new_state) { - struct vmw_private *dev_priv = vmw_priv(plane->dev); + struct vmw_private *dev_priv = vmw_priv(plane->drm); struct drm_framebuffer *new_fb = new_state->fb; struct vmw_framebuffer *vfb; struct vmw_plane_state *vps = vmw_plane_state_to_vps(new_state); diff --git a/drivers/gpu/drm/xlnx/zynqmp_kms.c b/drivers/gpu/drm/xlnx/zynqmp_kms.c index 37bbfd838499..0e11243d2f0d 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_kms.c +++ b/drivers/gpu/drm/xlnx/zynqmp_kms.c @@ -77,7 +77,7 @@ static void zynqmp_dpsub_plane_atomic_disable(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); - struct zynqmp_dpsub *dpsub = to_zynqmp_dpsub(plane->dev); + struct zynqmp_dpsub *dpsub = to_zynqmp_dpsub(plane->drm); struct zynqmp_disp_layer *layer = dpsub->layers[plane->index]; if (!old_state->fb) @@ -95,7 +95,7 @@ static void zynqmp_dpsub_plane_atomic_update(struct drm_plane *plane, { struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane); - struct zynqmp_dpsub *dpsub = to_zynqmp_dpsub(plane->dev); + struct zynqmp_dpsub *dpsub = to_zynqmp_dpsub(plane->drm); struct zynqmp_disp_layer *layer = dpsub->layers[plane->index]; bool format_changed = false; diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h index 51291983ea44..74c38eb72b8d 100644 --- a/include/drm/drm_plane.h +++ b/include/drm/drm_plane.h @@ -591,8 +591,8 @@ enum drm_plane_type { * Management Properties`_ for details on that. */ struct drm_plane { - /** @dev: DRM device this plane belongs to */ - struct drm_device *dev; + /** @drm: DRM device this plane belongs to */ + struct drm_device *drm; /** * @head: From patchwork Thu Jul 13 08:24:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311542 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 226C0C001DC for ; Thu, 13 Jul 2023 08:25:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 856F710E62B; Thu, 13 Jul 2023 08:25:09 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2C3AD10E627 for ; Thu, 13 Jul 2023 08:25:05 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrch-0005zd-I8; Thu, 13 Jul 2023 10:24:27 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrcg-00E4kB-Ki; Thu, 13 Jul 2023 10:24:26 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrcf-004Vhe-Sp; Thu, 13 Jul 2023 10:24:25 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 15/17] drm/property_blob: Rename struct drm_property_blob::dev to drm Date: Thu, 13 Jul 2023 10:24:06 +0200 Message-Id: <20230713082408.2266984-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2208; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=BvR/QEocHu3OeWqAz/vmlTZFNDu1xtjB/wxM1QxICQg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7SdWg/5fAmvH4zLByYhq1435qg26nThNtlYF exLc5KZD7SJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0nQAKCRCPgPtYfRL+ Ti8AB/9MfNcEm691uCRfNu8iqeVzLtGMintHfWtJpf9HIg8Mt3Qz1/fZTlLJ3uA3jNLbcEc2CLO ScK/EOYBNAGt6gR+A9F8GFbK1k9P+vHtkD0ihix/7Pza0KXspoCMLiT30nC5Bx0MP0R4KtorlBS ecXDvAoAX80RO3NM34MG7/LFaw9TyGU8CzP49JRRtoptWkPqcYF0sBPLu8gCMiMyfS8dn2dtF8R vfaeLYZ6ixZMkzToZRr9wovXUhAipixFyA1Bx8CeyQ7fLPixQNVxZD/QVDm1F+SM16+hLVe2D0z Xs8GY/TKxc7XSMVhA5DKuXk8uFTXxuhxidVLO2dNaOOALtx8 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/drm_property.c | 8 ++++---- include/drm/drm_property.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c index dfec479830e4..ab533c5b8cd4 100644 --- a/drivers/gpu/drm/drm_property.c +++ b/drivers/gpu/drm/drm_property.c @@ -528,11 +528,11 @@ static void drm_property_free_blob(struct kref *kref) struct drm_property_blob *blob = container_of(kref, struct drm_property_blob, base.refcount); - mutex_lock(&blob->dev->mode_config.blob_lock); + mutex_lock(&blob->drm->mode_config.blob_lock); list_del(&blob->head_global); - mutex_unlock(&blob->dev->mode_config.blob_lock); + mutex_unlock(&blob->drm->mode_config.blob_lock); - drm_mode_object_unregister(blob->dev, &blob->base); + drm_mode_object_unregister(blob->drm, &blob->base); kvfree(blob); } @@ -570,7 +570,7 @@ drm_property_create_blob(struct drm_device *dev, size_t length, INIT_LIST_HEAD(&blob->head_file); blob->data = (void *)blob + sizeof(*blob); blob->length = length; - blob->dev = dev; + blob->drm = dev; if (data) memcpy(blob->data, data, length); diff --git a/include/drm/drm_property.h b/include/drm/drm_property.h index 65bc9710a470..c6b570a8459e 100644 --- a/include/drm/drm_property.h +++ b/include/drm/drm_property.h @@ -200,7 +200,7 @@ struct drm_property { /** * struct drm_property_blob - Blob data for &drm_property * @base: base KMS object - * @dev: DRM device + * @drm: DRM device * @head_global: entry on the global blob list in * &drm_mode_config.property_blob_list. * @head_file: entry on the per-file blob list in &drm_file.blobs list. @@ -215,7 +215,7 @@ struct drm_property { */ struct drm_property_blob { struct drm_mode_object base; - struct drm_device *dev; + struct drm_device *drm; struct list_head head_global; struct list_head head_file; size_t length; From patchwork Thu Jul 13 08:24:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311540 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C8D17EB64DD for ; Thu, 13 Jul 2023 08:25:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC709882AF; Thu, 13 Jul 2023 08:25:05 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 64D6689F41 for ; Thu, 13 Jul 2023 08:25:04 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrch-0005zo-NQ; Thu, 13 Jul 2023 10:24:27 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrcg-00E4kF-RS; Thu, 13 Jul 2023 10:24:26 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrcg-004Vhi-5N; Thu, 13 Jul 2023 10:24:26 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 16/17] drm/property: Rename struct drm_property::dev to drm Date: Thu, 13 Jul 2023 10:24:07 +0200 Message-Id: <20230713082408.2266984-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6549; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ooW+Ud+VOqToHKNWoOg8p0KQxIh7xZn5APD7T7mJAtc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7Sf5x/bqo4O7ni+o2C48C9n7a1gjPUTUI7mN rpPTdEqgUOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0nwAKCRCPgPtYfRL+ TrpfB/4v2loa+3oniVWHdOZuWPZ5ZQZOObpL2hEuk9xJNGSUxqIdSv3UkNVTGuDkiU4n3qVaNnn kbAh6YKQMNRiCr9wDe7C8MTAAerflYS+iNW+Y9iyiAuQISExalTHnlYGLps4iJE+57BjcPCkM47 8LkgsB04umRdXbIESOIxBG1bK9VoTkkGvd8m1wJjtQOiMR2O0BqEqB8EoYq3TifzQw+21o47LY+ 4NnBwdn1tbT8BtTAVSmtxXMCvtt8XpqFE12SfZqLeznsiV3gY9XQB2rgJMwcvQmtHkJo/IuoDQx DkpEWKYQkHFddRl1A7z7o3dF58UVf8iwhAWY7mrOVwW+zWS4 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/drm_atomic_uapi.c | 5 +++-- drivers/gpu/drm/drm_mode_object.c | 16 ++++++++-------- drivers/gpu/drm/drm_property.c | 6 +++--- drivers/gpu/drm/tests/drm_damage_helper_test.c | 2 +- include/drm/drm_property.h | 4 ++-- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index d9d41d1b4f5d..58300caeea38 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -898,7 +898,7 @@ drm_atomic_connector_get_property(struct drm_connector *connector, int drm_atomic_get_property(struct drm_mode_object *obj, struct drm_property *property, uint64_t *val) { - struct drm_device *dev = property->dev; + struct drm_device *dev = property->drm; int ret; switch (obj->type) { @@ -1064,7 +1064,8 @@ int drm_atomic_set_property(struct drm_atomic_state *state, break; } default: - drm_dbg_atomic(prop->dev, "[OBJECT:%d] has no properties\n", obj->id); + drm_dbg_atomic(prop->drm, "[OBJECT:%d] has no properties\n", + obj->id); ret = -EINVAL; break; } diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c index 63f071e77d77..6f33dd62b329 100644 --- a/drivers/gpu/drm/drm_mode_object.c +++ b/drivers/gpu/drm/drm_mode_object.c @@ -235,7 +235,7 @@ void drm_object_attach_property(struct drm_mode_object *obj, uint64_t init_val) { int count = obj->properties->count; - struct drm_device *dev = property->dev; + struct drm_device *dev = property->drm; if (obj->type == DRM_MODE_OBJECT_CONNECTOR) { @@ -285,7 +285,7 @@ int drm_object_property_set_value(struct drm_mode_object *obj, { int i; - WARN_ON(drm_drv_uses_atomic_modeset(property->dev) && + WARN_ON(drm_drv_uses_atomic_modeset(property->drm) && !(property->flags & DRM_MODE_PROP_IMMUTABLE)); for (i = 0; i < obj->properties->count; i++) { @@ -324,7 +324,7 @@ static int __drm_object_property_get_value(struct drm_mode_object *obj, * their value in obj->properties->values[].. mostly to avoid * having to deal w/ EDID and similar props in atomic paths: */ - if (drm_drv_uses_atomic_modeset(property->dev) && + if (drm_drv_uses_atomic_modeset(property->drm) && !(property->flags & DRM_MODE_PROP_IMMUTABLE)) return drm_atomic_get_property(obj, property, val); @@ -351,7 +351,7 @@ static int __drm_object_property_get_value(struct drm_mode_object *obj, int drm_object_property_get_value(struct drm_mode_object *obj, struct drm_property *property, uint64_t *val) { - WARN_ON(drm_drv_uses_atomic_modeset(property->dev)); + WARN_ON(drm_drv_uses_atomic_modeset(property->drm)); return __drm_object_property_get_value(obj, property, val); } @@ -377,7 +377,7 @@ int drm_object_property_get_default_value(struct drm_mode_object *obj, struct drm_property *property, uint64_t *val) { - WARN_ON(!drm_drv_uses_atomic_modeset(property->dev)); + WARN_ON(!drm_drv_uses_atomic_modeset(property->drm)); return __drm_object_property_get_prop_value(obj, property, val); } @@ -483,7 +483,7 @@ static int set_property_legacy(struct drm_mode_object *obj, struct drm_property *prop, uint64_t prop_value) { - struct drm_device *dev = prop->dev; + struct drm_device *dev = prop->drm; struct drm_mode_object *ref; struct drm_modeset_acquire_ctx ctx; int ret = -EINVAL; @@ -515,7 +515,7 @@ static int set_property_atomic(struct drm_mode_object *obj, struct drm_property *prop, uint64_t prop_value) { - struct drm_device *dev = prop->dev; + struct drm_device *dev = prop->drm; struct drm_atomic_state *state; struct drm_modeset_acquire_ctx ctx; int ret; @@ -580,7 +580,7 @@ int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data, if (!property) goto out_unref; - if (drm_drv_uses_atomic_modeset(property->dev)) + if (drm_drv_uses_atomic_modeset(property->drm)) ret = set_property_atomic(arg_obj, file_priv, property, arg->value); else ret = set_property_legacy(arg_obj, property, arg->value); diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c index ab533c5b8cd4..045232c91420 100644 --- a/drivers/gpu/drm/drm_property.c +++ b/drivers/gpu/drm/drm_property.c @@ -110,7 +110,7 @@ struct drm_property *drm_property_create(struct drm_device *dev, if (!property) return NULL; - property->dev = dev; + property->drm = dev; if (num_values) { property->values = kcalloc(num_values, sizeof(uint64_t), @@ -904,7 +904,7 @@ bool drm_property_change_valid_get(struct drm_property *property, if (value == 0) return true; - blob = drm_property_lookup_blob(property->dev, value); + blob = drm_property_lookup_blob(property->drm, value); if (blob) { *ref = &blob->base; return true; @@ -916,7 +916,7 @@ bool drm_property_change_valid_get(struct drm_property *property, if (value == 0) return true; - *ref = __drm_mode_object_find(property->dev, NULL, value, + *ref = __drm_mode_object_find(property->drm, NULL, value, property->values[0]); return *ref != NULL; } diff --git a/drivers/gpu/drm/tests/drm_damage_helper_test.c b/drivers/gpu/drm/tests/drm_damage_helper_test.c index 0403e0e4450a..ed70d8ff1469 100644 --- a/drivers/gpu/drm/tests/drm_damage_helper_test.c +++ b/drivers/gpu/drm/tests/drm_damage_helper_test.c @@ -47,7 +47,7 @@ static int drm_damage_helper_init(struct kunit *test) mock->obj_props.count = 0; mock->plane.base.properties = &mock->obj_props; mock->prop.base.id = 1; /* 0 is an invalid id */ - mock->prop.dev = &mock->device; + mock->prop.drm = &mock->device; drm_plane_enable_fb_damage_clips(&mock->plane); diff --git a/include/drm/drm_property.h b/include/drm/drm_property.h index c6b570a8459e..9022f350eee7 100644 --- a/include/drm/drm_property.h +++ b/include/drm/drm_property.h @@ -184,9 +184,9 @@ struct drm_property { uint64_t *values; /** - * @dev: DRM device + * @drm: DRM device */ - struct drm_device *dev; + struct drm_device *drm; /** * @enum_list: From patchwork Thu Jul 13 08:24:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13311536 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E02EC001B0 for ; Thu, 13 Jul 2023 08:24:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B0C0410E5F5; Thu, 13 Jul 2023 08:24:51 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id AE7D910E626 for ; Thu, 13 Jul 2023 08:24:50 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJrch-00060j-Vp; Thu, 13 Jul 2023 10:24:28 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qJrch-00E4kK-7Q; Thu, 13 Jul 2023 10:24:27 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qJrcg-004Vhl-I4; Thu, 13 Jul 2023 10:24:26 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Thomas Zimmermann , Javier Martinez Canillas , "Russell King (Oracle)" , =?utf-8?q?Christian_K?= =?utf-8?q?=C3=B6nig?= , Julia Lawall , Andrzej Hajda , Maxime Ripard , Sui Jingfeng , Luben Tuikov , Jani Nikula , Thierry Reding , Geert Uytterhoeven , Sean Paul , Krzysztof Kozlowski Subject: [PATCH 17/17] drm/vblank_crtc: Rename struct drm_vblank_crtc::dev to drm Date: Thu, 13 Jul 2023 10:24:08 +0200 Message-Id: <20230713082408.2266984-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> References: <20230713082408.2266984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4760; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Wd0xW8yHKC8uHsToF/cS2FncD5+P2cYXJskTGCcSS/Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkr7ShmlRZtqfUvBLyNFx4SLtQ/vZSopj69UCzQ XDmyNqXWueJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK+0oQAKCRCPgPtYfRL+ TnzdCACfqI26iYix7kLA5Zp2vmncVy5K1whdGLSQBwK58mjcDLShIWjWg3MtRKRxu55f62jfGLi Mr4jR6XTGw/oZdXs6F01jk2GwyVh7BwV5/eoDyWyZ3IUAS5YfdWstfT2Fc44r1gbZjgDsnZdEXX fmq7e5PRhJ8l0cpGO8KXZxuH/x207isQmwaw8v8k/uW00R5obyXTfEGfM4qGRjQS5kHf66M0MK/ KWZUyt8HkYu/aI7ZKu9BOMMV8PcO3ZpOiFF4eqXZ9MCc2qC0JZYlxzBwY+FSKe3Tj53c9QdpkTK eCUGxJW4INTDOX88wMXpQ8NvLQDz/q0Uwmh7KIwt5hhfIWWs X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" "dev" is usually used for struct device pointers. Using it for struct drm_device pointers is irritating (for me at least). Replace it by "drm" and adapt all users. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/drm_vblank.c | 4 ++-- drivers/gpu/drm/drm_vblank_work.c | 18 +++++++++--------- include/drm/drm_vblank.h | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c index 87e305c8f7f6..351b0e3d1361 100644 --- a/drivers/gpu/drm/drm_vblank.c +++ b/drivers/gpu/drm/drm_vblank.c @@ -485,7 +485,7 @@ void drm_vblank_disable_and_save(struct drm_device *dev, unsigned int pipe) static void vblank_disable_fn(struct timer_list *t) { struct drm_vblank_crtc *vblank = from_timer(vblank, t, disable_timer); - struct drm_device *dev = vblank->dev; + struct drm_device *dev = vblank->drm; unsigned int pipe = vblank->pipe; unsigned long irqflags; @@ -537,7 +537,7 @@ int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs) for (i = 0; i < num_crtcs; i++) { struct drm_vblank_crtc *vblank = &dev->vblank[i]; - vblank->dev = dev; + vblank->drm = dev; vblank->pipe = i; init_waitqueue_head(&vblank->queue); timer_setup(&vblank->disable_timer, vblank_disable_fn, 0); diff --git a/drivers/gpu/drm/drm_vblank_work.c b/drivers/gpu/drm/drm_vblank_work.c index f6e024bed6b5..acd551ff247d 100644 --- a/drivers/gpu/drm/drm_vblank_work.c +++ b/drivers/gpu/drm/drm_vblank_work.c @@ -49,14 +49,14 @@ void drm_handle_vblank_works(struct drm_vblank_crtc *vblank) u64 count = atomic64_read(&vblank->count); bool wake = false; - assert_spin_locked(&vblank->dev->event_lock); + assert_spin_locked(&vblank->drm->event_lock); list_for_each_entry_safe(work, next, &vblank->pending_work, node) { if (!drm_vblank_passed(count, work->count)) continue; list_del_init(&work->node); - drm_vblank_put(vblank->dev, vblank->pipe); + drm_vblank_put(vblank->drm, vblank->pipe); kthread_queue_work(vblank->worker, &work->base); wake = true; } @@ -71,11 +71,11 @@ void drm_vblank_cancel_pending_works(struct drm_vblank_crtc *vblank) { struct drm_vblank_work *work, *next; - assert_spin_locked(&vblank->dev->event_lock); + assert_spin_locked(&vblank->drm->event_lock); list_for_each_entry_safe(work, next, &vblank->pending_work, node) { list_del_init(&work->node); - drm_vblank_put(vblank->dev, vblank->pipe); + drm_vblank_put(vblank->drm, vblank->pipe); } wake_up_all(&vblank->work_wait_queue); @@ -107,7 +107,7 @@ int drm_vblank_work_schedule(struct drm_vblank_work *work, u64 count, bool nextonmiss) { struct drm_vblank_crtc *vblank = work->vblank; - struct drm_device *dev = vblank->dev; + struct drm_device *dev = vblank->drm; u64 cur_vbl; unsigned long irqflags; bool passed, inmodeset, rescheduling = false, wake = false; @@ -182,13 +182,13 @@ EXPORT_SYMBOL(drm_vblank_work_schedule); bool drm_vblank_work_cancel_sync(struct drm_vblank_work *work) { struct drm_vblank_crtc *vblank = work->vblank; - struct drm_device *dev = vblank->dev; + struct drm_device *dev = vblank->drm; bool ret = false; spin_lock_irq(&dev->event_lock); if (!list_empty(&work->node)) { list_del_init(&work->node); - drm_vblank_put(vblank->dev, vblank->pipe); + drm_vblank_put(vblank->drm, vblank->pipe); ret = true; } @@ -218,7 +218,7 @@ EXPORT_SYMBOL(drm_vblank_work_cancel_sync); void drm_vblank_work_flush(struct drm_vblank_work *work) { struct drm_vblank_crtc *vblank = work->vblank; - struct drm_device *dev = vblank->dev; + struct drm_device *dev = vblank->drm; spin_lock_irq(&dev->event_lock); wait_event_lock_irq(vblank->work_wait_queue, list_empty(&work->node), @@ -253,7 +253,7 @@ int drm_vblank_worker_init(struct drm_vblank_crtc *vblank) INIT_LIST_HEAD(&vblank->pending_work); init_waitqueue_head(&vblank->work_wait_queue); worker = kthread_create_worker(0, "card%d-crtc%d", - vblank->dev->primary->index, + vblank->drm->primary->index, vblank->pipe); if (IS_ERR(worker)) return PTR_ERR(worker); diff --git a/include/drm/drm_vblank.h b/include/drm/drm_vblank.h index 7f3957943dd1..a89fc63a94f5 100644 --- a/include/drm/drm_vblank.h +++ b/include/drm/drm_vblank.h @@ -90,9 +90,9 @@ struct drm_pending_vblank_event { */ struct drm_vblank_crtc { /** - * @dev: Pointer to the &drm_device. + * @drm: Pointer to the &drm_device. */ - struct drm_device *dev; + struct drm_device *drm; /** * @queue: Wait queue for vblank waiters. */