mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 06:31:58 +02:00
drm/i915/overlay: add intel_overlay_available() and use it
Avoid accessing struct intel_display members directly from i915_getparam_ioctl(). Add intel_overlay_available() function to provide the information for I915_PARAM_HAS_OVERLAY. Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/26041645168ce3e76cb8f73bcb4c747619117e06.1732102179.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
40c9ad5f2d
commit
e3840e5871
|
|
@ -1438,6 +1438,11 @@ void intel_overlay_setup(struct intel_display *display)
|
|||
kfree(overlay);
|
||||
}
|
||||
|
||||
bool intel_overlay_available(struct intel_display *display)
|
||||
{
|
||||
return display->overlay;
|
||||
}
|
||||
|
||||
void intel_overlay_cleanup(struct intel_display *display)
|
||||
{
|
||||
struct intel_overlay *overlay;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ struct intel_overlay_snapshot;
|
|||
|
||||
#ifdef I915
|
||||
void intel_overlay_setup(struct intel_display *display);
|
||||
bool intel_overlay_available(struct intel_display *display);
|
||||
void intel_overlay_cleanup(struct intel_display *display);
|
||||
int intel_overlay_switch_off(struct intel_overlay *overlay);
|
||||
int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
|
||||
|
|
@ -29,6 +30,10 @@ void intel_overlay_reset(struct intel_display *display);
|
|||
static inline void intel_overlay_setup(struct intel_display *display)
|
||||
{
|
||||
}
|
||||
static inline bool intel_overlay_available(struct intel_display *display)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline void intel_overlay_cleanup(struct intel_display *display)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include "display/intel_overlay.h"
|
||||
#include "gem/i915_gem_mman.h"
|
||||
#include "gt/intel_engine_user.h"
|
||||
|
||||
#include "pxp/intel_pxp.h"
|
||||
|
||||
#include "i915_cmd_parser.h"
|
||||
|
|
@ -16,6 +16,7 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,
|
|||
struct drm_file *file_priv)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(dev);
|
||||
struct intel_display *display = &i915->display;
|
||||
struct pci_dev *pdev = to_pci_dev(dev->dev);
|
||||
const struct sseu_dev_info *sseu = &to_gt(i915)->info.sseu;
|
||||
drm_i915_getparam_t *param = data;
|
||||
|
|
@ -38,7 +39,7 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,
|
|||
value = to_gt(i915)->ggtt->num_fences;
|
||||
break;
|
||||
case I915_PARAM_HAS_OVERLAY:
|
||||
value = !!i915->display.overlay;
|
||||
value = intel_overlay_available(display);
|
||||
break;
|
||||
case I915_PARAM_HAS_BSD:
|
||||
value = !!intel_engine_lookup_user(i915,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user