Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce580fab authored by Andi Kleen's avatar Andi Kleen Committed by Dave Airlie
Browse files

drm/radeon: Move more code out of line



With this patch I'm only about 50k larger with DRM debugging
enables (why is that enabled by default?!?), and slightly
smaller without.

[airlied: moved r100.c additions to radeon_ring.c]

Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent cbdd4501
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -791,7 +791,7 @@ static __inline__ int r300_emit_packet3(drm_radeon_private_t *dev_priv,
/**
 * Emit the sequence to pacify R300.
 */
static __inline__ void r300_pacify(drm_radeon_private_t *dev_priv)
static void r300_pacify(drm_radeon_private_t *dev_priv)
{
	uint32_t cache_z, cache_3d, cache_2d;
	RING_LOCALS;
+2 −2
Original line number Diff line number Diff line
@@ -3138,7 +3138,7 @@ int r600_irq_set(struct radeon_device *rdev)
	return 0;
}

static inline void r600_irq_ack(struct radeon_device *rdev)
static void r600_irq_ack(struct radeon_device *rdev)
{
	u32 tmp;

@@ -3239,7 +3239,7 @@ void r600_irq_disable(struct radeon_device *rdev)
	r600_disable_interrupt_state(rdev);
}

static inline u32 r600_get_ih_wptr(struct radeon_device *rdev)
static u32 r600_get_ih_wptr(struct radeon_device *rdev)
{
	u32 wptr, tmp;

+1 −1
Original line number Diff line number Diff line
@@ -450,7 +450,7 @@ set_default_state(struct radeon_device *rdev)
	radeon_ring_write(rdev, sq_stack_resource_mgmt_2);
}

static inline uint32_t i2f(uint32_t input)
static uint32_t i2f(uint32_t input)
{
	u32 result, i, exponent, fraction;

+7 −32
Original line number Diff line number Diff line
@@ -600,32 +600,7 @@ struct radeon_cs_parser {

extern int radeon_cs_update_pages(struct radeon_cs_parser *p, int pg_idx);
extern int radeon_cs_finish_pages(struct radeon_cs_parser *p);


static inline u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx)
{
	struct radeon_cs_chunk *ibc = &p->chunks[p->chunk_ib_idx];
	u32 pg_idx, pg_offset;
	u32 idx_value = 0;
	int new_page;

	pg_idx = (idx * 4) / PAGE_SIZE;
	pg_offset = (idx * 4) % PAGE_SIZE;

	if (ibc->kpage_idx[0] == pg_idx)
		return ibc->kpage[0][pg_offset/4];
	if (ibc->kpage_idx[1] == pg_idx)
		return ibc->kpage[1][pg_offset/4];

	new_page = radeon_cs_update_pages(p, pg_idx);
	if (new_page < 0) {
		p->parser_error = new_page;
		return 0;
	}

	idx_value = ibc->kpage[new_page][pg_offset/4];
	return idx_value;
}
extern u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx);

struct radeon_cs_packet {
	unsigned	idx;
@@ -1414,19 +1389,19 @@ void radeon_atombios_fini(struct radeon_device *rdev);
/*
 * RING helpers.
 */

#if DRM_DEBUG_CODE == 0
static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v)
{
#if DRM_DEBUG_CODE
	if (rdev->cp.count_dw <= 0) {
		DRM_ERROR("radeon: writting more dword to ring than expected !\n");
	}
#endif
	rdev->cp.ring[rdev->cp.wptr++] = v;
	rdev->cp.wptr &= rdev->cp.ptr_mask;
	rdev->cp.count_dw--;
	rdev->cp.ring_free_dw--;
}

#else
/* With debugging this is just too big to inline */
void radeon_ring_write(struct radeon_device *rdev, uint32_t v);
#endif

/*
 * ASICs macro.
+2 −2
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ union atom_supported_devices {
	struct _ATOM_SUPPORTED_DEVICES_INFO_2d1 info_2d1;
};

static inline struct radeon_i2c_bus_rec radeon_lookup_i2c_gpio(struct radeon_device *rdev,
static struct radeon_i2c_bus_rec radeon_lookup_i2c_gpio(struct radeon_device *rdev,
							       uint8_t id)
{
	struct atom_context *ctx = rdev->mode_info.atom_context;
@@ -228,7 +228,7 @@ void radeon_atombios_i2c_init(struct radeon_device *rdev)
	}
}

static inline struct radeon_gpio_rec radeon_lookup_gpio(struct radeon_device *rdev,
static struct radeon_gpio_rec radeon_lookup_gpio(struct radeon_device *rdev,
							u8 id)
{
	struct atom_context *ctx = rdev->mode_info.atom_context;
Loading