> Subject: [PATCH v3 08/31] drm/i915/bios: de/allocate buf_trans for each port > > Allocate intel_ddi_buf_trans buffer per port if requested. Request is > considered invalid if .use_vbt_vswing field is unset and VBT version is less > than
Do you mean OR VBT version is less than 218 Also should be squashed with 7 and 9 Regards, Suraj Kandpal > 218. Do not allocate buffer if not requested or request is invalid. > > Deallocate buffer for each requesting port on driver removal. > > v2->v3 > - change kzalloc() into kzalloc_obj() > - remove null pointer check before kfree() > > Signed-off-by: Michał Grzelak <[email protected]> > --- > drivers/gpu/drm/i915/display/intel_bios.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/gpu/drm/i915/display/intel_bios.c > b/drivers/gpu/drm/i915/display/intel_bios.c > index a3f0334c3a582..fa9f21c5c6134 100644 > --- a/drivers/gpu/drm/i915/display/intel_bios.c > +++ b/drivers/gpu/drm/i915/display/intel_bios.c > @@ -2659,7 +2659,15 @@ static void sanitize_hdmi_level_shift(struct > intel_bios_encoder_data *devdata, > > static void override_vswing_preemph(struct intel_bios_encoder_data > *devdata) { > + struct intel_ddi_buf_trans *buf_trans; > + > devdata->buf_trans = NULL; > + > + if (devdata->display->vbt.version < 218 || !devdata- > >child.use_vbt_vswing) > + return; > + > + buf_trans = kzalloc_obj(*buf_trans); > + devdata->buf_trans = buf_trans; > } > > static bool > @@ -3398,6 +3406,8 @@ void intel_bios_driver_remove(struct intel_display > *display) > node) { > list_del(&devdata->node); > kfree(devdata->dsc); > + kfree(devdata->buf_trans); > + > kfree(devdata); > } > > -- > 2.45.2
