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

Commit a05d2988 authored by Hareesh Gundu's avatar Hareesh Gundu Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Add kgsl device to kgsl_hfi structure



In hfi_queue_write() it’s not guaranteed to get
kgsl device pointer from the kgsl_get_device().
Add kgsl device pointer to kgsl_hfi so that it
can be accessible across hfi related functions.

Change-Id: Iba2f5f7154b1447cd540d399c959dc5cc6d62ab4
Signed-off-by: default avatarHareesh Gundu <hareeshg@codeaurora.org>
parent 34f2dc73
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1415,6 +1415,7 @@ static int gmu_probe(struct kgsl_device *device,
	tasklet_init(&hfi->tasklet, hfi_receiver, (unsigned long)gmu);
	INIT_LIST_HEAD(&hfi->msglist);
	spin_lock_init(&hfi->msglock);
	hfi->kgsldev = device;

	/* Retrieves GMU/GPU power level configurations*/
	ret = gmu_pwrlevel_probe(gmu, node);
+1 −2
Original line number Diff line number Diff line
@@ -105,7 +105,6 @@ static int hfi_queue_read(struct gmu_device *gmu, uint32_t queue_idx,
static int hfi_queue_write(struct gmu_device *gmu, uint32_t queue_idx,
		uint32_t *msg)
{
	struct kgsl_device *device = kgsl_get_device(KGSL_DEVICE_3D0);
	struct hfi_queue_table *tbl = gmu->hfi_mem->hostptr;
	struct hfi_queue_header *hdr = &tbl->qhdr[queue_idx];
	uint32_t *queue;
@@ -168,7 +167,7 @@ static int hfi_queue_write(struct gmu_device *gmu, uint32_t queue_idx,
	wmb();

	/* Send interrupt to GMU to receive the message */
	adreno_write_gmureg(ADRENO_DEVICE(device),
	adreno_write_gmureg(ADRENO_DEVICE(hfi->kgsldev),
		ADRENO_REG_GMU_HOST2GMU_INTR_SET, 0x1);

	return 0;
+2 −0
Original line number Diff line number Diff line
@@ -590,6 +590,7 @@ struct pending_cmd {

/**
 * struct kgsl_hfi - HFI control structure
 * @kgsldev: Point to the kgsl device
 * @hfi_interrupt_num: number of GMU asserted HFI interrupt
 * @msglock: spinlock to protect access to outstanding command message list
 * @cmdq_mutex: mutex to protect command queue access from multiple senders
@@ -601,6 +602,7 @@ struct pending_cmd {
 *	value of the counter is used as sequence number for HFI message
 */
struct kgsl_hfi {
	struct kgsl_device *kgsldev;
	int hfi_interrupt_num;
	spinlock_t msglock;
	struct mutex cmdq_mutex;