Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization of OLED graphic display module with SSD1306 controller #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oleksii-kogutenko
Copy link

@oleksii-kogutenko oleksii-kogutenko commented Nov 29, 2017

  • update Makefile (compile analog clock with all target)
  • use compatible am335x-bone-common.dtsi with mpu6050
  • add i2c1 support added to dtsi
  • move defines to header file
  • optimization screen updater:
    • use "page addressing mode" for memory mode
    • send only modyfied bytes over i2c
    • decreased time of writing from 6 jiff items to {0-1} jiff items

@oleksii-kogutenko oleksii-kogutenko force-pushed the alexandr_ssd1306 branch 2 times, most recently from 5785feb to c264e2e Compare December 11, 2017 16:55
@oleksii-kogutenko oleksii-kogutenko changed the title OLED graphic display module with SSD1306 controller Optimization of OLED graphic display module with SSD1306 controller Dec 11, 2017
 * update Makefile
 * use compatible am335x-bone-common.dtsi with mpu6050
 * add i2c1 support added to dtsi
 * move defines to header file
 * optimization screen updater:
   - use "page addressing mode" for memory mode
   - send only modyfied bytes over i2c
@oleksii-kogutenko
Copy link
Author

Debugs from optimization log:
[ 1200.812771] [ssd1306_UpdateScreen]==>[cur_pos:1024, start_pos:1016, size:8]
[ 1200.812796] [ssd1306_sendDataArea] size:8 pos:1016
[ 1200.813376] [ssd1306_sendDataArea] page:7, col:120, send_size:8, i:0
[ 1200.813706] diff: 0
[ 1201.016734] [ssd1306_UpdateScreen]==>[cur_pos:346, start_pos:337, size:9]
[ 1201.016755] [ssd1306_sendDataArea] size:9 pos:337
[ 1201.017274] [ssd1306_sendDataArea] page:2, col:81, send_size:9, i:0
[ 1201.017637] [ssd1306_UpdateScreen]==>[cur_pos:453, start_pos:452, size:1]
[ 1201.017643] [ssd1306_sendDataArea] size:1 pos:452
[ 1201.018119] [ssd1306_sendDataArea] page:3, col:68, send_size:1, i:0
[ 1201.018281] [ssd1306_UpdateScreen]==>[cur_pos:455, start_pos:454, size:1]
[ 1201.018310] [ssd1306_sendDataArea] size:1 pos:454
[ 1201.018760] [ssd1306_sendDataArea] page:3, col:70, send_size:1, i:0
[ 1201.018921] [ssd1306_UpdateScreen]==>[cur_pos:469, start_pos:456, size:13]
[ 1201.018949] [ssd1306_sendDataArea] size:13 pos:456
[ 1201.019440] [ssd1306_sendDataArea] page:3, col:72, send_size:13, i:0
[ 1201.019887] [ssd1306_UpdateScreen]==>[cur_pos:1024, start_pos:1016, size:8]
[ 1201.019911] [ssd1306_sendDataArea] size:8 pos:1016
[ 1201.022534] [ssd1306_sendDataArea] page:7, col:120, send_size:8, i:0
[ 1201.022915] diff: 1

{
u8 type;
u8 data[LCD_WIDTH * LCD_HEIGHT / 8];
} ssd1306_data_array;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intended to be used in external modules?

size_t count, loff_t *ppos);
static int ssd1307fb_blank(int blank_mode, struct fb_info *info);
static void ssd1307fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
static void ssd1307fb_copyarea(struct fb_info *info, const struct fb_copyarea *area);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+static int ssd1307fb_blank(int blank_mode, struct fb_info *info); +static void ssd1307fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); +static void ssd1307fb_copyarea(struct fb_info *info, const struct fb_copyarea *area); +static void ssd1307fb_imageblit(struct fb_info *info, const struct fb_image *image);

static in the header file? what for?

Copy link

@DevyatovAndrey DevyatovAndrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix checkpatch issues and make some clean up

if( (draw_x1>=0)&&(draw_y1>=0) ){
Graphic_setPoint(draw_x1, draw_y1);
}
if( (draw_x2<=127)&&(draw_y2<=63) ){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't you confused with these "magic numbers"?

if( 0 == r)
return;

// calculate 8 special point(0��45��90��135��180��225��270degree) display them

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make a clean up - remove unnesessary comments/lines

* __u16 capabilities; // see FB_CAP_*
* __u16 reserved[2]; // Reserved for future compatibility
* };
* */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this large bunch of dead code is unnesessary and could be deleted

/* ******************************************************************
*
* *****************************************************************/
int ssd1306_UpdateScreen_old(struct ssd1306_data *drv_data)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this function is redunant

}

//ssd1306_sendDataArea(drv_client, dataArray.data, sizeof(dataArray.data), 0);
//memcpy(&dataArray_lcd, &dataArray, sizeof(dataArray));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if possible -please fix checkpatch issues and remove unnesessary comments

}

diff = get_jiffies_64() - jiff;
pr_info ("diff: %lld\n", diff); ///diff: 6

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think time consumption could be hidden into debug defines

ssd1306_first_start++;
} else {
while (cur_pos < msize) {
while (cur_pos < msize && dataArray.data[cur_pos] == dataArray_lcd.data[cur_pos])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point to calculate positions in buffer to update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants