Migrating from 7.5 to 8.1 - LV_HOR_RES_MAX


In 7.5 there was a LV_HOR_RES_MAX in the lv_conf.h
Where is this now?

What MCU/Processor/Board and compiler are you using?

RaspberryPi frame buffer

What LVGL version are you using?


What do you want to achieve?

res of 1024*600

What have you tried so far?

Looking in the config and searching the docs

Code to reproduce


Screenshot and/or video

@kisvegabor any input would be appreciated


v8 has no hardcoded max screen resolution, so LV_HOR_RES_MAX and LV_VER_RES_MAX no longer exist.

So how do i set them?

I don’t believe there’s a need to set them in v8; just set your display’s resolution to 1024x600.

As you can see in my screenshot the display doesnt look right.

This is what it used to look like:

I’m starting to loathe updating… :frowning:

I miss 7.5… :frowning:

If you are using the fbdev driver (which I assume you are on Raspberry Pi) it should be pulling the resolution directly from your display hardware. So I’m not sure exactly why there would be a difference between 7.5 and 8.1 here. @kisvegabor?

That looks like a real nice project! Is it available somewhere?

Normally these aren’t needed in v8, but if you still have some code somewhere that relies on them being defined, just put this in your lv_conf.h:

// Maximal horizontal and vertical resolution for backwards compatibility
#define LV_HOR_RES_DEF         1024
#define LV_VER_RES_DEF          600
#define LV_HOR_RES_MAX         1024
#define LV_VER_RES_MAX          600

I hope this can help solve your issue.

I feel your pain as I also still need to migrate a large project to v8. A while back I started a list of #defines to make the transition from v7 to v8 a bit more manageable.

If you are stuck with some errors then check out that list or add it to your #includes and there should be a lot less errors. Then once you have a working build, start to remove those temporary #defines one by one and fix each occurrence.

There are two things:

  1. The resolution of the display. It’s handled/set in the driver. You can’t set it to any values as it comes from the display itself. However the driver needs to be aware of the actual resolution of the display. In case of fbdev it is handled as @embeddedt mentioned.
  2. The resolution of the of the display registered for LVGL. I.e. you need to tell the display’s resolution to LVGL. It can be done in
disp_drv.hor_res = 1024;
disp_drv.ver_res = 600;

We are trying to lower breaking changes as much as possible. Sorry for the inconvenience. However, sometimes we need to take a deep breath and rework stuff to make them better. :frowning:

I’m guessing my issue is coming from here:


I re-cloned the lv_port_linux_frame_buffer project and hacked my app into it… Such a rookie error…

I will get there.

Again, @embeddedt and @kisvegabor thanks for the help!!

Thanks for the advice.

Gabor was right, I hadnt changed the hor & ver res to:

disp_drv.hor_res = 1024;
disp_drv.ver_res = 600;

The project is a private one at the moment. I guess I could share it if you wanted? It’s in Github at the moment and I have no clue how. If you know how I can share it with you without making it public then please let me know.

Thanks again!

1 Like

I understand. I’m not having a go at you as the library is awesome. Sometimes it can just be a bit frustrating when it takes so long to fix all of the issues. I have no idea how many lines of code I have in my app but it must number in the 1000’s…

1 Like