Skip to content

Commit

Permalink
drm/i915/gvt: move structs intel_gvt_irq_info and intel_gvt_irq_map t…
Browse files Browse the repository at this point in the history
…o interrupt.c

Structs intel_gvt_irq_info and intel_gvt_irq_map are not used outside of
interrupt.c. Hide them, and reduce includes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230926121904.499888-4-jani.nikula@intel.com
  • Loading branch information
Jani Nikula committed Oct 11, 2023
1 parent 21c828a commit 906cdb2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
17 changes: 17 additions & 0 deletions drivers/gpu/drm/i915/gvt/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@
#include "gvt.h"
#include "trace.h"

struct intel_gvt_irq_info {
char *name;
i915_reg_t reg_base;
enum intel_gvt_event_type bit_to_event[INTEL_GVT_IRQ_BITWIDTH];
unsigned long warned;
int group;
DECLARE_BITMAP(downstream_irq_bitmap, INTEL_GVT_IRQ_BITWIDTH);
bool has_upstream_irq;
};

struct intel_gvt_irq_map {
int up_irq_group;
int up_irq_bit;
int down_irq_group;
u32 down_irq_bitmask;
};

/* common offset among interrupt control registers */
#define regbase_to_isr(base) (base)
#define regbase_to_imr(base) (base + 0x4)
Expand Down
31 changes: 6 additions & 25 deletions drivers/gpu/drm/i915/gvt/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@
#ifndef _GVT_INTERRUPT_H_
#define _GVT_INTERRUPT_H_

#include <linux/hrtimer.h>
#include <linux/kernel.h>
#include <linux/bitops.h>

#include "i915_reg_defs.h"
struct intel_gvt;
struct intel_gvt_irq;
struct intel_gvt_irq_info;
struct intel_gvt_irq_map;
struct intel_vgpu;

enum intel_gvt_event_type {
RCS_MI_USER_INTERRUPT = 0,
Expand Down Expand Up @@ -138,10 +141,6 @@ enum intel_gvt_event_type {
INTEL_GVT_EVENT_MAX,
};

struct intel_gvt_irq;
struct intel_gvt;
struct intel_vgpu;

typedef void (*gvt_event_virt_handler_t)(struct intel_gvt_irq *irq,
enum intel_gvt_event_type event, struct intel_vgpu *vgpu);

Expand Down Expand Up @@ -175,17 +174,6 @@ enum intel_gvt_irq_type {

#define INTEL_GVT_IRQ_BITWIDTH 32

/* device specific interrupt bit definitions */
struct intel_gvt_irq_info {
char *name;
i915_reg_t reg_base;
enum intel_gvt_event_type bit_to_event[INTEL_GVT_IRQ_BITWIDTH];
unsigned long warned;
int group;
DECLARE_BITMAP(downstream_irq_bitmap, INTEL_GVT_IRQ_BITWIDTH);
bool has_upstream_irq;
};

/* per-event information */
struct intel_gvt_event_info {
int bit; /* map to register bit */
Expand All @@ -194,13 +182,6 @@ struct intel_gvt_event_info {
gvt_event_virt_handler_t v_handler; /* for v_event */
};

struct intel_gvt_irq_map {
int up_irq_group;
int up_irq_bit;
int down_irq_group;
u32 down_irq_bitmask;
};

/* structure containing device specific IRQ state */
struct intel_gvt_irq {
const struct intel_gvt_irq_ops *ops;
Expand Down

0 comments on commit 906cdb2

Please sign in to comment.