mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 10:11:38 -04:00
drm/i915/overlay: Convert overlay to parent interface
Convert the direct i915_overlay_*() calls from the display
side to go over a new parent interface instead.
v2: Correctly handle the ERR_PTR returned by
i915_overlay_obj_lookup() (Jani)
v3: Rebase due to the NULL check in intel_overlay_cleanup()
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20260226130150.16816-1-ville.syrjala@linux.intel.com
This commit is contained in:
@@ -30,13 +30,13 @@
|
||||
#include <drm/drm_gem.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "i915_overlay.h"
|
||||
#include "intel_color_regs.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_regs.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_frontbuffer.h"
|
||||
#include "intel_overlay.h"
|
||||
#include "intel_parent.h"
|
||||
#include "intel_pfit_regs.h"
|
||||
|
||||
/* Limits for overlay size. According to intel doc, the real limits are:
|
||||
@@ -199,7 +199,7 @@ void intel_overlay_reset(struct intel_display *display)
|
||||
overlay->old_yscale = 0;
|
||||
overlay->crtc = NULL;
|
||||
|
||||
i915_overlay_reset(display->drm);
|
||||
intel_parent_overlay_reset(display);
|
||||
}
|
||||
|
||||
static int packed_depth_bytes(u32 format)
|
||||
@@ -477,19 +477,19 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay,
|
||||
drm_WARN_ON(display->drm,
|
||||
!drm_modeset_is_locked(&display->drm->mode_config.connection_mutex));
|
||||
|
||||
ret = i915_overlay_release_old_vid(display->drm);
|
||||
ret = intel_parent_overlay_release_old_vid(display);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
atomic_inc(&display->restore.pending_fb_pin);
|
||||
|
||||
vma = i915_overlay_pin_fb(display->drm, obj, &offset);
|
||||
vma = intel_parent_overlay_pin_fb(display, obj, &offset);
|
||||
if (IS_ERR(vma)) {
|
||||
ret = PTR_ERR(vma);
|
||||
goto out_pin_section;
|
||||
}
|
||||
|
||||
if (!i915_overlay_is_active(display->drm)) {
|
||||
if (!intel_parent_overlay_is_active(display)) {
|
||||
const struct intel_crtc_state *crtc_state =
|
||||
overlay->crtc->config;
|
||||
u32 oconfig = 0;
|
||||
@@ -505,7 +505,7 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay,
|
||||
OCONF_PIPE_A : OCONF_PIPE_B;
|
||||
iowrite32(oconfig, ®s->OCONFIG);
|
||||
|
||||
ret = i915_overlay_on(display->drm, INTEL_FRONTBUFFER_OVERLAY(pipe));
|
||||
ret = intel_parent_overlay_on(display, INTEL_FRONTBUFFER_OVERLAY(pipe));
|
||||
if (ret != 0)
|
||||
goto out_unpin;
|
||||
}
|
||||
@@ -563,14 +563,14 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay,
|
||||
if (tmp & (1 << 17))
|
||||
drm_dbg(display->drm, "overlay underrun, DOVSTA: %x\n", tmp);
|
||||
|
||||
ret = i915_overlay_continue(display->drm, vma, scale_changed);
|
||||
ret = intel_parent_overlay_continue(display, vma, scale_changed);
|
||||
if (ret)
|
||||
goto out_unpin;
|
||||
|
||||
return 0;
|
||||
|
||||
out_unpin:
|
||||
i915_overlay_unpin_fb(display->drm, vma);
|
||||
intel_parent_overlay_unpin_fb(display, vma);
|
||||
out_pin_section:
|
||||
atomic_dec(&display->restore.pending_fb_pin);
|
||||
|
||||
@@ -585,14 +585,14 @@ int intel_overlay_switch_off(struct intel_overlay *overlay)
|
||||
drm_WARN_ON(display->drm,
|
||||
!drm_modeset_is_locked(&display->drm->mode_config.connection_mutex));
|
||||
|
||||
ret = i915_overlay_recover_from_interrupt(display->drm);
|
||||
ret = intel_parent_overlay_recover_from_interrupt(display);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
if (!i915_overlay_is_active(display->drm))
|
||||
if (!intel_parent_overlay_is_active(display))
|
||||
return 0;
|
||||
|
||||
ret = i915_overlay_release_old_vid(display->drm);
|
||||
ret = intel_parent_overlay_release_old_vid(display);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
@@ -601,7 +601,7 @@ int intel_overlay_switch_off(struct intel_overlay *overlay)
|
||||
overlay->crtc->overlay = NULL;
|
||||
overlay->crtc = NULL;
|
||||
|
||||
return i915_overlay_off(display->drm);
|
||||
return intel_parent_overlay_off(display);
|
||||
}
|
||||
|
||||
static int check_overlay_possible_on_crtc(struct intel_overlay *overlay,
|
||||
@@ -822,13 +822,13 @@ int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
|
||||
return -ENOENT;
|
||||
crtc = to_intel_crtc(drmmode_crtc);
|
||||
|
||||
obj = i915_overlay_obj_lookup(dev, file_priv, params->bo_handle);
|
||||
obj = intel_parent_overlay_obj_lookup(display, file_priv, params->bo_handle);
|
||||
if (IS_ERR(obj))
|
||||
return PTR_ERR(obj);
|
||||
|
||||
drm_modeset_lock_all(dev);
|
||||
|
||||
ret = i915_overlay_recover_from_interrupt(dev);
|
||||
ret = intel_parent_overlay_recover_from_interrupt(display);
|
||||
if (ret != 0)
|
||||
goto out_unlock;
|
||||
|
||||
@@ -998,7 +998,7 @@ int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
|
||||
if (DISPLAY_VER(display) == 2)
|
||||
goto out_unlock;
|
||||
|
||||
if (i915_overlay_is_active(display->drm)) {
|
||||
if (intel_parent_overlay_is_active(display)) {
|
||||
ret = -EBUSY;
|
||||
goto out_unlock;
|
||||
}
|
||||
@@ -1036,8 +1036,8 @@ void intel_overlay_setup(struct intel_display *display)
|
||||
if (!overlay)
|
||||
return;
|
||||
|
||||
regs = i915_overlay_setup(display->drm,
|
||||
OVERLAY_NEEDS_PHYSICAL(display));
|
||||
regs = intel_parent_overlay_setup(display,
|
||||
OVERLAY_NEEDS_PHYSICAL(display));
|
||||
if (IS_ERR(regs))
|
||||
goto out_free;
|
||||
|
||||
@@ -1071,7 +1071,7 @@ void intel_overlay_cleanup(struct intel_display *display)
|
||||
if (!display->overlay)
|
||||
return;
|
||||
|
||||
i915_overlay_cleanup(display->drm);
|
||||
intel_parent_overlay_cleanup(display);
|
||||
|
||||
kfree(display->overlay);
|
||||
display->overlay = NULL;
|
||||
|
||||
@@ -14,7 +14,6 @@ struct drm_printer;
|
||||
struct intel_display;
|
||||
struct intel_overlay;
|
||||
|
||||
#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);
|
||||
@@ -24,34 +23,5 @@ int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
|
||||
int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv);
|
||||
void intel_overlay_reset(struct intel_display *display);
|
||||
#else
|
||||
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)
|
||||
{
|
||||
}
|
||||
static inline int intel_overlay_switch_off(struct intel_overlay *overlay)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void intel_overlay_reset(struct intel_display *display)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INTEL_OVERLAY_H__ */
|
||||
|
||||
@@ -87,6 +87,82 @@ void intel_parent_irq_synchronize(struct intel_display *display)
|
||||
display->parent->irq->synchronize(display->drm);
|
||||
}
|
||||
|
||||
/* overlay */
|
||||
bool intel_parent_overlay_is_active(struct intel_display *display)
|
||||
{
|
||||
return display->parent->overlay->is_active(display->drm);
|
||||
}
|
||||
|
||||
int intel_parent_overlay_on(struct intel_display *display,
|
||||
u32 frontbuffer_bits)
|
||||
{
|
||||
return display->parent->overlay->overlay_on(display->drm,
|
||||
frontbuffer_bits);
|
||||
}
|
||||
|
||||
int intel_parent_overlay_continue(struct intel_display *display,
|
||||
struct i915_vma *vma,
|
||||
bool load_polyphase_filter)
|
||||
{
|
||||
return display->parent->overlay->overlay_continue(display->drm, vma,
|
||||
load_polyphase_filter);
|
||||
}
|
||||
|
||||
int intel_parent_overlay_off(struct intel_display *display)
|
||||
{
|
||||
return display->parent->overlay->overlay_off(display->drm);
|
||||
}
|
||||
|
||||
int intel_parent_overlay_recover_from_interrupt(struct intel_display *display)
|
||||
{
|
||||
return display->parent->overlay->recover_from_interrupt(display->drm);
|
||||
}
|
||||
|
||||
int intel_parent_overlay_release_old_vid(struct intel_display *display)
|
||||
{
|
||||
return display->parent->overlay->release_old_vid(display->drm);
|
||||
}
|
||||
|
||||
void intel_parent_overlay_reset(struct intel_display *display)
|
||||
{
|
||||
display->parent->overlay->reset(display->drm);
|
||||
}
|
||||
|
||||
struct i915_vma *intel_parent_overlay_pin_fb(struct intel_display *display,
|
||||
struct drm_gem_object *obj,
|
||||
u32 *offset)
|
||||
{
|
||||
return display->parent->overlay->pin_fb(display->drm, obj, offset);
|
||||
}
|
||||
|
||||
void intel_parent_overlay_unpin_fb(struct intel_display *display,
|
||||
struct i915_vma *vma)
|
||||
{
|
||||
return display->parent->overlay->unpin_fb(display->drm, vma);
|
||||
}
|
||||
|
||||
struct drm_gem_object *intel_parent_overlay_obj_lookup(struct intel_display *display,
|
||||
struct drm_file *filp,
|
||||
u32 handle)
|
||||
{
|
||||
return display->parent->overlay->obj_lookup(display->drm,
|
||||
filp, handle);
|
||||
}
|
||||
|
||||
void __iomem *intel_parent_overlay_setup(struct intel_display *display,
|
||||
bool needs_physical)
|
||||
{
|
||||
if (drm_WARN_ON_ONCE(display->drm, !display->parent->overlay))
|
||||
return ERR_PTR(-ENODEV);
|
||||
|
||||
return display->parent->overlay->setup(display->drm, needs_physical);
|
||||
}
|
||||
|
||||
void intel_parent_overlay_cleanup(struct intel_display *display)
|
||||
{
|
||||
display->parent->overlay->cleanup(display->drm);
|
||||
}
|
||||
|
||||
/* panic */
|
||||
struct intel_panic *intel_parent_panic_alloc(struct intel_display *display)
|
||||
{
|
||||
|
||||
@@ -7,8 +7,10 @@
|
||||
#include <linux/types.h>
|
||||
|
||||
struct dma_fence;
|
||||
struct drm_file;
|
||||
struct drm_gem_object;
|
||||
struct drm_scanout_buffer;
|
||||
struct i915_vma;
|
||||
struct intel_display;
|
||||
struct intel_dpt;
|
||||
struct intel_hdcp_gsc_context;
|
||||
@@ -36,6 +38,29 @@ void intel_parent_hdcp_gsc_context_free(struct intel_display *display,
|
||||
bool intel_parent_irq_enabled(struct intel_display *display);
|
||||
void intel_parent_irq_synchronize(struct intel_display *display);
|
||||
|
||||
/* overlay */
|
||||
bool intel_parent_overlay_is_active(struct intel_display *display);
|
||||
int intel_parent_overlay_on(struct intel_display *display,
|
||||
u32 frontbuffer_bits);
|
||||
int intel_parent_overlay_continue(struct intel_display *display,
|
||||
struct i915_vma *vma,
|
||||
bool load_polyphase_filter);
|
||||
int intel_parent_overlay_off(struct intel_display *display);
|
||||
int intel_parent_overlay_recover_from_interrupt(struct intel_display *display);
|
||||
int intel_parent_overlay_release_old_vid(struct intel_display *display);
|
||||
void intel_parent_overlay_reset(struct intel_display *display);
|
||||
struct i915_vma *intel_parent_overlay_pin_fb(struct intel_display *display,
|
||||
struct drm_gem_object *obj,
|
||||
u32 *offset);
|
||||
void intel_parent_overlay_unpin_fb(struct intel_display *display,
|
||||
struct i915_vma *vma);
|
||||
struct drm_gem_object *intel_parent_overlay_obj_lookup(struct intel_display *display,
|
||||
struct drm_file *filp,
|
||||
u32 handle);
|
||||
void __iomem *intel_parent_overlay_setup(struct intel_display *display,
|
||||
bool needs_physical);
|
||||
void intel_parent_overlay_cleanup(struct intel_display *display);
|
||||
|
||||
/* panic */
|
||||
struct intel_panic *intel_parent_panic_alloc(struct intel_display *display);
|
||||
int intel_parent_panic_setup(struct intel_display *display, struct intel_panic *panic, struct drm_scanout_buffer *sb);
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
#include "i915_ioctl.h"
|
||||
#include "i915_irq.h"
|
||||
#include "i915_memcpy.h"
|
||||
#include "i915_overlay.h"
|
||||
#include "i915_panic.h"
|
||||
#include "i915_perf.h"
|
||||
#include "i915_query.h"
|
||||
@@ -767,6 +768,7 @@ static const struct intel_display_parent_interface parent = {
|
||||
.hdcp = &i915_display_hdcp_interface,
|
||||
.initial_plane = &i915_display_initial_plane_interface,
|
||||
.irq = &i915_display_irq_interface,
|
||||
.overlay = &i915_display_overlay_interface,
|
||||
.panic = &i915_display_panic_interface,
|
||||
.pc8 = &i915_display_pc8_interface,
|
||||
.pcode = &i915_display_pcode_interface,
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include <drm/intel/display_parent_interface.h>
|
||||
#include <drm/intel/intel_gmd_interrupt_regs.h>
|
||||
|
||||
#include "gem/i915_gem_internal.h"
|
||||
@@ -88,7 +89,7 @@ alloc_request(struct i915_overlay *overlay, void (*fn)(struct i915_overlay *))
|
||||
return rq;
|
||||
}
|
||||
|
||||
bool i915_overlay_is_active(struct drm_device *drm)
|
||||
static bool i915_overlay_is_active(struct drm_device *drm)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(drm);
|
||||
struct i915_overlay *overlay = i915->overlay;
|
||||
@@ -97,8 +98,8 @@ bool i915_overlay_is_active(struct drm_device *drm)
|
||||
}
|
||||
|
||||
/* overlay needs to be disable in OCMD reg */
|
||||
int i915_overlay_on(struct drm_device *drm,
|
||||
u32 frontbuffer_bits)
|
||||
static int i915_overlay_on(struct drm_device *drm,
|
||||
u32 frontbuffer_bits)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(drm);
|
||||
struct i915_overlay *overlay = i915->overlay;
|
||||
@@ -159,9 +160,9 @@ static void i915_overlay_flip_prepare(struct i915_overlay *overlay,
|
||||
}
|
||||
|
||||
/* overlay needs to be enabled in OCMD reg */
|
||||
int i915_overlay_continue(struct drm_device *drm,
|
||||
struct i915_vma *vma,
|
||||
bool load_polyphase_filter)
|
||||
static int i915_overlay_continue(struct drm_device *drm,
|
||||
struct i915_vma *vma,
|
||||
bool load_polyphase_filter)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(drm);
|
||||
struct i915_overlay *overlay = i915->overlay;
|
||||
@@ -210,7 +211,8 @@ static void i915_overlay_release_old_vma(struct i915_overlay *overlay)
|
||||
i915_vma_put(vma);
|
||||
}
|
||||
|
||||
static void i915_overlay_release_old_vid_tail(struct i915_overlay *overlay)
|
||||
static void
|
||||
i915_overlay_release_old_vid_tail(struct i915_overlay *overlay)
|
||||
{
|
||||
i915_overlay_release_old_vma(overlay);
|
||||
}
|
||||
@@ -237,7 +239,7 @@ static void i915_overlay_last_flip_retire(struct i915_active *active)
|
||||
}
|
||||
|
||||
/* overlay needs to be disabled in OCMD reg */
|
||||
int i915_overlay_off(struct drm_device *drm)
|
||||
static int i915_overlay_off(struct drm_device *drm)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(drm);
|
||||
struct i915_overlay *overlay = i915->overlay;
|
||||
@@ -286,7 +288,7 @@ int i915_overlay_off(struct drm_device *drm)
|
||||
* Recover from an interruption due to a signal.
|
||||
* We have to be careful not to repeat work forever an make forward progress.
|
||||
*/
|
||||
int i915_overlay_recover_from_interrupt(struct drm_device *drm)
|
||||
static int i915_overlay_recover_from_interrupt(struct drm_device *drm)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(drm);
|
||||
struct i915_overlay *overlay = i915->overlay;
|
||||
@@ -299,7 +301,7 @@ int i915_overlay_recover_from_interrupt(struct drm_device *drm)
|
||||
* Needs to be called before the overlay register are changed
|
||||
* via intel_overlay_(un)map_regs.
|
||||
*/
|
||||
int i915_overlay_release_old_vid(struct drm_device *drm)
|
||||
static int i915_overlay_release_old_vid(struct drm_device *drm)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(drm);
|
||||
struct i915_overlay *overlay = i915->overlay;
|
||||
@@ -337,7 +339,7 @@ int i915_overlay_release_old_vid(struct drm_device *drm)
|
||||
return i915_active_wait(&overlay->last_flip);
|
||||
}
|
||||
|
||||
void i915_overlay_reset(struct drm_device *drm)
|
||||
static void i915_overlay_reset(struct drm_device *drm)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(drm);
|
||||
struct i915_overlay *overlay = i915->overlay;
|
||||
@@ -348,9 +350,9 @@ void i915_overlay_reset(struct drm_device *drm)
|
||||
overlay->frontbuffer_bits = 0;
|
||||
}
|
||||
|
||||
struct i915_vma *i915_overlay_pin_fb(struct drm_device *drm,
|
||||
struct drm_gem_object *obj,
|
||||
u32 *offset)
|
||||
static struct i915_vma *i915_overlay_pin_fb(struct drm_device *drm,
|
||||
struct drm_gem_object *obj,
|
||||
u32 *offset)
|
||||
{
|
||||
struct drm_i915_gem_object *new_bo = to_intel_bo(obj);
|
||||
struct i915_gem_ww_ctx ww;
|
||||
@@ -379,13 +381,13 @@ struct i915_vma *i915_overlay_pin_fb(struct drm_device *drm,
|
||||
return vma;
|
||||
}
|
||||
|
||||
void i915_overlay_unpin_fb(struct drm_device *drm,
|
||||
struct i915_vma *vma)
|
||||
static void i915_overlay_unpin_fb(struct drm_device *drm,
|
||||
struct i915_vma *vma)
|
||||
{
|
||||
i915_vma_unpin(vma);
|
||||
}
|
||||
|
||||
struct drm_gem_object *
|
||||
static struct drm_gem_object *
|
||||
i915_overlay_obj_lookup(struct drm_device *drm,
|
||||
struct drm_file *file_priv,
|
||||
u32 handle)
|
||||
@@ -444,8 +446,8 @@ static int get_registers(struct i915_overlay *overlay, bool use_phys)
|
||||
return err;
|
||||
}
|
||||
|
||||
void __iomem *i915_overlay_setup(struct drm_device *drm,
|
||||
bool needs_physical)
|
||||
static void __iomem *i915_overlay_setup(struct drm_device *drm,
|
||||
bool needs_physical)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(drm);
|
||||
struct intel_engine_cs *engine;
|
||||
@@ -477,7 +479,7 @@ void __iomem *i915_overlay_setup(struct drm_device *drm,
|
||||
return overlay->regs;
|
||||
}
|
||||
|
||||
void i915_overlay_cleanup(struct drm_device *drm)
|
||||
static void i915_overlay_cleanup(struct drm_device *drm)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(drm);
|
||||
struct i915_overlay *overlay;
|
||||
@@ -498,3 +500,18 @@ void i915_overlay_cleanup(struct drm_device *drm)
|
||||
|
||||
kfree(overlay);
|
||||
}
|
||||
|
||||
const struct intel_display_overlay_interface i915_display_overlay_interface = {
|
||||
.is_active = i915_overlay_is_active,
|
||||
.overlay_on = i915_overlay_on,
|
||||
.overlay_continue = i915_overlay_continue,
|
||||
.overlay_off = i915_overlay_off,
|
||||
.recover_from_interrupt = i915_overlay_recover_from_interrupt,
|
||||
.release_old_vid = i915_overlay_release_old_vid,
|
||||
.reset = i915_overlay_reset,
|
||||
.obj_lookup = i915_overlay_obj_lookup,
|
||||
.pin_fb = i915_overlay_pin_fb,
|
||||
.unpin_fb = i915_overlay_unpin_fb,
|
||||
.setup = i915_overlay_setup,
|
||||
.cleanup = i915_overlay_cleanup,
|
||||
};
|
||||
|
||||
@@ -6,38 +6,6 @@
|
||||
#ifndef __I915_OVERLAY_H__
|
||||
#define __I915_OVERLAY_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct drm_device;
|
||||
struct drm_file;
|
||||
struct drm_gem_object;
|
||||
struct i915_vma;
|
||||
|
||||
bool i915_overlay_is_active(struct drm_device *drm);
|
||||
int i915_overlay_on(struct drm_device *drm,
|
||||
u32 frontbuffer_bits);
|
||||
int i915_overlay_continue(struct drm_device *drm,
|
||||
struct i915_vma *vma,
|
||||
bool load_polyphase_filter);
|
||||
int i915_overlay_off(struct drm_device *drm);
|
||||
int i915_overlay_recover_from_interrupt(struct drm_device *drm);
|
||||
int i915_overlay_release_old_vid(struct drm_device *drm);
|
||||
|
||||
void i915_overlay_reset(struct drm_device *drm);
|
||||
|
||||
struct i915_vma *i915_overlay_pin_fb(struct drm_device *drm,
|
||||
struct drm_gem_object *obj,
|
||||
u32 *offset);
|
||||
void i915_overlay_unpin_fb(struct drm_device *drm,
|
||||
struct i915_vma *vma);
|
||||
|
||||
struct drm_gem_object *
|
||||
i915_overlay_obj_lookup(struct drm_device *drm,
|
||||
struct drm_file *file_priv,
|
||||
u32 handle);
|
||||
|
||||
void __iomem *i915_overlay_setup(struct drm_device *drm,
|
||||
bool needs_physical);
|
||||
void i915_overlay_cleanup(struct drm_device *drm);
|
||||
extern const struct intel_display_overlay_interface i915_display_overlay_interface;
|
||||
|
||||
#endif /* __I915_OVERLAY_H__ */
|
||||
|
||||
@@ -303,6 +303,7 @@ xe-$(CONFIG_DRM_XE_DISPLAY) += \
|
||||
i915-display/intel_modeset_lock.o \
|
||||
i915-display/intel_modeset_setup.o \
|
||||
i915-display/intel_modeset_verify.o \
|
||||
i915-display/intel_overlay.o \
|
||||
i915-display/intel_panel.o \
|
||||
i915-display/intel_parent.o \
|
||||
i915-display/intel_pch.o \
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
struct dma_fence;
|
||||
struct drm_crtc;
|
||||
struct drm_device;
|
||||
struct drm_file;
|
||||
struct drm_framebuffer;
|
||||
struct drm_gem_object;
|
||||
struct drm_plane_state;
|
||||
@@ -63,6 +64,35 @@ struct intel_display_irq_interface {
|
||||
void (*synchronize)(struct drm_device *drm);
|
||||
};
|
||||
|
||||
struct intel_display_overlay_interface {
|
||||
bool (*is_active)(struct drm_device *drm);
|
||||
|
||||
int (*overlay_on)(struct drm_device *drm,
|
||||
u32 frontbuffer_bits);
|
||||
int (*overlay_continue)(struct drm_device *drm,
|
||||
struct i915_vma *vma,
|
||||
bool load_polyphase_filter);
|
||||
int (*overlay_off)(struct drm_device *drm);
|
||||
int (*recover_from_interrupt)(struct drm_device *drm);
|
||||
int (*release_old_vid)(struct drm_device *drm);
|
||||
|
||||
void (*reset)(struct drm_device *drm);
|
||||
|
||||
struct i915_vma *(*pin_fb)(struct drm_device *drm,
|
||||
struct drm_gem_object *obj,
|
||||
u32 *offset);
|
||||
void (*unpin_fb)(struct drm_device *drm,
|
||||
struct i915_vma *vma);
|
||||
|
||||
struct drm_gem_object *(*obj_lookup)(struct drm_device *drm,
|
||||
struct drm_file *filp,
|
||||
u32 handle);
|
||||
|
||||
void __iomem *(*setup)(struct drm_device *drm,
|
||||
bool needs_physical);
|
||||
void (*cleanup)(struct drm_device *drm);
|
||||
};
|
||||
|
||||
struct intel_display_panic_interface {
|
||||
struct intel_panic *(*alloc)(void);
|
||||
int (*setup)(struct intel_panic *panic, struct drm_scanout_buffer *sb);
|
||||
@@ -150,6 +180,9 @@ struct intel_display_parent_interface {
|
||||
/** @panic: Panic interface */
|
||||
const struct intel_display_panic_interface *panic;
|
||||
|
||||
/** @overlay: Overlay. Optional. */
|
||||
const struct intel_display_overlay_interface *overlay;
|
||||
|
||||
/** @pc8: PC8 interface. Optional. */
|
||||
const struct intel_display_pc8_interface *pc8;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user