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

Commit d26f3cec authored by Shrenuj Bansal's avatar Shrenuj Bansal
Browse files

msm: kgsl: Pointer-integer casting and printk fixes



Fixes warnings caused by casting pointers to integers incorrectly.
Also fixes specifiers for print statements.

Change-Id: Ic28e57ec7d106d54c83d6df29de8918efd704623
Signed-off-by: default avatarShrenuj Bansal <shrenujb@codeaurora.org>
parent 2a3c9373
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@ static inline void shared_buf_inc(unsigned int max_size,
	*offset = (*offset + inc) % max_size;
}

static inline void log_buf_wrapcnt(unsigned int cnt, unsigned int *off)
static inline void log_buf_wrapcnt(unsigned int cnt, uintptr_t *off)
{
	*off = (*off + cnt) % ADRENO_PROFILE_LOG_BUF_SIZE_DWORDS;
}
@@ -231,16 +231,16 @@ static inline void log_buf_wrapinc(unsigned int *profile_log_buffer,
static inline unsigned int log_buf_available(struct adreno_profile *profile,
		unsigned int *head_ptr)
{
	unsigned int tail, head;
	uintptr_t tail, head;

	tail = (unsigned int) profile->log_tail -
		(unsigned int) profile->log_buffer;
	head = (unsigned int) head_ptr - (unsigned int) profile->log_buffer;
	tail = (uintptr_t) profile->log_tail -
		(uintptr_t) profile->log_buffer;
	head = (uintptr_t)head_ptr - (uintptr_t) profile->log_buffer;
	if (tail > head)
		return (tail - head) / sizeof(unsigned int);
		return (tail - head) / sizeof(uintptr_t);
	else
		return ADRENO_PROFILE_LOG_BUF_SIZE_DWORDS - ((head - tail) /
				sizeof(unsigned int));
				sizeof(uintptr_t));
}

static inline unsigned int shared_buf_available(struct adreno_profile *profile)
@@ -400,11 +400,12 @@ static void transfer_results(struct kgsl_device *device,
		 */
		while (log_buf_available(profile, log_ptr) <=
				SIZE_LOG_ENTRY(cnt)) {
			unsigned int size_tail, boff;
			unsigned int size_tail;
			uintptr_t boff;
			size_tail = SIZE_LOG_ENTRY(0xffff &
					*(profile->log_tail));
			boff = ((unsigned int) profile->log_tail -
				(unsigned int) log_base) / sizeof(unsigned int);
			boff = ((uintptr_t) profile->log_tail -
				(uintptr_t) log_base) / sizeof(uintptr_t);
			log_buf_wrapcnt(size_tail, &boff);
			profile->log_tail = log_base + boff;
		}
+7 −5
Original line number Diff line number Diff line
@@ -1893,8 +1893,9 @@ static struct kgsl_cmdbatch *_kgsl_cmdbatch_create_legacy(
static struct kgsl_cmdbatch *_kgsl_cmdbatch_create(struct kgsl_device *device,
		struct kgsl_context *context,
		unsigned int flags,
		unsigned int cmdlist, unsigned int numcmds,
		unsigned int synclist, unsigned int numsyncs)
		struct kgsl_ibdesc __user *cmdlist, unsigned int numcmds,
		struct kgsl_cmd_syncpoint __user *synclist,
		unsigned int numsyncs)
{
	struct kgsl_cmdbatch *cmdbatch =
		kgsl_cmdbatch_create(device, context, flags, numcmds);
@@ -1970,7 +1971,8 @@ static long kgsl_ioctl_rb_issueibcmds(struct kgsl_device_private *dev_priv,
			goto done;

		cmdbatch = _kgsl_cmdbatch_create(device, context, param->flags,
				param->ibdesc_addr, param->numibs, 0, 0);
			(struct kgsl_ibdesc __user *)param->ibdesc_addr,
			 param->numibs, 0, 0);
	} else
		cmdbatch = _kgsl_cmdbatch_create_legacy(device, context, param);

@@ -2023,8 +2025,8 @@ static long kgsl_ioctl_submit_commands(struct kgsl_device_private *dev_priv,
		return -EINVAL;

	cmdbatch = _kgsl_cmdbatch_create(device, context, param->flags,
		(unsigned int) param->cmdlist, param->numcmds,
		(unsigned int) param->synclist, param->numsyncs);
		param->cmdlist, param->numcmds,
		param->synclist, param->numsyncs);

	if (IS_ERR(cmdbatch)) {
		result = PTR_ERR(cmdbatch);
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
#define GSL_TLBFLUSH_FILTER_ENTRY_NUMBITS     (sizeof(unsigned char) * 8)
#define GSL_TLBFLUSH_FILTER_GET(superpte)			     \
	      (*((unsigned char *)				    \
	      (((unsigned int)gpummu_pt->tlbflushfilter.base)    \
	      (((uintptr_t)gpummu_pt->tlbflushfilter.base)    \
	      + (superpte / GSL_TLBFLUSH_FILTER_ENTRY_NUMBITS))))
#define GSL_TLBFLUSH_FILTER_SETDIRTY(superpte)				\
	      (GSL_TLBFLUSH_FILTER_GET((superpte)) |= 1 <<	    \
+2 −2
Original line number Diff line number Diff line
@@ -58,8 +58,8 @@
#define KGSL_IOMMU_CTX_TLBSTATUS_SACTIVE BIT(0)

/* IMPLDEF_MICRO_MMU_CTRL register fields */
#define KGSL_IOMMU_IMPLDEF_MICRO_MMU_CTRL_HALT BIT(2)
#define KGSL_IOMMU_IMPLDEF_MICRO_MMU_CTRL_IDLE BIT(3)
#define KGSL_IOMMU_IMPLDEF_MICRO_MMU_CTRL_HALT  0x00000004
#define KGSL_IOMMU_IMPLDEF_MICRO_MMU_CTRL_IDLE  0x00000008

/* SCTLR fields */
#define KGSL_IOMMU_SCTLR_HUPCF_SHIFT		8
+4 −2
Original line number Diff line number Diff line
@@ -620,6 +620,7 @@ int kgsl_device_snapshot(struct kgsl_device *device, int hang)
	void *snapshot;
	struct timespec boot;
	int ret = 0;
	phys_addr_t pa;

	/*
	 * Bail if failed to get active count for GPU,
@@ -691,8 +692,9 @@ int kgsl_device_snapshot(struct kgsl_device *device, int hang)
	device->snapshot_frozen = (hang) ? 1 : 0;

	/* log buffer info to aid in ramdump fault tolerance */
	KGSL_DRV_ERR(device, "snapshot created at pa %lx size %d\n",
			__pa(device->snapshot),	device->snapshot_size);
	pa = __pa(device->snapshot);
	KGSL_DRV_ERR(device, "snapshot created at pa %pa size %d\n",
			&pa, device->snapshot_size);
	if (hang)
		sysfs_notify(&device->snapshot_kobj, NULL, "timestamp");

Loading