Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
64 lines
1.5 KiB
C
64 lines
1.5 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2019 Intel Corporation
|
|
*/
|
|
|
|
#ifndef __INTEL_BREADCRUMBS__
|
|
#define __INTEL_BREADCRUMBS__
|
|
|
|
#include <linux/atomic.h>
|
|
#include <linux/irq_work.h>
|
|
|
|
#include "intel_breadcrumbs_types.h"
|
|
|
|
struct drm_printer;
|
|
struct i915_request;
|
|
struct intel_breadcrumbs;
|
|
|
|
struct intel_breadcrumbs *
|
|
intel_breadcrumbs_create(struct intel_engine_cs *irq_engine);
|
|
void intel_breadcrumbs_free(struct kref *kref);
|
|
|
|
void intel_breadcrumbs_reset(struct intel_breadcrumbs *b);
|
|
void __intel_breadcrumbs_park(struct intel_breadcrumbs *b);
|
|
|
|
static inline void intel_breadcrumbs_unpark(struct intel_breadcrumbs *b)
|
|
{
|
|
atomic_inc(&b->active);
|
|
}
|
|
|
|
static inline void intel_breadcrumbs_park(struct intel_breadcrumbs *b)
|
|
{
|
|
if (atomic_dec_and_test(&b->active))
|
|
__intel_breadcrumbs_park(b);
|
|
}
|
|
|
|
static inline void
|
|
intel_engine_signal_breadcrumbs(struct intel_engine_cs *engine)
|
|
{
|
|
irq_work_queue(&engine->breadcrumbs->irq_work);
|
|
}
|
|
|
|
void intel_engine_print_breadcrumbs(struct intel_engine_cs *engine,
|
|
struct drm_printer *p);
|
|
|
|
bool i915_request_enable_breadcrumb(struct i915_request *request);
|
|
void i915_request_cancel_breadcrumb(struct i915_request *request);
|
|
|
|
void intel_context_remove_breadcrumbs(struct intel_context *ce,
|
|
struct intel_breadcrumbs *b);
|
|
|
|
static inline struct intel_breadcrumbs *
|
|
intel_breadcrumbs_get(struct intel_breadcrumbs *b)
|
|
{
|
|
kref_get(&b->ref);
|
|
return b;
|
|
}
|
|
|
|
static inline void intel_breadcrumbs_put(struct intel_breadcrumbs *b)
|
|
{
|
|
kref_put(&b->ref, intel_breadcrumbs_free);
|
|
}
|
|
|
|
#endif /* __INTEL_BREADCRUMBS__ */
|