linux/drivers/gpu/drm/i915/display/intel_hti.c
Jani Nikula 513c1a2ec4 drm/i915: reduce intel_wakeref.h dependencies
Forward declare struct drm_printer instead of including drm/drm_print.h,
as we only need the pointer. Turns out quite a few places depend on this
include implicitly. Make them explicit.

Some of the includes are just stale and unnecessary. Group the forward
declarations together while at it.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/20250326115452.2090275-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2025-04-01 11:48:18 +03:00

43 lines
1 KiB
C

// SPDX-License-Identifier: MIT
/*
* Copyright © 2022 Intel Corporation
*/
#include <drm/drm_device.h>
#include <drm/drm_print.h>
#include "intel_de.h"
#include "intel_display.h"
#include "intel_hti.h"
#include "intel_hti_regs.h"
void intel_hti_init(struct intel_display *display)
{
/*
* If the platform has HTI, we need to find out whether it has reserved
* any display resources before we create our display outputs.
*/
if (DISPLAY_INFO(display)->has_hti)
display->hti.state = intel_de_read(display, HDPORT_STATE);
}
bool intel_hti_uses_phy(struct intel_display *display, enum phy phy)
{
if (drm_WARN_ON(display->drm, phy == PHY_NONE))
return false;
return display->hti.state & HDPORT_ENABLED &&
display->hti.state & HDPORT_DDI_USED(phy);
}
u32 intel_hti_dpll_mask(struct intel_display *display)
{
if (!(display->hti.state & HDPORT_ENABLED))
return 0;
/*
* Note: This is subtle. The values must coincide with what's defined
* for the platform.
*/
return REG_FIELD_GET(HDPORT_DPLL_USED_MASK, display->hti.state);
}