Re: [PATCH] drm/i915/guc: Keep the ctx_pool_vaddr mapped, for easy access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 02/09/2017 01:01 PM, Chris Wilson wrote:
On Thu, Feb 09, 2017 at 02:23:39AM -0800, Oscar Mateo wrote:
@@ -116,15 +114,8 @@ static int guc_update_doorbell_id(struct intel_guc *guc,
  	}
/* Update the GuC's idea of the doorbell ID */
-	len = sg_pcopy_to_buffer(sg->sgl, sg->nents, &desc, sizeof(desc),
-			     sizeof(desc) * client->ctx_index);
-	if (len != sizeof(desc))
-		return -EFAULT;
-	desc.db_id = new_id;
-	len = sg_pcopy_from_buffer(sg->sgl, sg->nents, &desc, sizeof(desc),
-			     sizeof(desc) * client->ctx_index);
-	if (len != sizeof(desc))
-		return -EFAULT;
+	desc = guc->ctx_pool_vaddr + sizeof(*desc) * client->ctx_index;
Repeated quite a few times.

static inline struct guc_context_desc *
guc_context_desc(struct intel_guc *guc,
		 struct i915_guc_client *client)
{
	return (guc->ctx_pool_vaddr +
		sizeof(struct guc_context_desc) * client->ctx_index);

Or your preference
}
It's repeated only three times, just one line long and it doesn't look like we are going to need more instances, so I didn't see the need to make it common code, but I'm OK with changing it.
Lots of little nitpicks I could make. *summons Joonas.
-Chris
Adding Joonas in CC, so that the summon spell is more effective.

-- Oscar

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux