Skip to content

Commit

Permalink
Merge lineage-21.0 from LineageOS/android_kernel_oneplus_sm8350
Browse files Browse the repository at this point in the history
commit: a0bd26c863335d44973739a33d0ca83c4c967bd8

Signed-off-by: engstk <[email protected]>
  • Loading branch information
engstk committed Aug 21, 2024
1 parent 5802ffb commit e7b8bf6
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 31 deletions.
3 changes: 2 additions & 1 deletion drivers/gpu/msm/kgsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2378,7 +2378,8 @@ static long gpuobj_free_on_fence(struct kgsl_device_private *dev_priv,
return -EINVAL;
}

handle = kgsl_sync_fence_async_wait(event.fd, gpuobj_free_fence_func, entry);
handle = kgsl_sync_fence_async_wait(event.fd,
gpuobj_free_fence_func, entry, NULL);

if (IS_ERR(handle)) {
kgsl_mem_entry_unset_pend(entry);
Expand Down
5 changes: 2 additions & 3 deletions drivers/gpu/msm/kgsl_drawobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,8 @@ static int drawobj_add_sync_fence(struct kgsl_device *device,

set_bit(event->id, &syncobj->pending);

event->handle = kgsl_sync_fence_async_wait(sync.fd, drawobj_sync_fence_func, event);
event->handle = kgsl_sync_fence_async_wait(sync.fd,
drawobj_sync_fence_func, event, priv);

event->priv = priv;

Expand All @@ -588,8 +589,6 @@ static int drawobj_add_sync_fence(struct kgsl_device *device,
return ret;
}

kgsl_get_fence_info(event);

for (i = 0; priv && i < priv->num_fences; i++)
trace_syncpoint_fence(syncobj, priv->fences[i].name);

Expand Down
13 changes: 7 additions & 6 deletions drivers/gpu/msm/kgsl_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,20 +424,19 @@ static void kgsl_sync_fence_callback(struct dma_fence *fence,
}
}

void kgsl_get_fence_info(struct kgsl_drawobj_sync_event *event)
static void kgsl_get_fence_names(struct dma_fence *fence,
struct event_fence_info *info_ptr)
{
unsigned int num_fences;
struct dma_fence *fence, **fences;
struct dma_fence **fences;
struct dma_fence_array *array;
struct event_fence_info *info_ptr = event->priv;
int i;

if (!info_ptr)
return;

fence = event->handle->fence;

array = to_dma_fence_array(fence);

if (array != NULL) {
num_fences = array->num_fences;
fences = array->fences;
Expand Down Expand Up @@ -472,7 +471,7 @@ void kgsl_get_fence_info(struct kgsl_drawobj_sync_event *event)
}

struct kgsl_sync_fence_cb *kgsl_sync_fence_async_wait(int fd,
bool (*func)(void *priv), void *priv)
bool (*func)(void *priv), void *priv, struct event_fence_info *info_ptr)
{
struct kgsl_sync_fence_cb *kcb;
struct dma_fence *fence;
Expand All @@ -493,6 +492,8 @@ struct kgsl_sync_fence_cb *kgsl_sync_fence_async_wait(int fd,
kcb->priv = priv;
kcb->func = func;

kgsl_get_fence_names(fence, info_ptr);

/* if status then error or signaled */
status = dma_fence_add_callback(fence, &kcb->fence_cb,
kgsl_sync_fence_callback);
Expand Down
13 changes: 5 additions & 8 deletions drivers/gpu/msm/kgsl_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ void kgsl_sync_timeline_detach(struct kgsl_sync_timeline *ktimeline);

void kgsl_sync_timeline_put(struct kgsl_sync_timeline *ktimeline);

struct kgsl_sync_fence_cb *kgsl_sync_fence_async_wait(int fd, bool (*func)(void *priv), void *priv);

void kgsl_get_fence_info(struct kgsl_drawobj_sync_event *event);
struct kgsl_sync_fence_cb *kgsl_sync_fence_async_wait(int fd,
bool (*func)(void *priv), void *priv,
struct event_fence_info *info_ptr);

void kgsl_sync_fence_async_cancel(struct kgsl_sync_fence_cb *kcb);

Expand Down Expand Up @@ -128,12 +128,9 @@ static inline void kgsl_sync_timeline_put(struct kgsl_sync_timeline *ktimeline)
}


static inline void kgsl_get_fence_info(struct kgsl_drawobj_sync_event *event)
{
}

static inline struct kgsl_sync_fence_cb *kgsl_sync_fence_async_wait(int fd,
bool (*func)(void *priv), void *priv);
bool (*func)(void *priv), void *priv,
struct event_fence_info *info_ptr)
{
return NULL;
}
Expand Down
39 changes: 26 additions & 13 deletions drivers/usb/gadget/composite.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ int config_ep_by_speed_and_alt(struct usb_gadget *g,
int want_comp_desc = 0;

struct usb_descriptor_header **d_spd; /* cursor for speed desc */
struct usb_composite_dev *cdev;
bool incomplete_desc = false;

if (!g || !f || !_ep)
return -EIO;
Expand All @@ -175,28 +177,43 @@ int config_ep_by_speed_and_alt(struct usb_gadget *g,
switch (g->speed) {
case USB_SPEED_SUPER_PLUS:
if (gadget_is_superspeed_plus(g)) {
speed_desc = f->ssp_descriptors;
want_comp_desc = 1;
break;
if (f->ssp_descriptors) {
speed_desc = f->ssp_descriptors;
want_comp_desc = 1;
break;
}
incomplete_desc = true;
}
/* fall through */
case USB_SPEED_SUPER:
if (gadget_is_superspeed(g)) {
speed_desc = f->ss_descriptors;
want_comp_desc = 1;
break;
if (f->ss_descriptors) {
speed_desc = f->ss_descriptors;
want_comp_desc = 1;
break;
}
incomplete_desc = true;
}
/* fall through */
case USB_SPEED_HIGH:
if (gadget_is_dualspeed(g)) {
speed_desc = f->hs_descriptors;
break;
if (f->hs_descriptors) {
speed_desc = f->hs_descriptors;
break;
}
incomplete_desc = true;
}
/* fall through */
default:
speed_desc = f->fs_descriptors;
}

cdev = get_gadget_data(g);
if (incomplete_desc)
WARNING(cdev,
"%s doesn't hold the descriptors for current speed\n",
f->name);

/* find correct alternate setting descriptor */
for_each_desc(speed_desc, d_spd, USB_DT_INTERFACE) {
int_desc = (struct usb_interface_descriptor *)*d_spd;
Expand Down Expand Up @@ -252,12 +269,8 @@ int config_ep_by_speed_and_alt(struct usb_gadget *g,
_ep->maxburst = comp_desc->bMaxBurst + 1;
break;
default:
if (comp_desc->bMaxBurst != 0) {
struct usb_composite_dev *cdev;

cdev = get_gadget_data(g);
if (comp_desc->bMaxBurst != 0)
ERROR(cdev, "ep0 bMaxBurst must be 0\n");
}
_ep->maxburst = 1;
break;
}
Expand Down

0 comments on commit e7b8bf6

Please sign in to comment.