diff mbox series

drm/stm: remove conflicting framebuffers

Message ID 20211206134735.13537-1-yannick.fertre@foss.st.com (mailing list archive)
State New, archived
Headers show
Series drm/stm: remove conflicting framebuffers | expand

Commit Message

Yannick FERTRE Dec. 6, 2021, 1:47 p.m. UTC
In case of using simplefb or another conflicting framebuffer,
call drm_aperture_remove_framebuffers() to remove memory allocated.

Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
---
 drivers/gpu/drm/stm/drv.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Thomas Zimmermann Dec. 6, 2021, 2:23 p.m. UTC | #1
Hi

Am 06.12.21 um 14:47 schrieb Yannick Fertre:
> In case of using simplefb or another conflicting framebuffer,
> call drm_aperture_remove_framebuffers() to remove memory allocated.
> 
> Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>

The patch should have contained a note that this is version 2 of the 
change with a short changelog. Anyway

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

Best regards
Thomas

> ---
>   drivers/gpu/drm/stm/drv.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
> index 222869b232ae..9f441aadf2d5 100644
> --- a/drivers/gpu/drm/stm/drv.c
> +++ b/drivers/gpu/drm/stm/drv.c
> @@ -14,6 +14,7 @@
>   #include <linux/of_platform.h>
>   #include <linux/pm_runtime.h>
>   
> +#include <drm/drm_aperture.h>
>   #include <drm/drm_atomic.h>
>   #include <drm/drm_atomic_helper.h>
>   #include <drm/drm_drv.h>
> @@ -183,6 +184,10 @@ static int stm_drm_platform_probe(struct platform_device *pdev)
>   
>   	DRM_DEBUG("%s\n", __func__);
>   
> +	ret = drm_aperture_remove_framebuffers(false, &drv_driver);
> +	if (ret)
> +		return ret;
> +
>   	dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
>   
>   	ddev = drm_dev_alloc(&drv_driver, dev);
>
Philippe CORNU Dec. 14, 2021, 10:15 a.m. UTC | #2
On 12/6/21 3:23 PM, Thomas Zimmermann wrote:
> Hi
> 
> Am 06.12.21 um 14:47 schrieb Yannick Fertre:
>> In case of using simplefb or another conflicting framebuffer,
>> call drm_aperture_remove_framebuffers() to remove memory allocated.
>>
>> Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
> 
> The patch should have contained a note that this is version 2 of the 
> change with a short changelog. Anyway
> 
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> 
> Best regards
> Thomas
> 
>> ---
>>   drivers/gpu/drm/stm/drv.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
>> index 222869b232ae..9f441aadf2d5 100644
>> --- a/drivers/gpu/drm/stm/drv.c
>> +++ b/drivers/gpu/drm/stm/drv.c
>> @@ -14,6 +14,7 @@
>>   #include <linux/of_platform.h>
>>   #include <linux/pm_runtime.h>
>> +#include <drm/drm_aperture.h>
>>   #include <drm/drm_atomic.h>
>>   #include <drm/drm_atomic_helper.h>
>>   #include <drm/drm_drv.h>
>> @@ -183,6 +184,10 @@ static int stm_drm_platform_probe(struct 
>> platform_device *pdev)
>>       DRM_DEBUG("%s\n", __func__);
>> +    ret = drm_aperture_remove_framebuffers(false, &drv_driver);
>> +    if (ret)
>> +        return ret;
>> +

Hi Yannick,
and many thanks for your patch.
Acked-by: Philippe Cornu <philippe.cornu@foss.st.com>
Philippe :-)


>>       dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
>>       ddev = drm_dev_alloc(&drv_driver, dev);
>>
>
Philippe CORNU Jan. 4, 2022, 1:52 p.m. UTC | #3
On 12/14/21 11:15 AM, Philippe CORNU wrote:
> 
> 
> On 12/6/21 3:23 PM, Thomas Zimmermann wrote:
>> Hi
>>
>> Am 06.12.21 um 14:47 schrieb Yannick Fertre:
>>> In case of using simplefb or another conflicting framebuffer,
>>> call drm_aperture_remove_framebuffers() to remove memory allocated.
>>>
>>> Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
>>
>> The patch should have contained a note that this is version 2 of the 
>> change with a short changelog. Anyway
>>
>> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>>
>> Best regards
>> Thomas
>>
>>> ---
>>>   drivers/gpu/drm/stm/drv.c | 5 +++++
>>>   1 file changed, 5 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
>>> index 222869b232ae..9f441aadf2d5 100644
>>> --- a/drivers/gpu/drm/stm/drv.c
>>> +++ b/drivers/gpu/drm/stm/drv.c
>>> @@ -14,6 +14,7 @@
>>>   #include <linux/of_platform.h>
>>>   #include <linux/pm_runtime.h>
>>> +#include <drm/drm_aperture.h>
>>>   #include <drm/drm_atomic.h>
>>>   #include <drm/drm_atomic_helper.h>
>>>   #include <drm/drm_drv.h>
>>> @@ -183,6 +184,10 @@ static int stm_drm_platform_probe(struct 
>>> platform_device *pdev)
>>>       DRM_DEBUG("%s\n", __func__);
>>> +    ret = drm_aperture_remove_framebuffers(false, &drv_driver);
>>> +    if (ret)
>>> +        return ret;
>>> +
> 
> Hi Yannick,
> and many thanks for your patch.
> Acked-by: Philippe Cornu <philippe.cornu@foss.st.com>
> Philippe :-)
> 
> 
>>>       dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
>>>       ddev = drm_dev_alloc(&drv_driver, dev);
>>>
>>

Applied on drm-misc-next.
Many thanks for your patch,
Philippe :-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index 222869b232ae..9f441aadf2d5 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -14,6 +14,7 @@ 
 #include <linux/of_platform.h>
 #include <linux/pm_runtime.h>
 
+#include <drm/drm_aperture.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_drv.h>
@@ -183,6 +184,10 @@  static int stm_drm_platform_probe(struct platform_device *pdev)
 
 	DRM_DEBUG("%s\n", __func__);
 
+	ret = drm_aperture_remove_framebuffers(false, &drv_driver);
+	if (ret)
+		return ret;
+
 	dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
 
 	ddev = drm_dev_alloc(&drv_driver, dev);